snappyHexMeshConfig: layers can be specified for individual surfaces
This commit is contained in:
@ -86,8 +86,8 @@ Description
|
|||||||
'-refinementBoxes' for quick, box-shaped refinement regions specified by min
|
'-refinementBoxes' for quick, box-shaped refinement regions specified by 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 controls additional layers of cells at specified
|
||||||
boundaries. The insidePoint parameter is set to '(0 0 0)' by default but can
|
surfaces. The insidePoint parameter is set to '(0 0 0)' by default but can
|
||||||
be overridden using the '-insidePoint' option.
|
be overridden using the '-insidePoint' option.
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
@ -137,8 +137,8 @@ Usage
|
|||||||
- \par -explicitFeatures,
|
- \par -explicitFeatures,
|
||||||
Use explicit feature capturing, default is implicit
|
Use explicit feature capturing, default is implicit
|
||||||
|
|
||||||
- \par -layers \<int\>
|
- \par -layers \<entry\>
|
||||||
Specify <int> surface layers at wall boundaries, default 0
|
Number of layers on specified surfaces, e.g. '((car 3) (ground 4))'
|
||||||
|
|
||||||
- \par -firstLayerThickness \<value\>
|
- \par -firstLayerThickness \<value\>
|
||||||
Specify the thickness of the near wall cells for layer addition
|
Specify the thickness of the near wall cells for layer addition
|
||||||
@ -322,8 +322,8 @@ int main(int argc, char *argv[])
|
|||||||
argList::addOption
|
argList::addOption
|
||||||
(
|
(
|
||||||
"layers",
|
"layers",
|
||||||
"int",
|
"entry",
|
||||||
"specify <int> surface layers at wall boundaries, default 0"
|
"number of layers on specified surfaces, e.g. '((car 3) (ground 4))'"
|
||||||
);
|
);
|
||||||
|
|
||||||
argList::addOption
|
argList::addOption
|
||||||
@ -592,7 +592,14 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
const bool explicitFeatures(args.optionFound("explicitFeatures"));
|
const bool explicitFeatures(args.optionFound("explicitFeatures"));
|
||||||
|
|
||||||
const label layers(args.optionLookupOrDefault<label>("layers", 0));
|
List<Tuple2<word, label>> layers;
|
||||||
|
if (args.optionFound("layers"))
|
||||||
|
{
|
||||||
|
layers.append
|
||||||
|
(
|
||||||
|
args.optionReadList<Tuple2<word, label>>("layers")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const scalar firstLayerThickness
|
const scalar firstLayerThickness
|
||||||
(
|
(
|
||||||
|
|||||||
@ -37,7 +37,7 @@ void Foam::snappyHexMeshConfiguration::writeSnappySwitches()
|
|||||||
dict.add
|
dict.add
|
||||||
(
|
(
|
||||||
"addLayers",
|
"addLayers",
|
||||||
layers_ == 0 ? "off" : "on",
|
layers_.empty() ? "off" : "on",
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -439,6 +439,9 @@ void Foam::snappyHexMeshConfiguration::writeAddLayersControls()
|
|||||||
|
|
||||||
beginDict(os_, "layers");
|
beginDict(os_, "layers");
|
||||||
|
|
||||||
|
if (layers_.empty())
|
||||||
|
{
|
||||||
|
// Add convenient entries with zero layers if layers are switched off.
|
||||||
forAll(surfaces_, i)
|
forAll(surfaces_, i)
|
||||||
{
|
{
|
||||||
switch (surfaces_[i].type())
|
switch (surfaces_[i].type())
|
||||||
@ -448,14 +451,23 @@ void Foam::snappyHexMeshConfiguration::writeAddLayersControls()
|
|||||||
case surfaceType::baffle:
|
case surfaceType::baffle:
|
||||||
{
|
{
|
||||||
os_ << indent << "\"" << surfaces_[i].name()
|
os_ << indent << "\"" << surfaces_[i].name()
|
||||||
<< ".*\" { nSurfaceLayers "
|
<< ".*\" { nSurfaceLayers 0; }" << endl;
|
||||||
<< layers_ << "; }" << endl;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Add entries for specified surfaces.
|
||||||
|
forAll(layers_, i)
|
||||||
|
{
|
||||||
|
os_ << indent << "\"" << layers_[i].first()
|
||||||
|
<< ".*\" { nSurfaceLayers "
|
||||||
|
<< layers_[i].second() << "; }" << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
endDict(os_);
|
endDict(os_);
|
||||||
|
|
||||||
@ -521,7 +533,7 @@ Foam::snappyHexMeshConfiguration::snappyHexMeshConfiguration
|
|||||||
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 explicitFeatures,
|
const bool explicitFeatures,
|
||||||
const label layers,
|
const List<Tuple2<word, label>>& layers,
|
||||||
const scalar firstLayerThickness,
|
const scalar firstLayerThickness,
|
||||||
const scalar layerExpansionRatio,
|
const scalar layerExpansionRatio,
|
||||||
const point& insidePoint,
|
const point& insidePoint,
|
||||||
|
|||||||
@ -83,8 +83,8 @@ class snappyHexMeshConfiguration
|
|||||||
//- Using explicit feature capturing?
|
//- Using explicit feature capturing?
|
||||||
const bool explicitFeatures_;
|
const bool explicitFeatures_;
|
||||||
|
|
||||||
//- Number of layers at wall patches, default 0
|
//- Number of layers on specified surfaces
|
||||||
const label layers_;
|
const List<Tuple2<word, label>> layers_;
|
||||||
|
|
||||||
//- Thickness of the near wall cells with layer addition
|
//- Thickness of the near wall cells with layer addition
|
||||||
const scalar firstLayerThickness_;
|
const scalar firstLayerThickness_;
|
||||||
@ -180,7 +180,7 @@ public:
|
|||||||
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 explicitFeatures,
|
const bool explicitFeatures,
|
||||||
const label layers,
|
const List<Tuple2<word, label>>& layers,
|
||||||
const scalar firstLayerThickness,
|
const scalar firstLayerThickness,
|
||||||
const scalar layerExpansionRatio,
|
const scalar layerExpansionRatio,
|
||||||
const point& insidePoint,
|
const point& insidePoint,
|
||||||
|
|||||||
Reference in New Issue
Block a user