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

View File

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

View File

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