|
[Sponsors] |
Plotting residuals for rhoSimpleFoam tutorial |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 24, 2017, 12:13 |
Plotting residuals for rhoSimpleFoam tutorial
|
#1 |
Member
power
Join Date: Jun 2014
Posts: 86
Rep Power: 12 |
Hello,
I run the tutorial angledDuctExplicitFixedCoeff found among the tutorials of rhoSimpleFoam. I created this script to plot residuals: Code:
#!/bin/bash foamLog log >/dev/null gnuplot -persist > /dev/null 2>&1 << EOF set logscale y set title "Residual vs. Iteration" set xlabel "Iteration" set ylabel "Residual" 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 U' | cut -d' ' -f9 | tr -d ','" title 'U' with lines,\ "< cat log | grep 'Solving for e' | cut -d' ' -f9 | tr -d ','" title 'e' with lines,\ "< cat log | grep 'Solving for p' | cut -d' ' -f9 | tr -d ','" title 'p' with lines,\ "< cat log | grep 'Solving for k' | cut -d' ' -f9 | tr -d ','" title 'k' with lines,\ "< cat log | grep 'Solving for epsilon' | cut -d' ' -f9 | tr -d ','" title 'epsilon' with lines,\ "< cat log | grep 'Solving for T' | cut -d' ' -f9 | tr -d ','" title 'T' with lines,\ "< cat log | grep 'Solving for nut' | cut -d' ' -f9 | tr -d ','" title 'nut' with lines,\ "< cat log | grep 'Solving for rho' | cut -d' ' -f9 | tr -d ','" title 'rho' with lines,\ "< cat log | grep 'Solving for alphat' | cut -d' ' -f9 | tr -d ','" title 'alphat' with lines EOF Why? Do you have the same? Could you check, please? Thanks Last edited by enginpower; April 28, 2017 at 06:34. |
|
April 26, 2017, 18:47 |
|
#2 |
Senior Member
CFD
Join Date: Nov 2010
Location: United States
Posts: 243
Rep Power: 16 |
This should be easy if you install gnuplot. If you already have gnuplot in your system, just type up
:~$ gnuplot Residuals It should work with you! |
|
April 28, 2017, 06:32 |
|
#3 |
Member
power
Join Date: Jun 2014
Posts: 86
Rep Power: 12 |
It returns:
Code:
gnuplot Residuals foamLog log.rhoSimpleFoam >/dev/null ^ "Residuals", line 3: invalid command Code:
#!/bin/bash foamLog log.rhoSimpleFoam >/dev/null gnuplot -persist > /dev/null 2>&1 << EOF set logscale y set title "Residual vs. Iteration" set xlabel "Iteration" set ylabel "Residual" 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 U' | cut -d' ' -f9 | tr -d ','" title 'U' with lines,\ "< cat log | grep 'Solving for e' | cut -d' ' -f9 | tr -d ','" title 'e' with lines,\ "< cat log | grep 'Solving for p' | cut -d' ' -f9 | tr -d ','" title 'p' with lines,\ "< cat log | grep 'Solving for k' | cut -d' ' -f9 | tr -d ','" title 'k' with lines,\ "< cat log | grep 'Solving for epsilon' | cut -d' ' -f9 | tr -d ','" title 'epsilon' with lines,\ "< cat log | grep 'Solving for T' | cut -d' ' -f9 | tr -d ','" title 'T' with lines,\ "< cat log | grep 'Solving for nut' | cut -d' ' -f9 | tr -d ','" title 'nut' with lines,\ "< cat log | grep 'Solving for alphat' | cut -d' ' -f9 | tr -d ','" title 'alphat' with lines EOF The log file generated by Allrun script is log.rhoSimpleFoam, but nothing Thanks |
|
April 28, 2017, 10:02 |
Try this file!
|
#4 |
Senior Member
CFD
Join Date: Nov 2010
Location: United States
Posts: 243
Rep Power: 16 |
|
|
April 28, 2017, 12:39 |
|
#5 |
Member
power
Join Date: Jun 2014
Posts: 86
Rep Power: 12 |
I downloaded your file in my case folder:
~/OpenFoam/angledDuctExplicitFixedCoeff Then I tried the command: Code:
$ gnuplot Residuals cat: log.simpleADFoam: No such file or directory "Residuals", line 10: warning: Skipping data file with no valid points cat: log.simpleADFoam: No such file or directory "Residuals", line 10: warning: Skipping data file with no valid points cat: log.simpleADFoam: No such file or directory "Residuals", line 10: warning: Skipping data file with no valid points cat: log.simpleADFoam: No such file or directory "Residuals", line 10: warning: Skipping data file with no valid points cat: log.simpleADFoam: No such file or directory "Residuals", line 10: warning: Skipping data file with no valid points cat: log.simpleADFoam: No such file or directory "Residuals", line 10: warning: Skipping data file with no valid points plot "< cat log.simpleADFoam | grep 'Solving for Ux' | cut -d' ' -f9 | tr -d ','" title 'Ux' with lines, "< cat log.simpleADFoam | grep 'Solving for Uy' | cut -d' ' -f9 | tr -d ','" title 'Uy' with lines, "< cat log.simpleADFoam | grep 'Solving for Uz' | cut -d' ' -f9 | tr -d ','" title 'Uz' with lines, "< cat log.simpleADFoam | grep 'Solving for omega' | cut -d' ' -f9 | tr -d ','" title 'omega' with lines, "< cat log.simpleADFoam | grep 'Solving for k' | cut -d' ' -f9 | tr -d ','" title 'k' with lines, "< cat log.simpleADFoam | grep 'Solving for p' | cut -d' ' -f9 | tr -d ','" title 'p' with lines ^ "Residuals", line 10: x range is invalid Code:
~/OpenFoam/angledDuctExplicitFixedCoeff$ ./Residuals./Residuals: line 5: plot: command not found ./Residuals: line 11: pause: command not found ./Residuals: line 12: reread: command not found |
|
April 28, 2017, 12:56 |
|
#6 | |
Senior Member
CFD
Join Date: Nov 2010
Location: United States
Posts: 243
Rep Power: 16 |
Quote:
log.simpleADFoam to your solver i.e. log.rhoSimpleFoam. Make sure also when you run you simulation, you have to make log.rhoSimpleFoam. For instance, rhoSimpleFoam > log.rhoSimpleFoam. It should work with you now. Cheers, |
||
May 2, 2017, 11:17 |
|
#7 |
Member
power
Join Date: Jun 2014
Posts: 86
Rep Power: 12 |
ok, now it works!
Thanks a lot for your help |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Tutorials] Tutorial of how to plot residuals ! | wolle1982 | OpenFOAM Community Contributions | 171 | February 20, 2024 02:55 |
plotting force history in Wigley hull Tutorial | jakaranda | OpenFOAM Running, Solving & CFD | 0 | August 1, 2012 11:58 |
[Virtualization] OpenFOAM oriented tutorial on using VMware Player - support thread | wyldckat | OpenFOAM Installation | 2 | July 11, 2012 16:01 |
Plotting residuals for solid | Julie | Siemens | 1 | October 29, 2004 06:24 |
Rotor/stator tutorial, and how to... | gilberto | CFX | 5 | January 21, 2002 09:41 |