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

Plotting a result while a simulation is running

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By tomf

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 26, 2022, 07:41
Default Plotting a result while a simulation is running
  #1
Senior Member
 
mohammad
Join Date: Dec 2010
Location: UK
Posts: 246
Rep Power: 17
mohammad is on a distinguished road
Hi everyone,

I know that PyFoamPlotRunner shows the residuals while a file is running.
However, I'm trying to plot the AreaAverage of pressure at the inlet of a domain while the simulating is running.

I have calculated the surface average within the "controlDict" by:

inletAvePressure
{
type surfaceFieldValue;
libs (fieldFunctionObjects);
enabled yes;
writeControl timeStep;
writeInterval 1;
log yes;
writeFields no;
regionType patch;
name inlet;
operation areaAverage;
weightField phi;
fields ( p );
}


Could anybody let me know how to plot this value during the run?

Best,
mohammad is offline   Reply With Quote

Old   May 30, 2022, 09:48
Default
  #2
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 647
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
Hi Mohammad,

If you run on any modern version of OpenFOAM this will probably work from the command line:

Code:
foamMonitor postProcessing/inletAvePressure/0/surfaceFieldValue.dat
Please note that the 0 assumes you started the monitor and the simulation from time=0.

Code:
foamMonitor -h
shows the usage.

Running in the background can be useful.

Hope this helps,
Best Regards,
Tom
mohammad likes this.
tomf is offline   Reply With Quote

Old   May 30, 2022, 10:42
Default
  #3
Senior Member
 
mohammad
Join Date: Dec 2010
Location: UK
Posts: 246
Rep Power: 17
mohammad is on a distinguished road
Quote:
Originally Posted by tomf View Post
Hi Mohammad,

If you run on any modern version of OpenFOAM this will probably work from the command line:

Code:
foamMonitor postProcessing/inletAvePressure/0/surfaceFieldValue.dat
Please note that the 0 assumes you started the monitor and the simulation from time=0.

Code:
foamMonitor -h
shows the usage.

Running in the background can be useful.

Hope this helps,
Best Regards,
Tom
Thanks Tom for your great help.

For future readers:

I was also able to use the "gnuplot" in a new terminal to read the results from the "log" file.

Best
mohammad is offline   Reply With Quote

Old   May 31, 2022, 09:13
Default
  #4
New Member
 
Join Date: Dec 2019
Posts: 13
Rep Power: 7
Vivio is on a distinguished road
Hi mohammad,

Another thing you can do, if you're using PyFoam, is to create a file called "customRegexp" in the run directory, containing a regular expression to parse the log for the quantity you want to plot. PyFoamPlotRunner will pick up the regular expression automatically and plot your result live alongside the residuals.

Best regards,
Vivio
Vivio is offline   Reply With Quote

Reply

Tags
plotting result, simultaneous, while running


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
[Workbench] Current result file may not contain requested result data zhizhuo ANSYS Meshing & Geometry 0 December 13, 2017 05:18
Can not get correct result in inducer simulation by pimpleDyMFoam zxzx OpenFOAM Running, Solving & CFD 1 February 19, 2017 03:43
Different Result between FLUENT and CFD Post free.man FLUENT 0 February 10, 2017 00:20
How to display the whole result of a periodic model via one period result? dixylo FLUENT 2 February 23, 2012 05:11
Read Result Files or User Defined Result Aquilaris ANSYS 0 February 9, 2011 06:25


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