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

Script for plotting Convergence Residuals

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 9, 2015, 08:40
Default Script for plotting Convergence Residuals
  #1
New Member
 
Ben S
Join Date: Feb 2014
Posts: 1
Rep Power: 0
Bensmeat is on a distinguished road
Hi All

I wanted to share a script I created which graphs OpenFOAM convergence residuals from a text file output from the command line. e.g (on windows) simpleFoam > log_01.txt.

The program outputs (Ux, Uy, Uz, p, k, omega and epsilon) and graphs them against time using matplotlib.

to use place in same directory as solver log file, run with python cmd and input log file name.

I would recommend downloading the python 3.4 version of Anaconda3 to use it.

I am by no means a programmer and I am a user of the excellent windows port of OpenFOAM by BlueCape (also runs fine on linux using the command "python ConGrapher.py"). So if there are any issues please leave a message and I can have a look at it.

It is available here:

https://github.com/bsmeaton/ConGrapher.git

Kind regards

Ben

Last edited by Bensmeat; April 9, 2015 at 14:46.
Bensmeat is offline   Reply With Quote

Old   February 13, 2017, 06:20
Default
  #2
Member
 
thegauravonline's Avatar
 
GS
Join Date: Mar 2016
Posts: 81
Rep Power: 10
thegauravonline is on a distinguished road
How do I use this in Ubuntu Linux?
Is it possible?
thegauravonline is offline   Reply With Quote

Old   March 5, 2019, 12:28
Default
  #3
New Member
 
Join Date: Mar 2016
Posts: 23
Rep Power: 10
miragemobile is on a distinguished road
Ben, thank you for the excellent python script!

thegauravonline, you would need to install python and then execute the script

Since the creation of this script, numpy no longer accepts the 'skip_rows' option as an arguement.

I have therefore modified the script to execute using the latest version of numpy. See Attached. I had to add the '.txt' at the end, please remove the extension before executing in python
Attached Files
File Type: txt residual_grapher.py.txt (7.4 KB, 122 views)
miragemobile is offline   Reply With Quote

Reply

Tags
convergence, openfoam, python, residuals, windows


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
under-relaxation factors -> level of residuals Zigainer FLUENT 19 July 21, 2017 16:53
Convergence issue- residuals of continuity s.garg FLUENT 4 November 7, 2016 11:39
Fluent: Tet Vs Poly mesh novice FLUENT 9 January 3, 2011 12:10
Convergence problem residuals stay at a certain level andimb OpenFOAM Running, Solving & CFD 3 April 28, 2006 17:13
Convergence problems Chetan FLUENT 3 April 15, 2004 19:13


All times are GMT -4. The time now is 10:38.