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),
|
||||
name_(name),
|
||||
coeffs_(dict),
|
||||
active_(true),
|
||||
active_(coeffs_.lookupOrDefault("active", true)),
|
||||
cellZoneName_(cellZoneName),
|
||||
cellZoneID_(),
|
||||
excludedPatchNames_
|
||||
(
|
||||
coeffs_.lookupOrDefault("nonRotatingPatches", wordList(0))
|
||||
wordReList(coeffs_.lookupOrDefault("nonRotatingPatches", wordReList()))
|
||||
),
|
||||
origin_(coeffs_.lookup("origin")),
|
||||
axis_(coeffs_.lookup("axis")),
|
||||
@ -253,7 +253,6 @@ Foam::MRFZone::MRFZone
|
||||
{
|
||||
if (cellZoneName_ == word::null)
|
||||
{
|
||||
coeffs_.lookup("active") >> active_;
|
||||
coeffs_.lookup("cellZone") >> cellZoneName_;
|
||||
}
|
||||
|
||||
@ -265,32 +264,19 @@ Foam::MRFZone::MRFZone
|
||||
{
|
||||
cellZoneID_ = mesh_.cellZones().findZoneID(cellZoneName_);
|
||||
|
||||
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
||||
|
||||
axis_ = axis_/mag(axis_);
|
||||
|
||||
excludedPatchLabels_.setSize(excludedPatchNames_.size());
|
||||
|
||||
forAll(excludedPatchNames_, i)
|
||||
{
|
||||
excludedPatchLabels_[i] =
|
||||
patches.findPatchID(excludedPatchNames_[i]);
|
||||
|
||||
if (excludedPatchLabels_[i] == -1)
|
||||
{
|
||||
FatalErrorIn
|
||||
const labelHashSet excludedPatchSet
|
||||
(
|
||||
"MRFZone"
|
||||
"("
|
||||
"const word&, "
|
||||
"const fvMesh&, "
|
||||
"const dictionary&, "
|
||||
"const word&"
|
||||
")"
|
||||
)
|
||||
<< "cannot find MRF patch " << excludedPatchNames_[i]
|
||||
<< exit(FatalError);
|
||||
}
|
||||
mesh_.boundaryMesh().patchSet(excludedPatchNames_)
|
||||
);
|
||||
|
||||
excludedPatchLabels_.setSize(excludedPatchSet.size());
|
||||
|
||||
label i = 0;
|
||||
forAllConstIter(labelHashSet, excludedPatchSet, iter)
|
||||
{
|
||||
excludedPatchLabels_[i++] = iter.key();
|
||||
}
|
||||
|
||||
bool cellZoneFound = (cellZoneID_ != -1);
|
||||
@ -585,7 +571,7 @@ bool Foam::MRFZone::read(const dictionary& dict)
|
||||
{
|
||||
coeffs_ = dict;
|
||||
|
||||
active_ = readBool(coeffs_.lookup("active"));
|
||||
active_ = coeffs_.lookupOrDefault("active", true);
|
||||
coeffs_.lookup("cellZone") >> cellZoneName_;
|
||||
cellZoneID_ = mesh_.cellZones().findZoneID(cellZoneName_);
|
||||
|
||||
|
||||
@ -85,7 +85,8 @@ class MRFZone
|
||||
//- Cell zone ID
|
||||
label cellZoneID_;
|
||||
|
||||
const wordList excludedPatchNames_;
|
||||
const wordReList excludedPatchNames_;
|
||||
|
||||
labelList excludedPatchLabels_;
|
||||
|
||||
//- Internal faces that are part of MRF
|
||||
|
||||
@ -45,6 +45,7 @@ namespace fv
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
|
||||
|
||||
void Foam::fv::MRFSource::initialise()
|
||||
|
||||
@ -24,6 +24,7 @@ MRF1
|
||||
|
||||
MRFSourceCoeffs
|
||||
{
|
||||
active true;
|
||||
origin (0 0 0);
|
||||
axis (0 0 1);
|
||||
omega 104.72;
|
||||
|
||||
Reference in New Issue
Block a user