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/)
-   -   Boundary layer salome (https://www.cfd-online.com/Forums/openfoam-pre-processing/207932-boundary-layer-salome.html)

fede32 October 6, 2018 15:32

Boundary layer salome
 
I'm trying to build a mesh using salome to run in openfoam. The geometry is a piping system. How can I refine the boundary layer? Using local refinement, I can only select points, faces or solids, but that is not what I really need. Selecting faces, for example, refines the 2d face meshing, instead of refine the orthogonal direction (the y+ direction).

fede32 October 6, 2018 15:38

Quote:

Originally Posted by fede32 (Post 709101)
I'm trying to build a mesh using salome to run in openfoam. The geometry is a piping system. How can I refine the boundary layer? Using local refinement, I can only select points, faces or solids, but that is not what I really need. Selecting faces, for example, refines the 2d face meshing, instead of refine the orthogonal direction (the y+ direction).


I thinnk the solution is using hypothesis-> viscous layer

peterhess October 6, 2018 18:41

Quote:

Originally Posted by fede32 (Post 709102)
I thinnk the solution is using hypothesis-> viscous layer

Well, that is one option.

https://www.youtube.com/watch?v=TI0u...NO25WdJ_ChsU5E

I can suggest two other...

Using Salome also --> sub-mesh

Hier you build a sub geometry in the region of refinement and use it for the sub mesh.

https://www.youtube.com/watch?v=btGV...hsU5E&index=37

Or the other option directly in openFoam using:

refineWallLayer -overwrite -region FLUID '(FLUID_to_SOLID)' 0.3

Where FLUID is the region name you want to refine (if you have multiple regions) and FLUID_to_SOLID is the boundary you want to refine

Anyway, if I still remember corrrectly, somebody in the forum here developed a code to refine the boundary near the walls using the calculated y+ value! Try to find it out. That is actualy what you are looking for,

Regards

Peter

fede32 October 6, 2018 19:37

Quote:

Originally Posted by peterhess (Post 709112)
Well, that is one option.

https://www.youtube.com/watch?v=TI0u...NO25WdJ_ChsU5E

I can suggest two other...

Using Salome also --> sub-mesh

Hier you build a sub geometry in the region of refinement and use it for the sub mesh.

https://www.youtube.com/watch?v=btGV...hsU5E&index=37

Or the other option directly in openFoam using:

refineWallLayer -overwrite -region FLUID '(FLUID_to_SOLID)' 0.3

Where FLUID is the region name you want to refine (if you have multiple regions) and FLUID_to_SOLID is the boundary you want to refine

Anyway, if I still remember corrrectly, somebody in the forum here developed a code to refine the boundary near the walls using the calculated y+ value! Try to find it out. That is actualy what you are looking for,

Regards

Peter


Thanks for your complete answer!!
I'm testing the first option, using the boundary layer hypotesis.
This way I create meshes with high amount of non-orthogonal faces.
I'm going to test the others options you give me.
But for now, do you know how can I limit the non-orthogonality generation in Salome? I'm using the NETGEN1D2D3D algorithm (may I use another?).

fede32 October 6, 2018 19:55

Quote:

Originally Posted by peterhess (Post 709112)
Well, that is one option.

https://www.youtube.com/watch?v=TI0u...NO25WdJ_ChsU5E

I can suggest two other...

Using Salome also --> sub-mesh

Hier you build a sub geometry in the region of refinement and use it for the sub mesh.

https://www.youtube.com/watch?v=btGV...hsU5E&index=37

Or the other option directly in openFoam using:

refineWallLayer -overwrite -region FLUID '(FLUID_to_SOLID)' 0.3

Where FLUID is the region name you want to refine (if you have multiple regions) and FLUID_to_SOLID is the boundary you want to refine

Anyway, if I still remember corrrectly, somebody in the forum here developed a code to refine the boundary near the walls using the calculated y+ value! Try to find it out. That is actualy what you are looking for,

Regards

Peter


Your second option is more complicated in my case. I'm dealing with a complex geometry (something like a manifold connected to an elbow system), and I can't figure out how to create a second geometry (in order to refine it).

fede32 October 6, 2018 20:25

Quote:

Originally Posted by peterhess (Post 709112)
Well, that is one option.

https://www.youtube.com/watch?v=TI0u...NO25WdJ_ChsU5E

I can suggest two other...

Using Salome also --> sub-mesh

Hier you build a sub geometry in the region of refinement and use it for the sub mesh.

https://www.youtube.com/watch?v=btGV...hsU5E&index=37

Or the other option directly in openFoam using:

refineWallLayer -overwrite -region FLUID '(FLUID_to_SOLID)' 0.3

Where FLUID is the region name you want to refine (if you have multiple regions) and FLUID_to_SOLID is the boundary you want to refine

Anyway, if I still remember corrrectly, somebody in the forum here developed a code to refine the boundary near the walls using the calculated y+ value! Try to find it out. That is actualy what you are looking for,

Regards

Peter


Lastly, using your third method, I get another kind of error.
I used this command:


refineWallLayer -overwrite wall 0.5


multiple times, (refining always the boundary cell).
When I use the checkMesh I get this error:


Checking geometry...
Overall domain bounding box (-13.74 -9.0452 -1.5144) (1.3196 5.476 12.0332)
Mesh has 3 geometric (non-empty/wedge) directions (1 1 1)
Mesh has 3 solution (non-empty) directions (1 1 1)
Boundary openness (1.28052e-16 2.37068e-17 5.13857e-17) OK.
Max cell openness = 6.72261e-16 OK.
Max aspect ratio = 45.2328 OK.
Minimum face area = 1.73917e-05. Maximum face area = 0.374593. Face area magnitudes OK.
Min volume = 3.66888e-08. Max volume = 0.0473133. Total volume = 29.2296. Cell volumes OK.
Mesh non-orthogonality Max: 68.5331 average: 25.4743
Non-orthogonality check OK.
Face pyramids OK.
***Max skewness = 4.35376, 1 highly skew faces detected which may impair the quality of the results
<<Writing 1 skew faces to set skewFaces
Coupled point location match (average 0) OK.

Failed 2 mesh checks.


Checking visually the mesh, I found this:
https://drive.google.com/open?id=1kP...Ald-GZYIcIF2-j


How can i solve the skewness problem?

peterhess October 6, 2018 20:43

Quote:

Originally Posted by fede32 (Post 709115)
Overall domain bounding box (-13.74 -9.0452 -1.5144) (1.3196 5.476 12.0332)

Well, far away from the discussion, I think there is an initial probleme here...

Your bounding box has the dimensions:

15 X 15 X 13.5 m³!!!

Are you sure about it?

I ask that because it seams that during the exporting the mesh you had a scaling problem here.

Principally you are able to simulate such a big geometry, anyway, you need a very big size mesh!

How many cells do you have in this bounding box?

I will try to replay the other points step by step (with my poor knowledge) :)

fede32 October 6, 2018 20:48

Quote:

Originally Posted by peterhess (Post 709116)
Well, far away from the discussion, I think there is an initial probleme here...

Your bounding box has the dimensions:

15 X 15 X 13.5 m³!!!

Are you sure about it?

I ask that because it seams that during the exporting the mesh you had a scaling problem here.

Principally you are able to simulate such a big geometry, anyway, you need a very big size mesh!

How many cells do you have in this bounding box?

I will try to replay the other points step by step (with my poor knowledge) :)


That bounding box is right!
I'm working with ~1 million cells.
The image in my previous answer, is from a coarse mesh, but the problem I try to show always happens.
Thanks for all your time!

peterhess October 6, 2018 20:58

Quote:

Originally Posted by fede32 (Post 709117)
That bounding box is right!
I'm working with ~1 million cells.
The image in my previous answer, is from a coarse mesh, but the problem I try to show always happens.
Thanks for all your time!

Ok! :)

Would you please upload the Salome *.hdf file.

It should be small sufficient to upload.

Regards

Peter

peterhess October 6, 2018 21:12

Quote:

Originally Posted by fede32 (Post 709114)
Your second option is more complicated in my case. I'm dealing with a complex geometry (something like a manifold connected to an elbow system), and I can't figure out how to create a second geometry (in order to refine it).

Yes, I also dont like it :)

Anyway to do that, you generate two geometries and then use the operation "partition" in Salome to combine the geometries in one, then you explode the combined Partition to get the combined geometry separated, then use the sub mesh for the part you want to refine!

Watch the tutorial set on youtype will explain that better.

peterhess October 6, 2018 21:22

1 Attachment(s)
Quote:

Originally Posted by fede32 (Post 709115)
Lastly, using your third method, I get another kind of error.
I used this command:


refineWallLayer -overwrite wall 0.5


multiple times, (refining always the boundary cell).
When I use the checkMesh I get this error:


Checking geometry...
Overall domain bounding box (-13.74 -9.0452 -1.5144) (1.3196 5.476 12.0332)
Mesh has 3 geometric (non-empty/wedge) directions (1 1 1)
Mesh has 3 solution (non-empty) directions (1 1 1)
Boundary openness (1.28052e-16 2.37068e-17 5.13857e-17) OK.
Max cell openness = 6.72261e-16 OK.
Max aspect ratio = 45.2328 OK.
Minimum face area = 1.73917e-05. Maximum face area = 0.374593. Face area magnitudes OK.
Min volume = 3.66888e-08. Max volume = 0.0473133. Total volume = 29.2296. Cell volumes OK.
Mesh non-orthogonality Max: 68.5331 average: 25.4743
Non-orthogonality check OK.
Face pyramids OK.
***Max skewness = 4.35376, 1 highly skew faces detected which may impair the quality of the results
<<Writing 1 skew faces to set skewFaces
Coupled point location match (average 0) OK.

Failed 2 mesh checks.


Checking visually the mesh, I found this:
https://drive.google.com/open?id=1kP...Ald-GZYIcIF2-j


How can i solve the skewness problem?

Well, the question here is if the bad mesh quality exists before refine or after?

I suggest running the checkMesh before refinement and after to see the difference.

I uploaded here an example case using the refineWallMesh three times after the mesh generation (using blockMesh). It works perfectly.

It is possible that the generated mesh quality using Salome is poor and you have bad skewness cells in the boundary layer where you apply the refinement.

fede32 October 6, 2018 21:25

Quote:

Originally Posted by peterhess (Post 709118)
Ok! :)

Would you please upload the Salome *.hdf file.

It should be small sufficient to upload.

Regards

Peter


Sure, here is the *.hdf:


https://drive.google.com/open?id=1ZV...ZlGVBm_cqWsRke



(I made a coarse mesh and erase the others to have a light file)



thanks!

fede32 October 6, 2018 21:31

Quote:

Originally Posted by peterhess (Post 709122)
Well, the question here is if the bad mesh quality exists before refine or after?

I suggest running the checkMesh before refinement and after ans see the difference.

I uploaded here an example case using the refineWallMesh three times after the mesh generation (using blockMesh). It works perfectly.

It is possible that the generated mesh quality using Salome is poor and you have bad skewness cells in the boundary layer where you apply the refinement.


Before applying refineWallMesh, the quality of the Mesh was good (I only had the error applying two or more times refineWallMesh).
I am going to analyze the case you submitted, thanks!

fede32 October 6, 2018 21:44

Quote:

Originally Posted by peterhess (Post 709122)
It is possible that the generated mesh quality using Salome is poor and you have bad skewness cells in the boundary layer where you apply the refinement.


There are two cases.


In the first case, I haven't prepare the boundary layer in Salome. I only mesh using NETGEN1D2D3D, which gives me a good mesh. Then, I use refineWallMesh in OpenFoam, and here is where I get the skewness error, because previously I used tetrahedras and not Boundary Layer.


In the second case, using a boundary layer hypothesis in Salome, the generated mesh quality is poor (I get too many faces with high non-orthogonality). I think maybe I can solve this problem using a mesh composed only by hexa, but I was trying unsuccessfully to create an hexa mesh using Salome.

peterhess October 6, 2018 22:16

By the way, a "bad" skewness does not always mean a bad mesh!

You could get a bad skewness but a "acceptable" element quality.

See minute 29:20!

https://www.youtube.com/watch?v=Od38...6xDh5L9bbeK3BL

Try to execute the simulation and see if you get divergence and then look for the skewness.

fede32 October 6, 2018 22:40

Quote:

Originally Posted by peterhess (Post 709126)
By the way, a "bad" skewness does not always mean a bad mesh!

You could get a bad skewness but a "acceptable" element quality.

See minute 29:20!

https://www.youtube.com/watch?v=Od38...6xDh5L9bbeK3BL

Try to execute the simulation and see if you get divergence and then look for the skewness.


Thanks for the video! That's a good explanation of the checkMesh tool. So I always should check the max non-orthogonality.



Finally I made mesh in Salome with just one gross layer, (it's the best case to get the lowest "max non-orthogonallity"). Then, I refined it using the refineWallLayer tool. Checking the mesh, everything is OK. Now I'm running the simulation, which with more than 1000 steps is stable. Thanks for all your help!



I will review the whole OF videos of that channel, they seems great! Thanks!

peterhess October 7, 2018 05:50

I made the following:

- Salome --> Geometry --> explode system (region) --> sub shape type --> face

doing that I got all the surfaces out of the geometry

- Delete all the old faces and keep the new generated

- Generated three new groups for inlet, outlet and wall using the new generated faces

- Generated the mesh using the same setup as yours with 4 boundary layers (3 also worked)

- Fixed the mesh size for the wall to an acceptable value

And I got no highly skewness anymore in checkMesh...

I used the original method you used as you opened the thread...

Actually the mesh is very good.

Increasing the number of layers to 10 generats a very good quality mesh.

Hat off for Salome developers!

https://drive.google.com/file/d/1EvA...ew?usp=sharing

Regards

Peter

fede32 October 7, 2018 15:13

Quote:

Originally Posted by peterhess (Post 709151)
I made the following:

- Salome --> Geometry --> explode system (region) --> sub shape type --> face

doing that I got all the surfaces out of the geometry

- Delete all the old faces and keep the new generated

- Generated three new groups for inlet, outlet and wall using the new generated faces

- Generated the mesh using the same setup as yours with 4 boundary layers (3 also worked)

- Fixed the mesh size for the wall to an acceptable value

And I got no highly skewness anymore in checkMesh...

I used the original method you used as you opened the thread...

Actually the mesh is very good.

Increasing the number of layers to 10 generats a very good quality mesh.

Hat off for Salome developers!

https://drive.google.com/file/d/1EvA...ew?usp=sharing

Regards

Peter


Thanks a lot for your work!!!


When I use checkMesh on the mesh generated with the parameters/methods you used, I get the following output:

Checking geometry...
Overall domain bounding box (-13.74 -9.0452 -1.5144) (1.3196 5.476 12.0332)
Mesh has 3 geometric (non-empty/wedge) directions (1 1 1)
Mesh has 3 solution (non-empty) directions (1 1 1)
Boundary openness (6.43708e-16 1.0415e-17 8.96766e-17) OK.
Max cell openness = 4.78509e-16 OK.
Max aspect ratio = 24.9331 OK.
Minimum face area = 1.20507e-05. Maximum face area = 0.0136992. Face area magnitudes OK.
Min volume = 2.80859e-08. Max volume = 0.000472208. Total volume = 29.2795. Cell volumes OK.
Mesh non-orthogonality Max: 83.8929 average: 22.363
*Number of severely non-orthogonal (> 70 degrees) faces: 859.
Non-orthogonality check OK.
<<Writing 859 non-orthogonal faces to set nonOrthoFaces
Face pyramids OK.
Max skewness = 2.46259 OK.
Coupled point location match (average 0) OK.

Failed 1 mesh checks.

End


Which is good, but we have 859 faces with severely non-orthogonal. (max 83º). I know that in the classes in the video you passed me before, the teacher says that it shouldn't be a problem, but until now, every time I use a mesh with this kind of non-orthogonality the simulations become unstable.


Anyway, I will try the simulation using this mesh.
Again, thanks a lot for your help!

fede32 October 7, 2018 17:09

Quote:

Originally Posted by fede32 (Post 709191)
Thanks a lot for your work!!!
Anyway, I will try the simulation using this mesh.
Again, thanks a lot for your help!


The simpleFoam simulation is not stable

Update: That was because of my bad selection of schemes and parameters in solutions.
Playing with them, I found a stable configuration.
Again, txs.
:/


All times are GMT -4. The time now is 02:22.