【分享】 Residual 动态监测
-
- log 文件,模拟中生成的
- Gnuplot
- 新建一个文件resplot,代码内容如下
set logscale y set title "Residuals" set ylabel 'Residual' set xlabel 'Iteration' plot "< cat log | grep 'Solving for Ux' | cut -d' ' -f9 | tr -d ','" title 'Ux' with lines,\ "< cat log | grep 'Solving for Uy' | cut -d' ' -f9 | tr -d ','" title 'Uy' with lines,\ "< cat log | grep 'Solving for Uz' | cut -d' ' -f9 | tr -d ','" title 'Uz' with lines,\ "< cat log | grep 'Solving for omega' | cut -d' ' -f9 | tr -d ','" title 'omega' with lines,\ "< cat log | grep 'Solving for k' | cut -d' ' -f9 | tr -d ','" title 'k' with lines,\ pause 1 reread
解析:
cat log2 | grep 'Solving for Ux' | cut -d' ' -f9 | tr -d ','" title 'Ux' with lines, 在 log2文件中 1.搜索 'Solving for Ux' , 2.删除 ' ' 空格, 3. -f9 第9个词 4. tr -d tr(translate)命令是sed命令的简化版,tr命令能实现的功能, sed都能实现 pause 1 reread 实现实时更新,间隔1秒更新
- 在terminal中进入gnuplot,进入case文件夹
- 输入,load “resplot” (我的命令叫plot)
-
-
好!
但为啥不直接用pyFoam?😂
-
所里有linux-admin, 安装东西费劲的
-
为啥不直接用openfoam自带监控残差de...
-
@东岳 嗯 这个是同事教我的方法,另外还要监控一些其他的东西,想着他的方法比较方便。。其他的还得自己弄
-
那你知道怎么在gnuplot的界面自动replot么?
gnuplot > plot
这个plot能自动replot么
-
@东岳
pause 1
reread
这个就是更新的命令 在 load的resplot文件