35 Foam::MRFZoneList::MRFZoneList
57 a = a || this->operator[](i).active();
60 if (warn && this->size() && !a)
72 for (
const entry& dEntry :
dict)
83 for (
const entry& dEntry :
dict)
87 const word&
name = dEntry.keyword();
88 const dictionary& modelDict = dEntry.dict();
95 new MRFZone(
name, mesh_, modelDict)
107 DynamicList<word>
names;
108 for (
const auto& mrf: *
this)
110 if (mrf.name() ==
name)
119 <<
"Unable to find MRFZone " <<
name 120 <<
". Available zones are: " <<
names 130 for (
auto& mrf: *
this)
133 allOk = (allOk && ok);
141 for (
const auto& mrf: *
this)
157 for (
const auto& mrf: *
this)
159 mrf.addCoriolis(
U, ddtU);
166 for (
const auto& mrf: *
this)
168 mrf.addCoriolis(
UEqn);
179 for (
const auto& mrf: *
this)
196 "MRFZoneList:acceleration",
197 U.mesh().time().timeName(),
203 auto& acceleration = tacceleration.ref();
205 for (
const auto& mrf: *
this)
207 mrf.addCoriolis(
U, acceleration);
210 return tacceleration;
226 for (
const auto& mrf: *
this)
235 for (
const auto& mrf: *
this)
237 mrf.makeRelative(
phi);
244 const tmp<surfaceScalarField>& tphi
249 tmp<surfaceScalarField> rphi
254 "relative(" + tphi().
name() +
')',
276 const tmp<FieldField<fvsPatchField, scalar>>& tphi
281 tmp<FieldField<fvsPatchField, scalar>> rphi(
New(tphi,
true));
283 for (
const auto& mrf: *
this)
285 mrf.makeRelative(rphi.ref());
302 const tmp<Field<scalar>>& tphi,
308 tmp<Field<scalar>> rphi(
New(tphi,
true));
310 for (
const auto& mrf: *
this)
312 mrf.makeRelative(rphi.ref(), patchi);
332 for (
const auto& mrf: *
this)
334 mrf.makeRelative(
rho,
phi);
341 for (
const auto& mrf: *
this)
350 for (
const auto& mrf: *
this)
352 mrf.makeAbsolute(
phi);
359 const tmp<surfaceScalarField>& tphi
364 tmp<surfaceScalarField> rphi
369 "absolute(" + tphi().
name() +
')',
394 for (
const auto& mrf: *
this)
396 mrf.makeAbsolute(
rho,
phi);
403 for (
const auto& mrf: *
this)
405 mrf.correctBoundaryVelocity(
U);
416 FieldField<fvsPatchField, scalar>
Uf 418 relative(mesh_.Sf().boundaryField() &
U.boundaryField())
423 forAll(mesh_.boundary(), patchi)
425 if (isA<fixedValueFvsPatchScalarField>(phibf[patchi]))
427 phibf[patchi] ==
Uf[patchi];
435 if (mesh_.topoChanging())
437 for (
auto& mrf: *
this)
450 const MRFZoneList& models
453 models.writeData(
os);
void makeAbsolute(volVectorField &U) const
Make the given relative velocity absolute within the MRF region.
void update()
Update MRFZone faces if the mesh topology changes.
void reset(const dictionary &dict)
Reset the source list.
tmp< GeometricField< Type, fvPatchField, volMesh > > DDt(const surfaceScalarField &phi, const GeometricField< Type, fvPatchField, volMesh > &psi)
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
List of names generated by calling name() for each list item and filtered for matches.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void addAcceleration(const volVectorField &U, volVectorField &ddtU) const
Add the frame acceleration.
patchWriters resize(patchIds.size())
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void append(const T &val)
Append an element at the end of the list.
MRF zone definition based on cell zone and parameters obtained from a control dictionary constructed ...
constexpr char nl
The newline '\n' character (0x0a)
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
GeometricBoundaryField< scalar, fvsPatchField, surfaceMesh > Boundary
Type of boundary fields.
GeometricField< vector, fvPatchField, volMesh > volVectorField
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
#define forAll(list, i)
Loop across all elements in list.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const MRFZone & getFromName(const word &name) const
Return the MRF with a given name.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
bool active(const bool warn=false) const
Return active status.
void correctBoundaryVelocity(volVectorField &U) const
Correct the boundary velocity for the rotation of the MRF region.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
void correctBoundaryFlux(const volVectorField &U, surfaceScalarField &phi) const
Correct the boundary flux for the rotation of the MRF region.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &phi) const
Return the given relative flux absolute within the MRF region.
autoPtr< surfaceVectorField > Uf
tmp< volVectorField > DDt(const volVectorField &U) const
Return the frame acceleration.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
bool writeData(Ostream &os) const
Write data to Ostream.
OBJstream os(runTime.globalPath()/outputName)
tmp< surfaceScalarField > relative(const tmp< surfaceScalarField > &phi) const
Return the given absolute flux relative within the MRF region.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
bool good() const noexcept
True if next operation might succeed.
Mesh data needed to do the Finite Volume discretisation.
fvMatrix< vector > fvVectorMatrix
void makeAbsolute(surfaceScalarField &phi, const volVectorField &U)
Make the given flux absolute.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
messageStream Info
Information stream (stdout output on master, null elsewhere)
A class for managing temporary objects.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
void makeRelative(surfaceScalarField &phi, const volVectorField &U)
Make the given flux relative.
void makeRelative(volVectorField &U) const
Make the given absolute velocity relative within the MRF region.
bool read(const dictionary &dict)
Read dictionary.
tmp< surfaceScalarField > relative(const tmp< surfaceScalarField > &tphi, const volVectorField &U)
Return the given absolute flux in relative form.
static constexpr const zero Zero
Global zero (0)