The defaultPatch type currently defaults to empty which is appropriate for 1D
and 2D cases but not when creating the initial blockMesh for snappyHexMesh as
the presence of empty patches triggers the inappropriate application of 2D point
constraint corrections following snapping and morphing. To avoid this hidden
problem a warning is now generated from blockMesh when the defaultPatch is not
explicitly set for cases which generate a default patch, i.e. for which the
boundary is not entirely defined. e.g.
.
.
.
Creating block mesh topology
--> FOAM FATAL IO ERROR:
The 'defaultPatch' type must be specified for the 'defaultFaces' patch, e.g. for snappyHexMesh
defaultPatch
{
name default; // optional
type patch;
}
or for 2D meshes
defaultPatch
{
name frontAndBack; // optional
type empty;
}
.
.
.
All the tutorials have been update to include the defaultPatch specification as
appropriate.
99 lines
2.3 KiB
C++
99 lines
2.3 KiB
C++
/*--------------------------------*- C++ -*----------------------------------*\
|
|
========= |
|
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
\\ / O peration | Website: https://openfoam.org
|
|
\\ / A nd | Version: dev
|
|
\\/ M anipulation |
|
|
\*---------------------------------------------------------------------------*/
|
|
FoamFile
|
|
{
|
|
format ascii;
|
|
class dictionary;
|
|
object blockMeshDict;
|
|
}
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
radius 25.5;
|
|
radiusNeg -25.5;
|
|
box 5;
|
|
boxNeg -5;
|
|
zMax 84;
|
|
zMin -60;
|
|
|
|
nR 7;
|
|
nZ 24;
|
|
|
|
verbose no;
|
|
|
|
geometry
|
|
{
|
|
cylinder
|
|
{
|
|
type searchableCylinder;
|
|
point1 (0 0 -100);
|
|
point2 (0 0 100);
|
|
radius $radius;
|
|
}
|
|
}
|
|
|
|
scale 1;
|
|
|
|
vertices
|
|
(
|
|
// Inner
|
|
($boxNeg $boxNeg $zMin)
|
|
($box $boxNeg $zMin)
|
|
($boxNeg $box $zMin)
|
|
($box $box $zMin)
|
|
|
|
// Outer block points
|
|
project ($radiusNeg $radiusNeg $zMin) (cylinder)
|
|
project ($radius $radiusNeg $zMin) (cylinder)
|
|
project ($radiusNeg $radius $zMin) (cylinder)
|
|
project ($radius $radius $zMin) (cylinder)
|
|
|
|
// Inner
|
|
($boxNeg $boxNeg $zMax)
|
|
($box $boxNeg $zMax)
|
|
($boxNeg $box $zMax)
|
|
($box $box $zMax)
|
|
|
|
// Outer block points
|
|
project ($radiusNeg $radiusNeg $zMax) (cylinder)
|
|
project ($radius $radiusNeg $zMax) (cylinder)
|
|
project ($radiusNeg $radius $zMax) (cylinder)
|
|
project ($radius $radius $zMax) (cylinder)
|
|
);
|
|
|
|
blocks
|
|
(
|
|
hex ( 4 5 1 0 12 13 9 8) ($nR $nR $nZ) simpleGrading (1 1 1)
|
|
hex ( 4 0 2 6 12 8 10 14) ($nR $nR $nZ) simpleGrading (1 1 1)
|
|
hex ( 1 5 7 3 9 13 15 11) ($nR $nR $nZ) simpleGrading (1 1 1)
|
|
hex ( 2 3 7 6 10 11 15 14) ($nR $nR $nZ) simpleGrading (1 1 1)
|
|
hex ( 0 1 3 2 8 9 11 10) ($nR $nR $nZ) simpleGrading (1 1 1)
|
|
);
|
|
|
|
edges
|
|
(
|
|
project 4 5 (cylinder)
|
|
project 7 5 (cylinder)
|
|
project 6 7 (cylinder)
|
|
project 4 6 (cylinder)
|
|
project 12 13 (cylinder)
|
|
project 13 15 (cylinder)
|
|
project 12 14 (cylinder)
|
|
project 14 15 (cylinder)
|
|
);
|
|
|
|
defaultPatch
|
|
{
|
|
type patch;
|
|
}
|
|
|
|
boundary
|
|
(
|
|
);
|
|
|
|
// ************************************************************************* //
|