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

[snappyHexMesh] creating a mesh for a small object <1m in length

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 1 Post By AtoHM
  • 1 Post By Yann
  • 3 Post By SnyderFoam

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 14, 2022, 05:29
Default creating a mesh for a small object <1m in length
  #1
New Member
 
Join Date: Jan 2022
Location: USA
Posts: 8
Rep Power: 4
SnyderFoam is on a distinguished road
Hello, this is my first time using both OpenFoam and the forum. Please let me know if this question belongs somewhere else.

My eventual goal is to perform a conjugate heat transfer analysis on the object pictured in the attachments(1.jpg). For now I am just trying to get a good mesh. I tried modifying the steps performed to successfully mesh the motorBike example, but have had little success. Listed below is basic workflow that I followed

1) import the stl into paraView so that I can get an idea of how to size the block mesh and refinement box
2) edit the blockmeshDict accordingly. I added more cells per block since the overall block mesh is so much smaller than the motor bike case
3) performed blockmesh and snappyhexmesh
4) applied extract cells by region filter and viewed "3rd" time step to see the affects of constellation,snap, and layers.

Some things I still do not understand is why there seems to be no castellatedMesh or snapping happening? It seems to ignore my object completely. Do I need to make the cells much smaller?
Attached Images
File Type: jpg detail1.jpg (166.2 KB, 32 views)
File Type: jpg refinementBox.jpg (200.7 KB, 30 views)
File Type: jpg 1.jpg (41.5 KB, 30 views)
Attached Files
File Type: txt blockMeshDict.txt (1.4 KB, 1 views)
File Type: txt snappyHexMeshDict.txt (9.2 KB, 11 views)

Last edited by SnyderFoam; January 14, 2022 at 05:42. Reason: did not mean to publish
SnyderFoam is offline   Reply With Quote

Old   January 17, 2022, 04:28
Default
  #2
Senior Member
 
M
Join Date: Dec 2017
Posts: 642
Rep Power: 12
AtoHM is on a distinguished road
Welcome!
I suggest to write .log files and look through these, when something looks suspicious. We could also help interpret errors.
snappyHexMesh &> snappyHexMesh.log

At first glance, you are having several references to geometry motorBike, but it is not defined in the geometry subdictionary. I assume this kills the run at some point.
There is no other surface refinement defined in refinementSurfaces, therefore it appears like your file is ignored.



To get a better view of the mesh, deactivate "decompose polyhedra" at the openfoam node in Paraview and deactivate the "triangulate the slice" option on slices. Crinkle option can also be used for slices and clips to avoid cutting cells.
SnyderFoam likes this.
AtoHM is offline   Reply With Quote

Old   January 17, 2022, 11:41
Default
  #3
New Member
 
Join Date: Jan 2022
Location: USA
Posts: 8
Rep Power: 4
SnyderFoam is on a distinguished road
Thanks for the reply, this was helpful. I diff'ed the original snappyhexmesh and compared it to my own. I found that I accidentally reduced the max globa/local cells by an order of magnitude. After adjusting this, I got better results.....but still not good.


As far as your advice with instances of motorBike, these were just patch names. I had already edited the .emesh and .stl lines to point to the proper file. For clarity, I did however fix the patch names to reference the "heaterBlock"



Attached is some log files in case that helps diagnose why the mesh is so poor.
Attached Images
File Type: jpg Screenshot from 2022-01-17 11-32-28.jpg (169.8 KB, 16 views)
File Type: jpg Screenshot from 2022-01-17 11-32-45.jpg (176.0 KB, 18 views)
Attached Files
File Type: txt snappy.txt (46.2 KB, 5 views)
File Type: txt blockMesh.txt (2.0 KB, 1 views)
File Type: txt furfaceFeatures.txt (2.3 KB, 4 views)
SnyderFoam is offline   Reply With Quote

Old   January 17, 2022, 11:55
Default
  #4
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,074
Rep Power: 26
Yann will become famous soon enough
Hi,

Have a look at your snappy log: the warnings show some things are wrong with your snappyHexMeshDict. You need to fix it in order to get back on track.

Code:
Reading refinement surfaces.
--> FOAM Warning : 
    From function Foam::refinementSurfaces::refinementSurfaces(const Foam::searchableSurfaces&, const Foam::dictionary&, Foam::label)
    in file refinementSurfaces/refinementSurfaces.C at line 215
    Reading "/home/fizics/OpenFOAM/run/heaterBlock/system/snappyHexMeshDict/castellatedMeshControls/refinementSurfaces" from line 115 to line 121
    Not all entries in refinementSurfaces dictionary were used. The following entries were not used : 1(heaterBlock)
Read refinement surfaces in = 0.06 s
You specified refinement surface parameters on "heaterBlock" but snappyHexMesh warns you it didn't find any entities matching this name. Something must be wrong in your geometry section.

Code:
Layer thickness specified as final layer and expansion ratio.
--> FOAM Warning : 
    From function Foam::labelHashSet Foam::polyBoundaryMesh::patchSet(const Foam::UList<Foam::wordRe>&, bool, bool) const
    in file meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C at line 804
    Cannot find any patch or group names matching "(heaterBlock).*"
--> FOAM Warning : 
    From function Foam::layerParameters::layerParameters(const Foam::dictionary&, const Foam::polyBoundaryMesh&)
    in file snappyHexMeshDriver/layerParameters/layerParameters.C at line 279
    Reading "/home/fizics/OpenFOAM/run/heaterBlock/system/snappyHexMeshDict/addLayersControls/layers" from line 222 to line 222
    Layer specification for "(heaterBlock).*" does not match any patch.
Valid patches are 
5
(
frontAndBack
inlet
outlet
lowerWall
upperWall
)
Same here for layer addition: there is nothing named "heaterBlock" and the only available patches are the one coming from your blockMesh. Again, this shows you have something wrong in your geometry section.

Try to fix it and post your snappyHexMeshDict and snappy log here if you struggle to find what is wrong.
SnyderFoam likes this.
Yann is online now   Reply With Quote

Old   January 17, 2022, 12:52
Default
  #5
New Member
 
Join Date: Jan 2022
Location: USA
Posts: 8
Rep Power: 4
SnyderFoam is on a distinguished road
I see....... after fixing these errors it seems I got my first successful mesh. It is still too rough to perform any simulations yet, but I am on the right track for sure!!


Most of the warning in the snappy log are now related to displacement errors it seems.
Attached Images
File Type: jpg Screenshot from 2022-01-17 12-48-31.jpg (178.0 KB, 25 views)
Attached Files
File Type: txt snappyHexMesh.txt (181.9 KB, 6 views)
SnyderFoam is offline   Reply With Quote

Old   January 18, 2022, 11:33
Default Thanks for the help all
  #6
New Member
 
Join Date: Jan 2022
Location: USA
Posts: 8
Rep Power: 4
SnyderFoam is on a distinguished road
Now learning how to incorporate a thermal study. Thanks for the input everyone!
Attached Images
File Type: jpg photo_2022-01-18_10-30-23 (2).jpg (81.3 KB, 30 views)
File Type: jpg photo_2022-01-18_10-30-23.jpg (81.7 KB, 23 views)
rmaries, Yann and AtoHM like this.
SnyderFoam is offline   Reply With Quote

Reply


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
[OpenFOAM.com] Installing on Ubuntu 18.04 samiam1000 OpenFOAM Installation 11 April 27, 2020 00:01
[OpenFOAM.com] Issue configuring ./makeParaView - Ubuntu 16.04 bjdarrer OpenFOAM Installation 2 April 20, 2020 13:50
Short shot simulation problems in die casting simulation correlation with test yanhua.li FLOW-3D 12 August 3, 2016 02:21
OF 1.6 | Ubuntu 9.10 (64bit) | GLIBCXX_3.4.11 not found piprus OpenFOAM Installation 22 February 25, 2010 13:43
test cases Maciej Matyka Main CFD Forum 3 November 24, 2004 08:27


All times are GMT -4. The time now is 11:42.