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

[Tutorials] Tutorial of how to plot residuals !

Register Blogs Community New Posts Updated Threads Search

Like Tree346Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 19, 2011, 19:34
Default
  #41
Senior Member
 
Sandy Lee
Join Date: Mar 2009
Posts: 213
Rep Power: 18
sandy is on a distinguished road
It's ok, I think. If p equation gets convergent, you can judge other equations have got convergent early.
sandy is offline   Reply With Quote

Old   April 19, 2012, 04:53
Default
  #42
Member
 
Arina
Join Date: Oct 2009
Location: Belarus
Posts: 71
Rep Power: 17
Akuji is on a distinguished road
Send a message via ICQ to Akuji
Hello, everyone!

I use scripts for plot residuals and coefficients (thank you VERY MUCH).

Residuals are plotting, but coefficients - not. I have only grid of graphics, and a tip, that lift coeff have red color, drag - green.
I look inside file and change it according my solver.

Did I do something wrong? Or how can I get the graphic of force coefficients?
Akuji is offline   Reply With Quote

Old   August 13, 2012, 07:29
Default
  #43
New Member
 
tanzil tjhin
Join Date: Jan 2012
Posts: 4
Rep Power: 14
tanzil is on a distinguished road
Thanks Wolfgang for the great script,

I was wondering what syntax is needed to plot Residual vs Time in transient case instead of Residual vs Iteration. Does anyone have an Idea?

Regards
tanzil is offline   Reply With Quote

Old   August 14, 2012, 02:33
Default
  #44
ata
Senior Member
 
ata's Avatar
 
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18
ata is on a distinguished road
Hi
May be you can use pyFoam
ata is offline   Reply With Quote

Old   November 2, 2012, 03:05
Default
  #45
Member
 
Suranga Dharmarathne
Join Date: Jan 2011
Location: TX, USA
Posts: 39
Rep Power: 15
sdharmar is on a distinguished road
how to save pyFoamPlotWatcher.py generated gunplots at the end of the run.

BR,
Suranga.
sdharmar is offline   Reply With Quote

Old   November 21, 2012, 13:00
Default
  #46
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by sdharmar View Post
how to save pyFoamPlotWatcher.py generated gunplots at the end of the run.

BR,
Suranga.
With all pyFoam-utilities the option "--help" is your friend. The option you're looking for is callled --hardcopy I believe (just because I write this stuff doesn't mean that I know how to use it ). There are also options to write the data to postprocess it with other programs (going through pyFoamRedoPlot.py even allows you to write CSV-files that you can directly use in a Spreadsheet)
sdharmar likes this.
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   November 29, 2012, 17:41
Default
  #47
New Member
 
Join Date: Nov 2012
Location: Scotland, UK
Posts: 19
Rep Power: 14
GPan1 is on a distinguished road
This is quite nice, but is there anyway to import the data from the log file into excel for some nicer looking graphs?
GPan1 is offline   Reply With Quote

Old   November 29, 2012, 17:50
Default
  #48
Senior Member
 
calim_cfd's Avatar
 
mauricio
Join Date: Jun 2011
Posts: 172
Rep Power: 18
calim_cfd is on a distinguished road
hi! u can create a bash script to create a txt/csv like file so u can import it to excel..

the command "awk" is the best call imo

gl
GPan1 likes this.
__________________
Best Regards
/calim

"Elune will grant us the strength"
calim_cfd is offline   Reply With Quote

Old   November 29, 2012, 18:55
Default
  #49
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by GPan1 View Post
This is quite nice, but is there anyway to import the data from the log file into excel for some nicer looking graphs?
"This" you mean hardcopy in pyFoamPlotWatcher?

One possible way was described in the next sentence: read the file with the pickled data with pyFoamRedoPlot.py and instead of generating images write CSV-files (CSV is read by almost everyone including Excel)

Other way would be to let the Watcher write files with the --write-files-option and use pyFoamConvertToCSV.py
GPan1 likes this.
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   November 29, 2012, 19:16
Default
  #50
New Member
 
Join Date: Nov 2012
Location: Scotland, UK
Posts: 19
Rep Power: 14
GPan1 is on a distinguished road
oops, no I meant using gnuplot however I'll take a look at using pyFoamWatcher. CSV data would be perfect. Thanks!
GPan1 is offline   Reply With Quote

Old   November 29, 2012, 20:10
Default
  #51
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by GPan1 View Post
oops, no I meant using gnuplot however I'll take a look at using pyFoamWatcher. CSV data would be perfect. Thanks!
In the thread tree your posting showed up as a response to one of my postings. And that was all context there was for the "this". Didn't mean to impose PyFoam on you
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   November 30, 2012, 05:20
Default
  #52
New Member
 
Join Date: Nov 2012
Location: Scotland, UK
Posts: 19
Rep Power: 14
GPan1 is on a distinguished road
Ah right, the quick reply function is different here compared to other forums. Usually just adds a comment onto the thread without specifying who you reply to.

Found an easier way, simply copy and paste the log file into excel, split into columns by delimiting (use space and comma). Use an if/else function to select the row of the column that has (for me Uy) then return the row 3 columns to the right or return zero. Filter out the zeros, copy and paste the non-zero data into a new sheet as 'values' and you're sorted.
GPan1 is offline   Reply With Quote

Old   November 30, 2012, 13:16
Default
  #53
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by GPan1 View Post
Ah right, the quick reply function is different here compared to other forums. Usually just adds a comment onto the thread without specifying who you reply to.

Found an easier way, simply copy and paste the log file into excel, split into columns by delimiting (use space and comma). Use an if/else function to select the row of the column that has (for me Uy) then return the row 3 columns to the right or return zero. Filter out the zeros, copy and paste the non-zero data into a new sheet as 'values' and you're sorted.
Well. Whatever you consider easy
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   December 7, 2012, 11:25
Default Problems with plotting by gnuplot, simpleFoam Residuals
  #54
Senior Member
 
Sören
Join Date: Mar 2012
Posts: 102
Rep Power: 14
despaired student is on a distinguished road
Hi foamers,

I have a maybe stupid question about how to plot the residuals of a simpleFoam Simulation.

I'm used to pyFoam but this is no longer an option so I've tried gnuplot and the script provided by W.Heydlauff.
As I understand the script it should plot the Final Residual of the log-file, right? But when I use it now it gives me the Initial Residual of the log-file. How comes?


Here is my gnuplot-script:

Quote:
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 p' | cut -d' ' -f9 | sed -n 'p;N;N' | tr -d ','" title 'p' with lines
pause 1
reread
The Log-file and my plot are attached.


Thank you in advance.
Attached Images
File Type: jpg Residuals_Baffle_seriell.jpg (29.4 KB, 307 views)
Attached Files
File Type: gz Log.tar.gz (87.2 KB, 80 views)
File Type: gz Residuals_Baffle_seriell.png.tar.gz (11.6 KB, 48 views)
despaired student is offline   Reply With Quote

Old   December 7, 2012, 12:33
Default
  #55
New Member
 
tanzil tjhin
Join Date: Jan 2012
Posts: 4
Rep Power: 14
tanzil is on a distinguished road
It should be f13 instead of f9 to plot Final residual.

regards,
Tanzil
tanzil is offline   Reply With Quote

Old   December 7, 2012, 12:44
Default
  #56
Senior Member
 
Sören
Join Date: Mar 2012
Posts: 102
Rep Power: 14
despaired student is on a distinguished road
Sure? I've tried f12, f13 and f14 but these tries just produced error-messages...
despaired student is offline   Reply With Quote

Old   December 10, 2012, 07:31
Default
  #57
New Member
 
Dima Risch
Join Date: Jun 2011
Location: Cologne
Posts: 22
Rep Power: 15
dima is on a distinguished road
Hi Sören,

with your gnuplot-script and the changes described by Tanzil the plot works without errors

Quote:
set logscale y
set title "Residuals"
set ylabel 'Residual'
set xlabel 'Iteration'
plot "< cat Log | grep 'Solving for Ux' | cut -d' ' -f13 | tr -d ','" title 'Ux' with lines,\
"< cat Log | grep 'Solving for Uy' | cut -d' ' -f13 | tr -d ','" title 'Uy' with lines,\
"< cat Log | grep 'Solving for Uz' | cut -d' ' -f13 | tr -d ','" title 'Uz' with lines,\
"< cat Log | grep 'Solving for p' | cut -d' ' -f13 | sed -n 'p;N;N' | tr -d ','" title 'p' with lines
pause 1
reread
regards,
dima
Attached Images
File Type: jpg Residuals_Baffle_seriell_finalRes.jpg (26.1 KB, 252 views)
dima is offline   Reply With Quote

Old   December 10, 2012, 07:43
Default
  #58
Senior Member
 
Sören
Join Date: Mar 2012
Posts: 102
Rep Power: 14
despaired student is on a distinguished road
Thanks,

I copied your script - working fine. I guess that I've overlooked something in my script...


Thnaks for the quick help.
despaired student is offline   Reply With Quote

Old   December 18, 2012, 13:15
Default how draw pressure coefficient in openFoam
  #59
s.m
Senior Member
 
saeideh mohamadi
Join Date: Aug 2012
Posts: 229
Rep Power: 15
s.m is on a distinguished road
hi dear Wolfgang;
it was really useful post, it help me alot.
would you please tell us how can draw pressure coefficient on airfoil using paraview? our multi element airfoil have been solved with openFoam software.
thank you very much
s.m is offline   Reply With Quote

Old   January 4, 2013, 09:03
Default How about parallel situation
  #60
Member
 
Jianye Xia
Join Date: Mar 2009
Posts: 32
Rep Power: 18
bioexplore is on a distinguished road
Hi, can this method applicable to parallel cases?
bioexplore 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
plot residuals in multiregion solver val46 OpenFOAM 4 December 12, 2016 07:06
To Plot Residuals on the fly. neeraj OpenFOAM Running, Solving & CFD 5 October 2, 2013 07:23
[PyFoam] why pyFoamPlotRunner doesn't plot continuity residuals? immortality OpenFOAM Community Contributions 10 May 5, 2013 07:13
plot of residuals hawkeye321 OpenFOAM 5 December 7, 2012 10:05
[Virtualization] OpenFOAM oriented tutorial on using VMware Player - support thread wyldckat OpenFOAM Installation 2 July 11, 2012 17:01


All times are GMT -4. The time now is 13:55.