CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   I want to plot residual U: (http://www.cfd-online.com/Forums/openfoam-post-processing/107705-i-want-plot-residual-u.html)

vahid.najafi October 4, 2012 09:15

I want to plot residual U:
 
Hi dear Foamers.I have a problem,please help me to solve this.

Im working with interPhaseChaneFoam solver!!!in the end of run I want to have residual plot!!!
I have log file but in this I havent residual for Ux,Uy and Uz!!!!

I want to have
residual U,but I seen:
"plotres.txt", line 7: warning: Skipping data file with no valid points
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
^
"plotres.txt", line 7: x range is invalid???
please help me to plot this residual!!!


{for more Description.
Im using gnuplot.for this work im do this work step by step:
1-my solver >log
2-tail -f log
3-Crtl+C
4-gnuplot plotres.txt
(file plotres.txt include:
set logscale y
set title "Residuals"
set ylabel 'Residual'
set xlabel 'Iteration'
plot "< cat log | grep 'Solving for U' | cut -d' ' -f9 | tr -d ','" title 'U' 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,\
pause 1
reread
)
}


/////////////////////////////////////////////////////////////////////////
The point that needs to be said:
I plot residual P with this Commands in gnuplot!!!
/////////////////////////////////////////////////////////////////////////

please help me for this problem??
Thanks for your Attention.


SirWombat October 5, 2012 03:29

could you post a small part of the logfile where the velocity residual is listet. we can then think about the correct syntax for your plot.

Bernhard October 5, 2012 06:39

You may want to use the foamLog utility.

vahid.najafi October 5, 2012 10:39

Hi dear SirWombat.
 
2 Attachment(s)
Hi dear SirWombat.
Thanks for your answer,I attachment Part of the log file in my log file.txt and plotres.txt,I hope that you with them,solve my problem???
Thank you very much.

vahid.najafi October 5, 2012 11:16

Thanks dear Bernarad for your answer.
 
Hi Dear Bernhard,Thanks for your answer.
please give me more information about to use the foamLog utility???
I've never use it!!!

SirWombat October 5, 2012 15:36

Have a look at the official documentation: http://www.openfoam.org/docs/user/monitoring-jobs.php

Code:

foamLog "my log file.txt"
will create a folder "logs" containing a few plots. You can use gnuplot to plot those files, i.e.

Code:

gnuplot --persist -e "plot 'logs/p_rgh_0' w lines;"
---

about the velocity residual: i cannot find it in your log file, so unfortunately i cannot help you with that. There is this "max(U)" and you can surely extract this by using:

Code:

grep "max(U)"  "my log file.txt"  | awk '{print $2}'
but i am not sure what that actually is ... looks more like the actual maximum velocity than a residual ...

vahid.najafi October 6, 2012 00:22

Tnx
 
Hi agian dear SirWombat.

Thanks for your reply.
Im trying your commands ,but i dont succes to plot residual U yet!!!???
I ask you,if do you find a solution,advice to me.

However,thanks for your Guidance.

Bernhard October 8, 2012 03:13

Quote:

Originally Posted by vahid.najafi (Post 385120)
Hi Dear Bernhard,Thanks for your answer.
please give me more information about to use the foamLog utility???
I've never use it!!!

You can use it ase "foamLog log" and you'll get a directory ./logs, where, I think, the are easily related to the original logfile.

s.m July 7, 2013 08:32

Quote:

Originally Posted by vahid.najafi (Post 384920)
Hi dear Foamers.I have a problem,please help me to solve this.

Im working with interPhaseChaneFoam solver!!!in the end of run I want to have residual plot!!!
I have log file but in this I havent residual for Ux,Uy and Uz!!!!

I want to have
residual U,but I seen:
"plotres.txt", line 7: warning: Skipping data file with no valid points
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
^
"plotres.txt", line 7: x range is invalid???
please help me to plot this residual!!!


{for more Description.
Im using gnuplot.for this work im do this work step by step:
1-my solver >log
2-tail -f log
3-Crtl+C
4-gnuplot plotres.txt
(file plotres.txt include:
set logscale y
set title "Residuals"
set ylabel 'Residual'
set xlabel 'Iteration'
plot "< cat log | grep 'Solving for U' | cut -d' ' -f9 | tr -d ','" title 'U' 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,\
pause 1
reread
)
}


/////////////////////////////////////////////////////////////////////////
The point that needs to be said:
I plot residual P with this Commands in gnuplot!!!
/////////////////////////////////////////////////////////////////////////

please help me for this problem??
Thanks for your Attention.


you can use "pyFoamPlotRunner.py simpleFoam" if you use simpleFoam For your analysis.
it will show you the residuals during the run.

amir_kb June 2, 2014 09:29

Hi Vahid
I think you must remove the ,\ at the end of line 7 (just one line before pause 1).

amir_kb June 2, 2014 09:31

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,\
"< cat log | grep 'Solving for p' | cut -d' ' -f9 | tr -d ','" title 'p' with lines
pause 1
reread

ashishvshelke July 1, 2016 02:54

Need help in OpenFoam COmbustion Model
 
Dear Foamer,
I am working on fuel cloud combustion, in which a fuel vapor cloud is getting form in case of leakage of fuel and get ignited by any heat source available.

I have tried this in fireFoam as fuel C3H8 is inlet from ground for certain time span to make a cloud.

with singleStepReactingMixture, infinitelyFastChemistry<psiThermoCombustion,constG asHThermoPhysics> started the chemical reaction as O2 comes contact in C3H8..

in many available "ignition" contained model do not contain the species fraction that I required as CO2, H2O


so I need a model that contain:
1 Radiation Model
2 LES
3 Species Transport
4 Spark ignition


All times are GMT -4. The time now is 02:06.