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

Merge multiple regions to use simpleFoam

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

Like Tree1Likes
  • 1 Post By KateEisenhower

Reply
 
LinkBack Thread Tools Display Modes
Old   December 31, 2014, 05:01
Default Merge multiple regions to use simpleFoam
  #1
New Member
 
Join Date: May 2013
Posts: 22
Rep Power: 4
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
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,258
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Arnaud6,

I see that this issue is somewhat related to this thread: Merge boundaries with same name into one single boundary

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
wyldckat is offline   Reply With Quote

Old   December 31, 2014, 12:48
Unhappy
  #3
New Member
 
Join Date: May 2013
Posts: 22
Rep Power: 4
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
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,258
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
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: 22
Rep Power: 4
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, 10:29
Default
  #6
Member
 
Join Date: Mar 2015
Posts: 86
Rep Power: 2
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, 02:48
Default
  #7
Member
 
Join Date: Mar 2015
Posts: 86
Rep Power: 2
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
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using snappyHexMesh for multiple enclosed regions richard_vega OpenFOAM Native Meshers: snappyHexMesh and Others 0 November 13, 2014 15:28
multiple regions Tobi OpenFOAM Native Meshers: snappyHexMesh and Others 47 September 9, 2014 09:36
blockCoupled solver for multiple regions benk OpenFOAM 2 February 13, 2014 23:35
how to set periodic boundary conditions Ganesh FLUENT 13 January 22, 2014 05:11
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 12:21


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