CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Plot residuals over Iterations instead of time steps

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By vikramaditya91

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 29, 2016, 03:56
Default Plot residuals over Iterations instead of time steps
  #1
Member
 
Charles K.
Join Date: Feb 2016
Location: Germany
Posts: 37
Rep Power: 10
McCharles is on a distinguished road
Hello everyone,

I would like to plot the residuals over the Pimple Iterations instead of every completed time step in order to see the PIMPLE-Loops. Usually i use pyFoamPlotWatcher.py to plot the residuals.

Is there a special extension to use with pyFoamPlotWatcher or do i have to change any setting?

Cheers,

Charles
McCharles is offline   Reply With Quote

Old   July 29, 2016, 04:46
Default Have you gone through this
  #2
New Member
 
eu sou cfd
Join Date: Jun 2012
Location: Brazil
Posts: 18
Rep Power: 14
vikramaditya91 is on a distinguished road
Hey McCharles, I am not sure if pyFoamPlots have that option while running a transient case.

http://www.cfd-online.com/Forums/ope...residuals.html

But if you haven't gone through the above link I suggest going through it thougroughly. Of course it isnt as straight forward as the pyFoamPlots but this gets the job done and you have a much better control on the graphs I think

Last edited by vikramaditya91; July 29, 2016 at 05:34. Reason: incomplete
vikramaditya91 is offline   Reply With Quote

Old   July 29, 2016, 08:10
Default
  #3
Member
 
Bruno
Join Date: Jun 2016
Location: Siegen, Germany
Posts: 59
Rep Power: 10
MBttR is on a distinguished road
Quote:
Originally Posted by vikramaditya91 View Post
Hey McCharles, I am not sure if pyFoamPlots have that option while running a transient case.

http://www.cfd-online.com/Forums/ope...residuals.html

But if you haven't gone through the above link I suggest going through it thougroughly. Of course it isnt as straight forward as the pyFoamPlots but this gets the job done and you have a much better control on the graphs I think
Hi Vikramaditya, do you maybe know how to just plot the last iteration of a variable per timestep? For example, pressure makes several iterations per timestep and hence the plot contains all these values, as the word pressure is stated many times. I thought maybe to do a search for the last instance of the word but I'm not sure how to do this.

Greetings,

Bruno
MBttR is offline   Reply With Quote

Old   July 29, 2016, 08:35
Default Convergence plot
  #4
New Member
 
eu sou cfd
Join Date: Jun 2012
Location: Brazil
Posts: 18
Rep Power: 14
vikramaditya91 is on a distinguished road
Hey Bruno, the post I referred to actually makes that distinction. But anyway, here is the code

Code:
set logscale y
set title "Residuals"
set ylabel 'Residual'
set xlabel 'Iteration'
plot "< cat log_parallel.txt | grep 'Solving for Urelx' | cut -d' ' -f9 | tr -d ','" title 'Urelx' with lines,\
     "< cat log_parallel.txt | grep 'Solving for Urely' | cut -d' ' -f9 | tr -d ','" title 'Urely' with lines,\
     "< cat log_parallel.txt | grep 'Solving for Urelz' | cut -d' ' -f9 | tr -d ','" title 'Urelz' with lines,\
     "< cat log_parallel.txt | grep 'Solving for p' | cut -d' ' -f9 | sed -n '0~6p'| tr -d ','" title 'p' with lines
pause 1
reread
You replace the 6 in '0~6p' to the number of corrections you make
McCharles likes this.
vikramaditya91 is offline   Reply With Quote

Old   July 29, 2016, 08:46
Default
  #5
Member
 
Charles K.
Join Date: Feb 2016
Location: Germany
Posts: 37
Rep Power: 10
McCharles is on a distinguished road
Wow, thank you very much for your reply Vik !
McCharles 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
Cannot run the code properly: very large time step continuity error crst15 OpenFOAM Running, Solving & CFD 9 December 14, 2014 19:17
Simulation seems to converge but crashes suddenly xxxx OpenFOAM 16 September 12, 2014 09:07
Help for the small implementation in turbulence model shipman OpenFOAM Programming & Development 25 March 19, 2014 11:08
pimpleFoam: turbulence->correct(); is not executed when using residualControl hfs OpenFOAM Running, Solving & CFD 3 October 29, 2013 09:35
How to write k and epsilon before the abnormal end xiuying OpenFOAM Running, Solving & CFD 8 August 27, 2013 16:33


All times are GMT -4. The time now is 15:12.