CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

Merge multiple regions to use simpleFoam

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

Like Tree2Likes
  • 1 Post By wyldckat
  • 1 Post By KateEisenhower

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 31, 2014, 05:01
Default Merge multiple regions to use simpleFoam
  #1
New Member
 
Join Date: May 2013
Posts: 23
Rep Power: 13
arnaud6 is on a distinguished road
Hello all,

I would like an advice to execute a mesh operation on openfoam. I am working only with fluid regions and want to execute simpleFoam solver.

I have got a mesher which can directly export to openfoam .

But instead of exporting only one mesh with the different regions stored into the "cellZones" file (which is what I want), it exports one mesh for each region, and without creating a "cellZones" file

So, do you know a quick workaround to perform this operation ?
What can work I think is
*Add a minor mesh to the master mesh using mergeMeshes
*Use a topoSetDict file to write the different cellZones
What do you think about it ?

It may work but it will be very painful and time consuming as I have more than 15 regions to merge !! Is there a quicker way ?

In fact if I think about it, what I want to do is the exact inverse operation of splitMeshRegions ! Or maybe I should use chtMultiRegionSimpleFoam ? I have never used it ... Is it as fast as using the simpleFoam solver?
arnaud6 is offline   Reply With Quote

Old   December 31, 2014, 09:23
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Arnaud6,

I see that this issue is somewhat related to this thread: http://www.cfd-online.com/Forums/ope...-boundary.html

Let me start in reverse order:
  1. chtMultiRegionSimpleFoam was designed for Conjugate Heat Transfer and therefore is mainly meant for heat transfer between non-mixing regions, i.e. heat exchanges between solids and fluids.
  2. The way I see it, if the mesh regions are 100% perfectly compatible meshes, i.e. they can be easily be stitched together without having to cut cells, then you could perhaps simply merge the meshes and then use cyclic patches to connect the patches between each ex-region.
  3. With so many regions, scripting is likely the way to go with this. I know I made a post somewhere about how to delete unwanted regions... which should help a bit with this... ah, OK, the way to find it:Mmm... then again... perhaps it's not exactly what you're looking for?
  4. Why does your original mesh have multiple regions? Why not simply merge them before exporting to the file that is later converted to OpenFOAM?
Best regards,
Bruno
granzer likes this.
wyldckat is offline   Reply With Quote

Old   December 31, 2014, 12:48
Unhappy
  #3
New Member
 
Join Date: May 2013
Posts: 23
Rep Power: 13
arnaud6 is on a distinguished road
Hi Wyldckat

Thanks for being everywhere on the forum and giving great advice !

So, from what you are saying, I will stick to using mergeMeshes to build a master mesh then running simpleFoam. In fact I have just seen that I can run

mergeMeshes <masterCase> <addCase> -addRegion region1 -addRegion region 2 ....

And specifying all the regions to merge in one command. So that I need to run the utility only once !

And after, as I need the cellZones to apply on them different treatment on the fvOptions file (I need an MRF cellZone), I will use the setSet I think.
Do you know if from an inside point of a region, I can select select all the cells of the region ? That would do the trick !

For your last question, unfortunately, I have almost no control on the mesher . And it is only exporting the multi region to multiple meshes instead of exporting only one mesh with multiple cellZones !

I will try with the scripting and let you know !
arnaud6 is offline   Reply With Quote

Old   December 31, 2014, 13:04
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by arnaud6 View Post
Do you know if from an inside point of a region, I can select select all the cells of the region ? That would do the trick !
I'm not sure it will work as you want it to work, but you can use setSet to create a new empty cellSet and then invert that set, which will select all cells (invert "nothing" to "everything" ). Then you can convert that set to a zone (cellSet -> cellSetZone), all from using:
Code:
setSet -region region_name
so... you'll need at least for the zones with MRF.

Problem is that when the merging process is used, I don't know if the cellSetZone will be translated accordingly, or not, to the new cell ID in the new merged mesh.
wyldckat is offline   Reply With Quote

Old   January 6, 2015, 12:27
Default
  #5
New Member
 
Join Date: May 2013
Posts: 23
Rep Power: 13
arnaud6 is on a distinguished road
Well it's strange, I have made some tests with mergeMeshes and openfoam complained about an imaginary missing boundary.

Sorry Wyldckat, I have abandonned this way of working for the moment and I am concentrating on playing in a different way.

I ll let you know when I come back to this issue.
arnaud6 is offline   Reply With Quote

Old   June 23, 2015, 11:29
Default
  #6
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
I'm not sure it will work as you want it to work, but you can use setSet to create a new empty cellSet and then invert that set, which will select all cells (invert "nothing" to "everything" ). Then you can convert that set to a zone (cellSet -> cellSetZone), all from using:
Code:
setSet -region region_name
so... you'll need at least for the zones with MRF.

Problem is that when the merging process is used, I don't know if the cellSetZone will be translated accordingly, or not, to the new cell ID in the new merged mesh.
Hello Bruno,

how do you invert a set in OpenFoam?

Thanks for your help,

Kate
KateEisenhower is offline   Reply With Quote

Old   June 24, 2015, 03:48
Default
  #7
Senior Member
 
Join Date: Mar 2015
Posts: 250
Rep Power: 12
KateEisenhower is on a distinguished road
Hello,

I got the answer from the openfoamwiki:

Code:
setSet
Command>cellSet younameit invert
Command>quit
Thanks anyway,

Kate
wyldckat likes this.
KateEisenhower is offline   Reply With Quote

Reply

Tags
cellzones, chtmultiregionsimplefoam, mergemeshes, splitmeshregions

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
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 07:09
[snappyHexMesh] multiple regions Tobi OpenFOAM Meshing & Mesh Conversion 56 March 29, 2020 05:53
[snappyHexMesh] Using snappyHexMesh for multiple enclosed regions richard_vega OpenFOAM Meshing & Mesh Conversion 0 November 13, 2014 15:28
blockCoupled solver for multiple regions benk OpenFOAM 2 February 13, 2014 23:35
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 13:21


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