CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Creating arbitrary surfaces in meshed domain (https://www.cfd-online.com/Forums/openfoam/90804-creating-arbitrary-surfaces-meshed-domain.html)

suh July 21, 2011 04:17

Creating arbitrary surfaces in meshed domain
 
hi,

Please tell me that how to create arbitrary surfaces (or somthing like that) (other than predefined patches) to calculate area or mass weighted averages of any function for postprocessing in predefined+meshed+solved domain openfoam 1.7.1?

thanks in advance

gschaider July 21, 2011 19:01

Quote:

Originally Posted by suh (Post 316886)
Please tell me that how to create arbitrary surfaces (or somthing like that) (other than predefined patches) to calculate area or mass weighted averages of any function for postprocessing in predefined+meshed+solved domain openfoam 1.7.1?

The sample-utility allows you to sample field data on so called sampledSurfaces (there is a file called sampleDict with the sources of the utility that shows which of these can be specified, I'm afraid that is all the documentation you're going to find - at least to my knowledge) and write them out for graphical postprocessing

The library swak4foam (search the board or google) allows you to do calculations on these surfaces (but it builds on the same mechanism, so sampleDict will give you an idea which surfaces are possible)

suh July 22, 2011 08:51

Thank you for replying..

Actually i done with that thing, but problem is that i want to use patchAverage <field> <requiredsurface> , so that i can directly know about mass or area weighted average on that particular surface (not a predefined boundary).

but how to get that individual surface from domain to calculate like this that i dont know.

or is there any way to calculate area or mass weighted averages on arbitrary surfaces in domain in any postprocessing software coming with openfoam.

thank you for your precious time.
plz reply..

CedricVH August 5, 2011 05:33

You can use the patchAverage function as a funtionObject on a plane by adding some code to your controlDict. In the following code, an area weighted average of the pressure is calculated every outputTime (when the data is written) on a plane that is given by a base point and a normal vector.

In the sampledSurfaceDict, you can also use other types of planes (see examples in $FOAM_APP/applications/utilities/postProcessing/sampling/sample/sampleDict file)

Code:

functions
(
    new_plane
    {
        type            faceSource;
        functionObjectLibs ("libfieldFunctionObjects.so");
        enabled        true;
        outputControl  outputTime;
        log            true;
        valueOutput    true;
        source          sampledSurface;
        sampledSurfaceDict
        {
            type            plane;    // always triangulated
            basePoint      (0.0501 0.0501 0.005);
            normalVector    (0.1 0.1 1);
        }
        operation      areaAverage;
        fields
        (
            p
        );
    }
)


suh August 5, 2011 08:31

Thank you.

I will try this and let u know.

Regards
Suhas

newOFuser July 4, 2012 15:56

Hi Suhas and Cedric,

I tried running the code and got the following error:
keyword sourceName is undefined in dictionary

Could you please suggest how to get rid of this error? I use OF 1.7.1

The code works when I define source as patch and sourceName as inlet. But I'd like to perform the calculations on an internal plane, within the mesh.

Thanks so much,
amit

bingchuan December 20, 2017 22:14

Quote:

Originally Posted by newOFuser (Post 369816)
Hi Suhas and Cedric,

I tried running the code and got the following error:
keyword sourceName is undefined in dictionary

Could you please suggest how to get rid of this error? I use OF 1.7.1

The code works when I define source as patch and sourceName as inlet. But I'd like to perform the calculations on an internal plane, within the mesh.

Thanks so much,
amit

Have you solved this problem?
I am facing the same issue now, Could you please share your experience?
Thanks.

Bests,
Bingchuan

Behtash August 20, 2019 13:27

pressure area average over a plane
 
Hello all,

I tried the function recommended by CedricVH to obtain the area averaged pressure over a plane and it did not work :(

I want to define a plane in the fluidized bed to obtain the area average pressure over an arbitrary plane either on the fly or at the end of the simulation. I have tried to define a Function object and also tried TopoSet but could not figure it out. Can you please guide me to an example or explain the best approach to do this. I imported the mesh from workbench Ansys and using OpenFOAM v6.

Thanks!


All times are GMT -4. The time now is 09:15.