CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Monitoring boundaries in OpenFOAM (http://www.cfd-online.com/Forums/openfoam/116688-monitoring-boundaries-openfoam.html)

AlmostSurelyRob April 23, 2013 07:28

Monitoring boundaries in OpenFOAM
 
Dear Users and Developers,

it is possible in OpenFOAM to set up a monitoring boundary? I am trying to do some runtime post-processing. I would be satisifed with one of the two solutions

1) Calculate a surface integral on a given set of faces
2) Interpolate field values for a set of faces

According to this link
http://www.openfoam.com/features/run...processing.php
my request would be satisifed by either fieldValue and surfaceInterpolateFields.

Using setSet I have already defined the correct face sets and confirmed their validity with paraview. I am only interested in phase indicator field from a VOF simulation.

First problem: fieldValue doesn't appear to be implemented or registered.

Code:

Unknown function type fieldValue

Valid functions are :

14
(
cellSource
faceSource
fieldAverage
fieldCoordinateSystemTransform
fieldMinMax
nearWallFields
patchProbes
probes
readFields
regionSizeDistribution
sets
streamLine
surfaceInterpolateFields
surfaces
)

Second problem surfaceInterpolate defined in the following way in controlDict


Code:

functions
{

  monitoring1
  {
    type            fieldValue;
    functionObjectLibs ( "libfieldFunctionObjects.so" );
    outputControl  timeStep;
    patches monitoringSurface1;
    fields ((alpha1 alpha1Near));
  }
}

produces output that does not match my exectations. What is actually alpha1Near? How do I tell surfacInterpolate that I only want interoplation on a surface given by a faceSet that resides in constant/polyMesh/sets?

Could anyone explain to me what is the correct syntax for defining this function and how could I use it to achieve my goal?

In the worst case I would like to point out that the above website needs updating (fieldValue absent?). Please do let me know if you understand how it is supposed to work.

AlmostSurelyRob April 23, 2013 07:45

cuttingPlane doesn't work with periodic?
 
I've just discovered that cuttingPlane could do what I want from interpolateSurfaceFields, but alas it crashes with my periodic domain producing no output at all. It's strange because the plane does not pass through a periodic patch.

Code:

functions
{

  cuttingPlane
  {
    type            surfaces;
    functionObjectLibs ("libsampling.so");
    outputControl  timeStep;

    surfaceFormat  vtk;
    fields          (alpha1);

    interpolationScheme cellPoint;

    surfaces
      (
      monitoring1
      {
      type            cuttingPlane;
      planeType      pointAndNormal;
      pointAndNormalDict
      {
      basePoint      (0 0 0.6);
      normalVector    (0 0 1);
      }
      interpolate    true;
      }
      );
  }

}

and the error

Code:

Unhandled coupledPolyPatch type cyclic

    From function isoSurface::collocatedFaces(const coupledPolyPatch&) const
    in file sampledSurface/isoSurface/isoSurface.C at line 97.

FOAM aborting

is that normal?

Also I don't know if VTK will be any useful. I just want to take a signal out of it which will be the integrated volume fraction. Will I be able to do it efficiently with plenty of VTK files?

AlmostSurelyRob April 23, 2013 09:06

Praise be to swak4Foam developers!

Using this link
http://www.cfd-online.com/Forums/ope...e-average.html
I figured out that this piece of code in my controlDict
Code:

libs (
"libOpenFOAM.so"
"libsimpleSwakFunctionObjects.so"
"libswakFunctionObjects.so"
);

functions
{
  liquidHoldup1
  {
    type            swakExpression;
    valueType      surface;
    surfaceName monitoringBoundary1;
    surface {
            type plane;
            basePoint      (0 0 0.6);
            normalVector    (0 0 1);
            interpolate false;
        }
    functionObjectLibs ("libsampling.so");
    outputControl  timeStep;

    zoneName monitoringZone1;
    accumulations ( min);
    expression "sum((1-alpha1)*area())/sum(area())";
    verbose true;
  }
}

dooes the job for point 1 of my querry. I am still cuious to learn how to do point 2.

gschaider April 23, 2013 14:11

Quote:

Originally Posted by AlmostSurelyRob (Post 422586)
Praise be to swak4Foam developers!

Using this link
http://www.cfd-online.com/Forums/ope...e-average.html
I figured out that this piece of code in my controlDict

<code snipped>

does the job for point 1 of my querry. I am still cuious to learn how to do point 2.

That would be "Interpolate field values for a set of faces"? With "set of faces" you mean a faceSet or a faceZone? As you already bit the bullet and installed swak I can offer you this: swakExpressions that work on faceSets or faceZones have an option "autoInterpolate". If you set the to true and use the name of a field that is defined on the cells in your expression the field is automatically interpolated onto the faces and used for the calculation. Other option would be to use an expressionField-functionObject that generates (for instance) a field pOnFaces from the expression "interpolate(p)" and use that with one of the stock function objects


All times are GMT -4. The time now is 05:18.