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

[snappyHexMesh] Meshing a rock sample

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By salicTo

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 29, 2024, 04:39
Default Meshing a rock sample
  #1
New Member
 
Tom SALIC
Join Date: Jul 2023
Posts: 10
Rep Power: 3
salicTo is on a distinguished road
Hello,


I would like to study the flow of a fluid in a porous rock. The rock is created using the Python library Porespy. After pre-processing, I obtain a file in .stl format. Once I have this file, I use SnappyHexMesh to create the mesh. It should mesh the empty space between the solid grains so that the fluid can flow. Unfortunately, it meshes the surfaces of the elements, so when I apply the fluid at the inlet, it gets blocked by the material. I've tried changing the locationInMesh to place it in an empty space, but it didn't yield the expected results. If you have any ideas, I'd appreciate it. I'm attaching two images to show the geometry as well as the mesh results.


Thank you for your help.
Attached Images
File Type: jpg Rock_mesh.jpg (64.6 KB, 20 views)
File Type: jpg rockk_snappyHex.jpg (86.9 KB, 16 views)
huiselilun likes this.
salicTo is offline   Reply With Quote

Old   April 2, 2024, 05:00
Default
  #2
Senior Member
 
Join Date: Dec 2021
Posts: 246
Rep Power: 5
Alczem is on a distinguished road
Hey!


If you already managed to mesh the solid part, it means that you probably have a working setup the main thing you should change is the locationInMesh keyword: make sure it is located in the fluid part, and not in the solid part, and snappy should keep the fluid cells.


One more thing, the background mesh you use should be slightly smaller than the STL of the porous rock so that the mesh cuts off at the borders.
Alczem is offline   Reply With Quote

Old   April 2, 2024, 05:10
Default
  #3
New Member
 
Tom SALIC
Join Date: Jul 2023
Posts: 10
Rep Power: 3
salicTo is on a distinguished road
Quote:
Originally Posted by Alczem View Post
Hey!


If you already managed to mesh the solid part, it means that you probably have a working setup the main thing you should change is the locationInMesh keyword: make sure it is located in the fluid part, and not in the solid part, and snappy should keep the fluid cells.


One more thing, the background mesh you use should be slightly smaller than the STL of the porous rock so that the mesh cuts off at the borders.

Hello Alczem,


Thank you for the response. I've already changed the LocationInMesh to the void space, but the problem persists. I tried using the Toposet dictionary to select the cells located on the rock and create the other set defined by the void, but the same issue remains.


I'm going to reduce the background to avoid the straight borders.
salicTo is offline   Reply With Quote

Old   April 3, 2024, 05:05
Default
  #4
Senior Member
 
Join Date: Dec 2021
Posts: 246
Rep Power: 5
Alczem is on a distinguished road
Hm, weird! Can you share your blockMesh and snappyHexMesh dicts, and your stl file as well? It will probably help diagnose the issue.


If your stl is okay, topoSet should not be needed to have a decent mesh.
Alczem is offline   Reply With Quote

Old   April 3, 2024, 05:18
Default
  #5
New Member
 
Tom SALIC
Join Date: Jul 2023
Posts: 10
Rep Power: 3
salicTo is on a distinguished road
Quote:
Originally Posted by Alczem View Post
Hm, weird! Can you share your blockMesh and snappyHexMesh dicts, and your stl file as well? It will probably help diagnose the issue.


If your stl is okay, topoSet should not be needed to have a decent mesh.

Hi,


Thank you for your help. I can upload my snappyHexMeshDict and blockMesh files, but my stl file is 151 MB in size. I won't be able to share it using the forum.Block_SnappyHexMesh.zip
salicTo is offline   Reply With Quote

Old   April 3, 2024, 06:32
Default
  #6
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,200
Rep Power: 28
Yann will become famous soon enough
Just a quick question: are you sure there is no scaling issue with your stl file and locationInMesh coordinates?
OpenFOAM works with meters and CAD softwars usually use mm. It is a pretty common mistake to mix things up and give a locationInMesh in mm instead of meters, or have a STL file 1000 time too big.

Best way to be sure: open your stl file in paraview, use the point source with your locationInMesh coordinates and make sure it is really in the void space.
Yann is offline   Reply With Quote

Old   April 3, 2024, 09:33
Default
  #7
New Member
 
Tom SALIC
Join Date: Jul 2023
Posts: 10
Rep Power: 3
salicTo is on a distinguished road
Quote:
Originally Posted by Yann View Post
Just a quick question: are you sure there is no scaling issue with your stl file and locationInMesh coordinates?
OpenFOAM works with meters and CAD softwars usually use mm. It is a pretty common mistake to mix things up and give a locationInMesh in mm instead of meters, or have a STL file 1000 time too big.

Best way to be sure: open your stl file in paraview, use the point source with your locationInMesh coordinates and make sure it is really in the void space.

Thank you for the help, I have already looked at the locationInMesh (I encountered this problem in another case ). As you can see in the attached image, the point is located in an void space.
Attached Images
File Type: jpg POint_Location.jpg (35.0 KB, 8 views)
salicTo is offline   Reply With Quote

Reply

Tags
complex geometry, micro flows, porous media flow


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
[ANSYS Meshing] only automatic meshing works, kazra ANSYS Meshing & Geometry 2 February 23, 2017 12:38
why does 'sample' do this? wallShearStress question CHARLES OpenFOAM Post-Processing 0 August 7, 2013 20:30
Sample issues MikePo OpenFOAM Post-Processing 1 February 7, 2010 20:20
Best Meshing scheme for Cylinder Nutrex Main CFD Forum 4 July 29, 2008 12:03
Volume Meshing & Face Meshing? singularity of grid ken FLUENT 0 September 4, 2003 12:08


All times are GMT -4. The time now is 21:38.