Selaa lähdekoodia

瓦斯爆炸求解

huangxingxing 1 vuosi sitten
vanhempi
säilyke
cd49eb1c4b

+ 7 - 2
src/main/java/com/miniframe/bisiness/system/D00008Service.java

@@ -112,7 +112,7 @@ public class D00008Service extends D00008BaseModel implements ExecProcessFlow {
 			for (DGas gas: gases) {
 				TemplateGenerator.createGasControl(aid,jid,gas.getId(),totaltime,dt,dx,reportstep,interactionstep,cocodes);
 				TemplateGenerator.createGasInit(aid,jid,gas.getId());
-				TemplateGenerator.createGassRunsh(aid,jid,gas.getId(),gas.getBfname());
+				TemplateGenerator.createGassRunsh(aid,jid,gas.getId());
 				//文件迁移
 				SysFileMapper sysFileMapper = UtilTools.getBean(SysFileMapper.class);
 				SysFile gf = sysFileMapper.selectByPrimaryKey(gas.getGfid());
@@ -129,7 +129,12 @@ public class D00008Service extends D00008BaseModel implements ExecProcessFlow {
 						,TemplateGenerator.BPATH + "/" + aid + "/" + jid + "/" + "/gas" + "/" + gas.getId() + "/"+bf.getFilename());
 				//网格文件
 				//执行文件
-				cpGssExe(TemplateGenerator.BPATH + "/" + aid + "/" + jid + "/" + "/gas" + "/" + gas.getId() );
+//				cpGssExe(TemplateGenerator.BPATH + "/" + aid + "/" + jid + "/" + "/gas" + "/" + gas.getId() );
+
+				cpFile("/home/disaster/gas/mpich2/bin/gas_mod.Lewis_2"
+					,TemplateGenerator.BPATH + "/" + aid + "/" + jid + "/" + "/gas" + "/" + gas.getId() + "/gas_mod.Lewis_2");
+				cpFile("/home/disaster/gas/mpich2/bin/reac_mod.fluent_CH4_Air_5x1"
+						,TemplateGenerator.BPATH + "/" + aid + "/" + jid + "/" + "/gas" + "/" + gas.getId() + "/reac_mod.fluent_CH4_Air_5x1");
 			}
 
 		}

+ 5 - 2
src/main/java/com/miniframe/template/TemplateGenerator.java

@@ -213,6 +213,9 @@ public class TemplateGenerator {
         XIFileUtils.mkdir(BPATH + "/" + aid + "/" + jid + s + "/" + gid);
         XIFileUtils.mkdir(BPATH + "/" + aid + "/" + jid + s + "/" + gid + "/mid");
         XIFileUtils.mkdir(BPATH + "/" + aid + "/" + jid + s + "/" + gid + "/out");
+        XIFileUtils.mkdir(BPATH + "/" + aid + "/" + jid + s + "/" + gid + "/case");
+        XIFileUtils.mkdir(BPATH + "/" + aid + "/" + jid + s + "/" + gid + "/data_mnt");
+        XIFileUtils.mkdir(BPATH + "/" + aid + "/" + jid + s + "/" + gid + "/data_rst");
     }
 
     /**
@@ -524,7 +527,7 @@ public class TemplateGenerator {
 
     }
 
-    public static void createGassRunsh(Integer aid, Integer jid, Integer gid, String bfname) throws IOException, TemplateException {
+    public static void createGassRunsh(Integer aid, Integer jid, Integer gid) throws IOException, TemplateException {
         Configuration cfg = new Configuration(Configuration.VERSION_2_3_0);
         // 设置模板所在目录
         cfg.setClassForTemplateLoading(TemplateGenerator.class, "/templates");
@@ -532,7 +535,7 @@ public class TemplateGenerator {
         Template template = cfg.getTemplate("mashGasRunsh.ftl");
         // 定义数据模型(Map)
         Map<String, Object> dataModel = new HashMap<>();
-        dataModel.put("bfname", bfname);
+        dataModel.put("casepath", BPATH + "/" + aid + "/" + jid  + "/gas" + "/case");
         dataModel.put("gascontrol", BPATH + "/" + aid + "/" + jid  + "/gas" + "/" + gid + "/MashGas.control");
         // 将数据模型传入模板进行处理
         StringWriter writer = new StringWriter();

+ 9 - 8
src/main/resources/templates/mashGasRunsh.ftl

@@ -1,9 +1,10 @@
-export PATH="/home/disaster/gas/mpich2/bin:$PATH"
-./convert_input --parse=${bfname}
-./couple --proc=1d-3d --input-1d=${gascontrol}
-./convert_input
-./grid_split
-./prepch
+export PATH="/home/disaster/gas/mpich2/bin:/home/disaster/gas/bin:$PATH"
+./couple --proc=1d-3d --path=${casepath} --input-1d=${gascontrol}
+./convert_input --path=${casepath}
+./grid_split --path=${casepath}
+./prepch --path=${casepath}
+
+mpirun -n 8 ./solver --path=${casepath}
+
+./couple --proc=3d-1d --path=${casepath} --input-1d=${gascontrol} --delhis
 
-mpirun -n 8 ./solver
-./couple --proc=3d-1d --input-1d=${gascontrol}