CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

Script for plotting Convergence Residuals

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

LinkBack Thread Tools Search this Thread Display Modes
Old   April 9, 2015, 09:40
Default Script for plotting Convergence Residuals
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"). So if there are any issues please leave a message and I can have a look at it.

It is available here:

Kind regards


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

Old   February 13, 2017, 07:20
thegauravonline's Avatar
Gaurav Singh
Join Date: Mar 2016
Posts: 78
Rep Power: 6
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, 13:28
New Member
Join Date: Mar 2016
Posts: 23
Rep Power: 6
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 (7.4 KB, 49 views)
miragemobile is offline   Reply With Quote


convergence, openfoam, python, residuals, windows

Thread Tools Search this Thread
Search this Thread:

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

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