如何输出场最大温度值这个文件
-
本人openfoam新手,想要通过openfoam模拟droplet的燃烧过程,希望监测场中最大温度值随时间的变化,想请问一下要如何操作?或者说如何去操控openfoam输出的文件?谢谢!
-
functions { pressureProbes { type probes; functionObjectLibs ("libsampling.so"); outputControl timeStep; outputInterval 1; probeLocations//监控位置 ( ( 1 0 0 ) ( 2 0 0 ) ); fields ( T//监控场 ); } } }
把上述代码添加到你的
controlDict
文件中。 -
functions { cellSource1 { type cellSource; functionObjectLibs ("libfieldFunctionObjects.so"); enabled yes; outputControl outputTime; log yes; valueOutput yes; source all; operation max; fields ( T ); } }
这个加到 controlDict 里就能输出最大值了。
其实还有一种办法,既然你说在终端的输出信息中包括了最大和最小温度,那么如果你保存了终端输出信息,你还可以用 linux 的工具来从那些众多的信息中将你想要的最大和最小信息提取出来,
比如,假设你的文件名为 logcat log | grep "max(" | sed 's/^\ *//g' | cut -d ' ' -f 5
感兴趣的话可以试试这个命令,可能不能完全适合你的情况,你需要做些修改。
2016年6月6日 19:30
3/8
2019年2月19日 07:47