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/)
-   -   Geometry preparation, snappyhexmesh, OpenFOAM (https://www.cfd-online.com/Forums/openfoam-pre-processing/227811-geometry-preparation-snappyhexmesh-openfoam.html)

nikhil108 June 10, 2020 18:02

Geometry preparation, snappyhexmesh, OpenFOAM
 
1 Attachment(s)
I have a leak source in a box, which has an outlet. From the leak source a gas releases and mixes with the air inside the box first, then it comes out into the atmosphere outside through an outlet from the box and gets influenced by parameters like turbulence.
So, here I want to consider the flow domain inside the box and also the flow domain outside the box. When I use snappy hex it removes one of the regions when I use the seeding point feature with it, then I am unable to define patches for the box. I tried setSet and toposet, with that I am able to extract the fluid domains of both inside and outside of the box, but I am unable to select and define box walls as walls and a part of the box as an outlet. So, I thought to break the case into 2 parts namely
1. Leak inside the box
2. Leak coming from box to outside environment. Solve the fluxes individually and couple them (output from 1st case acts as input to 2nd case).
Is there any other way to do this, I think I am just complicating the case?
Please have a look at the figure. Any kind of help would be appreciated. Thank you.

Rango June 23, 2020 09:11

1 Attachment(s)
Hi,

If I understand your question correctly, you want to perform a multi-region simulation on two regions, "leakSource" and "airBox", coupled through one single patch, "leakOutlet".

Regarding the mesh generation step, you should,

1) use sHM to create cellZones.
Code:

snappyHexMesh -overwrite
2) remove unwanted domains created by sHM:
Code:

cellSet computationalDomain new zoneToCell airBox
cellSet computationalDomain add zoneToCell leakSource
cellSet computationalDomain subset
subsetMesh -overwrite computationalDomain

3) split the mesh:
Code:

splitMeshRegions -cellZones -overwrite
This results in two different mesh regions, "airBox" and "leakSource", with one single patch coupling them, e.g. "leakSource_to_airBox" and "airBox_to_leakSource".

4) use a combination of topoSet and createPatch for each mesh region separatly to create your desired patches.

The following link shares a test case, not exactly but similar to the image that you have posted, which demonstrates these steps in action (please note that I have used OpenFoam-5.x to create and run the case):

patchMultiRegion_case

All the steps can be found in "run" bash script. Dictionaries for topoSet and createPatch are stored in separate folders in "system/topoSet" and "system/createPatch".

Please let me know if you have any questions/comments! :)

Cheers

me3840 June 23, 2020 13:10

No, you can if you so desire run snappy in multi-region mode, which will give both volumes simultaneously. However, IMO, this is quite limited as you cannot use layer generation in this mode.


Personally for multi-region models I prefer the method you propose, but instead of using two cases still use two regions that you just mesh independently. Then couple the boundary with a cyclicAMI patch.

nikhil108 June 25, 2020 10:14

create Baffle with stl
 
Hallo Rango,

Thaks for your detailed explanation. But, i did the samething using setSet. When i use splitMesh, it splits all my boundary conditions too (ofcourse), which i don't want. Because the properties of the regions are same. So i only need to find a way to create a wall with the stl (small box_inside_stl), so that the gas which leaks inside, only comes from the outlet of inside stl.
So, i created a empty box (empty inside, contains only shape of wall), and used seeding option in snappyhex, which left me with the regions i want. To make it further simpler, as the thickness of the walls is not concerned, i am created a baffle with the inside_stl file i have, and defined it as wall. After that i used toposet (nearestPointToCell) and gave a leak_source. Everything works fine now. Thanks for the help (@Rango, @me3840)


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