snappyHexMesh: Added new experimental region refinement strategy based on the local span
In the new tutorial mesh/snappyHexMesh/pipe the pipe diameter changes by a factor
of 2 but the number of cells across the pipe is specified to be constant along
the length using the new "span" refinement mode in which the number of cells
across the span is set to be at least 40:
refinementRegions
{
pipe
{
mode span;
levels ((1000 2)); // Maximum distance and maximum level
cellsAcrossSpan 40;
}
}
This operates in conjunction with the "pointCloseness" option in surfaceFeatures
which writes a surfacePointScalarField of the local span of the domain. Note
that the behaviour of this option is critically dependent on the quality of this
field and the surface may need to be re-triangulated more isotropically to
ensure the "pointCloseness" is accurate and representative of the domain and the
required mesh distribution.
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -72,9 +72,16 @@ inline label readLabel(Istream& is)
|
||||
//- Raise one label to the power of another
|
||||
label pow(label a, label b);
|
||||
|
||||
//- Evaluate n! : 0 < n <= 12
|
||||
//- Return n! : 0 < n <= 12
|
||||
label factorial(label n);
|
||||
|
||||
//- Return the log base 2 by successive bit-shifting of the given label
|
||||
inline label log2(label i)
|
||||
{
|
||||
label log2i = 0;
|
||||
while (i >>= 1) log2i++;
|
||||
return log2i;
|
||||
}
|
||||
|
||||
inline label& setComponent(label& l, const direction)
|
||||
{
|
||||
|
||||
@ -808,7 +808,13 @@ Foam::label Foam::meshRefinement::markInternalRefinement
|
||||
|
||||
// Do test to see whether cells is inside/outside shell with higher level
|
||||
labelList maxLevel;
|
||||
shells_.findHigherLevel(testCc, testLevels, maxLevel);
|
||||
shells_.findHigherLevel
|
||||
(
|
||||
testCc,
|
||||
testLevels,
|
||||
meshCutter().level0EdgeLength(),
|
||||
maxLevel
|
||||
);
|
||||
|
||||
// Mark for refinement. Note that we didn't store the original cellID so
|
||||
// now just reloop in same order.
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -41,15 +41,16 @@ namespace Foam
|
||||
|
||||
template<>
|
||||
const char*
|
||||
NamedEnum<shellSurfaces::refineMode, 3>::
|
||||
NamedEnum<shellSurfaces::refineMode, 4>::
|
||||
names[] =
|
||||
{
|
||||
"inside",
|
||||
"outside",
|
||||
"distance"
|
||||
"distance",
|
||||
"span"
|
||||
};
|
||||
|
||||
const NamedEnum<shellSurfaces::refineMode, 3> shellSurfaces::refineModeNames_;
|
||||
const NamedEnum<shellSurfaces::refineMode, 4> shellSurfaces::refineModeNames_;
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -225,11 +226,36 @@ void Foam::shellSurfaces::orient()
|
||||
}
|
||||
|
||||
|
||||
// Find maximum level of a shell.
|
||||
Foam::scalar Foam::shellSurfaces::interpolate
|
||||
(
|
||||
const triSurfaceMesh& tsm,
|
||||
const triSurfacePointScalarField& closeness,
|
||||
const point& pt,
|
||||
const label index
|
||||
) const
|
||||
{
|
||||
const barycentric2D bary
|
||||
(
|
||||
triPointRef
|
||||
(
|
||||
tsm.points(),
|
||||
tsm.triSurface::operator[](index)
|
||||
).pointToBarycentric(pt)
|
||||
);
|
||||
|
||||
const labelledTri& lf = tsm.localFaces()[index];
|
||||
|
||||
return closeness[lf[0]]*bary[0]
|
||||
+ closeness[lf[1]]*bary[1]
|
||||
+ closeness[lf[2]]*bary[2];
|
||||
}
|
||||
|
||||
|
||||
void Foam::shellSurfaces::findHigherLevel
|
||||
(
|
||||
const pointField& pt,
|
||||
const label shellI,
|
||||
const scalar level0EdgeLength,
|
||||
labelList& maxLevel
|
||||
) const
|
||||
{
|
||||
@ -296,6 +322,80 @@ void Foam::shellSurfaces::findHigherLevel
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (modes_[shellI] == SPAN)
|
||||
{
|
||||
const triSurfaceMesh& tsm =
|
||||
refCast<const triSurfaceMesh>(allGeometry_[shells_[shellI]]);
|
||||
|
||||
// Collect all those points that have a current maxLevel less than
|
||||
// the maximum and furthest distance allowable for the shell.
|
||||
|
||||
pointField candidates(pt.size());
|
||||
labelList candidateMap(pt.size());
|
||||
scalarField candidateDistSqr(pt.size());
|
||||
label candidateI = 0;
|
||||
|
||||
forAll(pt, pointi)
|
||||
{
|
||||
if (levels[0] > maxLevel[pointi])
|
||||
{
|
||||
candidates[candidateI] = pt[pointi];
|
||||
candidateMap[candidateI] = pointi;
|
||||
candidateDistSqr[candidateI] = sqr(distances_[shellI][0]);
|
||||
candidateI++;
|
||||
}
|
||||
}
|
||||
candidates.setSize(candidateI);
|
||||
candidateMap.setSize(candidateI);
|
||||
candidateDistSqr.setSize(candidateI);
|
||||
|
||||
// Do the expensive nearest test only for the candidate points.
|
||||
List<pointIndexHit> nearInfo;
|
||||
tsm.findNearest
|
||||
(
|
||||
candidates,
|
||||
candidateDistSqr,
|
||||
nearInfo
|
||||
);
|
||||
|
||||
// Minimum span for the maximum level specified
|
||||
const scalar minSpan
|
||||
(
|
||||
cellsAcrossSpan_[shellI]*level0EdgeLength/(1 << (levels[0] - 1))
|
||||
);
|
||||
|
||||
// Update maxLevel
|
||||
forAll(nearInfo, candidateI)
|
||||
{
|
||||
if (nearInfo[candidateI].hit())
|
||||
{
|
||||
const scalar span
|
||||
(
|
||||
interpolate
|
||||
(
|
||||
tsm,
|
||||
closeness_[shellI],
|
||||
nearInfo[candidateI].rawPoint(),
|
||||
nearInfo[candidateI].index()
|
||||
)
|
||||
);
|
||||
|
||||
if (span > minSpan)
|
||||
{
|
||||
const label level
|
||||
(
|
||||
log2(cellsAcrossSpan_[shellI]*level0EdgeLength/span) + 1
|
||||
);
|
||||
|
||||
maxLevel[candidateMap[candidateI]] = min(levels[0], level);
|
||||
}
|
||||
else
|
||||
{
|
||||
maxLevel[candidateMap[candidateI]] = levels[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Inside/outside mode
|
||||
@ -370,12 +470,13 @@ Foam::shellSurfaces::shellSurfaces
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Size lists
|
||||
shells_.setSize(shellI);
|
||||
modes_.setSize(shellI);
|
||||
distances_.setSize(shellI);
|
||||
levels_.setSize(shellI);
|
||||
cellsAcrossSpan_.setSize(shellI);
|
||||
closeness_.setSize(shellI);
|
||||
|
||||
HashSet<word> unmatchedKeys(shellsDict.toc());
|
||||
shellI = 0;
|
||||
@ -397,6 +498,47 @@ Foam::shellSurfaces::shellSurfaces
|
||||
// Read pairs of distance+level
|
||||
setAndCheckLevels(shellI, dict.lookup("levels"));
|
||||
|
||||
if (modes_[shellI] == SPAN)
|
||||
{
|
||||
const searchableSurface& surface = allGeometry_[geomI];
|
||||
|
||||
if (isA<triSurfaceMesh>(surface))
|
||||
{
|
||||
dict.lookup("cellsAcrossSpan") >> cellsAcrossSpan_[shellI];
|
||||
|
||||
const triSurfaceMesh& tsm =
|
||||
refCast<const triSurfaceMesh>(surface);
|
||||
|
||||
closeness_.set
|
||||
(
|
||||
shellI,
|
||||
new triSurfacePointScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
surface.name()
|
||||
+ ".closeness.internalPointCloseness",
|
||||
surface.searchableSurface::time().constant(),
|
||||
"triSurface",
|
||||
surface.searchableSurface::time(),
|
||||
IOobject::MUST_READ
|
||||
),
|
||||
tsm,
|
||||
dimLength,
|
||||
true
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalIOErrorInFunction(shellsDict)
|
||||
<< "Surface " << surface.name()
|
||||
<< " is not a triSurface as required by"
|
||||
" refinement mode " << refineModeNames_[SPAN]
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
}
|
||||
|
||||
shellI++;
|
||||
}
|
||||
}
|
||||
@ -437,6 +579,7 @@ void Foam::shellSurfaces::findHigherLevel
|
||||
(
|
||||
const pointField& pt,
|
||||
const labelList& ptLevel,
|
||||
const scalar level0EdgeLength,
|
||||
labelList& maxLevel
|
||||
) const
|
||||
{
|
||||
@ -445,7 +588,7 @@ void Foam::shellSurfaces::findHigherLevel
|
||||
|
||||
forAll(shells_, shellI)
|
||||
{
|
||||
findHigherLevel(pt, shellI, maxLevel);
|
||||
findHigherLevel(pt, shellI, level0EdgeLength, maxLevel);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -36,8 +36,9 @@ SourceFiles
|
||||
#ifndef shellSurfaces_H
|
||||
#define shellSurfaces_H
|
||||
|
||||
#include "searchableSurface.H"
|
||||
#include "Tuple2.H"
|
||||
#include "triSurfaceMesh.H"
|
||||
#include "triSurfaceFieldsFwd.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -61,7 +62,8 @@ public:
|
||||
{
|
||||
INSIDE, // Refine all inside shell
|
||||
OUTSIDE, // ,, outside
|
||||
DISTANCE // Refine based on distance to shell
|
||||
DISTANCE, // Refine based on distance to shell
|
||||
SPAN // Refine based on distance across span
|
||||
};
|
||||
|
||||
|
||||
@ -84,11 +86,17 @@ private:
|
||||
//- Per shell per distance the refinement level
|
||||
labelListList levels_;
|
||||
|
||||
//- Number of cells across span for refinement mode span
|
||||
labelList cellsAcrossSpan_;
|
||||
|
||||
//- Surface closness field for refinement mode span
|
||||
PtrList<triSurfacePointScalarField> closeness_;
|
||||
|
||||
|
||||
// Private Data
|
||||
|
||||
//- refineMode names
|
||||
static const NamedEnum<refineMode, 3> refineModeNames_;
|
||||
static const NamedEnum<refineMode, 4> refineModeNames_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
@ -102,13 +110,25 @@ private:
|
||||
|
||||
void orient();
|
||||
|
||||
//- Interpolate the surface closeness field to the given point
|
||||
scalar interpolate
|
||||
(
|
||||
const triSurfaceMesh& tris,
|
||||
const triSurfacePointScalarField& closeness,
|
||||
const point& pt,
|
||||
const label index
|
||||
) const;
|
||||
|
||||
//- Find maximum level of a shell
|
||||
void findHigherLevel
|
||||
(
|
||||
const pointField& pt,
|
||||
const label shellI,
|
||||
const scalar level0EdgeLength,
|
||||
labelList& maxLevel
|
||||
) const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
@ -123,20 +143,6 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
// const List<scalarField>& distances() const
|
||||
//{
|
||||
// return distances_;
|
||||
//}
|
||||
//
|
||||
////- Per shell per distance the refinement level
|
||||
// const labelListList& levels() const
|
||||
//{
|
||||
// return levels_;
|
||||
//}
|
||||
|
||||
|
||||
// Query
|
||||
|
||||
//- Highest shell level
|
||||
@ -147,9 +153,9 @@ public:
|
||||
(
|
||||
const pointField& pt,
|
||||
const labelList& ptLevel,
|
||||
const scalar level0EdgeLength,
|
||||
labelList& maxLevel
|
||||
) const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
# Source tutorial clean functions
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
# remove surface
|
||||
# Remove surface
|
||||
rm -f constant/triSurface/flange.stl.gz
|
||||
|
||||
rm -rf 0 > /dev/null 2>&1
|
||||
|
||||
@ -2,9 +2,11 @@
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# copy flange surface from resources directory
|
||||
# Copy flange surface from resources directory
|
||||
cp $FOAM_TUTORIALS/resources/geometry/flange.stl.gz constant/triSurface/
|
||||
|
||||
runApplication blockMesh
|
||||
runApplication surfaceFeatures
|
||||
runApplication snappyHexMesh -overwrite
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
14
tutorials/mesh/snappyHexMesh/pipe/Allclean
Executable file
14
tutorials/mesh/snappyHexMesh/pipe/Allclean
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
# Remove surface
|
||||
rm -f constant/triSurface/* > /dev/null 2>&1
|
||||
|
||||
rm -rf constant/extendedFeatureEdgeMesh > /dev/null 2>&1
|
||||
|
||||
cleanCase
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
14
tutorials/mesh/snappyHexMesh/pipe/Allrun
Executable file
14
tutorials/mesh/snappyHexMesh/pipe/Allrun
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# Copy pipe surface from resources directory
|
||||
cp $FOAM_TUTORIALS/resources/geometry/pipe.obj.gz constant/triSurface/
|
||||
|
||||
runApplication surfaceFeatures
|
||||
runApplication blockMesh
|
||||
runApplication snappyHexMesh -overwrite
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
94
tutorials/mesh/snappyHexMesh/pipe/system/blockMeshDict
Normal file
94
tutorials/mesh/snappyHexMesh/pipe/system/blockMeshDict
Normal file
@ -0,0 +1,94 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object blockMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
radius 25.2;
|
||||
radiusNeg -25.2;
|
||||
box 5;
|
||||
boxNeg -5;
|
||||
zMax 70;
|
||||
zMin -50;
|
||||
|
||||
nR 7;
|
||||
nZ 20;
|
||||
|
||||
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)
|
||||
);
|
||||
|
||||
boundary
|
||||
(
|
||||
);
|
||||
|
||||
// ************************************************************************* //
|
||||
55
tutorials/mesh/snappyHexMesh/pipe/system/controlDict
Normal file
55
tutorials/mesh/snappyHexMesh/pipe/system/controlDict
Normal file
@ -0,0 +1,55 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object controlDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application interFoam;
|
||||
|
||||
startFrom latestTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
stopAt endTime;
|
||||
|
||||
endTime 0.5;
|
||||
|
||||
deltaT 0.001;
|
||||
|
||||
writeControl adjustableRunTime;
|
||||
|
||||
writeInterval 0.02;
|
||||
|
||||
purgeWrite 0;
|
||||
|
||||
writeFormat ascii;
|
||||
|
||||
writePrecision 6;
|
||||
|
||||
writeCompression off;
|
||||
|
||||
timeFormat general;
|
||||
|
||||
timePrecision 6;
|
||||
|
||||
runTimeModifiable yes;
|
||||
|
||||
adjustTimeStep yes;
|
||||
|
||||
maxCo 2;
|
||||
maxAlphaCo 2;
|
||||
|
||||
maxDeltaT 1;
|
||||
|
||||
// ************************************************************************* //
|
||||
53
tutorials/mesh/snappyHexMesh/pipe/system/fvSchemes
Normal file
53
tutorials/mesh/snappyHexMesh/pipe/system/fvSchemes
Normal file
@ -0,0 +1,53 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object fvSchemes;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
ddtSchemes
|
||||
{
|
||||
default Euler;
|
||||
}
|
||||
|
||||
gradSchemes
|
||||
{
|
||||
default Gauss linear;
|
||||
grad(U) cellLimited Gauss linear 1;
|
||||
}
|
||||
|
||||
divSchemes
|
||||
{
|
||||
div(rhoPhi,U) Gauss linearUpwindV grad(U);
|
||||
div(phi,alpha) Gauss vanLeer;
|
||||
div(phirb,alpha) Gauss linear;
|
||||
|
||||
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
{
|
||||
default Gauss linear corrected;
|
||||
}
|
||||
|
||||
interpolationSchemes
|
||||
{
|
||||
default linear;
|
||||
}
|
||||
|
||||
snGradSchemes
|
||||
{
|
||||
default corrected;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
89
tutorials/mesh/snappyHexMesh/pipe/system/fvSolution
Normal file
89
tutorials/mesh/snappyHexMesh/pipe/system/fvSolution
Normal file
@ -0,0 +1,89 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object fvSolution;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
solvers
|
||||
{
|
||||
"alpha.water.*"
|
||||
{
|
||||
nAlphaCorr 2;
|
||||
nAlphaSubCycles 1;
|
||||
cAlpha 1;
|
||||
|
||||
MULESCorr yes;
|
||||
nLimiterIter 8;
|
||||
|
||||
solver smoothSolver;
|
||||
smoother symGaussSeidel;
|
||||
tolerance 1e-8;
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
"pcorr.*"
|
||||
{
|
||||
solver PCG;
|
||||
preconditioner DIC;
|
||||
tolerance 1e-10;
|
||||
relTol 0;
|
||||
maxIter 100;
|
||||
}
|
||||
|
||||
p_rgh
|
||||
{
|
||||
solver GAMG;
|
||||
smoother DIC;
|
||||
tolerance 1e-05;
|
||||
relTol 0.01;
|
||||
}
|
||||
|
||||
p_rghFinal
|
||||
{
|
||||
$p_rgh;
|
||||
relTol 0;
|
||||
maxIter 20;
|
||||
}
|
||||
|
||||
U
|
||||
{
|
||||
solver smoothSolver;
|
||||
smoother GaussSeidel;
|
||||
tolerance 1e-06;
|
||||
relTol 0;
|
||||
nSweeps 1;
|
||||
}
|
||||
}
|
||||
|
||||
PIMPLE
|
||||
{
|
||||
momentumPredictor no;
|
||||
nCorrectors 2;
|
||||
nNonOrthogonalCorrectors 1;
|
||||
correctPhi no;
|
||||
|
||||
pRefPoint (0 0 0);
|
||||
pRefValue 0;
|
||||
}
|
||||
|
||||
relaxationFactors
|
||||
{
|
||||
equations
|
||||
{
|
||||
".*" 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
19
tutorials/mesh/snappyHexMesh/pipe/system/meshQualityDict
Normal file
19
tutorials/mesh/snappyHexMesh/pipe/system/meshQualityDict
Normal file
@ -0,0 +1,19 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object meshQualityDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#includeEtc "caseDicts/mesh/generation/meshQualityDict.cfg"
|
||||
|
||||
// ************************************************************************* //
|
||||
121
tutorials/mesh/snappyHexMesh/pipe/system/snappyHexMeshDict
Normal file
121
tutorials/mesh/snappyHexMesh/pipe/system/snappyHexMeshDict
Normal file
@ -0,0 +1,121 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object snappyHexMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#includeEtc "caseDicts/mesh/generation/snappyHexMeshDict.cfg"
|
||||
|
||||
castellatedMesh on;
|
||||
snap on;
|
||||
addLayers off;
|
||||
|
||||
geometry
|
||||
{
|
||||
pipe
|
||||
{
|
||||
type closedTriSurfaceMesh;
|
||||
file "pipe.obj";
|
||||
}
|
||||
};
|
||||
|
||||
castellatedMeshControls
|
||||
{
|
||||
features
|
||||
(
|
||||
{
|
||||
file "pipe.eMesh";
|
||||
levels ((1 1));
|
||||
}
|
||||
);
|
||||
|
||||
refinementSurfaces
|
||||
{
|
||||
pipe
|
||||
{
|
||||
level (1 1);
|
||||
patchInfo
|
||||
{
|
||||
type wall;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
refinementRegions
|
||||
{
|
||||
pipe
|
||||
{
|
||||
mode span;
|
||||
levels ((1000 2));
|
||||
cellsAcrossSpan 40;
|
||||
}
|
||||
}
|
||||
|
||||
locationInMesh (1e-5 1e-5 1e-5);
|
||||
}
|
||||
|
||||
snapControls
|
||||
{
|
||||
// Number of patch smoothing iterations before finding correspondence
|
||||
// to surface
|
||||
nSmoothPatch 3;
|
||||
|
||||
// Maximum relative distance for points to be attracted by surface.
|
||||
// True distance is this factor times local maximum edge length.
|
||||
// Note: changed(corrected) w.r.t 17x! (17x used 2* tolerance)
|
||||
tolerance 3.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;
|
||||
|
||||
// Feature snapping
|
||||
|
||||
// Number of feature edge snapping iterations.
|
||||
// Leave out altogether to disable.
|
||||
nFeatureSnapIter 15;
|
||||
|
||||
// Detect (geometric only) features by sampling the surface
|
||||
// (default=false).
|
||||
implicitFeatureSnap false;
|
||||
|
||||
// Use castellatedMeshControls::features (default = true)
|
||||
explicitFeatureSnap true;
|
||||
|
||||
// Detect features between multiple surfaces
|
||||
// (only for explicitFeatureSnap, default = false)
|
||||
multiRegionFeatureSnap false;
|
||||
}
|
||||
|
||||
addLayersControls
|
||||
{
|
||||
layers
|
||||
{
|
||||
}
|
||||
|
||||
relativeSizes true;
|
||||
expansionRatio 1.2;
|
||||
finalLayerThickness 0.5;
|
||||
minThickness 1e-3;
|
||||
}
|
||||
|
||||
writeFlags
|
||||
(
|
||||
);
|
||||
|
||||
mergeTolerance 1e-6;
|
||||
|
||||
// ************************************************************************* //
|
||||
36
tutorials/mesh/snappyHexMesh/pipe/system/surfaceFeaturesDict
Normal file
36
tutorials/mesh/snappyHexMesh/pipe/system/surfaceFeaturesDict
Normal file
@ -0,0 +1,36 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Version: dev
|
||||
\\/ M anipulation |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object surfaceFeaturesDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
surfaces
|
||||
(
|
||||
"pipe.obj"
|
||||
);
|
||||
|
||||
// Mark edges whose adjacent surface normals are at an angle less
|
||||
// than includedAngle as features
|
||||
// - 0 : selects no edges
|
||||
// - 180: selects all edges
|
||||
includedAngle 150;
|
||||
|
||||
// Do not mark region edges
|
||||
geometricTestOnly yes;
|
||||
|
||||
// Output the closeness of surface points to other surface elements.
|
||||
pointCloseness yes;
|
||||
|
||||
writeVTK yes;
|
||||
|
||||
// ************************************************************************* //
|
||||
BIN
tutorials/resources/geometry/pipe.obj.gz
Normal file
BIN
tutorials/resources/geometry/pipe.obj.gz
Normal file
Binary file not shown.
Reference in New Issue
Block a user