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/)
-   -   [mesh manipulation] Naming cellzones before splitting (https://www.cfd-online.com/Forums/openfoam-meshing/237540-naming-cellzones-before-splitting.html)

HorstvanGrass July 22, 2021 12:08

Naming cellzones before splitting
 
1 Attachment(s)
Hi,
I have a multiRegion case with 3 different region (region0, Fluid and region 1) as simplified in the attached image. I'm using snappyhexmesh for snapping a STL geometry. For my mesh study the region 0 and region 1 are randomly switching which is pretty anoying to adapt the boundary condition before each run.


I would like to precisely rename the undefined regions in outer cell region and inner one before splitting with splitMeshRegion -cellZones . I tried with locationsInMesh command but it conflicts resulting in new nonsense domains.



Thx in advance

Yann July 23, 2021 03:50

Hi,


I usually use locationsInMesh to define cellZones in multi region cases. How do you define it and what issues are you having with it?


Yann

HorstvanGrass July 23, 2021 04:06

This is the righ way
 
After some try and error, I found that a refinement definition cause problems when using locationsInMesh.
I removed the highlighted part and now its not conflicting.



refinementSurfaces
{
Fluid
{

level (0 0);
faceZone Fluid;
cellZone Fluid;
cellZoneInside inside;

}

Yann July 23, 2021 05:28

OK I understand. In your code, you are defining a cellZone in refinementSurfaces.

Code:

refinementSurfaces
{
    Fluid
    {
        level (0 0);
        faceZone Fluid;
        cellZone Fluid;
        cellZoneInside inside;
    }
}

But the locationsInMesh function is also used to define a cellZone:

Code:

locationsInMesh
(
    (( 0.005 0.005  0.005) Fluid)
    (( 0.05  0.005  0.005) Solid1)
    ((-0.05  0.005  0.005) Solid2)
);


I guess you cannot use both mechanisms at the same time. You have to choose if you want to define your cellZones in refinementSurfaces or with locationsInMesh.

Yann


PS: just a clarification for people reading this thread: locationsInMesh is only available in the ESI-OpenCFD branch (openfoam.com). In the foundation branch (openfoam.org) you have to define your cellZones in refinementSurfaces.

HorstvanGrass July 23, 2021 06:44

Thanks for the explanation. Helped me a lot!

HorstvanGrass July 23, 2021 11:40

1 Attachment(s)
Hey Yann,
locationsInMesh is however creating a hole in my Mesh, as you can see in the center of the image for my coarse mesh. This does not occur when defining with refinementSurfaces. Is there a way to fix the hole or to define explicitly the unnamed region with therefinementSurfaces as with locationsInMesh?


Thx in advance


Attachment 85549

Yann July 23, 2021 12:21

I'm not aware of a way to fix it except by playing around with the refinement levels (this is very coarse!) and maybe some snapping parameters.


Maybe someone else will have an idea?


Yann

HorstvanGrass July 23, 2021 17:40

I managed it to solve the naming of the region by roughly attributing cellzone with toposet for region 1 and 2 naming them solid 1 and 2. Then execute sHM which substract the dupllcated cells in the cellzone and adding them to Fluid. Then there three distinct named region.


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