CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Post-Processing

swak4Foam: run-time function/expression evaluation at a part of a cross section

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   July 1, 2015, 10:17
Question swak4Foam: run-time function/expression evaluation at a part of a cross section
  #1
New Member
 
Silvan
Join Date: Jun 2014
Posts: 12
Rep Power: 4
silvan is on a distinguished road
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
Defining a zone for sampling a plane
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 is offline   Reply With Quote

Old   July 3, 2015, 03:53
Post I am still looking for your opinion :-)
  #2
New Member
 
Silvan
Join Date: Jun 2014
Posts: 12
Rep Power: 4
silvan is on a distinguished road
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 is offline   Reply With Quote

Old   July 13, 2015, 02:31
Default No solution so far...
  #3
New Member
 
Silvan
Join Date: Jun 2014
Posts: 12
Rep Power: 4
silvan is on a distinguished road
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?

Looking forward to your reply,
Silvan
silvan is offline   Reply With Quote

Old   August 3, 2015, 10:12
Default
  #4
RMF
New Member
 
Join Date: Aug 2012
Posts: 11
Rep Power: 5
RMF is on a distinguished road
I have the same problem!
@gschaider any suggestions?

RMF
RMF is offline   Reply With Quote

Reply

Tags
expression, function, run-time processing, swak4foam, toposet

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
simpleFoam error - "Floating point exception" mbcx4jc2 OpenFOAM Running, Solving & CFD 12 August 4, 2015 02:20
Hardware-Configuration for Fluent HPC-Pack (8x) JohHaas Hardware 9 March 3, 2015 14:25
Contribution a new utility: refine wall layer mesh based on yPlus field lakeat OpenFOAM Mesh Utilities 57 February 1, 2015 09:25
swak4Foam on run time object hchen OpenFOAM Running, Solving & CFD 6 December 4, 2014 16:39
High Courant Number @ icoFoam Artex85 OpenFOAM Running, Solving & CFD 9 January 3, 2012 09:06


All times are GMT -4. The time now is 16:50.