|January 31, 2013, 18:08||
outputting averaged quantities to a text file in parallel execution
Join Date: Oct 2012
Posts: 77Rep Power: 7
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!
|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|