mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
MRFZone: Add regex and group support to the specification of nonRotatingPatches
This commit is contained in:
@ -240,12 +240,12 @@ Foam::MRFZone::MRFZone
|
|||||||
mesh_(mesh),
|
mesh_(mesh),
|
||||||
name_(name),
|
name_(name),
|
||||||
coeffs_(dict),
|
coeffs_(dict),
|
||||||
active_(true),
|
active_(coeffs_.lookupOrDefault("active", true)),
|
||||||
cellZoneName_(cellZoneName),
|
cellZoneName_(cellZoneName),
|
||||||
cellZoneID_(),
|
cellZoneID_(),
|
||||||
excludedPatchNames_
|
excludedPatchNames_
|
||||||
(
|
(
|
||||||
coeffs_.lookupOrDefault("nonRotatingPatches", wordList(0))
|
wordReList(coeffs_.lookupOrDefault("nonRotatingPatches", wordReList()))
|
||||||
),
|
),
|
||||||
origin_(coeffs_.lookup("origin")),
|
origin_(coeffs_.lookup("origin")),
|
||||||
axis_(coeffs_.lookup("axis")),
|
axis_(coeffs_.lookup("axis")),
|
||||||
@ -253,7 +253,6 @@ Foam::MRFZone::MRFZone
|
|||||||
{
|
{
|
||||||
if (cellZoneName_ == word::null)
|
if (cellZoneName_ == word::null)
|
||||||
{
|
{
|
||||||
coeffs_.lookup("active") >> active_;
|
|
||||||
coeffs_.lookup("cellZone") >> cellZoneName_;
|
coeffs_.lookup("cellZone") >> cellZoneName_;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -265,32 +264,19 @@ Foam::MRFZone::MRFZone
|
|||||||
{
|
{
|
||||||
cellZoneID_ = mesh_.cellZones().findZoneID(cellZoneName_);
|
cellZoneID_ = mesh_.cellZones().findZoneID(cellZoneName_);
|
||||||
|
|
||||||
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
|
||||||
|
|
||||||
axis_ = axis_/mag(axis_);
|
axis_ = axis_/mag(axis_);
|
||||||
|
|
||||||
excludedPatchLabels_.setSize(excludedPatchNames_.size());
|
const labelHashSet excludedPatchSet
|
||||||
|
(
|
||||||
|
mesh_.boundaryMesh().patchSet(excludedPatchNames_)
|
||||||
|
);
|
||||||
|
|
||||||
forAll(excludedPatchNames_, i)
|
excludedPatchLabels_.setSize(excludedPatchSet.size());
|
||||||
|
|
||||||
|
label i = 0;
|
||||||
|
forAllConstIter(labelHashSet, excludedPatchSet, iter)
|
||||||
{
|
{
|
||||||
excludedPatchLabels_[i] =
|
excludedPatchLabels_[i++] = iter.key();
|
||||||
patches.findPatchID(excludedPatchNames_[i]);
|
|
||||||
|
|
||||||
if (excludedPatchLabels_[i] == -1)
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"MRFZone"
|
|
||||||
"("
|
|
||||||
"const word&, "
|
|
||||||
"const fvMesh&, "
|
|
||||||
"const dictionary&, "
|
|
||||||
"const word&"
|
|
||||||
")"
|
|
||||||
)
|
|
||||||
<< "cannot find MRF patch " << excludedPatchNames_[i]
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cellZoneFound = (cellZoneID_ != -1);
|
bool cellZoneFound = (cellZoneID_ != -1);
|
||||||
@ -585,7 +571,7 @@ bool Foam::MRFZone::read(const dictionary& dict)
|
|||||||
{
|
{
|
||||||
coeffs_ = dict;
|
coeffs_ = dict;
|
||||||
|
|
||||||
active_ = readBool(coeffs_.lookup("active"));
|
active_ = coeffs_.lookupOrDefault("active", true);
|
||||||
coeffs_.lookup("cellZone") >> cellZoneName_;
|
coeffs_.lookup("cellZone") >> cellZoneName_;
|
||||||
cellZoneID_ = mesh_.cellZones().findZoneID(cellZoneName_);
|
cellZoneID_ = mesh_.cellZones().findZoneID(cellZoneName_);
|
||||||
|
|
||||||
|
|||||||
@ -85,7 +85,8 @@ class MRFZone
|
|||||||
//- Cell zone ID
|
//- Cell zone ID
|
||||||
label cellZoneID_;
|
label cellZoneID_;
|
||||||
|
|
||||||
const wordList excludedPatchNames_;
|
const wordReList excludedPatchNames_;
|
||||||
|
|
||||||
labelList excludedPatchLabels_;
|
labelList excludedPatchLabels_;
|
||||||
|
|
||||||
//- Internal faces that are part of MRF
|
//- Internal faces that are part of MRF
|
||||||
|
|||||||
@ -45,6 +45,7 @@ namespace fv
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
|
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::fv::MRFSource::initialise()
|
void Foam::fv::MRFSource::initialise()
|
||||||
|
|||||||
@ -24,6 +24,7 @@ MRF1
|
|||||||
|
|
||||||
MRFSourceCoeffs
|
MRFSourceCoeffs
|
||||||
{
|
{
|
||||||
|
active true;
|
||||||
origin (0 0 0);
|
origin (0 0 0);
|
||||||
axis (0 0 1);
|
axis (0 0 1);
|
||||||
omega 104.72;
|
omega 104.72;
|
||||||
|
|||||||
Reference in New Issue
Block a user