CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

I want to plot residual U:

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By SirWombat
  • 1 Post By Bernhard
  • 1 Post By SirWombat
  • 1 Post By Bernhard

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 4, 2012, 10:15
Default I want to plot residual U:
  #1
Member
 
vahid
Join Date: Feb 2012
Location: Mashhad-Iran
Posts: 80
Rep Power: 13
vahid.najafi is an unknown quantity at this point
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.

vahid.najafi is offline   Reply With Quote

Old   October 5, 2012, 04:29
Default
  #2
Member
 
Jan
Join Date: Dec 2009
Location: Berlin
Posts: 50
Rep Power: 19
SirWombat is on a distinguished road
Send a message via Skype™ to SirWombat
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.
vahid.najafi likes this.
__________________
~~~_/)~~~
SirWombat is offline   Reply With Quote

Old   October 5, 2012, 07:39
Default
  #3
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22
Bernhard is on a distinguished road
You may want to use the foamLog utility.
vahid.najafi likes this.
Bernhard is offline   Reply With Quote

Old   October 5, 2012, 11:39
Default Hi dear SirWombat.
  #4
Member
 
vahid
Join Date: Feb 2012
Location: Mashhad-Iran
Posts: 80
Rep Power: 13
vahid.najafi is an unknown quantity at this point
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.
Attached Files
File Type: txt plotres.txt (195 Bytes, 51 views)
File Type: txt my log file.txt (18.3 KB, 48 views)

Last edited by vahid.najafi; October 5, 2012 at 12:18.
vahid.najafi is offline   Reply With Quote

Old   October 5, 2012, 12:16
Default Thanks dear Bernarad for your answer.
  #5
Member
 
vahid
Join Date: Feb 2012
Location: Mashhad-Iran
Posts: 80
Rep Power: 13
vahid.najafi is an unknown quantity at this point
Hi Dear Bernhard,Thanks for your answer.
please give me more information about to use the foamLog utility???
I've never use it!!!
vahid.najafi is offline   Reply With Quote

Old   October 5, 2012, 16:36
Default
  #6
Member
 
Jan
Join Date: Dec 2009
Location: Berlin
Posts: 50
Rep Power: 19
SirWombat is on a distinguished road
Send a message via Skype™ to SirWombat
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 likes this.
__________________
~~~_/)~~~

Last edited by SirWombat; October 8, 2012 at 05:10.
SirWombat is offline   Reply With Quote

Old   October 6, 2012, 01:22
Default Tnx
  #7
Member
 
vahid
Join Date: Feb 2012
Location: Mashhad-Iran
Posts: 80
Rep Power: 13
vahid.najafi is an unknown quantity at this point
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.
vahid.najafi is offline   Reply With Quote

Old   October 8, 2012, 04:13
Default
  #8
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22
Bernhard is on a distinguished road
Quote:
Originally Posted by vahid.najafi View Post
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.
vahid.najafi likes this.
Bernhard is offline   Reply With Quote

Old   July 7, 2013, 09:32
Default
  #9
s.m
Senior Member
 
saeideh mohamadi
Join Date: Aug 2012
Posts: 229
Rep Power: 15
s.m is on a distinguished road
Quote:
Originally Posted by vahid.najafi View Post
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.
s.m is offline   Reply With Quote

Old   June 2, 2014, 10:29
Default
  #10
New Member
 
Amir
Join Date: Jan 2014
Posts: 3
Rep Power: 12
amir_kb is on a distinguished road
Hi Vahid
I think you must remove the ,\ at the end of line 7 (just one line before pause 1).
amir_kb is offline   Reply With Quote

Old   June 2, 2014, 10:31
Default
  #11
New Member
 
Amir
Join Date: Jan 2014
Posts: 3
Rep Power: 12
amir_kb is on a distinguished road
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
amir_kb is offline   Reply With Quote

Old   July 1, 2016, 03:54
Default Need help in OpenFoam COmbustion Model
  #12
New Member
 
ashishvshelke's Avatar
 
A V Shelke
Join Date: Jun 2014
Location: UK
Posts: 10
Rep Power: 12
ashishvshelke is on a distinguished road
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
ashishvshelke is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
High Courant Number @ icoFoam Artex85 OpenFOAM Running, Solving & CFD 11 February 16, 2017 14:40
Extrusion with OpenFoam problem No. Iterations 0 Lord Kelvin OpenFOAM Running, Solving & CFD 8 March 28, 2016 12:08
How to write k and epsilon before the abnormal end xiuying OpenFOAM Running, Solving & CFD 8 August 27, 2013 16:33
Orifice Plate with a fully developed flow - Problems with convergence jonmec OpenFOAM Running, Solving & CFD 3 July 28, 2011 06:24
Differences between serial and parallel runs carsten OpenFOAM Bugs 11 September 12, 2008 12:16


All times are GMT -4. The time now is 18:00.