36Foam::MRFZoneList::MRFZoneList
58 a = a || this->operator[](i).active();
61 if (warn && this->size() && !a)
73 for (
const entry& dEntry :
dict)
109 for (
const auto& mrf: *
this)
111 if (mrf.name() ==
name)
116 names.append(mrf.name());
120 <<
"Unable to find MRFZone " <<
name
121 <<
". Available zones are: " <<
names
131 for (
auto& mrf: *
this)
133 bool ok = mrf.read(
dict.subDict(mrf.name()));
134 allOk = (allOk && ok);
142 for (
const auto& mrf: *
this)
158 for (
const auto& mrf: *
this)
160 mrf.addCoriolis(
U, ddtU);
167 for (
const auto& mrf: *
this)
169 mrf.addCoriolis(
UEqn);
180 for (
const auto& mrf: *
this)
199 auto& acceleration = tacceleration.ref();
201 for (
const auto& mrf: *
this)
203 mrf.addCoriolis(
U, acceleration);
206 return tacceleration;
229 auto&
phi = tphi.ref();
231 for (
const auto& mrf : *
this)
242 for (
const auto& mrf: *
this)
251 for (
const auto& mrf: *
this)
253 mrf.makeRelative(
phi);
260 const tmp<surfaceScalarField>& tphi
265 tmp<surfaceScalarField> rphi
270 "relative(" + tphi().
name() +
')',
290 const tmp<FieldField<fvsPatchField, scalar>>& tphi
295 tmp<FieldField<fvsPatchField, scalar>> rphi(
New(tphi,
true));
297 for (
const auto& mrf: *
this)
299 mrf.makeRelative(rphi.ref());
314 const tmp<Field<scalar>>& tphi,
320 tmp<Field<scalar>> rphi(
New(tphi,
true));
322 for (
const auto& mrf: *
this)
324 mrf.makeRelative(rphi.ref(), patchi);
342 for (
const auto& mrf: *
this)
344 mrf.makeRelative(
rho,
phi);
351 for (
const auto& mrf: *
this)
360 for (
const auto& mrf: *
this)
362 mrf.makeAbsolute(
phi);
369 const tmp<surfaceScalarField>& tphi
374 tmp<surfaceScalarField> rphi
379 "absolute(" + tphi().
name() +
')',
385 makeAbsolute(rphi.ref());
402 for (
const auto& mrf: *
this)
404 mrf.makeAbsolute(
rho,
phi);
411 for (
const auto& mrf: *
this)
413 mrf.correctBoundaryVelocity(
U);
424 FieldField<fvsPatchField, scalar>
Uf
426 relative(mesh_.Sf().boundaryField() &
U.boundaryField())
431 forAll(mesh_.boundary(), patchi)
435 phibf[patchi] ==
Uf[patchi];
443 if (mesh_.topoChanging())
445 for (
auto& mrf: *
this)
455Foam::Ostream& Foam::operator<<
461 models.writeData(
os);
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
A field of fields is a PtrList of fields with reference counting.
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
static tmp< GeometricField< vector, fvPatchField, volMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=fvPatchField< vector >::calculatedType())
GeometricBoundaryField< scalar, fvsPatchField, surfaceMesh > Boundary
@ NO_REGISTER
Do not request registration (bool: false).
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
List container for MRF zomes.
tmp< surfaceScalarField > relative(const tmp< surfaceScalarField > &phi) const
Return the given absolute flux relative within the MRF region.
void reset(const dictionary &dict)
Reset the source list.
const fvMesh & mesh_
Reference to the mesh database.
bool writeData(Ostream &os) const
Write data to Ostream.
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &phi) const
Return the given relative flux absolute within the MRF region.
bool read(const dictionary &dict)
Read dictionary.
void addAcceleration(const volVectorField &U, volVectorField &ddtU) const
Add the frame acceleration.
void makeAbsolute(volVectorField &U) const
Make the given relative velocity absolute within the MRF region.
void correctBoundaryVelocity(volVectorField &U) const
Correct the boundary velocity for the rotation of the MRF region.
const MRFZone & getFromName(const word &name) const
Return the MRF with a given name.
void makeRelative(volVectorField &U) const
Make the given absolute velocity relative within the MRF region.
void update()
Update MRFZone faces if the mesh topology changes.
tmp< surfaceScalarField > phi() const
Return the MRF absolute flux.
tmp< volVectorField > DDt(const volVectorField &U) const
Return the frame acceleration.
bool active(const bool warn=false) const
Return active status.
void correctBoundaryFlux(const volVectorField &U, surfaceScalarField &phi) const
Correct the boundary flux for the rotation of the MRF region.
MRF zone definition based on cell zone and parameters obtained from a control dictionary constructed ...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const MRFZone * set(const label i) const
constexpr PtrList() noexcept
const MRFZone & operator[](const label i) const
label size() const noexcept
label count() const noexcept
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A keyword and a list of tokens is an 'entry'.
Mesh data needed to do the Finite Volume discretisation.
A class for managing temporary objects.
void clear() const noexcept
If object pointer points to valid object: delete object and set pointer to nullptr.
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
A class for handling words, derived from Foam::string.
MRF makeRelative(fvc::interpolate(rho), phiHbyA)
patchWriters resize(patchIds.size())
autoPtr< surfaceVectorField > Uf
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
void set(List< bool > &bools, const labelUList &locations)
Set the listed locations (assign 'true').
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
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.
GeometricField< vector, fvPatchField, volMesh > volVectorField
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const dimensionSet dimArea(sqr(dimLength))
const dimensionSet dimVelocity
messageStream Info
Information stream (stdout output on master, null elsewhere).
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
fvMatrix< vector > fvVectorMatrix
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.