CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [snappyHexMesh] Obtaining two regions from background mesh (https://www.cfd-online.com/Forums/openfoam-meshing/177685-obtaining-two-regions-background-mesh.html)

cfdsolver1 September 19, 2016 02:39

Obtaining two regions from background mesh
 
Hello everyone. I am working on a complex geometry so I need to use STL file to generate mesh. What I am doing is, I create a bounding box using blockMesh. Then, I run snappyHexMesh to obtain background mesh and this creates new boundary for me. Using this boundary, I need to split STL file as solid region and the rest of the mesh as fluid region. I run setSet to create zone from boundary:

Code:

setSet
faceSet f0 new patchToFace myWall
cellSet c0 new faceToCell f0 any
cellZoneSet c0 new setToCellZone c0

Using this cell zone, I want to split my mesh into 2 regions. If I run
Code:

splitMeshRegions -cellZones
command, I get thousands of domains (because of porous structure). If I use cellZonesOnly option of splitMeshRegions, I get an error:

Code:

For the cellZonesOnly option all cells have to be in a cellZone.
I just need to have 2 regions. The cells in the regions are not required to be connected to each other. One of other post here suggests using topoSet but I am lost while using it. Can you help me to split my domain0 into two regions? This is the domain I am working on:

http://i.imgur.com/D7YJa7v.jpg

Thank you so much.

RobertoCirolini September 21, 2016 16:30

Hi,
If I understood what you want to do, I would suggest you play around with sHM. Therefore you can split your regions. I do believe topoSet would put you into trouble and make you waste a lot of time.

I think this thread is about what you want.

http://www.cfd-online.com/Forums/ope...ous-media.html

Regards,
Roberto

cfdsolver1 September 21, 2016 19:38

Dear Roberto,

Thank you so much for your reply. I am able to obtain a mesh using sHM like the post you posted but my problem is, If I use sHM I get the solid region as a boundary. However, I want to name my STL file as cellZone; not as boundary. Is this possible with sHM?

Antimony September 23, 2016 11:18

Hi,

Have you tried the option "cellZoneInside inside;" and the associated ones as stated in slide 31 here: http://openfoamwiki.net/images/f/f0/...SlidesOFW7.pdf

Does it do what you want?

Cheers,
Antimony

cfdsolver1 September 26, 2016 12:53

Hello again, thanks for the tips. I guess I was able to split mesh into two regions but I am not sure if I did it correctly or not. I used
Quote:

setSet
and starting from boundary, I created a cell zone and inverted it and obtained second zone. Then I applied
Quote:

splitMeshRegions -cellZonesOnly
and created two zones and I was able to run chtMultiRegionSimpleFoam but I have a problem.

If I run chtMultiRegionSolver, the h equation at fluid region decreases and goes to minus values, which is of course wrong. If I solve solid region only, everything is okay. If I run only fluid region using chtMultiRegionSolver, it doesn't work again. So, what might be problem? Can you help me? If I use
Quote:

checkMesh -region fluid
I think everything looks okay. How can I ensure if the problem is boundary conditions or model, or mesh?


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