|
[Sponsors] |
August 30, 2012, 12:41 |
average over cutting plane during runtime
|
#1 |
Member
Join Date: Aug 2012
Posts: 33
Rep Power: 14 |
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 ); } |
|
December 16, 2018, 12:31 |
|
#2 |
Member
Federico Agustín Caccia
Join Date: Jun 2015
Location: Buenos Aires, Argentina
Posts: 55
Rep Power: 11 |
was it right?
|
|
June 3, 2022, 10:39 |
average over cutting plane during runtime
|
#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 |
|
June 14, 2022, 05:24 |
|
#4 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40 |
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 |
|
December 26, 2023, 19:33 |
|
#5 | |
Senior Member
ONESP-RO
Join Date: Feb 2021
Location: Somwhere on Planet Earth
Posts: 127
Rep Power: 5 |
Quote:
In a normal static case it would be easier to just compute the mean fields (e.g., UMean, pMean, etc) then using the surface sampling on those fields. Unfortunately this cannot be used with moving/sliding meshes because the computed mean fields using fieldAverage are wrong on the moving/sliding region. I use meshSurface (obj file) to compute the surfaces sampling at each time but I have no idea how to average them over time (not space which can be easily handled by surfaceFieldValue). Is there any solution to this?
__________________
Don't keep making the same mistakes. Try to make new mistakes. Last edited by NotOverUnderated; December 26, 2023 at 21:25. |
||
Tags |
areaaverage, cuttingplane, openfoam |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Gmsh] Problem with Gmsh | nishant_hull | OpenFOAM Meshing & Mesh Conversion | 23 | August 5, 2015 03:09 |
plane cutting complex geometry in the middle | Lilly | FLUENT | 0 | July 27, 2011 10:01 |
[Gmsh] boundaries with gmshToFoam | ouafa | OpenFOAM Meshing & Mesh Conversion | 7 | May 21, 2010 13:43 |
average value in any plane | aloise | CFX | 3 | July 26, 2006 16:30 |
average value in any plane | Roy Chen | CFX | 7 | November 14, 2002 12:17 |