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/)
-   -   areaAverage sampledSurface - what does it do exactly? (https://www.cfd-online.com/Forums/openfoam-post-processing/220071-areaaverage-sampledsurface-what-does-do-exactly.html)

er10 August 22, 2019 12:26

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
          );
      }


tecmul September 5, 2019 10:54

Hi, the areaAverage operation is defined in (for OpenFOAM 6):

src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValueTemplates.C

Here's the piece of code for areaAverage:

Code:

       
      case opAreaAverage:
        {
            const scalarField magSf(mag(Sf));

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

magSf is defined as a scalar field of face normal vector magnitudes. The rest is just the area weighted average of whatever field you choose to integrate (rho in your case) over the plane specified by the sampledSurfaceDict. surfaceFieldValueTemplates.C also has some code related to interpolation of the field onto the plane which I don't understand.


All times are GMT -4. The time now is 07:15.