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

coded functions (for runtime post-processing) fails with parallel run

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By cfd@kgp

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   December 2, 2016, 12:22
Default coded functions (for runtime post-processing) fails with parallel run
  #1
Member
 
a
Join Date: Oct 2014
Posts: 49
Rep Power: 11
cfd@kgp is on a distinguished road
Dear Foam experts',

here is a coded function to calculate a derived variable using a existiong variable IO object variable sMS1:alpha1. The following quoted text was added in the controlDict,

Quote:
TIntegral
{
functionObjectLibs ("libutilityFunctionObjects.so");
type coded;
redirectType integral;
outputControl timeStep;
code
#{
const volScalarField& fl = mesh().lookupObject<volScalarField>("sMS1:alpha1") ;
// volScalarField magU(mag(U));

scalar volIntegral = 0;
scalar volIntegralV = 0;

forAll (fl, cellI)
{
volIntegral += fl[cellI]*mesh().V()[cellI];
volIntegralV += 1.0*mesh().V()[cellI];
}
volIntegral=volIntegral/volIntegralV;
Info<<"ANSWER: " << volIntegral << endl;
//foo.write();

#};
}

In serial running of the solver it performs and does the job. But when executed in parallel the output is always zero.

Somebody kindly help.

Thanks and regards,
cfd@kgp
flbrandao likes this.
cfd@kgp is offline   Reply With Quote

 


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
Error running simpleFoam in parallel Yuby OpenFOAM Running, Solving & CFD 14 October 7, 2021 04:38
Some questions about a multi region case run in parallel zfaraday OpenFOAM Running, Solving & CFD 5 February 23, 2017 10:25
Run time post processing vs Post run post processing pruthvi1991 OpenFOAM Post-Processing 1 February 19, 2015 14:15
parallel Grief: BoundaryFields ok in single CPU but NOT in Parallel JR22 OpenFOAM Running, Solving & CFD 2 April 19, 2013 16:49
Parallel computation and simultaneous post processing Armin OpenFOAM 9 December 27, 2010 19:18


All times are GMT -4. The time now is 21:02.