CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   multiple cellSets in a region (https://www.cfd-online.com/Forums/openfoam-pre-processing/87812-multiple-cellsets-region.html)

mabinty April 29, 2011 11:16

multiple cellSets in a region
 
Dear all!

Does anybody have experience with creating multiple cellSets/cellZones in a specific region which is produced by "splitMeshRegions"?

I have three cellSets: setA, setB and setC, and I d like to put them into two regions as follows: region0 = setA, region1 = setB+setC in order to be able to access setB and setC explicitly in region1.

Currently I study/play with the "splitMeshRegions -cellZonesFileOnly <zoneFile>" utility but for now I ve no idea how the <zoneFile> has to look like!

Appreciate your comments!

Cheers,
Aram

zhoubinwx May 10, 2011 08:45

Hi Aram,

I am also playing with this problem these days. I would like to suggest you to investigate the test case entitled "chtMultiRegionFoam" first. After that when you have some questions, you can post it online.

Good luck.

Bin

zhoubinwx May 11, 2011 04:35

Hi Aram and OF friends,

I want to simulate 4 circles in a rectangle. I need to define 4 circles as "cylinder" while the rest of the domain "water".

After studying the test case of multiRegionHeater, I set up mine.

1) After the command "setSet -batch makeCellSets.setSet", I could see from log.setSet, everything goes on well; At this stage, 4 circles are included as "cylinder" while the rest of the domain "water".

2) After the comment "setsToZones -noFlipMap", I get:
------------------------------------------
Create polyMesh for time = 0
Searched : "constant/polyMesh/sets"
Found :
2
(
cylinder
water
)
Overwriting contents of existing cellZone 1 with that of set water.
Overwriting contents of existing cellZone 2 with that of set cylinder.
Writing mesh.
------------------------------------------

3) However, when I launch the command "splitMeshRegions -cellZones -overwrite", I find that 4 circles are no longer together. The "cylinder" now is only one of the circles:
------------------------------------------
Region Zone Name
------------------------------------------
0 1 water
1 -1 domain1
2 -1 domain2
3 2 cylinder
4 -1 domain4
------------------------------------------
The number of regions is 5 instead of 2 (cylinder and water).

Do any one have any opinion about this problem? Thank you.

Bin

mabinty May 11, 2011 07:32

hi bin,

as far as i experienced splitMeshRegion creates regions called "domain<n>" when something went wrong in the previous steps of setting up the cellSets and setsToZones. hence, I d suggest you to check the log-files of cellSets and setsToZones if any error messages were outputted. be aware of the fact that the flag "-cellZones" does not allow disconnected domains in a single region. if you want to have that use "-cellZonesOnly" (see utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C).

hope that helps!

cheers,
aram

mabinty May 11, 2011 07:51

2 Attachment(s)
dear all,

i continued playing around with the cellSets in different regions. after establishing the region air i created a cellSet "heatSource" stored in constant/polyMesh/sets. i then moved it to constant/air/polyMesh/sets and the command "set(heatSource)" used in the code of region air can find and access the cellSet. the problem now is that due to different cell addressing the region air the cellSet constant/air/polyMesh/sets/heatSource is not put at the intended location (see attached pics: cellSet at constant/polyMesh/sets = heatSource.png, cellSet at constant/air/polyMesh/sets = heatSourceAir.png). So I m looking for a way to translate the cellSet in constant/polyMesh/sets to constant/air/polyMesh/sets. i ll keep on digging.

appreciate your comments!
aram

mabinty May 12, 2011 06:18

1 Attachment(s)
Dear all!

finally I could solve the problem. one should better read the output of "-help". I simply had to add the flag "-region <regionName>" to the setSet utility, e.g.:

Code:

setSet -batch makeCellSets.heatSource -region air
where makeCellSets.heatSource defines the location of the cellSet heatSource. Voila and the correct cellSet heatSource is produced and stored in constant/air/polyMesh/sets :) also see attached pic. In case one wants to make a cellZone out of the cellSet, use

Code:

setsToZones -region air
and the zone "heatSource" is added to constant/air/polyMesh/cellZones.

Cheers,
Aram

zhoubinwx May 12, 2011 21:02

Hi Aram,

Sorry for my delayed reply. Today I saw your post and try again. it works with "-cellZonesOnly"!

Thank you very much.

Bin

Quote:

Originally Posted by mabinty (Post 307173)
hi bin,

as far as i experienced splitMeshRegion creates regions called "domain<n>" when something went wrong in the previous steps of setting up the cellSets and setsToZones. hence, I d suggest you to check the log-files of cellSets and setsToZones if any error messages were outputted. be aware of the fact that the flag "-cellZones" does not allow disconnected domains in a single region. if you want to have that use "-cellZonesOnly" (see utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C).

hope that helps!

cheers,
aram


calim_cfd August 11, 2011 10:45

Quote:

Originally Posted by mabinty (Post 307325)
Dear all!

finally I could solve the problem. one should better read the output of "-help". I simply had to add the flag "-region <regionName>" to the setSet utility, e.g.:

Code:

setSet -batch makeCellSets.heatSource -region air
where makeCellSets.heatSource defines the location of the cellSet heatSource. Voila and the correct cellSet heatSource is produced and stored in constant/air/polyMesh/sets :) also see attached pic. In case one wants to make a cellZone out of the cellSet, use

Code:

setsToZones -region air
and the zone "heatSource" is added to constant/air/polyMesh/cellZones.

Cheers,
Aram

wow!

i find these findings particularly intererting to me!

thx for sharing:D

miles_davis September 19, 2011 10:01

Hi guys,

I have the same problem: i want to split a mesh and then set some initial conditions.

I am simulating a two phase flow and I have defined two cell zones, one for the air on for the water.
I have used splitMeshRegions to get those two regions.
Therefore, now in the last temporary file (in wich the mesh was slitted into two zones) I have two folders one for each cell regions.
I have* for instance for vol fraction alpha:
- case_folder/0.0005/zone1/alpha
- case_folder/0.0005/zone2/alpha
I have no file in the directory case_folder/0.0005.
That sounded quite consistent to me.
So I have defined all the BC in each zone folder (e.g. case_folder/0.0005/zone1 and case_folder/0.0005/zone2).
Thought this would be enough but when I launch the simulation, OF says that he cannot find the initial condition file in the folder case_folder/0.0005.:confused:

--> FOAM FATAL IO ERROR:
cannot find file

file: /media/DATA/CFD/OpenFOAM/sydney-2.0.1/run/copy-bubbleColumn-cas-test-tri-2D-V2-degazage/0.0005/Ua at line 0.

From function regIOobject::readStream()
in file db/regIOobject/regIOobjectRead.C at line 73.

FOAM exiting


Why does it need for? Everything is defined in the folder of each zone??

So my question is: After you managed to devide your cases in many zones: how did you set initial values on them.


Thaks for your help.

calim_cfd September 19, 2011 17:16

hello miles!

**************************
cannot find file

file: /media/DATA/CFD/OpenFOAM/sydney-2.0.1/run/copy-bubbleColumn-cas-test-tri-2D-V2-degazage/0.0005/Ua at line 0
*************************

this kinda of error usually happens when u split ur case to parallel processing and u dont have the folder indicated in your controlDict file. There, as u know, is the timestep when ur analysis will start, so u need to make sure u have the correspondent time folder (0 or 0.0005, as pointed by controlDict) b4 splitting anything through either utility.

also.. check the damBreak case $FOAM-2.0.0/tutorials/multiphase/interFoam/ras/damBreak (i dont recall the path atm but its sth like this)

try using the tool setFields instead

idk if it helps anything but gl!

miles_davis September 20, 2011 02:57

Thanks a lot
I'll check and let you know.


regards

mm.abdollahzadeh April 3, 2012 09:53

Dear All.

Is it possible to spilt the zones in way that i have two interface between the region1 and region2?
I am transorming the fluent mesh and the spliting in to zones. i have a cube in the flow stream. one of the edges of my cube is insulated and the others are conductive.

Best
Mehdi

calim_cfd April 3, 2012 10:05

Quote:

Originally Posted by mm.abdollahzadeh (Post 352910)
Dear All.

Is it possible to spilt the zones in way that i have two interface between the region1 and region2?
I am transorming the fluent mesh and the spliting in to zones. i have a cube in the flow stream. one of the edges of my cube is insulated and the others are conductive.

Best
Mehdi

hi!
check the following tutorials

/tutorials/incompressible/pimpleFoam/TJunctionFan/
/tutorials/incompressible/pimpleDyMFoam/propeller/
/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/

they deal with the app: createBaffles, topoSet and more stuff on BC mapping. Maybe you'll have to create a set or even a patch from your current interface patches and go from there.

hope it helps :D

mm.abdollahzadeh April 3, 2012 10:37

Quote:

Originally Posted by calim_cfd (Post 352918)
hi!
check the following tutorials

/tutorials/incompressible/pimpleFoam/TJunctionFan/
/tutorials/incompressible/pimpleDyMFoam/propeller/
/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/

they deal with the app: createBaffles, topoSet and more stuff on BC mapping. Maybe you'll have to create a set or even a patch from your current interface patches and go from there.

hope it helps :D


Many thanks for your kind reply.

I will certainly look at these application.
but however i have seen a option for splitMeshFaces "-useFaceZones"
it is to use faceZones to patch inter- region faces instead of single patch.
when i am transforming the msh file from fluent to openfoam it recognize the diffrent boundry condition at interface and even setsToZones command is adding thoese interfaces to faceZone. but when i used "-useFaceZones" nothing happend!!!:(

Best
Mehdi

calim_cfd April 3, 2012 10:59

Quote:

Originally Posted by mm.abdollahzadeh (Post 352933)
Many thanks for your kind reply.

I will certainly look at these application.
but however i have seen a option for splitMeshFaces "-useFaceZones"
it is to use faceZones to patch inter- region faces instead of single patch.
when i am transforming the msh file from fluent to openfoam it recognize the diffrent boundry condition at interface and even setsToZones command is adding thoese interfaces to faceZone. but when i used "-useFaceZones" nothing happend!!!:(

Best
Mehdi

i'm sorry but i don't have much time to help because i myself have only glanced at these options on a few cases so i dont have much xp. But i can tell you to remove all interface patches b4 exporting the case. Then in OF you create sets/patches using the option based on solid zones. I guess you have diferent solid domains, but even if the fluid/solid is the same split anyways so that you can use OF's options easier

sry i cant be of more help.. maybe some1 with more xp can add a comment l8r gl :)


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