|
[Sponsors] |
[snappyHexMesh] gmsh import add layers with shm |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 26, 2022, 09:52 |
gmsh import add layers with shm
|
#1 |
Senior Member
Nico
Join Date: Jan 2022
Location: Germany
Posts: 122
Rep Power: 6 |
Hey,
i an older post i found a quote stating that it is possible to create a mesh in gmsh and import it to further create the boundary layer with snappy hex mesh. Is this actually possible? If so, has anybody done that before and can tell how to do that? Or just share some experiences? |
|
October 26, 2022, 11:11 |
|
#2 |
Senior Member
Nico
Join Date: Jan 2022
Location: Germany
Posts: 122
Rep Power: 6 |
I have just tried doing that with a simple pipe and it actually works.
|
|
November 20, 2022, 17:50 |
|
#3 |
New Member
Join Date: Nov 2022
Posts: 7
Rep Power: 3 |
Would you be able to describe the process you used?
|
|
November 21, 2022, 06:05 |
|
#4 |
Senior Member
Nico
Join Date: Jan 2022
Location: Germany
Posts: 122
Rep Power: 6 |
Hey, yes of course!
I have created the mesh in GMSH with a script alone. The resulting mesh is located in the case in the constant folder -> constant/mesh.msh I import the mesh with gmshToFoam constant/mesh.msh Prvious command creates the polymesh folder with faces, cellzones and so on.. In the snappyHexMeshDict i start with following settings: Code:
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 9 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { format ascii; class dictionary; object snappyHexMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #includeEtc "caseDicts/mesh/generation/snappyHexMeshDict.cfg" castellatedMesh off; snap off; addLayers on; Code:
geometry { dummy { type triSurfaceMesh; file "dummy.stl"; regions { dummy1.stl {name dummy1;} dummy2.stl {name dummy2;} dummy3.stl {name dummy3;} dummy4.stl {name dummy4;} } } }; castellatedMeshControls { features ( ); refinementSurfaces { dummy { level (0 0); regions { dummy1 { level (1 1); patchInfo { type wall; } } dummy2 { level (1 1); patchInfo { type wall; } } dummy3 { level (1 1); patchInfo { type wall; } } dummy4 { level (1 1); patchInfo { type wall; } } } } } locationInMesh (0.0 0.0 0.005); nCellsBetweenLevels 2; resolveFeatureAngle 15; } snapControls { implicitFeatureSnap true; } In the last portion of the script: Code:
addLayersControls { layers { top { nSurfaceLayers 5; mergeFaces true; } bottom { nSurfaceLayers 5; mergeFaces true; } left { nSurfaceLayers 5; mergeFaces true; } right { nSurfaceLayers 5; mergeFaces true; } } relativeSizes true; expansionRatio 1.2; finalLayerThickness 0.4; minThickness 0.001; } For simple geometries you can simply run: gmshToFoam constant/mesh.msh createPatch -overwrite snappyHexMesh -overwrite Side note: Since i want some of the patches to be walls i use the createPatch dict to change the boundary type to wall and use the createFromPatch option of the createPatch dict. The resulting mesh in my case was mesh with various elements mixed, the checkMesh command doesn't complain about the mesh and test runs were all quite successfull, so i hope this helps you! If you have any further questions i will try ma best to answer them! |
|
November 21, 2022, 16:57 |
|
#5 |
New Member
Join Date: Nov 2022
Posts: 7
Rep Power: 3 |
Thanks! That is very useful.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] Snappy add layers failed | mqsim | OpenFOAM Meshing & Mesh Conversion | 1 | January 24, 2021 15:02 |
[snappyHexMesh] Add Layers in snappyHexMesh | shchepan | OpenFOAM Meshing & Mesh Conversion | 24 | May 14, 2020 12:29 |
[snappyHexMesh] Fail to create boundary layers during sHM | farahiam | OpenFOAM Meshing & Mesh Conversion | 13 | October 15, 2014 19:46 |
[Gmsh] 2D Mesh Generation Tutorial for GMSH | aeroslacker | OpenFOAM Meshing & Mesh Conversion | 12 | January 19, 2012 03:52 |
[snappyHexMesh] SHM add layers problem | doubtsincfd | OpenFOAM Meshing & Mesh Conversion | 0 | June 6, 2011 12:01 |