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

[snappyHexMesh] Treating non connecting geometries as one region

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By Yann
  • 1 Post By Clau.77

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 27, 2021, 08:10
Default Treating non connecting geometries as one region
  #1
Member
 
Claudia
Join Date: Mar 2021
Posts: 43
Rep Power: 5
Clau.77 is on a distinguished road
Hello!


As you can see in the attachted foto, i have a tray filled with chocolate bars, that I want to mesh with snappyHexMesh and then use chtMultiRegionFoam. So in the end I want to have three regions: the tray, the chocolate and the air. The problem is, that the chocolate bars are not connected, so I don't know how to get them to be in one region.

I tried putting all the chocolate bars into one stl file but I understand know that snappyHexMesh can't deal with that.



So should I put all the bars in seperate stl files? How can I combine them into one Region then? Or is there a smarter way to do that?


I have been struggeling with this for over a week, I would really appreciate your help!
Attached Images
File Type: png Form_Ausschnitt.png (8.7 KB, 9 views)
Clau.77 is offline   Reply With Quote

Old   April 27, 2021, 08:59
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Hi Claudia,



What OpenFOAM version are you using and what is your current workflow to mesh this case?


Yann
Yann is offline   Reply With Quote

Old   April 27, 2021, 09:05
Default
  #3
Member
 
Claudia
Join Date: Mar 2021
Posts: 43
Rep Power: 5
Clau.77 is on a distinguished road
Hey,


I am using version 8. I created the geometry in inventor and exported the geometries as one step file to Salome. There I created a partition and exploded the partition again. After that I exported the stl files (tray.stl, chocolate.stl,...) to OF. Then:
- blockMesh
- surfaceFeatures
- snappyHexMesh
- splitMeshRegions
Clau.77 is offline   Reply With Quote

Old   April 27, 2021, 09:36
Default
  #4
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
I did not try this in OpenFOAM-8, however I think it's worth trying:
  • Define a cellZone for each region you need in your case in snappyHexMeshDict (tray, chocolate and air)
  • Use splitMeshRegion with the -cellZonesOnly option
The trick lies in the splitMeshRegion option. As long as every chocolate bars belongs to the same cellZone, it should end up in the same region.

Let us know if it works for you.
Yann
Yann is offline   Reply With Quote

Old   April 27, 2021, 11:39
Default
  #5
Member
 
Claudia
Join Date: Mar 2021
Posts: 43
Rep Power: 5
Clau.77 is on a distinguished road
Thank you Yann!


Do I need to use topoSet to create the cellZones or is there a way to do it wothout topoSet?
Clau.77 is offline   Reply With Quote

Old   April 27, 2021, 12:06
Default
  #6
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
You can either use topoSet, or define it directly in snappyHexMeshDict in the refinementSurface section:

Code:
refinementSurfaces
{
    sphere
    {
        level (2 2);
        
        cellZone sphere;
        cellZoneInside inside;  // outside/insidePoint
    }
}

You can check some chtMultiRegionFoam tutorials such as "heatedDuct" to have a functional case using a similar syntax.

Hope this helps,
Yann
AtoHM likes this.
Yann is offline   Reply With Quote

Old   April 30, 2021, 09:25
Default
  #7
Member
 
Claudia
Join Date: Mar 2021
Posts: 43
Rep Power: 5
Clau.77 is on a distinguished road
I finally did it! My problem was that i tried to define the air as cellZone in snappyHexMesh too, but its easier to define the air in the blockMesh and the rest in snappyHexMesh.


Thank you for your help!
Yann likes this.
Clau.77 is offline   Reply With Quote

Reply

Tags
chtmultiregionfoam, multiregion, snappyhexmesh


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
Can I use fvOptions to couple a solid region and a fluid region? titanchao OpenFOAM Running, Solving & CFD 4 January 14, 2022 08:55
Maximum number of iterations exceeded chtmultiregionsimpleFoam Moncef OpenFOAM Running, Solving & CFD 28 July 13, 2020 15:26
p_rgh initial residual no change with different settings manuc OpenFOAM Running, Solving & CFD 3 June 26, 2018 16:53
chtMultiRegionFoam- too slow sandymech1 OpenFOAM Running, Solving & CFD 4 November 20, 2017 19:51
HeatSource BC to the whole region in chtMultiRegionHeater xsa OpenFOAM Running, Solving & CFD 3 November 7, 2016 06:07


All times are GMT -4. The time now is 13:58.