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

[swak4Foam] weightedAverage using execFlowFunctionObject

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 24, 2017, 12:44
Default [swak4Foam] weightedAverage using execFlowFunctionObject
  #1
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 313
Rep Power: 9
Andrea_85 is on a distinguished road
Hello,

i want to output the weighted average of temperature on a given plane as postProcessing using functionObject (i am using "execFlowFunctionObject -time myTime" to run it as postprocessing). I added these lines to my controlDict:

Code:
 surfacePlane
    {
        type swakExpression;
        valueType surface;
        surfaceName testPlane;
        surface {
            type plane;
            basePoint       (0.0040125 1.25e-4 0);
            normalVector    (1 0 0);
            interpolate false;
        }
        verbose true;
        expression "T*area()/sum(area())";
        accumulations (
              sum
        );
    }
However, it seems it does not recognize the field "T". I get this error

Code:
--> FOAM FATAL ERROR:
 Parser Error for driver SampledSurfaceValueExpressionDriver at "1.1-2" :"field T not existing or of wrong type"
"T*area()/sum(area())"
  ^^
--|
what am i doing wrong?
i am using openfoam 2.3

Thanks,

andrea
Andrea_85 is offline   Reply With Quote

Old   May 10, 2017, 05:34
Default
  #2
Member
 
Ricky
Join Date: Jul 2014
Location: Germany
Posts: 46
Rep Power: 5
kera is on a distinguished road
Hi,

I am not sure what is actually triggering that error, apart from saying that you might be missing "T" field in your time directory :P, as your functionObject worked out fine for me.

I am wondering, is there any reason that you are using this expression

Code:
 expression "T*area()/sum(area())";
        accumulations (
              sum
        );
and not this
Code:
 expression "T";
        accumulations (
              weightedAverage
        );
Regards,
Ricky

Quote:
Originally Posted by Andrea_85 View Post
Hello,

i want to output the weighted average of temperature on a given plane as postProcessing using functionObject (i am using "execFlowFunctionObject -time myTime" to run it as postprocessing). I added these lines to my controlDict:


Code:
--> FOAM FATAL ERROR:
 Parser Error for driver SampledSurfaceValueExpressionDriver at "1.1-2" :"field T not existing or of wrong type"
"T*area()/sum(area())"
  ^^
--|
what am i doing wrong?
i am using openfoam 2.3

Thanks,

andrea
__________________
If it is easy, then something is fishy!
kera is offline   Reply With Quote

Old   May 10, 2017, 05:49
Default
  #3
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 313
Rep Power: 9
Andrea_85 is on a distinguished road
I have actually tried both expressions and got the same error, and yes T-field is in "myTime" directory. If i run the simulation and perform the calculation during the run it works with no problems....

andrea
Andrea_85 is offline   Reply With Quote

Old   May 10, 2017, 06:43
Default
  #4
Member
 
Ricky
Join Date: Jul 2014
Location: Germany
Posts: 46
Rep Power: 5
kera is on a distinguished road
Quote:
Originally Posted by Andrea_85 View Post
I have actually tried both expressions and got the same error, and yes T-field is in "myTime" directory. If i run the simulation and perform the calculation during the run it works with no problems....

andrea
then don't load any models. Try to run execFlowFunctionObject in noflow mode
Code:
execFlowFunctionObject -noFlow -time yourTime
__________________
If it is easy, then something is fishy!
kera is offline   Reply With Quote

Reply

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
[swak4Foam] groovyBC boundary using values from another boundary lg88 OpenFOAM Running, Solving & CFD 9 July 28, 2017 10:43
[swak4Foam] Trouble accessing fields within expressionField aerogt3 OpenFOAM Post-Processing 6 May 12, 2017 15:02
[swak4Foam] Is it possible to append monitored data in a single file? vasava OpenFOAM Post-Processing 0 February 26, 2016 02:53
[swak4Foam] segmentation faults when using the debug switch "ExpressionResult" Astrodan OpenFOAM Running, Solving & CFD 1 February 21, 2016 17:29
[swak4Foam] different values between swakExpression & faceSource areaAverage Paebin OpenFOAM Post-Processing 7 December 23, 2015 12:29


All times are GMT -4. The time now is 17:16.