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

[snappyHexMesh] snappyHexMesh for chtMultiRegionFoam

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By simrego

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 29, 2019, 06:20
Default snappyHexMesh for chtMultiRegionFoam
  #1
New Member
 
Thomas Heßling
Join Date: Mar 2019
Posts: 4
Rep Power: 7
thessling is on a distinguished road
Hello,

I am trying to run some chtMultiRegionFoam simulations with heat transfer between an air flow in an insulated duct. To get familiar with the setup I started with a simple rectangular geometry but it will get more complicated, that's why I use snappyHexMesh.

The basic setup is taken from the heatedDuct tutorial case. My problem is that sometimes the temperature starts to diverge at certain mesh positions, so I guess I need a better mesh.

With the heatedDuct tutorial setup the mesh doesn't look to good, as you can see in the first image. It is asymmetric and the edges show some artefacts as well. When I try to add layers they are created in the solid domain, not the fluid as they are supposed to. The full case is attached.

When searching this forum and googling I found a comment that when meshing multi regions one should have a single STL file for every region. The tutorial case is set up differently with all external surfaces in a single file and the interfaces/baffles in a separate one.

When I try the one-stl-per-region setup I get a different problem. First, I noticed that I cannot have the coincident interface in both STL files, it will lead to errors in the faceZones. Removing it from one file fixes this but even then SHM removes all boundary faces in the end. They appear to be recognized correctly in the logs by I cannot get them to last. This case is also attached.


Since I couldn't solve this on my own with this forum and other documentation I'd like to ask some questions here:

What is the preferred/correct way to set up snappyHexMesh with multi region cases?

Why does SHM add the layers in the solid domain in my first example, can this be changed?

Why does SHM remove by boundaries in the second case? They are defined the same way as in the first case.

Are there any tips on how I can improve the mesh quality?

I am quite new to OpenFOAM and right now don't know how to proceed on these problems. Any help is appreciated!



Thanks a lot,
Thomas
Attached Images
File Type: jpg resultingMesh_try1.jpg (72.7 KB, 37 views)
File Type: jpg resultingMesh_try1_layers.jpg (89.3 KB, 35 views)
Attached Files
File Type: gz heatedTunnel_try1.tar.gz (110.0 KB, 5 views)
File Type: gz heatedTunnel_try2.tar.gz (110.0 KB, 4 views)
File Type: zip logfiles_snappyHexMesh.zip (32.7 KB, 4 views)
thessling is offline   Reply With Quote

Old   September 4, 2019, 04:09
Default
  #2
New Member
 
Thomas Heßling
Join Date: Mar 2019
Posts: 4
Rep Power: 7
thessling is on a distinguished road
I've managed to make some progress and create a mesh with correct layers. Maybe someone else finds this useful. I had to create one STL file with all external surfaces of the mesh and one for each baffle between solid and fluid region. I also need to set the default cellZone to fluid in blockMeshDict.

Getting the layers is a bit tricky, there's is an example available at https://holzmann-cfd.com. Initially you run SHM with only "castellatedMesh" and "snap" set to true. Then you run splitMeshRegions and manually copy the fluid region's polyMesh folder to constant/polyMesh. With this SHM is run again with only "addLayers" and the resulting polyMesh is copied back to constant/fluid/polyMesh. It's a bit cumbersome but works.

The simulation still diverges, though, but I suppose that's a different problem...

Last edited by Tobi; June 24, 2020 at 13:05.
thessling is offline   Reply With Quote

Old   September 4, 2019, 06:37
Default
  #3
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
Hi!


Using the snappyHexMesh from ESI group (v17xx, v18x0, v19xx), you are able to define locationsInMesh, so an inside point for every region. Thus you don't need that tricky stl generation. Also you can add layers on faceZone, for example on fluid_to_solid, but it is better (I think) if you decompose your case into regions as you did, and you can use the switch like snappyHexMesh -region "regionName", and it'll read the system/"regionName"/snappyHexMeshDict file. So you don't need that trick with the mesh copy... Also in parallel case it would be a nightmare what you did.
altinel likes this.
simrego is offline   Reply With Quote

Old   September 5, 2019, 09:09
Default
  #4
New Member
 
Thomas Heßling
Join Date: Mar 2019
Posts: 4
Rep Power: 7
thessling is on a distinguished road
Thank you for your suggestions! I wasn't aware that there are different SHM versions in the OpenFOAM distributions. I will try the ESI version, the -region option will make things a lot easier.
thessling is offline   Reply With Quote

Old   September 5, 2019, 09:16
Default
  #5
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
The -region is working in the foundation version too i think. But the locationsInMesh not.
simrego is offline   Reply With Quote

Old   September 5, 2019, 09:22
Default
  #6
New Member
 
Thomas Heßling
Join Date: Mar 2019
Posts: 4
Rep Power: 7
thessling is on a distinguished road
SHM from the latest OpenFOAM 7 release unfortunately does not recognize the -region option. Installation of OpenFOAM 1906 is already in progress ;-)
thessling is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[CAD formats] Creating waterproof STL using snappyHexMesh or salome Tobi OpenFOAM Meshing & Mesh Conversion 58 May 13, 2020 07:01
[snappyHexMesh] Running snappyHexMesh in parallel - optimizing peterhess OpenFOAM Meshing & Mesh Conversion 2 January 3, 2018 03:54
[snappyHexMesh] Tutorial crashes: snappyHexMesh floating point exception. jasv OpenFOAM Meshing & Mesh Conversion 4 May 10, 2016 03:55
Strange Results With snappyHexMesh calebamiles OpenFOAM Running, Solving & CFD 0 August 14, 2011 17:02
[snappyHexMesh] stitchMesh and snappyHexMesh gdbaldw OpenFOAM Meshing & Mesh Conversion 0 December 23, 2009 03:09


All times are GMT -4. The time now is 12:01.