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] run-time function/expression evaluation at a part of a cross section (https://www.cfd-online.com/Forums/openfoam-community-contributions/155471-run-time-function-expression-evaluation-part-cross-section.html)

silvan July 1, 2015 10:17

run-time function/expression evaluation at a part of a cross section
 
Dear foamers,

I am trying to calculate the mass flow (and other quantities) during run-time with functions/expressions from swak4foam. So far, I successfully managed to compute these values at a randomly defined plane which slices the complete domain. Now, I would like to calculate these values at a part/subset of this cross section, e.g. a circle which lies in this plane.

Here is a short description on how I am trying to achieve this:
1) Use topoSet to define a sphere with the desired radius. Create a zone of the cells within this sphere.
2) Use functions in the controlDict to define the plane of interest and calculate whatever needed. Using zone, I expect to "intersect" the sphere with the plane and thus create the desired circle.

The only thing that I was able to achieve was that the plane I am looking at has been reduced to about half its original size (looks kind of random in ParaView). Thus, also the calculated mass flow has reduced accordingly. BUT, the mass flow is still computed on the whole of the remaining plane. So, no sign of successful "intersection"...

I already searched the internet and found the following resources:
http://openfoamwiki.net/index.php/TopoSet
https://github.com/OpenFOAM/OpenFOAM...et/topoSetDict
http://www.cfd-online.com/Forums/ope...ing-plane.html
http://openfoamwiki.net/images/2/2a/...esentation.pdf
But, none of these could answer my question completely...

And here follows a code snippet of the topoSetDict:
Code:

actions
(
  {
    name        apertureSphereZone;
    type        cellSet;
    action      new;
    source      sphereToCell;
    sourceInfo
    {
        centre  (-1 0 0);
        radius  0.18;
    }
  }
  {
    name        apertureSphereZone;
    type        cellZoneSet;
    action      new;
    source      setToCellZone;
    sourceInfo
    {
        set    apertureSphereZone;
    }
  }
);

And a snippet from the controlDict with the functions:
Code:

libs (
    "libgroovyBC.so"
    "libsimpleFunctionObjects.so"
    "libsimpleSwakFunctionObjects.so"
    "libswakFunctionObjects.so"
    "libgroovyStandardBCs.so"
);

functions
(
flowAperture
{
    type        swakExpression;
    valueType  surface;
    surfaceName aperturePlane;
    surface
    {
        type            plane;
        basePoint      (-1 0 0);
        normalVector    (1 0 0);
        interpolate    true;
        zone            apertureSphereZone;
    }
    expression  "U.x*rho";
    writeSurfaceOnConstruction true;
    surfaceFormat      vtk;
    accumulations
    (
        min
        max
        weightedAverage
        integrate
    );
    outputControlMode  timeStep;
    outputInterval      1;
    verbose            true;
}
);

I ask you the following:
A) Am I on the right track?
B) Are there alternatives? Could one use e.g.
Code:

condition "(pow(pos().y,2)+pow(pos().z,2)) < pow(0.18,2)";
within the swakExpression to achieve the same?

Every hint will be appreciated! Thanks in advance for your support!
Happy foaming to you all,
Silvan

silvan July 3, 2015 03:53

I am still looking for your opinion :-)
 
I am still stuck with this question and would highly appreciate your opinion on this matter.
Especially comments from gschaider are welcomed. By the way, thank you very much for developing these useful tools! :-)

Looking forward to your inspirations!
Silvan

silvan July 13, 2015 02:31

No solution so far...
 
Dear Foamers,

I didn't come any further...
Is it true that no one has a suggestion on how to solve this??? In such a big group of experts? :confused:

Looking forward to your reply,
Silvan

RMF August 3, 2015 10:12

I have the same problem!
@gschaider any suggestions?

RMF


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