CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Large contrasting values across adjacent cells (https://www.cfd-online.com/Forums/openfoam-solving/189752-large-contrasting-values-across-adjacent-cells.html)

sturgeon June 26, 2017 08:34

Large contrasting values across adjacent cells
 
Hi all

Apologies as this is very basic, trying to learn OpenFOAM in preparation for more complex sims. I am running a simple 2D case in potentialFoam, where air is entering from the left and exiting at the top and right, encountering a triangular ridge in the centre. In the solution however I am getting large contrasting values across the cells. (http://i.imgur.com/EqrlL0y.png) I am guessing it is due to the mesh, but checkMesh registers it as okay and I've messed around with increasing cell count/grading with no success.

The mesh: http://i.imgur.com/kobL1OJ.png

Mesh zoomed to the area of contrast: http://i.imgur.com/4ylAZHa.png

blockMeshDict:

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  plus                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices
(

(0 100 -0.5)
(46.25 100 -0.5)
(50 100 -0.5)
(53.75 100 -0.5) //3
(100 100 -0.5) //4
(0 5.47 -0.5)
(46.25 5.47 -0.5)
(50 11.99 -0.5)
(53.75 5.47 -0.5) //8
(100 5.47 -0.5) //9
(0 0 -0.5)
(43.09 0 -0.5)
(44.23 0 -0.5)
(47.115 5 -0.5)
(50 10 -0.5)
(52.885 5 -0.5)
(55.77 0 -0.5)
(56.91 0 -0.5)
(100 0 -0.5)

(0 100 0.5)
(46.25 100 0.5)
(50 100 0.5)
(53.75 100 0.5)
(100 100 0.5)
(0 5.47 0.5)
(46.25 5.47 0.5)
(50 11.99 0.5)
(53.75 5.47 0.5)
(100 5.47 0.5)
(0 0 0.5)
(43.09 0 0.5)
(44.23 0 0.5)
(47.115 5 0.5)
(50 10 0.5)
(52.885 5 0.5)
(55.77 0 0.5)
(56.91 0 0.5)
(100 0 0.5)

);

blocks
(
    hex (5 6 1 0 24 25 20 19) (25 25 1) simpleGrading (0.02 50 1)
    hex (6 7 2 1 25 26 21 20) (50 25 1) simpleGrading (1 50 1)
    hex (7 8 3 2 26 27 22 21) (50 25 1) simpleGrading (1 50 1)
    hex (8 9 4 3 27 28 23 22) (25 25 1) simpleGrading (50 50 1)
        hex (10 11 6 5 29 30 25 24) (25 50 1) simpleGrading (0.02 1 1)
        hex (11 12 13 6 30 31 32 25) (25 50 1) simpleGrading (1 1 1)
        hex (13 14 7 6 32 33 26 25) (50 25 1) simpleGrading (1 1 1)
        hex (14 15 8 7 33 34 27 26) (50 25 1) simpleGrading (1 1 1)
        hex (15 16 17 8 34 35 36 27) (50 25 1) simpleGrading (1 1 1)
        hex (17 18 9 8 36 37 28 27) (25 50 1) simpleGrading (50 1 1)

);

edges
(
);

boundary
(

    inlet
    {
        type patch;
        faces
        (
                        (10 5 24 29)
                        (5 0 19 24)

        );
    }
    outlet
    {
        type patch;
        faces
        (
                        (0 1 20 19)
                        (1 2 21 20)
                        (2 3 22 21)
                        (3 4 23 22)
                        (4 9 28 23)
                        (9 18 37 28)
        );
    }
    fixedWalls
    {
        type wall;
        faces
        (
                        (11 10 29 30)
                        (12 11 30 31)
                        (13 12 31 32)
                        (14 13 32 33)
                        (15 14 33 34)
                        (16 15 34 35)
                        (17 16 35 36)
                        (18 17 36 37)

        );
    }

);

mergePatchPairs
(
);

// ************************************************************************* //

Again, sorry this is basic; I have looked online and messed around in the files for a while without any success, so any advice would be appreciated.

Cheers

piu58 June 26, 2017 14:11

I think the solution you got may be physical plausible: There should be a large increasing in pressure at the top of the triangle. I think you gave the pressure here.

I say "plausible" and not "correct" because your problem is perhaps not a potential problem so the potential solution is only a first guess.

sturgeon June 26, 2017 15:00

Thank you piu. Sorry though, I should have been more clear - I meant the contrast between the light blue triangular part and the darker blue surroundings, which aligns with the different blocks of the mesh, which made me feel like there was something wrong with the way I'd meshed it.

Joshua14 June 26, 2017 16:01

Quote:

Originally Posted by sturgeon (Post 654933)
Thank you piu. Sorry though, I should have been more clear - I meant the contrast between the light blue triangular part and the darker blue surroundings, which aligns with the different blocks of the mesh, which made me feel like there was something wrong with the way I'd meshed it.

It looks like the culprit is the change in the cell orientation between these regions. You can either try remeshing with finer cells where there is larger changes between the regions, or try a different block structure.

Currently you use 10 different blocks. Maybe try less blocks. You can also always try to mesh with snappy.

Joshua

sturgeon June 26, 2017 18:10

Quote:

Originally Posted by Joshua14 (Post 654943)
It looks like the culprit is the change in the cell orientation between these regions. You can either try remeshing with finer cells where there is larger changes between the regions, or try a different block structure.

Currently you use 10 different blocks. Maybe try less blocks. You can also always try to mesh with snappy.

Joshua

Thank you Joshua, I will look into this and see if it resolves the issue. Cheers.

piu58 June 27, 2017 00:13

You used a triangular mesh. Such meshes are known to be diffusive, because they realize a first order approximation. I strongly recommend a hex mesh.

sturgeon June 27, 2017 08:23

Quote:

Originally Posted by piu58 (Post 654974)
You used a triangular mesh. Such meshes are known to be diffusive, because they realize a first order approximation. I strongly recommend a hex mesh.

I am attempting to rectify this but I don't understand how to get blockMesh to do this. The layout of my geometry was trying to mirror the cylinder case tutorial, which uses hexes and executes properly... but I don't see anything different about its blockMeshDict versus mine. Do the sharp edges prevent the use of hexes over triangles?

guin June 27, 2017 09:28

2 Attachment(s)
I believe Sturgeon didn't use a tetrahedral mesh. It is more likely a common visualization issue with ParaView, which decomposes the polyhedral elements into tetrahedra for any good reason I still ignore. You can see the correct mesh by unclicking the option Decompose polyhedra (see attached pics.).
Now coming back to your problem... my initial guess is that it is related with the sudden non-orthogonality in the transition regions.
1st question: Are you using nonOrthogonal correctors?
(fvSolution file -> nNonOrthogonalCorrectors)
2nd question: Are you using corrected schemes? (fvScheme file -> laplacianSchemes & snGradSchemes)

Attachment 56980

Attachment 56981

sturgeon June 27, 2017 11:33

Quote:

Originally Posted by guin (Post 655027)
I believe Sturgeon didn't use a tetrahedral mesh. It is more likely a common visualization issue with ParaView, which decomposes the polyhedral elements into tetrahedra for any good reason I still ignore. You can see the correct mesh by unclicking the option Decompose polyhedra (see attached pics.).
Now coming back to your problem... my initial guess is that it is related with the sudden non-orthogonality in the transition regions.
1st question: Are you using nonOrthogonal correctors?
(fvSolution file -> nNonOrthogonalCorrectors)
2nd question: Are you using corrected schemes? (fvScheme file -> laplacianSchemes & snGradSchemes)

Attachment 56980

Attachment 56981

I believe you are correct about the mesh - I can't find that option in ParaView but when I disable the cell interpolation and just have them coloured by absolute value it's pretty clear they're not triangular.

My nNonOrthogonalCorrectors is set to 3, as it's copied directly from the cylinder case. Both of the schemes you mentioned are the corrected versions, like in the cylinder case.


All times are GMT -4. The time now is 05:35.