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

outputting averaged quantities to a text file in parallel execution

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

LinkBack Thread Tools Display Modes
Old   January 31, 2013, 18:08
Default outputting averaged quantities to a text file in parallel execution
Join Date: Oct 2012
Posts: 77
Rep Power: 6
zhengzh5 is on a distinguished road

I am currently working with OpenFOAM-2.0.x, and trying to do some engine simulations. I want to calculate average quantities such as meanPressure, meanTemperature at every time step and output them to, say, summaryLog file.

In serial execution, I have

totalV = sum(mesh.V().field());
sumMass = fvc::domainIntegrate(rho).value();
pPistonMean = fvc::domainIntegrate(p).value()/totalV;
aveT = fvc::domainIntegrate(rho*Tu).value()/sumMass;
summaryLog << pPistonMean << " "<<aveT <<endl;

and things seem to work fine. But when I try to run the code in parallel with 4 processors, the output doesn't make sense to me anymore.

For instance, all 4 summaryLog files (1 per processor) will show the same sumMass when the mass contained in each decomposed domain should be different since the domain size varies a lot between processors. (I use scotch for domain decomposition) My questions are:

1. if each processor stores their own copy of mesh and internal fields such as, pressure, temperature, density.
2. when writing data to a text file, does each processor output the individual data it's holding, or does a certain processor does the task for all 4 processors.

Any help is appreciated. thanks a lot!

zhengzh5 is offline   Reply With Quote


Thread Tools
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
wmake compiling new solver mksca OpenFOAM Programming & Development 13 August 18, 2014 22:26
error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Native Meshers: blockMesh 2 March 14, 2012 10:56
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 20:08
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 01:24
error while compiling the USER Sub routine CFD user CFX 3 November 25, 2002 16:16

All times are GMT -4. The time now is 08:18.