CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swak4Foam] Temperature Average on internal faceZone with swak4Foam (https://www.cfd-online.com/Forums/openfoam-community-contributions/125507-temperature-average-internal-facezone-swak4foam.html)

woodwick October 26, 2013 22:27

Temperature Average on internal faceZone with swak4Foam
 
Hello,

I was trying to get the average temperature over a faceZone. I installed swak4Foam and add the following lines in controlDict:
Code:

    T_averaged_CORE
    {
        type swakExpression;
        variables "T";
        valueType faceZone;
        zoneName CORE;
        accumulations (
            average
        );
        expression "average(T)";
        verbose true;
    }

but I get the following error:
Code:

--> FOAM FATAL ERROR:
Context: "- From dictionary: . T_averaged_CORE"
No terminating ';' found in expression '"T"'

Where am I doing wrong?

woodwick October 26, 2013 22:48

I solved the problem by using a similar sintax in the mass flow example
http://openfoamwiki.net/index.php/Co...e_calcMassFlow

Code:

    T_averaged_CORE
    {
        type swakExpression;
        enabled        true;
        autoInterpolate true; 
        // I introduced the previous instruction in order to avoid the error : Could not find a field name T of type scalar (neither surfaceScalarField nor volScalarField) autoInterpolate
        outputControl  timeStep;
        outputInterval  1;       
        //variables "T";
        valueType faceZone;
        zoneName CORE;
        expression "T";
        accumulations (
            average
        );       
        verbose true;
    }


gschaider October 28, 2013 18:20

Quote:

Originally Posted by woodwick (Post 459198)
I solved the problem by using a similar sintax in the mass flow example
http://openfoamwiki.net/index.php/Co...e_calcMassFlow

Code:

    T_averaged_CORE
    {
        type swakExpression;
        enabled        true;
        autoInterpolate true; 
        // I introduced the previous instruction in order to avoid the error : Could not find a field name T of type scalar (neither surfaceScalarField nor volScalarField) autoInterpolate
        outputControl  timeStep;
        outputInterval  1;       
        //variables "T";
        valueType faceZone;
        zoneName CORE;
        expression "T";
        accumulations (
            average
        );       
        verbose true;
    }


OK. But you are aware that this is "only" the arithmetic average? That it only gives the "physically correct" value if all faces are of the same size. Otherwise I'd recommend the weightedAverage-accumulation (if your swak-version already has it) or implementing a area-weighted averaging in swak-terms (there are plenty examples for that)


All times are GMT -4. The time now is 10:48.