CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Salome Viscous Layers (https://www.cfd-online.com/Forums/openfoam-pre-processing/199183-salome-viscous-layers.html)

ancolli February 27, 2018 18:00

Salome Viscous Layers
 
Anyone with experience. I am doing a simple example, 3D cylinder with a viscous layer (Total thickness: 1e-5 m, Number of layers: 10-20, Stretch factor: 1.2 (diameter of cylinder 0.03 m)). When I compute all is ok, but when I check the mesh with OpenFOAM, the mesh has plenty of mistakes and is not proper for simulation...even if I refine with triangles the surface.
Any Suggestion

HakikiCanakkaleli March 2, 2018 12:15

Could you share the output of checkMesh?

PS: Guide: How to ask a question on the forums

ancolli March 2, 2018 12:33

I think is information useless but Sure! I am sharing the best mesh I could generate. However is not the the one I want, is not really refined near the wall (first layer 1e-6 m, then 5 layers, Stretch factor: 3.) I would like to add more layers but errors start to apear, like:

***Max cell openness
***Max aspect ratio
***Max skewness, etc etc.

In the present case It is just high number of severely non-orthogonal faces.

Thanks for ur time

Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  dev                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : dev-883687dd2706
Exec  : checkMesh
Date  : Mar 02 2018
Time  : 14:18:09
Host  : "LAPTOP-5T43R11I"
PID    : 1879
I/O    : uncollated
Case  : /mnt/d/.....
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create polyMesh for time = 0

Time = 0

Mesh stats
    points:          942760
    faces:            5992815
    internal faces:  5765913
    cells:            2606524
    faces per cell:  4.51127
    boundary patches: 6
    point zones:      0
    face zones:      0
    cell zones:      0

Overall number of cells of each type:
    hexahedra:    0
    prisms:        1329790
    wedges:        0
    pyramids:      2842
    tet wedges:    0
    tetrahedra:    1273892
    polyhedra:    0

Checking topology...
    Boundary definition OK.
    Cell to face addressing OK.
    Point usage OK.
    Upper triangular ordering OK.
    Face vertices OK.
    Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces...
    Patch              Faces    Points  Surface topology
    wall_1        33948    20474    ok (non-closed singly connected)
    wall_2        159208  79923    ok (non-closed singly connected)
    wall_3          31568    16084    ok (non-closed singly connected)
    inlet              844      473      ok (non-closed singly connected)
    outlet_1            854      478      ok (non-closed singly connected)
    outlet_2            480      401      ok (non-closed singly connected)

Checking geometry...
    Overall domain bounding box (-0.02 -0.02 0) (0.02 0.02 0.191)
    Mesh has 3 geometric (non-empty/wedge) directions (1 1 1)
    Mesh has 3 solution (non-empty) directions (1 1 1)
    Boundary openness (-1.27466e-15 1.59862e-17 2.95515e-16) OK.
    Max cell openness = 3.53122e-14 OK.
    Max aspect ratio = 525.268 OK.
    Minimum face area = 5.74974e-11. Maximum face area = 1.9187e-06.  Face area magnitudes OK.
    Min volume = 5.91976e-15. Max volume = 7.65275e-10.  Total volume = 0.000130565.  Cell volumes OK.
    Mesh non-orthogonality Max: 87.4235 average: 18.4473
  *Number of severely non-orthogonal (> 70 degrees) faces: 101936.
    Non-orthogonality check OK.
  <<Writing 101936 non-orthogonal faces to set nonOrthoFaces
    Face pyramids OK.
    Max skewness = 0.732127 OK.
    Coupled point location match (average 0) OK.

Mesh OK.



Quote:

Originally Posted by HakikiCanakkaleli (Post 683570)
Could you share the output of checkMesh?

PS: Guide: How to ask a question on the forums


HakikiCanakkaleli March 2, 2018 12:52

In contrast, providing checkMesh output is critical. Plus, you should explain your case thoroughly without the reader asking for it.

Anyways.

As can be seen from the output:

Quote:

Overall number of cells of each type:
hexahedra: 0
prisms: 1329790
wedges: 0
pyramids: 2842
tet wedges: 0
tetrahedra: 1273892
polyhedra: 0
Your grid contains tetrahedra and prisms (and a bit pyramids). With this tetrahedral topology, it is natural that checkMesh measures these quantities. It does not necessarily mean that your mesh is bad, but checkMesh's meshQuality metrics (and schemes) are mostly tuned for hexahedra.

I recommend you to use hexahedral mesh capabilities of OpenFOAM, or I speculate this, you can use OpenFOAM-extend for simulations using tetrahedral mesh.

Kind regards

ancolli March 2, 2018 13:34

Quote:

Originally Posted by HakikiCanakkaleli (Post 683575)
In contrast, providing checkMesh output is critical. Plus, you should explain your case thoroughly without the reader asking for it.

Anyways.

As you can see from the output:



Your grid contains tetrahedra and prisms (and a bit pyramids). With this tetrahedral topology, it is natural that checkMesh measures these quantities. It does not necessarily mean that your mesh is bad, but checkMesh's meshQuality metrics (and schemes) are mostly tuned for hexahedra.

I recommend you to use hexahedral mesh capabilities of OpenFOAM, or I speculate, you can use OpenFOAM-extend for simulations using tetrahedral mesh.

Kind regards


My intention was not the reader asking, just someone that have tried to refine (with salome) near the wall. Sorry if I did not stated in a proper way the problem.

Do u mean that if I get "Failed n mesh checks" i can still run my simulation with good results?

If i would have to mesh a cylinder, definitively I would do it with blockMesh, but my geometry is more complicated (I already tried with blockMesh and is not easy to get good results when trying join different blocks (boundary layer in the order of 1e-6 m).
What I did is starting to work in a cylinder in salome (if i can not do it in a cylinder, definitively I would never do it in my geometry).

Is OpenFOAM-extend better when using tetrahedral meshes? I have some things (BC, post-proc and solvers) programed by myself and i got problems of compatibility every few months with of-dev (or from of-3 to of-5). I do not want to imagine if I jump to OpenFOAM-extend. Any recommendation or forum?

Thanks a lot

HakikiCanakkaleli March 2, 2018 14:44

Quote:

Do u mean that if I get "Failed n mesh checks" i can still run my simulation with good results?
Yes, in principle, you can. Tetrahedra is commonly being used in industry. Though I speculate that OF schemes are not appropriate to compute on tetrahedra. Might someone else give some more-educated opinion, don't know.

Quote:

If i would have to mesh a cylinder, definitively I would do it with blockMesh, but my geometry is more complicated (I already tried with blockMesh and is not easy to get good results when trying join different blocks (boundary layer in the order of 1e-6 m).
What I did is starting to work in a cylinder in salome (if i can not do it in a cylinder, definitively I would never do it in my geometry).
IMHO, obtain STL surface mesh of your complicated geometry from SALOME (it provides good quality STLs as opposed to CAD software. e.g. SolidWorks etc.), then use snappyHexMesh to mesh it.

Quote:

Is OpenFOAM-extend better when using tetrahedral meshes? I have some things (BC, post-proc and solvers) programed by myself and i got problems of compatibility every few months with of-dev (or from of-3 to of-5). I do not want to imagine if I jump to OpenFOAM-extend. Any recommendation or forum?
It was a suggestion only. OF-extend, AFAIK, has schemes more suitable to tetrahedra-meshed sims (for FSI). You can check forum for further information.

Hope these help.

ancolli March 2, 2018 16:08

Quote:

Originally Posted by HakikiCanakkaleli (Post 683584)
Yes, in principle, you can. Tetrahedra is commonly being used in industry. Though I speculate that OF schemes are not appropriate to compute on tetrahedra. Might someone else give some more-educated opinion, don't know.



IMHO, obtain STL surface mesh of your complicated geometry from SALOME (it provides good quality STLs as opposed to CAD software. e.g. SolidWorks etc.), then use snappyHexMesh to mesh it.



It was a suggestion only. OF-extend, AFAIK, has schemes more suitable to tetrahedra-meshed sims (for FSI). You can check forum for further information.

Hope these help.

About snappyHexMesh, I am afraid of having problems as with blockMesh (refineWallLayer) in a complex geometry. Reading the following link (https://cfd.direct/openfoam/user-gui...26-1980005.4.7)

4 if the validation criteria can be satisfied, insert mesh layers;
5 the mesh is checked again; if the checks fail, layers are removed

And seen what people experienced with boundary layers and snappyHexMesh (https://www.cfd-online.com/Forums/op...pyhexmesh.html)

I think i am right...

Do u have any experience using snappyHexMesh for boundary layers in the order of 1e-6 m (y+ < 1)?

Finally, I do not see the restriction u said about tetrahedral mesh

"By default OpenFOAM defines a mesh of arbitrary polyhedral cells in 3-D, bounded by arbitrary polygonal faces, i.e. the cells can have an unlimited number of faces where, for each face, there is no limit on the number of edges nor any restriction on its alignment. A mesh with this general structure is known in OpenFOAM as a polyMesh." (https://cfd.direct/openfoam/user-gui...h-description/)
Am i missing something?

HakikiCanakkaleli March 4, 2018 06:51

Quote:

Originally Posted by ancolli (Post 683593)
Do u have any experience using snappyHexMesh for boundary layers in the order of 1e-6 m (y+ < 1)?

No, I'm afraid.

Quote:

Originally Posted by ancolli (Post 683593)
Finally, I do not see the restriction u said about tetrahedral mesh

OpenFOAM mesh topology capabilities allow polyhedra. My suspicion is however whether schemes you will use on tetrahedra were derived and implemented with the consideration of tetrahedra? For example, you may very likely have issues if you use Gauss linear for gradient terms within such a domain (but you can use leastSquares to ensure second-order accuracy independent of the mesh topology).

As I said, I only speculated about this, and encourage you to be more cautious when you will use tetrahedra.

Hope you resolve this matter.

PS: It would be very nice of you if you would share your experience herein in the future.

Gerhard March 16, 2021 03:56

Generally, hex-meshes are better than tet-meshes, but OpenFOAM and its schemes can deal with both.

It is a very simple utility and does not always provide good layers, but it is worth looking at. That is, the refineWallLayer utility of OpenFOAM. I have used it sometimes to get through the viscous sublayer, i.e. to get y+ ~ 1.

Say you want to add five layers to a wall called pipeWall, it would look something like:

Code:

refineWallLayer pipeWall 0.65 -overwrite
refineWallLayer pipeWall 0.60 -overwrite
refineWallLayer pipeWall 0.55 -overwrite
refineWallLayer pipeWall 0.50 -overwrite
refineWallLayer pipeWall 0.40 -overwrite

In a bash script you could do it more elegantly with something like

Code:

echo "Adding layers ..."
i=1
for j in 0.65 0.6 0.55 0.5 0.4
do
    echo "      - Adding layer $i"
    refineWallLayer pipeWall $j -overwrite >> log.refineWallLayer.pipeWall
    let i=i+1
done



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