|
[Sponsors] |
![]() |
![]() |
#1 |
Member
Join Date: Aug 2012
Posts: 33
Rep Power: 13 ![]() |
Dear FOAMers,
can you confirm me that the function object below in ControlDict is the correct and fastest way to calculate average over cutting planes in a 3D simulation during runtime? it seems to work but I'm not 100% sure about the results... Code:
functions { cuttingplane_average { type faceSource; functionObjectLibs ("libfieldFunctionObjects.so"); enabled true; outputControl outputTime; // Output to log&file (true) or to file only log true; // Output field values as well valueOutput false; //true; // Type of source: patch/faceZone/sampledSurface source sampledSurface; sampledSurfaceDict { type cuttingPlane; planeType pointAndNormal; pointAndNormalDict { basePoint (0 0 0); normalVector (0 0 1); } source cells; // sample cells or boundaryFaces interpolate true; } // Operation: areaAverage/sum/weightedAverage ... operation areaAverage; fields ( p U ); } |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Member
Federico Agustín Caccia
Join Date: Jun 2015
Location: Buenos Aires, Argentina
Posts: 55
Rep Power: 10 ![]() |
was it right?
|
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
Mir
Join Date: Sep 2014
Posts: 1
Rep Power: 0 ![]() |
In OF version 7 I have managed to report on runtime the average value on a cutting plane by modifying a little the above code, which is inside the "functions" sub-dictionary in the controlDict:
Code:
cuttingplane_average { type surfaceFieldValue; libs ("libfieldFunctionObjects.so"); enabled yes; writeControl timeStep; writeInterval 1; log yes; // Output field values as well writeFields no; // Type of source: patch/faceZone/sampledSurface regionType sampledSurface; name sampledSurfaceNormalZ1; sampledSurfaceDict { type cuttingPlane; planeType pointAndNormal; pointAndNormalDict { basePoint (0 0 1); normalVector (0 0 1); } source cells; // sample cells or boundaryFaces interpolate true; } // Operation: areaAverage/sum/weightedAverage ... operation areaAverage; fields ( U p ); } 1. "type" must be "surfaceFieldValue" instead of "faceSource". 2. It is necessary to give a user "name" for the average value output ("sampledSurfaceNormalZ1" in my case.) 3. Other differences are I guess because the different OF versions ("regionType" instead of "source", "writeControl", ...). I hope it helps. Cheers |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,594
Rep Power: 38 ![]() ![]() |
For future reference as well: if you are using OpenFOAM-v1906 or later you also have the possibility to create/sample surfaces and "store" them. This places them in memory where they can be picked up later for surfaceFieldValue and/or runTimePostProcessing.
In many cases this can be more efficient and flexible than creating the sampled surfaces from within surfaceFieldValue itself. https://develop.openfoam.com/Develop.../-/issues/1206 https://www.openfoam.com/documentati...s.html#details |
|
![]() |
![]() |
![]() |
Tags |
areaaverage, cuttingplane, openfoam |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Gmsh] Problem with Gmsh | nishant_hull | OpenFOAM Meshing & Mesh Conversion | 23 | August 5, 2015 02:09 |
plane cutting complex geometry in the middle | Lilly | FLUENT | 0 | July 27, 2011 09:01 |
[Gmsh] boundaries with gmshToFoam | ouafa | OpenFOAM Meshing & Mesh Conversion | 7 | May 21, 2010 12:43 |
average value in any plane | aloise | CFX | 3 | July 26, 2006 15:30 |
average value in any plane | Roy Chen | CFX | 7 | November 14, 2002 11:17 |