CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[snappyHexMesh] Issues with Internal Solid Region and Patch Preservation in SHM in multiRegion mesh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 13, 2024, 17:18
Post Issues with Internal Solid Region and Patch Preservation in SHM in multiRegion mesh
  #1
New Member
 
Ali
Join Date: Mar 2024
Posts: 4
Rep Power: 2
aliFauze is on a distinguished road
Hello everyone,


I've been working with snappyHexMesh on a geometry that includes two regions: a solid region entirely within a fluid domain. I defined multiple patches for my geometry. The snappyHexMesh process retains the exterior patches, but after it finishes, I can't find the patches of the solid region which are supposed to be within the fluid. Instead, when I execute splitMeshRegions -cellZones, a new patch named "heater_to_room" is created that combines all the solid region's patches.
I tried to use the function surfaceToPatch but the patches are created just in the 0.001 file, and they are empty (nFaces 0 in the boundary file).


Can someone explain why the internal solid patches are not preserved as separate entities and how I might retain these internal solid patches within the fluid domain in the meshing process?
Any tips or suggestions would be greatly appreciated!


Thank you in advance!
Best Regards!
aliFauze is offline   Reply With Quote

Old   May 13, 2024, 17:24
Default
  #2
Senior Member
 
Will Kernkamp
Join Date: Jun 2014
Posts: 343
Rep Power: 12
wkernkamp is on a distinguished road
There is not enough information here. You should look in your Dict files for the name heater_to_room.
wkernkamp is offline   Reply With Quote

Old   May 13, 2024, 17:48
Default
  #3
New Member
 
Ali
Join Date: Mar 2024
Posts: 4
Rep Power: 2
aliFauze is on a distinguished road
Hello Will,
Thank you for your reply.
In my setup, the patch named "heater_to_room" is configured as follows in the mesh file:
heater_to_room
{
type mappedWall;
inGroups 1(wall);
nFaces 48002;
startFace 814235;
sampleMode nearestPatchFace;
sampleRegion room;
samplePatch room_to_heater;
}



My problem is that this patch combines all the faces, but in my original STL file and in my snappyHexMeshDict, I had separated the faces to apply different boundary conditions. How can I keep the original patch divisions?



PS: This is how I defined my patches in SHMDict

model.stl
{
type triSurfaceMesh;

regions
{
ceiling { name ceiling; }
floor { name floor; }
glass_doors { name glass_doors; }
insulated_walls { name insulated_walls; }
roof { name roof; }
back { name back; }
down { name down; }
front { name front; }
left { name left; }
right { name right; }
upper { name upper; }
}
}



and this are the patches in the output mesh file:
ceiling
{
type wall;
inGroups 1(wall);
nFaces 2668;
startFace 1578061;
}
floor
{
type wall;
inGroups 1(wall);
nFaces 5725;
startFace 1580729;
}
glass_doors
{
type wall;
inGroups 1(wall);
nFaces 828;
startFace 1586454;
}
insulated_walls
{
type wall;
inGroups 1(wall);
nFaces 26985;
startFace 1587282;
}
roof
{
type wall;
inGroups 1(wall);
nFaces 1768;
startFace 1614267;
}
room_to_heater
{
type mappedWall;
inGroups 1(wall);
nFaces 48002;
startFace 1616035;
sampleMode nearestPatchFace;
sampleRegion heater;
samplePatch heater_to_room;
}



Hopping it's clearer right now
aliFauze is offline   Reply With Quote

Old   May 14, 2024, 04:14
Default
  #4
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,096
Rep Power: 26
Yann will become famous soon enough
Hello Ali,

splitMeshRegions automatically creates interface patches when splitting the mesh. So I think if you want to avoid it you should look into splitMeshRegions options.

The option -useFaceZones looks like it could be helpful:

Quote:
-useFaceZones Use faceZones to patch inter-region faces instead of single patch
However I never used it so I'm not exactly sure how it works/behaves.
Yann is offline   Reply With Quote

Old   May 15, 2024, 16:13
Default
  #5
New Member
 
Ali
Join Date: Mar 2024
Posts: 4
Rep Power: 2
aliFauze is on a distinguished road
Hello Yann,


Thank you for you response, I tried running splitMeshRegions -cellZones -useFaces but it only duplicates the name, resulting in something like solid_to_fluid_solid_to_fluid instead of just solid_to_fluid. When I run splitMeshRegions -useFaces, it doesn't detect any regions.


Any advice on how to fix this?
Thanks!
aliFauze is offline   Reply With Quote

Old   May 16, 2024, 03:02
Default
  #6
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,096
Rep Power: 26
Yann will become famous soon enough
It's very hypothetical since I never tried it myself, but I guess you need to define faceZones in snappy beforehand.

Could you post your snappyHexMeshDict?
Yann is offline   Reply With Quote

Old   May 30, 2024, 15:59
Default
  #7
New Member
 
Ali
Join Date: Mar 2024
Posts: 4
Rep Power: 2
aliFauze is on a distinguished road
Hello Yann,


Thank you for your response, and sorry for the late reply.


Here is my snappyHexMeshDict file.


/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2312 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// Which of the steps to run
castellatedMesh true;
snap true;
addLayers false;


// Geometry. Definition of all surfaces. All surfaces are of class
// searchableSurface.
// Surfaces are used
// - to specify refinement for any mesh cell intersecting it
// - to specify refinement for any mesh cell inside/outside/near
// - to 'snap' the mesh boundary to the surface
geometry
{
room.stl
{
type triSurfaceMesh;

regions
{
ceiling { name ceiling; }
floor { name floor; }
glass_doors { name glass_doors; }
insulated_walls { name insulated_walls; }
roof { name roof; }
}
}

heater.stl
{
type triSurfaceMesh;

regions
{
back { name back; }
down { name down; }
front { name front; }
left { name left; }
right { name right; }
upper { name upper; }
}
}

hot.stl
{
type triSurfaceMesh;

regions
{
a { name a; }
b { name b; }
c { name c; }
d { name d; }
e { name e; }
f { name f; }
}
}
}


// Settings for the castellatedMesh generation.
castellatedMeshControls
{

// Refinement parameters
// ~~~~~~~~~~~~~~~~~~~~~

// If local number of cells is >= maxLocalCells on any processor
// switches from from refinement followed by balancing
// (current method) to (weighted) balancing before refinement.
maxLocalCells 1000000;

// Overall cell limit (approximately). Refinement will stop immediately
// upon reaching this number so a refinement level might not complete.
// Note that this is the number of cells before removing the part which
// is not 'visible' from the keepPoint. The final number of cells might
// actually be a lot less.
maxGlobalCells 20000000;

// The surface refinement loop might spend lots of iterations
// refining just a few cells. This setting will cause refinement
// to stop if <= minimumRefine are selected for refinement. Note:
// it will at least do one iteration (unless the number of cells
// to refine is 0)
minRefinementCells 10;
// Number of buffer layers between different levels.
// 1 means normal 2:1 refinement restriction, larger means slower
// refinement.
nCellsBetweenLevels 6;



// Explicit feature edge refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// Specifies a level for any cell intersected by its edges.
// This is a featureEdgeMesh, read from constant/triSurface for now.
features
(
);



// Surface based refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~

// Specifies two levels for every surface. The first is the minimum level,
// every cell intersecting a surface gets refined up to the minimum level.
// The second level is the maximum level. Cells that 'see' multiple
// intersections where the intersections make an
// angle > resolveFeatureAngle get refined up to the maximum level.

refinementSurfaces
{
room.stl
{
level (0 0);

regions
{
ceiling { level (0 0); patchInfo { type wall; }}
floor { level (0 0); patchInfo { type wall; }}
glass_doors { level (0 0); patchInfo { type wall; }}
insulated_walls { level (0 0); patchInfo { type wall; }}
roof { level (0 0); patchInfo { type wall; }}
}
}

heater.stl
{
level (0 0);

regions
{
back { level (3 3); patchInfo { type patch; }}
down { level (3 3); patchInfo { type patch; }}
front { level (3 3); patchInfo { type patch; }}
left { level (3 3); patchInfo { type patch; }}
right { level (3 3); patchInfo { type patch; }}
upper { level (3 3); patchInfo { type patch; }}
}
}

hot.stl
{
level (0 0);

regions
{
a { level (3 3); patchInfo { type patch; }}
b { level (3 3); patchInfo { type patch; }}
c { level (3 3); patchInfo { type patch; }}
d { level (3 3); patchInfo { type patch; }}
e { level (3 3); patchInfo { type patch; }}
f { level (3 3); patchInfo { type patch; }}
}
}

}

// Resolve sharp angles
resolveFeatureAngle 30;
locationsInMesh
(
(( 0.5647 0.12536 0.376) heater)
(( 1.4253 1.25635 1.243) room)
(( 0.5647 0.07645 0.113) hot)
);


// Whether any faceZones (as specified in the refinementSurfaces)
// are only on the boundary of corresponding cellZones or also allow
// free-standing zone faces. Not used if there are no faceZones.
allowFreeStandingZoneFaces true;
}



// Settings for the snapping.
snapControls
{
//- Number of patch smoothing iterations before finding correspondence
// to surface
nSmoothPatch 3;

//- Relative distance for points to be attracted by surface feature point
// or edge. True distance is this factor times local
// maximum edge length.
tolerance 1.0;

//- Number of mesh displacement relaxation iterations.
nSolveIter 30;

//- Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 5;

//- Highly experimental and wip: number of feature edge snapping
// iterations. Leave out altogether to disable.
// Of limited use in this case since faceZone faces not handled.
nFeatureSnapIter 10;

implicitFeatureSnap true;
multiRegionFeatureSnap true;
}
aliFauze is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 18:57
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 09:38
[Commercial meshers] Using starToFoam clo OpenFOAM Meshing & Mesh Conversion 33 September 26, 2012 04:04
[Other] StarToFoam error Kart OpenFOAM Meshing & Mesh Conversion 1 February 4, 2010 04:38
[Gmsh] Import gmsh msh to Foam adorean OpenFOAM Meshing & Mesh Conversion 24 April 27, 2005 08:19


All times are GMT -4. The time now is 06:52.