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] About snappyHexMesh (https://www.cfd-online.com/Forums/openfoam-meshing/106097-about-snappyhexmesh.html)

Yann July 24, 2023 04:01

Hi Hossein,

Adding layers in multiregion cases is pretty straightforward in recent OpenCFD branch (openfoam.com), it's a bit trickier in the foundation branch (openfoam.org).

AFAIK, you need to mesh in 2 steps: running snappyHexMesh once without layers, then create baffles and run snappy a 2nd time only for the layers addition phase.

Have a look at the shellAndTubeHeatExchanger tutorial, especially the Allmesh.layers script which, I think, does what you are trying to achieve: https://github.com/OpenFOAM/OpenFOAM...eHeatExchanger

Hope this helps,
Yann

H_SheikhShoaie August 10, 2023 03:22

1 Attachment(s)
Hey Yann,

I really appreciate your guidance. Well I completely redefined my case, I have tried different methods , different stl files (created by salome and solidworks with various meshes).
Now there is a little problem, a few number (very low in compare to the whole number) of faces on an interface are named different from created interface's name (they get the name of their stl file and has been shown in attached picture), however there are in the correct region means there is no extra regions.

In my opinion this can be addressed can by defining BCs as same as interface for these faces. I had an unsuccessful effort to solve this problem by adjusting snappyHexMesh parameters but this arises from stl files (I've already changed all snappy's parameters). In addition It doesn't show a linear behavior by increasing or decreasing the resolution of slt's mesh. Unfortunately, it is weakly related to some mesh parameters too.

The snappyHexMesh containment has been brought below. In addition the faces has been illustrated in attached picture. surprisingly There is no problem with the more complex pipe which has five 180 degree bends.

I'm pressed for time to finish this project, I was wondering if you let me know how this faces can interfere the mesh quality and numerical solution. Because, My geometries will becoming more complicated. In addition, I will be grateful if I can have your Email address.

Regards,

Hossein



Quote:

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

castellatedMesh off;

snap off;

addLayers on;



geometry
{
burner
{
type triSurfaceMesh;
file "burner.stl";
regions
{
burnerinlet
{
name burnerinlet;
}
burneroutlet
{
name burneroutlet;
}
burnerwall
{
name burnerwall;
}
}
}
gas
{
type triSurfaceMesh;
file "gas.stl";
regions
{
gasinlet
{
name gasinlet;
}
gasoutlet
{
name gasoutlet;
}
gaswall
{
name gaswall;
}
}
}
shell
{
type triSurfaceMesh;
file "shell.stl";
regions
{
shellwall
{
name shellwall;
}
}
}
}

castellatedMeshControls
{
maxLocalCells 100000;
maxGlobalCells 100000000;
minRefinementCells 10;
maxLoadUnbalance 0.1;
nCellsBetweenLevels 1;
resolveFeatureAngle 15;
allowFreeStandingZoneFaces true;
features ( { file "shell.eMesh" ; level 2 ; } );
refinementSurfaces
{
burner
{
level ( 1 1 );
regions
{
burnerinlet
{
level ( 1 1 );
patchInfo
{
type patch;
}
}
burneroutlet
{
level ( 1 1 );
patchInfo
{
type patch;
}
}
burnerwall
{
level ( 1 1 );
patchInfo
{
type wall;
}
}
}
}
gas
{
level ( 1 1 );
regions
{
gasinlet
{
level ( 1 1 );
patchInfo
{
type patch;
}
}
gasoutlet
{
level ( 1 1 );
patchInfo
{
type patch;
}
}
gaswall
{
level ( 1 1 );
patchInfo
{
type wall;
}
}
}
}
shell
{
level ( 0 0 );
regions
{
shellwall
{
level ( 0 0 );
patchInfo
{
type wall;
}
}
}
}
}
refinementRegions
{
}
locationsInMesh ( ( ( 1 0.008 0.015 ) region1 ) ( ( 2.5 0.23 0.3 ) cellZone2 ) ( ( 1 -0.369 0.2 ) cellZone1 ) );
}

snapControls
{
nSmoothPatch 3;
tolerance 2;
nSolveIter 100;
nRelaxIter 5;
nFeatureSnapIter 10;
explicitFeatureSnap false;
multiRegionFeatureSnap false;
implicitFeatureSnap true;
}

addLayersControls
{
featureAngle 100;
slipFeatureAngle 30;
nLayerIter 50;
nRelaxedIter 20;
nRelaxIter 5;
nGrow 0;
nSmoothSurfaceNormals 1;
nSmoothNormals 3;
nSmoothThickness 10;
maxFaceThicknessRatio 0.5;
maxThicknessToMedialRatio 0.3;
minMedialAxisAngle 90;
nMedialAxisIter 10;
nBufferCellsNoExtrude 0;
additionalReporting false;
layers
{
}
relativeSizes true;
expansionRatio 1.2;
finalLayerThickness 0.5;
minThickness 0.2;
}

meshQualityControls
{
maxNonOrtho 65;
maxBoundarySkewness 20;
maxInternalSkewness 4;
maxConcave 80;
minVol 1e-13;
minTetQuality -1;
minArea -1;
minTwist 0.02;
minDeterminant 0.001;
minFaceWeight 0.05;
minVolRatio 0.01;
minTriangleTwist -1;
nSmoothScale 4;
errorReduction 0.75;
relaxed
{
}
}

debug 0;

mergeTolerance 1e-06;


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