CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   SnappyHexMesh add layers (https://www.cfd-online.com/Forums/openfoam-meshing/254970-snappyhexmesh-add-layers.html)

Origami March 12, 2024 12:49

SnappyHexMesh add layers
 
I am modelling an urban area with buildings on non-flat terrain. I want to add layers to the surface of buildings and terrains. Below the log file of running snappyHexMesh. I don’t understand what it means for “layers”, “overall [m]” and “thickness [%]”. Can someone please help?

patch faces layers overall thickness
[m] [%]
----- ----- ------ --- ---
buildingSurroundings 9147 2.14 0.138 68.9
innerTerrain 583214 0.00712 0.00303 0.163

Below an excerpt of snappyHexMeshDict for adding layers.

addLayersControls
{
minMedialAxisAngle 90;
relativeSizes true;
layers
{
buildingSurroundings
{
nSurfaceLayers 3;
relativeSizes true;
minThickness 0.1;
finalLayerThickness 0.6;
expansionRatio 1.1;
}
innerTerrain
{
nSurfaceLayers 4;
relativeSizes false;
minThickness 0.2;
firstLayerThickness 0.4;
expansionRatio 1.1;
}
}
expansionRatio 1.2;
firstLayerThickness 1;
minThickness 0.3;
nGrow 0;
featureAngle 130;
nRelaxIter 5;
nSmoothSurfaceNormals 1;
nSmoothNormals 3;
nSmoothThickness 10;
maxFaceThicknessRatio 0.5;
maxThicknessToMedialRatio 0.3;
minMedianAxisAngle 90;
nBufferCellsNoExtrude 0;
nLayerIter 50;
nRelaxedIter 20;
}

LuckyTran March 12, 2024 14:14

there is something wrong with your log output, maybe a copy and past error

Code:

patch                        faces    layers  overall    thickness
                                                  [m]      [%]
-----                        -----        ------    ---              ---

this tells you the format of the following outputted lines

buildingSurroundings 9147 2.14 0.138 68.9
innerTerrain 583214 0.00712 0.00303 0.163


buildingSurroundings is the patch 9147 is the number of faces. 3 numbers should follow. A number of layers, an overall thickness of the layers in [m] and an overall thickness of the layers in %


in the next line
innerTerrain is the patch, it has 583214 faces, 0.00712 layers apparently


The last percentage is the percentage of the patch that has been layered. 100% means every face on the patch has a layer.

Origami March 13, 2024 07:48

2 Attachment(s)
Hi LuckyTran,
Thanks very much for your response.
I attached the log.snappyHexMesh and snappyHexMesh.
I don't think I made copy paste error for the log file.
Thanks.

LuckyTran March 13, 2024 13:14

It doesn't really matter whether you did or not, your question is answered

Origami March 13, 2024 16:26

I'm not grasping it yet. The surface of buildingSurroundings has a Layers value of 2.14. However, in sappyHexMesh, 3 layers are specified. What is the “overall”, is it the total height of the 3 layers 0.138m? It doesn’t seem to make sense. Additionally, the term "thickness (%)" seems misleading since it refers to the percentage of all faces being layered, which doesn't seem to align with its name.

Patch faces layers overall([m]) thickness(%)

----- ----- ------ --- ---
buildingSurroundings 9147 2.14 0.138 68.9
innerTerrain 583214 0.00712 0.00303 0.163

LuckyTran March 14, 2024 07:57

it's actually overall thickness [m] and just a plain unlabeled %

You are arguing pedantics. If you don't agree with it, then simply change it. OpenFOAM is meant to be modifiable, that's why they give you the source code.

It's also just a report. You can just open the mesh and look at it and verify with your own eyeballs what the mesh looks like. Take a picture, screenshot it, whatever.

Origami March 14, 2024 10:01

Ok. Thanks for the tip. I'll look at the source code and see if I can crack the code of understanding.


All times are GMT -4. The time now is 16:06.