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] Location of mesh within background mesh (https://www.cfd-online.com/Forums/openfoam-meshing/236961-location-mesh-within-background-mesh.html)

bjavila1409 June 23, 2021 23:59

Location of mesh within background mesh
 
I am trying to model flow around a cylinder using snappyHexMesh and am a little stuck. I made a background mesh as a cube with point 0 at (0,0,0), and max x,y,z points of (30,10,5) respectively. I have an .stl file of a cylinder which I am meshing using snappyHexMesh. Every time i place the cylinder, it is at the point 0,0,0. What i want is for the cylinder to be at around 10 in the x direction and 5 in the y direction. Do i have to change my blockMeshDict for the background mesh to move the position of where the cylinder is located? I know locationInMesh and refinementBox are not the indices to change, so that is my next thought. Though I feel there should be an easier way to say "Move my mesh to this place in my background mesh". Thanks for the help!

jerik June 24, 2021 03:35

You have to move your geometry-Location in your STL-File. Either move the Geometry with your CAD-Program of choice or give surfaceTransformPoints a try. Something like
Code:

surfaceTransformPoints -translate '(10 5 0)' geometry.stl geometry_translated.stl
should do it.

Yann June 24, 2021 03:37

Hi Bailey,

You can either:
  • Move your STL file to place it where you want in your background mesh using the surfaceTransformPoints utility
  • Move your background mesh to place it where you want around your cylinder by changing the vertices coordinates in your blockMeshDict file.
The choice is up to you!

Cheers,
Yann

EDIT: Jan has been faster than Yann on this one! :D


All times are GMT -4. The time now is 08:59.