snappyHexMeshConfig: use implicitFeatures by default

and make '-explicitFeatures' the option to use explicitFeatures. When implicitFeatures
is used, a surfaceFeaturesDict file is not written out to the system directory
This commit is contained in:
Chris Greenshields
2023-07-19 11:38:19 +01:00
parent 31679117a4
commit afdaf49b4f
3 changed files with 34 additions and 31 deletions

View File

@ -75,20 +75,20 @@ Description
oriented along the z-axis along x = y = 0.
The snappyHexMesh configuration is generated automatically, applying a set
of defaults to the main configuration parameters. By default, explicit
feature capturing is configured, for which a surfaceFeaturesDict file is
written for the user to generate the features files with the
surfaceFeatures utility. Implicit feature capturing can alternatively be
selected with the '-implicitFeatures' option. Refinement levels can be
of defaults to the main configuration parameters. By default, implicit
feature capturing is configured. Explicit feature capturing can
alternatively be selected with the '-explicitFeatures' option, when an
additional surfaceFeaturesDict file is written for the user to generate the
features files with the surfaceFeatures utility. Refinement levels can be
controlled with a range of options including: '-refinementLevel' for the
baseline refinement level; '-refinementSurfaces' for levels on specific
surfaces; '-refinementRegions' for levels inside specific surfaces;
'-refinementBoxes' for quick, box-shaped refinement regions specified by
min and max bounds; '-refinementDists' for distance-based refinement; and
'-refinementBoxes' for quick, box-shaped refinement regions specified by min
and max bounds; '-refinementDists' for distance-based refinement; and
'-nCellsBetweenLevels' to control the transition between refinement
levels. A '-layers' option specifies additional layers of cells at wall
boundaries. The insidePoint parameter is set to '(0 0 0)' by default but
can be overridden using the '-insidePoint' option.
boundaries. The insidePoint parameter is set to '(0 0 0)' by default but can
be overridden using the '-insidePoint' option.
Usage
\b snappyHexMeshConfig [OPTIONS]
@ -134,8 +134,8 @@ Usage
- \par -clearBoundary,
Do not set default patch entries, i.e. xMin, xMax, yMin, etc...
- \par -implicitFeatures,
Use implicit feature capturing
- \par -explicitFeatures,
Use explicit feature capturing, default is implicit
- \par -layers \<int\>
Specify <int> surface layers at wall boundaries, default 0
@ -308,8 +308,8 @@ int main(int argc, char *argv[])
argList::addBoolOption
(
"implicitFeatures",
"use implicit feature capturing"
"explicitFeatures",
"use explicit feature capturing"
);
argList::addOption
@ -569,7 +569,7 @@ int main(int argc, char *argv[])
);
}
const bool implicitFeatures(args.optionFound("implicitFeatures"));
const bool explicitFeatures(args.optionFound("explicitFeatures"));
const label layers(args.optionLookupOrDefault<label>("layers", 0));
@ -583,15 +583,18 @@ int main(int argc, char *argv[])
args.optionLookupOrDefault<label>("nCellsBetweenLevels", 3)
);
surfaceFeaturesConfiguration surfaceFeaturesConfig
(
"surfaceFeaturesDict",
runTime.system(),
runTime,
surfaces
);
if (explicitFeatures)
{
surfaceFeaturesConfiguration surfaceFeaturesConfig
(
"surfaceFeaturesDict",
runTime.system(),
runTime,
surfaces
);
surfaceFeaturesConfig.write();
surfaceFeaturesConfig.write();
}
snappyHexMeshConfiguration snappyConfig
(
@ -604,7 +607,7 @@ int main(int argc, char *argv[])
refinementRegions,
refinementBoxes,
refinementDists,
implicitFeatures,
explicitFeatures,
layers,
insidePoint,
nCellsBetweenLevels

View File

@ -133,7 +133,7 @@ void Foam::snappyHexMeshConfiguration::writeFeatures()
{
beginList(os_, "features");
if (!implicitFeatures_)
if (explicitFeatures_)
{
forAll(surfaces_, i)
{
@ -422,9 +422,9 @@ void Foam::snappyHexMeshConfiguration::writeSnapControls()
beginDict(os_, "snapControls");
os_ << indent << "explicitFeatureSnap "
<< (implicitFeatures_ ? "off" : "on") << ";" << endl;
<< (explicitFeatures_ ? "on" : "off") << ";" << endl;
os_ << indent << "implicitFeatureSnap "
<< (implicitFeatures_ ? "on" : "off") << ";" << endl;
<< (explicitFeatures_ ? "off" : "on") << ";" << endl;
endDict(os_);
}
@ -497,7 +497,7 @@ Foam::snappyHexMeshConfiguration::snappyHexMeshConfiguration
const List<Tuple2<word, label>>& refinementRegions,
const List<Tuple3<vector, vector, label>>& refinementBoxes,
const List<Tuple3<word, scalar, label>>& refinementDists,
const bool implicitFeatures,
const bool explicitFeatures,
const label layers,
const point& insidePoint,
const label nCellsBetweenLevels
@ -510,7 +510,7 @@ Foam::snappyHexMeshConfiguration::snappyHexMeshConfiguration
refinementRegions_(refinementRegions),
refinementBoxes_(refinementBoxes),
refinementDists_(refinementDists),
implicitFeatures_(implicitFeatures),
explicitFeatures_(explicitFeatures),
layers_(layers),
insidePoint_(insidePoint),
nCellsBetweenLevels_(nCellsBetweenLevels)

View File

@ -80,8 +80,8 @@ class snappyHexMeshConfiguration
//- Refinement distances with level of refinement
const List<Tuple3<word, scalar, label>>& refinementDists_;
//- Using implicit feature capturing?
const bool implicitFeatures_;
//- Using explicit feature capturing?
const bool explicitFeatures_;
//- Number of layers at wall patches, default 0
const label layers_;
@ -173,7 +173,7 @@ public:
const List<Tuple2<word, label>>& refinementRegions,
const List<Tuple3<vector, vector, label>>& refinementBoxes,
const List<Tuple3<word, scalar, label>>& refinementDists,
const bool implicitFeatures,
const bool explicitFeatures,
const label layers,
const point& insidePoint,
const label nCellsBetweenLevels