CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[snappyHexMesh] Help in locating the locationInMesh coordinates

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 16, 2021, 14:53
Default Help in locating the locationInMesh coordinates
  #1
New Member
 
edgar africano
Join Date: Apr 2021
Posts: 3
Rep Power: 4
Edafri is on a distinguished road
Good morning to everybody
I developed a water tank geometry in STL and through snaapyHexMesh I want to use it for simulations.

I am not very sure where to put the locationInMesh coordinates. I have put them inside the tank and the inlet or outlet of the tank don't appaer. I put it in the inlet and the tank and outlet don't appaer in the mesh. The same goes for the outlet.
I kindly ask you for suggestions in putting the coordinates in order to run the simulation properly.
I have attached the case file where the blockMeshDict and snappyHexMeshDict are avaliable.



Thank you very much
Attached Files
File Type: zip tankcase.zip (139.8 KB, 10 views)
Edafri is offline   Reply With Quote

Old   July 18, 2021, 14:13
Default
  #2
Senior Member
 
M
Join Date: Dec 2017
Posts: 642
Rep Power: 12
AtoHM is on a distinguished road
I don't like opening zips where I don't know whats inside. So my best guess is: you have multiple closed regions inside your STL. The default behavior of snappy is to keep only the region, that encloses the locationInMesh. So, make sure your STL is only one solid body.
AtoHM is offline   Reply With Quote

Old   July 19, 2021, 12:34
Default
  #3
New Member
 
edgar africano
Join Date: Apr 2021
Posts: 3
Rep Power: 4
Edafri is on a distinguished road
Thank you for your reply.



Probably it wasn't the best choice to send a zip file attached. So it will explain myself in a better way.


I developed a simple tank in FreeCAD. It us composed of four STL files. the inlet, the outlet, the volume (the whole tank) and the walls (which is the tank minus the inlet and outlet).


After doing the blockMesh, surfaceFeatureExtract and snappyHexMesh. The block Mesh also appears. I have modified the locationInMesh coordinates to different locations. In some cases the blockMesh doesn't appear, it just appears the inlet or the outlet but no the complete tank. I believe that the source of error is the locationInMesh coordinates. But perhaps the error comes from other place. Any feedback or suggestion is more than welcomed.


Thank you
Attached Images
File Type: jpg Captura.JPG (29.0 KB, 24 views)
File Type: jpg mesh.JPG (17.2 KB, 17 views)
Attached Files
File Type: txt snappyHexMeshDict.txt (11.8 KB, 5 views)
File Type: txt blockMeshDict.txt (2.2 KB, 0 views)
File Type: txt surfaceFeatureExtractDict.txt (2.6 KB, 1 views)
Edafri is offline   Reply With Quote

Old   July 20, 2021, 11:19
Default
  #4
Senior Member
 
M
Join Date: Dec 2017
Posts: 642
Rep Power: 12
AtoHM is on a distinguished road
I can't tell, if your model is one closed body or not (are the inlet/outlet cylinders merged with the tank?). From your description how snappy behaved, I think they are not merged? Then the first step would be to merge them to one solid. Then, separately export stl files for each region you need (tank walls, inlet face, outlet face). This can cause issues, but I describe later.

Normally, what you want is a STL file, that contains all faces and encloses a volume. So, now, place these single stls into one file (its ascii, just copy the lines over). Then, in the geometry section of the snappyHexMesh dict, you can use following syntax to address the regions:

Code:
  geometry 
  { 
      myFileWithAllSTLsInside     // User defined region name 
      { 
          type    triSurfaceMesh; 
          file    "myFileWithAllSTLsInside.stl";  // surface geometry
          regions 
          { 
              inletSolid             // Named region in the STL file 
              { 
                  name inlet; // User-defined patch name 
              }
          } 
      }
  }
(Taken from https://cfd.direct/openfoam/user-gui...snappyhexmesh/)

Now, you must only place your locationInMesh somewhere inside. Instead of using (0 0 0) as in your sHMDict, go for some small float numbers like (0.024 0.012 0.021). The reason for this is: the locationInMesh should not hit a node or face from the blockMesh, otherwise strange behavior can occur.
Theoretically, it should all work fine now.

However, as mentioned, one problem may arise: when you export these single STLs for your region, they might not form a watertight geometry when put back together (the triangulation leaves holes). You can check that visually in Paraview or use surfaceCheck utility from OpenFOAM. There are many threads here disussing how to get watertight geometry.

Another way: FreeCAD has its own OpenFOAM-Workbench including a GUI for snappyHexMesh, which works around the open stl issue internally. You might want to check that out to get a working snappy case.
AtoHM is offline   Reply With Quote

Reply

Tags
locationinmesh, snappyhexmesh, stl file


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting cell closest to coordinates (and setting its field value) rando_foamer OpenFOAM Pre-Processing 2 May 14, 2019 05:15
[Scripting]: How to get the coordinates of a 2D airfoil @ different angles of attack? CfdIntro Main CFD Forum 2 December 12, 2017 10:23
[General] Spherical Coordinates Bing ParaView 0 June 10, 2014 07:58
tracking / locating of coordinates chauhan FLUENT 0 May 27, 2010 04:16
Coordinate's tranformation tommy FLUENT 0 February 13, 2004 02:19


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