CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   areaAverage sampledSurface - what does it do exactly? (https://www.cfd-online.com/Forums/openfoam-programming-development/220072-areaaverage-sampledsurface-what-does-do-exactly.html)

er99 August 22, 2019 13:12

areaAverage sampledSurface - what does it do exactly?
 
Hi all,

I have inherited a code which includes the following sampling lines below within the controlDict file.
Does anyone know how the plane areaAverage operation works in OpenFOAM? What's the equation which describes this particular operation?

Would really appreciate your help!

Thanks in advance.



Code:


    {
      type            surfaceRegion;
      libs ("libfieldFunctionObjects.so");
 
        enabled        true;
        writeControl    runTime;
        writeInterval  0.001;
        log            false;
        writeFields    false;
        writeArea      false;
        surfaceFormat  none;
        regionType      sampledSurface;
        name      Mean;

        sampledSurfaceDict
        {
              type        plane;
              basePoint  (0.1524 0 0);
              normalVector (1 0 0);
        }
          operation      areaAverage;
          fields
          (
            rho
          );
      }


einstein_zee August 23, 2019 04:11

Hii there,

you may find it here "https://github.com/OpenFOAM/OpenFOAM-dev/blob/61c9bc2ee31289bc2a91a1fa60f075361fc8e61d/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValueTemplates.C"

it is :
Code:


            const scalarField magSf(mag(Sf));

            result = sum(magSf*values)/sum(magSf);


er99 August 23, 2019 06:57

Quote:

Originally Posted by einstein_zee (Post 742883)
Hii there,

you may find it here "https://github.com/OpenFOAM/OpenFOAM-dev/blob/61c9bc2ee31289bc2a91a1fa60f075361fc8e61d/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValueTemplates.C"

it is :
Code:


            const scalarField magSf(mag(Sf));

            result = sum(magSf*values)/sum(magSf);



Thanks for this!


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