CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   How to use the output of a function object as an input to another one? (https://www.cfd-online.com/Forums/openfoam-post-processing/230286-how-use-output-function-object-input-another-one.html)

amuzeshi September 17, 2020 01:03

How to use the output of a function object as an input to another one?
 
Hello,
I want to use an average pressure at a section as a reference pressure for pressure coefficient calculation. I have included the following function objects in my controlDict for pressure averaging and calculation of Cp:
Code:

averagedPressure
        {
            type            surfaceFieldValue;
            libs            (fieldFunctionObjects);
            enabled        true;

            writeControl    onEnd;
            executeControl  onEnd;
            writeFields    true;
            result          pRef;
            surfaceFormat  none;
   
            regionType      sampledSurface;
            name            sampledP;
            sampledSurfaceDict
            {
                type            cuttingPlane;
                planeType      pointAndNormal;
                pointAndNormalDict
                {
                    point    (-1.7 0 0.4);
                    normal    (1 0 0);
                }
                interpolate    true;
            }
            operation      areaAverage;
            fields          ( p );
        }

        pressure
        {
            type            pressure;
            libs            (fieldFunctionObjects);
            executeControl      onEnd;
            writeControl        onEnd;
            result              Cp;
            mode            staticCoeff;

            rho            rhoInf;
            rhoInf          1.0;
            pInf              0;
     
            U              UInf;
            UInf            (1 0 0);

        }

Now I don't no how to use the calculated average pressure as a reference pressure for Cp (shown in red).

Ali

rouco75 February 17, 2021 14:49

Have you achieved a solution, I am facing the same problem

amuzeshi February 22, 2021 03:18

Quote:

Originally Posted by rouco75 (Post 796479)
Have you achieved a solution, I am facing the same problem

No, but it was not due to that it is not possible, but because of my limited amount of time.
Instead, I ran the case one time in order to obtain the average pressure in the reference section, then ran it again and used the calculated reference pressure as pInf.


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