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

average over cutting plane during runtime

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

Like Tree8Likes
  • 6 Post By gigilentini8
  • 2 Post By Vidal

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 30, 2012, 12:41
Default average over cutting plane during runtime
  #1
Member
 
Join Date: Aug 2012
Posts: 33
Rep Power: 14
gigilentini8 is on a distinguished road
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
        );
    }
gigilentini8 is offline   Reply With Quote

Old   December 16, 2018, 12:31
Default
  #2
Member
 
fede32's Avatar
 
Federico Agustín Caccia
Join Date: Jun 2015
Location: Buenos Aires, Argentina
Posts: 55
Rep Power: 11
fede32 is on a distinguished road
was it right?
fede32 is offline   Reply With Quote

Old   June 3, 2022, 10:39
Default average over cutting plane during runtime
  #3
New Member
 
Mir
Join Date: Sep 2014
Posts: 1
Rep Power: 0
Vidal is on a distinguished road
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
    );
}
The changes are:
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
Chanikya_Valeti and davcrisp like this.
Vidal is offline   Reply With Quote

Old   June 14, 2022, 05:24
Default
  #4
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
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
olesen is offline   Reply With Quote

Old   December 26, 2023, 19:33
Default
  #5
Senior Member
 
NotOverUnderated's Avatar
 
ONESP-RO
Join Date: Feb 2021
Location: Somwhere on Planet Earth
Posts: 127
Rep Power: 5
NotOverUnderated is on a distinguished road
Quote:
Originally Posted by olesen View Post
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
Is it possible to use those stored surfaces with fieldAverage function object? I am looking for a way to average over time not space.

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.
NotOverUnderated is offline   Reply With Quote

Reply

Tags
areaaverage, cuttingplane, openfoam

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 12:53.