Fluent批处理之--windows下多个任务的计算 【转载】
转载自http://jingcao830828.blog.163.com/blog/static/10320833620103633624506/
1.同维多任务的连续计算
对于工程应用来说,计算精度要求不高,但是计算的case比较多,尤其模型优化工作,你可
能有几十个case要算。一个case只需要计算个把钟头,对于周末的大好时光来说,两天时间
只能算一个,实在是浪费时间。经过一番研究,找到了解决方法。
操作步骤:
1.保存完直接执行迭代命令后的case&dat
2.写脚本语言,直接复制,用户只需更改红体字部分的名字,如下:
(cx-gui-do cx-activate-item "MenuBar*ReadSubMenu*Case & Data...")
(cx-gui-do cx-set-text-entry "Select File*Text" "boat.cas")
(cx-gui-do cx-activate-item "Select File*OK")
(cx-gui-do cx-activate-item "MenuBar*SolveMenu*Iterate...")
(cx-gui-do cx-set-integer-entry
"Iterate*Table1*Frame2(Iteration)*Table2(Iteration)*IntegerEntry1(Number of
Iterations)" 2000)
(cx-gui-do cx-activate-item "MenuBar*SolveMenu*Iterate...")
(cx-gui-do cx-activate-item "Iterate*PanelButtons*PushButton1(OK)")
(cx-gui-do cx-activate-item "MenuBar*WriteSubMenu*Case & Data...")
(cx-gui-do cx-set-text-entry "Select File*Text" "boat.cas ")
(cx-gui-do cx-activate-item "Select File*OK")
(cx-gui-do cx-activate-item "Warning*OK")
注:如果多个case连续计算,如下:
(cx-gui-do cx-activate-item "MenuBar*ReadSubMenu*Case & Data...")
(cx-gui-do cx-set-text-entry "Select File*Text" "s.cas")
(cx-gui-do cx-activate-item "Select File*OK")
(cx-gui-do cx-activate-item "MenuBar*SolveMenu*Iterate...")
(cx-gui-do cx-set-integer-entry
"Iterate*Table1*Frame2(Iteration)*Table2(Iteration)*IntegerEntry1(Number of
Iterations)" 2000)
(cx-gui-do cx-activate-item "MenuBar*SolveMenu*Iterate...")
(cx-gui-do cx-activate-item "Iterate*PanelButtons*PushButton1(OK)")
(cx-gui-do cx-activate-item "MenuBar*WriteSubMenu*Case & Data...")
(cx-gui-do cx-set-text-entry "Select File*Text" "s.cas ")
(cx-gui-do cx-activate-item "Select File*OK")
(cx-gui-do cx-activate-item "Warning*OK")
(cx-gui-do cx-activate-item "MenuBar*ReadSubMenu*Case & Data...")
(cx-gui-do cx-set-text-entry "Select File*Text" "s2.cas")
(cx-gui-do cx-activate-item "Select File*OK")
(cx-gui-do cx-activate-item "MenuBar*SolveMenu*Iterate...")
(cx-gui-do cx-set-integer-entry
"Iterate*Table1*Frame2(Iteration)*Table2(Iteration)*IntegerEntry1(Number of
Iterations)" 2000)
(cx-gui-do cx-activate-item "MenuBar*SolveMenu*Iterate...")
(cx-gui-do cx-activate-item "Iterate*PanelButtons*PushButton1(OK)")
(cx-gui-do cx-activate-item "MenuBar*WriteSubMenu*Case & Data...")
(cx-gui-do cx-set-text-entry "Select File*Text" "s2.cas ")
(cx-gui-do cx-activate-item "Select File*OK")
(cx-gui-do cx-activate-item "Warning*OK")
2.不同维数的多任务计算
需要再写入一个批处理,内容为
fluent 2d -g -i g -i 1.jou
fluent 3d -g -i g -i 2.jou
命名为:1.bat
操作时:首先运行1.bat的批处理
注:要将1.jou和2.jou及case放在同个目录下
3.任务的延续怎么计算?
fluent 2d -wait -i g -i 2.jou
fluent 3d -wait -i g -i 1.jou
则先执行脚本2下的case,然后执行1下的case