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

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

 July 1, 2015, 10:17 swak4Foam: run-time function/expression evaluation at a part of a cross section #1 New Member   Silvan Join Date: Jun 2014 Posts: 10 Rep Power: 3 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

 July 3, 2015, 03:53 I am still looking for your opinion :-) #2 New Member   Silvan Join Date: Jun 2014 Posts: 10 Rep Power: 3 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

 July 13, 2015, 02:31 No solution so far... #3 New Member   Silvan Join Date: Jun 2014 Posts: 10 Rep Power: 3 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

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

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

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post mbcx4jc2 OpenFOAM Running, Solving & CFD 12 August 4, 2015 02:20 JohHaas Hardware 9 March 3, 2015 14:25 lakeat OpenFOAM Mesh Utilities 57 February 1, 2015 09:25 hchen OpenFOAM Running, Solving & CFD 6 December 4, 2014 16:39 Artex85 OpenFOAM Running, Solving & CFD 9 January 3, 2012 09:06

All times are GMT -4. The time now is 13:02.