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

I want to plot residual U:

Register Blogs Members List Search Today's Posts Mark Forums Read

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 4, 2012, 09:15
Default I want to plot residual U:
  #1
Member
 
vahid
Join Date: Feb 2012
Location: Mashhad-Iran
Posts: 80
Rep Power: 4
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, 03:29
Default
  #2
Member
 
Jan
Join Date: Dec 2009
Location: Berlin
Posts: 50
Rep Power: 9
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, 06:39
Default
  #3
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 12
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, 10:39
Default Hi dear SirWombat.
  #4
Member
 
vahid
Join Date: Feb 2012
Location: Mashhad-Iran
Posts: 80
Rep Power: 4
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, 33 views)
File Type: txt my log file.txt (18.3 KB, 26 views)

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

Old   October 5, 2012, 11:16
Default Thanks dear Bernarad for your answer.
  #5
Member
 
vahid
Join Date: Feb 2012
Location: Mashhad-Iran
Posts: 80
Rep Power: 4
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, 15:36
Default
  #6
Member
 
Jan
Join Date: Dec 2009
Location: Berlin
Posts: 50
Rep Power: 9
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 04:10.
SirWombat is offline   Reply With Quote

Old   October 6, 2012, 00:22
Default Tnx
  #7
Member
 
vahid
Join Date: Feb 2012
Location: Mashhad-Iran
Posts: 80
Rep Power: 4
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, 03:13
Default
  #8
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 12
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, 08:32
Default
  #9
s.m
Senior Member
 
saeideh mohamadi
Join Date: Aug 2012
Posts: 229
Rep Power: 6
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, 09:29
Default
  #10
New Member
 
Amir
Join Date: Jan 2014
Posts: 3
Rep Power: 3
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, 09:31
Default
  #11
New Member
 
Amir
Join Date: Jan 2014
Posts: 3
Rep Power: 3
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

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 20:56.