CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   cuttingPlane is creating unwanted surfaces (https://www.cfd-online.com/Forums/openfoam-post-processing/220073-cuttingplane-creating-unwanted-surfaces.html)

tecmul August 22, 2019 14:15

cuttingPlane is creating unwanted surfaces
 
4 Attachment(s)
Hello everyone, I'm simulating 2D flow in a channel with OpenFOAM 6 and am trying to interpolate some field variables onto a plane and integrate. I do this by including the following function object in my controlDict file.

Code:

cuttingplane
    {
        type            surfaceFieldValue;
        libs            ("libfieldFunctionObjects.so");

        log            true;
        writeControl    timeStep;
        writeInterval        1;
        writeFields    true;

        // Type of source: patch/faceZone/sampledSurface
        surfaceFormat  vtk;
        regionType      sampledSurface;
        name                        mySurface;

        sampledSurfaceDict
        {
                type cuttingPlane;
                planeType          pointAndNormal;
                pointAndNormalDict
                {
                        basePoint      (0.01 0 0); 
                        normalVector    (1 0 0);
                }
                source cells; // sample cells or boundaryFaces
                interpolate true;
        }

        // Operation: areaAverage/sum/weightedAverage ...
        operation      areaIntegrate;

        fields
        (
            U
        );
    }

The channel is in the x direction and goes from x = 0 to 1. I want a slice of the channel at x = 0.01. This slice is generated correctly, but for some reason the surface generated by the function object includes tetrahedra at x = 0. I've attached images showing these surfaces. Moving the location of the slice towards increasing x results in smaller tetrahedra, until x = 0.5 where they disappear. Moving further to the right, the tetrahedra appear at x = 1 and increase in size as we move along the channel.
Why is this happening?

Attachment 71900

Attachment 71901

Attachment 71902

Attachment 71903

syavash August 26, 2019 12:29

Quote:

Originally Posted by tecmul (Post 742812)
Hello everyone, I'm simulating 2D flow in a channel with OpenFOAM 6 and am trying to interpolate some field variables onto a plane and integrate. I do this by including the following function object in my controlDict file.

Code:

cuttingplane
    {
        type            surfaceFieldValue;
        libs            ("libfieldFunctionObjects.so");

        log            true;
        writeControl    timeStep;
        writeInterval        1;
        writeFields    true;

        // Type of source: patch/faceZone/sampledSurface
        surfaceFormat  vtk;
        regionType      sampledSurface;
        name                        mySurface;

        sampledSurfaceDict
        {
                type cuttingPlane;
                planeType          pointAndNormal;
                pointAndNormalDict
                {
                        basePoint      (0.01 0 0); 
                        normalVector    (1 0 0);
                }
                source cells; // sample cells or boundaryFaces
                interpolate true;
        }

        // Operation: areaAverage/sum/weightedAverage ...
        operation      areaIntegrate;

        fields
        (
            U
        );
    }

The channel is in the x direction and goes from x = 0 to 1. I want a slice of the channel at x = 0.01. This slice is generated correctly, but for some reason the surface generated by the function object includes tetrahedra at x = 0. I've attached images showing these surfaces. Moving the location of the slice towards increasing x results in smaller tetrahedra, until x = 0.5 where they disappear. Moving further to the right, the tetrahedra appear at x = 1 and increase in size as we move along the channel.
Why is this happening?

Attachment 71900

Attachment 71901

Attachment 71902

Attachment 71903

Are you using parallel mode? I had the same problem when I run in parallel.

tecmul August 28, 2019 10:03

Quote:

Originally Posted by syavash (Post 743117)
Are you using parallel mode? I had the same problem when I run in parallel.

No my case isn't parallel. I was curious and switched to parallel to see what would happen. The same thing happened. Thanks anyway.

Luiz February 1, 2021 10:40

Did someone work on the problem?
From my experience the area value is different for single/parallel mode, where the single mode gives the correct area. My guess is that the decompose method should be modified although I do not have any idea of what to use instead of scotch.


My function is similar to the others:
Code:

velocityInterface
    {
        type            surfaceFieldValue;
        libs            (fieldFunctionObjects);
        fields          (absUy);
        operation      areaIntegrate;
        regionType      sampledSurface;
       
        sampledSurfaceDict
        {
            type            plane;
            planeType        pointAndNormal;
           
            pointAndNormalDict
            {
                point        (0 0.3 0);
                normal        (0 1 0);
            }
            zone        interfaceSelection;
            interpolate    true;
        }
        name            interface;
        timeStart      0;
        executeControl  timeStep;
        executeInterval 1;
        writeControl    timeStep;
        writeInterval  1;
        writeFields    false;
    }


syavash February 1, 2021 15:12

One solution is to create baffles or faceZone for sampling the desired region. Then in the decomposeParDict, use the "preservePatches" or other similar options to put the baffle or faceZone in one single process altogether.
I tried and it worked for me.

Bests


All times are GMT -4. The time now is 19:51.