Loading...
Searching...
No Matches
MRFZoneList Class Reference

List container for MRF zomes. More...

#include <MRFZoneList.H>

Inheritance diagram for MRFZoneList:
Collaboration diagram for MRFZoneList:

Public Member Functions

 MRFZoneList (const fvMesh &mesh, const dictionary &dict)
 Constructor.
 ~MRFZoneList ()=default
 Destructor.
bool active (const bool warn=false) const
 Return active status.
void reset (const dictionary &dict)
 Reset the source list.
const MRFZonegetFromName (const word &name) const
 Return the MRF with a given name.
void addAcceleration (const volVectorField &U, volVectorField &ddtU) const
 Add the frame acceleration.
void addAcceleration (fvVectorMatrix &UEqn) const
 Add the frame acceleration contribution to the momentum equation.
void addAcceleration (const volScalarField &rho, fvVectorMatrix &UEqn) const
 Add the frame acceleration contribution to the momentum equation.
tmp< volVectorFieldDDt (const volVectorField &U) const
 Return the frame acceleration.
tmp< volVectorFieldDDt (const volScalarField &rho, const volVectorField &U) const
 Return the frame acceleration.
tmp< surfaceScalarFieldphi () const
 Return the MRF absolute flux.
void makeRelative (volVectorField &U) const
 Make the given absolute velocity relative within the MRF region.
void makeRelative (surfaceScalarField &phi) const
 Make the given absolute flux relative within the MRF region.
tmp< surfaceScalarFieldrelative (const tmp< surfaceScalarField > &phi) const
 Return the given absolute flux relative within the MRF region.
tmp< FieldField< fvsPatchField, scalar > > relative (const tmp< FieldField< fvsPatchField, scalar > > &tphi) const
 Return the given absolute boundary flux relative within.
tmp< Field< scalar > > relative (const tmp< Field< scalar > > &tphi, const label patchi) const
 Return the given absolute patch flux relative within.
void makeRelative (const surfaceScalarField &rho, surfaceScalarField &phi) const
 Make the given absolute mass-flux relative within the MRF region.
void makeAbsolute (volVectorField &U) const
 Make the given relative velocity absolute within the MRF region.
void makeAbsolute (surfaceScalarField &phi) const
 Make the given relative flux absolute within the MRF region.
tmp< surfaceScalarFieldabsolute (const tmp< surfaceScalarField > &phi) const
 Return the given relative flux absolute within the MRF region.
void makeAbsolute (const surfaceScalarField &rho, surfaceScalarField &phi) const
 Make the given relative mass-flux absolute within the MRF region.
void correctBoundaryVelocity (volVectorField &U) const
 Correct the boundary velocity for the rotation of the MRF region.
void correctBoundaryFlux (const volVectorField &U, surfaceScalarField &phi) const
 Correct the boundary flux for the rotation of the MRF region.
template<class Type>
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > zeroFilter (const tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > &tphi) const
 Filter-out the MRF region contribution from the given field.
void update ()
 Update MRFZone faces if the mesh topology changes.
bool read (const dictionary &dict)
 Read dictionary.
bool writeData (Ostream &os) const
 Write data to Ostream.
template<class Type>
Foam::tmp< Foam::GeometricField< Type, Foam::fvsPatchField, Foam::surfaceMesh > > zeroFilter (const tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > &tphi) const
Public Member Functions inherited from PtrList< MRFZone >
Foam::PtrList< MRFZoneclone (Args &&... args) const
constexpr PtrList () noexcept
 Default construct.
 ~PtrList ()
 Destructor. Frees all pointers.
const MRFZoneset (const label i) const
 Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).
void clear ()
 Clear the PtrList. Delete allocated entries and set size to zero.
void free ()
 Free memory and nullify all entries. Does not change the list size.
void resize (const label newLen)
 Adjust size of PtrList.
void resize_null (const label newLen)
 Set the addressed list to the given size, deleting all existing entries. Afterwards the list contains all nullptr entries.
MRFZoneemplace_back (Args &&... args)
 Construct and append an element to the end of the list, return reference to the new list element.
void push_back (MRFZone *ptr)
 Append an element to the end of the list.
MRFZoneemplace_set (const label i, Args &&... args)
 Construct and set a new element at given position, (discard old element at that location).
MRFZoneemplace (const label i, Args &&... args)
 Same as emplace_set().
MRFZonetry_emplace (const label i, Args &&... args)
 Like emplace_set() but will not overwrite an occupied (non-null) location.
autoPtr< MRFZonerelease (const label i)
 Release ownership of the pointer at the given position.
void transfer (PtrList< MRFZone > &list)
 Transfer into this list and annul the argument list.
void operator= (const UPtrList< MRFZone > &list)
 Copy assignment.
void setSize (const label n)
 Same as resize().
void append (autoPtr< MRFZone > &ptr)
 Move append an element to the end of the list.
Public Member Functions inherited from UPtrList< MRFZone >
bool empty () const noexcept
 True if the list is empty (ie, size() is zero).
label size () const noexcept
 The number of entries in the list.
label capacity () const noexcept
 Size of the underlying storage.
label count_nonnull () const noexcept
 The number of non-nullptr entries in the list.
MRFZonefront ()
 Reference to the first element of the list.
MRFZoneback ()
 Reference to the last element of the list.
const MRFZonetest (const label i) const
 Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).
const MRFZoneget (const label i) const
 Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).
const MRFZoneset (const label i) const
 Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).
void clear ()
 Set list size to zero.
void free ()
 Nullify all entries. Does not change the list size.
void resize (const label newLen)
 Change the size of the list. Any new entries are nullptr.
void resize_null (const label newLen)
 Set the list to the given size and set all entries to nullptr.
label squeezeNull ()
 Squeeze out nullptr entries in the list of pointers after which any null pointers will be at the end of the list.
void push_back (MRFZone *ptr)
 Append an element to the end of the list.
void swap (UPtrList< MRFZone > &list) noexcept
 Swap content.
void transfer (UPtrList< MRFZone > &list)
 Transfer contents into this list and annul the argument.
void reorder (const labelUList &oldToNew, const bool check=false)
 Reorder elements. Reordering must be unique (ie, shuffle).
void sortOrder (const labelUList &order, const bool check=false)
 Reorder elements according to new order mapping (newToOld). Reordering must be unique (ie, shuffle).
void checkNonNull () const
 Check and raise FatalError if any nullptr exists in the list.
const MRFZoneat (const label i) const
 Return const reference to the element at given position. FatalError for bounds problem or nullptr.
const MRFZoneoperator[] (const label i) const
 Return const reference to the element at given position. FatalError for bounds problem or nullptr. Same as at().
 FOAM_DEPRECATED_FOR (2022-09, "get(), set() or test() methods") const MRFZone *operator()(const label i) const
 Deprecated(2022-09) - same as get().
void operator= (const UPtrList< MRFZone > &list)
 Copy assignment (shallow copies addresses).
OstreamprintAddresses (Ostream &os) const
 Print pointer addresses to Ostream (debugging only).
OstreamwriteList (Ostream &os, const bool trimNull=false) const
 Write UPtrList to Ostream, optionally ignoring null entries.
MRFZone ** begin_ptr () noexcept
 Iterator to begin of raw pointers traversal (use with caution).
MRFZone ** end_ptr () noexcept
 Iterator beyond end of raw pointers traversal (use with caution).
iterator begin ()
 Return iterator to begin traversal of non-nullptr entries.
iterator end () noexcept
 Return iterator beyond end of UPtrList traversal.
const_iterator cbegin () const
 Return const_iterator to begin traversal of non-nullptr entries.
const_iterator cend () const noexcept
 Return const_iterator beyond end of UPtrList traversal.
void setSize (const label n)
 Alias for resize().
MRFZonefirst ()
 Reference to the first element of the list.
MRFZonelast ()
 Return reference to the last element of the list.
void append (MRFZone *ptr)
 Append an element to the end of the list.
label count () const noexcept
 The number of non-nullptr entries in the list.

Protected Attributes

const fvMeshmesh_
 Reference to the mesh database.
Protected Attributes inherited from UPtrList< MRFZone >
Detail::PtrListDetail< MRFZoneptrs_
 The list of pointers.

Friends

Ostreamoperator<< (Ostream &os, const MRFZoneList &models)
 Ostream operator.

Additional Inherited Members

Public Types inherited from UPtrList< MRFZone >
typedef MRFZone value_type
 Type of values the list contains.
typedef MRFZonereference
 A non-const reference to the value_type.
typedef const MRFZoneconst_reference
 A const reference to the value_type.
Protected Member Functions inherited from PtrList< MRFZone >
void readIstream (Istream &is, const INew &inew)
 Read from Istream using Istream constructor class.
Protected Member Functions inherited from UPtrList< MRFZone >
void setAddressableSize (const label n) noexcept
 Adjust addressable size.
label find_next (label pos) const
 The next non-null entry after the specified position.
 UPtrList (Detail::PtrListDetail< MRFZone > &&ptrs) noexcept
 Low-level move construct.

Detailed Description

List container for MRF zomes.

Source files

Definition at line 54 of file MRFZoneList.H.

Constructor & Destructor Documentation

◆ MRFZoneList()

MRFZoneList ( const fvMesh & mesh,
const dictionary & dict )

Constructor.

Definition at line 29 of file MRFZoneList.C.

References active(), dict, mesh, mesh_, PtrList< MRFZone >::PtrList(), and reset().

Here is the call graph for this function:

◆ ~MRFZoneList()

~MRFZoneList ( )
default

Destructor.

References dict, Foam::name(), phi(), rho, U, and UEqn.

Here is the call graph for this function:

Member Function Documentation

◆ active()

bool active ( const bool warn = false) const

Return active status.

Definition at line 46 of file MRFZoneList.C.

References Foam::endl(), forAll, Foam::Info, UPtrList< MRFZone >::operator[](), and UPtrList< MRFZone >::size().

Referenced by MRFZoneList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

void reset ( const dictionary & dict)

Reset the source list.

Definition at line 63 of file MRFZoneList.C.

References UPtrList< MRFZone >::count(), dict, Foam::endl(), Foam::Info, mesh_, Foam::name(), resize(), and PtrList< MRFZone >::set().

Referenced by MRFZoneList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFromName()

const Foam::MRFZone & getFromName ( const word & name) const

Return the MRF with a given name.

Definition at line 96 of file MRFZoneList.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, UPtrList< MRFZone >::first(), Foam::name(), and names.

Here is the call graph for this function:

◆ addAcceleration() [1/3]

void addAcceleration ( const volVectorField & U,
volVectorField & ddtU ) const

Add the frame acceleration.

Definition at line 145 of file MRFZoneList.C.

References U.

◆ addAcceleration() [2/3]

void addAcceleration ( fvVectorMatrix & UEqn) const

Add the frame acceleration contribution to the momentum equation.

Definition at line 158 of file MRFZoneList.C.

References UEqn.

◆ addAcceleration() [3/3]

void addAcceleration ( const volScalarField & rho,
fvVectorMatrix & UEqn ) const

Add the frame acceleration contribution to the momentum equation.

Definition at line 167 of file MRFZoneList.C.

References rho, and UEqn.

◆ DDt() [1/2]

Foam::tmp< Foam::volVectorField > DDt ( const volVectorField & U) const

Return the frame acceleration.

Definition at line 180 of file MRFZoneList.C.

References Foam::dimTime, GeometricField< vector, fvPatchField, volMesh >::New(), IOobjectOption::NO_REGISTER, IOobject::scopedName(), U, and Foam::Zero.

Referenced by DDt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DDt() [2/2]

Foam::tmp< Foam::volVectorField > DDt ( const volScalarField & rho,
const volVectorField & U ) const

Return the frame acceleration.

Definition at line 203 of file MRFZoneList.C.

References DDt(), rho, and U.

Here is the call graph for this function:

◆ phi()

Return the MRF absolute flux.

Definition at line 213 of file MRFZoneList.C.

References Foam::dimArea, Foam::dimVelocity, mesh_, GeometricField< scalar, fvsPatchField, surfaceMesh >::New(), IOobjectOption::NO_REGISTER, phi(), and Foam::Zero.

Referenced by correctBoundaryFlux(), makeAbsolute(), makeAbsolute(), makeRelative(), makeRelative(), phi(), and ~MRFZoneList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeRelative() [1/3]

void makeRelative ( volVectorField & U) const

Make the given absolute velocity relative within the MRF region.

Definition at line 233 of file MRFZoneList.C.

References U.

◆ makeRelative() [2/3]

void makeRelative ( surfaceScalarField & phi) const

Make the given absolute flux relative within the MRF region.

Definition at line 242 of file MRFZoneList.C.

References phi().

Here is the call graph for this function:

◆ relative() [1/3]

Foam::tmp< Foam::surfaceScalarField > relative ( const tmp< surfaceScalarField > & phi) const

Return the given absolute flux relative within the MRF region.

Definition at line 251 of file MRFZoneList.C.

References tmp< T >::clear(), makeRelative(), name, Foam::New(), tmp< T >::ref(), and UPtrList< MRFZone >::size().

Referenced by correctBoundaryFlux().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ relative() [2/3]

Foam::tmp< Foam::FieldField< Foam::fvsPatchField, Foam::scalar > > relative ( const tmp< FieldField< fvsPatchField, scalar > > & tphi) const

Return the given absolute boundary flux relative within.

the MRF region

Definition at line 281 of file MRFZoneList.C.

References Foam::New(), tmp< T >::ref(), and UPtrList< MRFZone >::size().

Here is the call graph for this function:

◆ relative() [3/3]

Foam::tmp< Foam::Field< Foam::scalar > > relative ( const tmp< Field< scalar > > & tphi,
const label patchi ) const

Return the given absolute patch flux relative within.

the MRF region

Definition at line 305 of file MRFZoneList.C.

References Foam::New(), tmp< T >::ref(), and UPtrList< MRFZone >::size().

Here is the call graph for this function:

◆ makeRelative() [3/3]

void makeRelative ( const surfaceScalarField & rho,
surfaceScalarField & phi ) const

Make the given absolute mass-flux relative within the MRF region.

Definition at line 329 of file MRFZoneList.C.

References phi(), and rho.

Here is the call graph for this function:

◆ makeAbsolute() [1/3]

void makeAbsolute ( volVectorField & U) const

Make the given relative velocity absolute within the MRF region.

Definition at line 342 of file MRFZoneList.C.

References U.

Referenced by absolute().

Here is the caller graph for this function:

◆ makeAbsolute() [2/3]

void makeAbsolute ( surfaceScalarField & phi) const

Make the given relative flux absolute within the MRF region.

Definition at line 351 of file MRFZoneList.C.

References phi().

Here is the call graph for this function:

◆ absolute()

Foam::tmp< Foam::surfaceScalarField > absolute ( const tmp< surfaceScalarField > & phi) const

Return the given relative flux absolute within the MRF region.

Definition at line 360 of file MRFZoneList.C.

References tmp< T >::clear(), makeAbsolute(), name, Foam::New(), tmp< T >::ref(), and UPtrList< MRFZone >::size().

Here is the call graph for this function:

◆ makeAbsolute() [3/3]

void makeAbsolute ( const surfaceScalarField & rho,
surfaceScalarField & phi ) const

Make the given relative mass-flux absolute within the MRF region.

Definition at line 389 of file MRFZoneList.C.

References phi(), and rho.

Here is the call graph for this function:

◆ correctBoundaryVelocity()

void correctBoundaryVelocity ( volVectorField & U) const

Correct the boundary velocity for the rotation of the MRF region.

Definition at line 402 of file MRFZoneList.C.

References U.

◆ correctBoundaryFlux()

void correctBoundaryFlux ( const volVectorField & U,
surfaceScalarField & phi ) const

Correct the boundary flux for the rotation of the MRF region.

Definition at line 411 of file MRFZoneList.C.

References forAll, Foam::isA(), mesh_, phi(), relative(), U, and Uf.

Here is the call graph for this function:

◆ zeroFilter() [1/2]

template<class Type>
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > zeroFilter ( const tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > & tphi) const

Filter-out the MRF region contribution from the given field.

setting the corresponding values to zero

References dict, and os().

Here is the call graph for this function:

◆ update()

void update ( )

Update MRFZone faces if the mesh topology changes.

Definition at line 434 of file MRFZoneList.C.

References mesh_.

◆ read()

bool read ( const dictionary & dict)

Read dictionary.

Definition at line 121 of file MRFZoneList.C.

References dict.

Referenced by IOMRFZoneList::read().

Here is the caller graph for this function:

◆ writeData()

bool writeData ( Ostream & os) const

Write data to Ostream.

Definition at line 133 of file MRFZoneList.C.

References Foam::nl, and os().

Here is the call graph for this function:

◆ zeroFilter() [2/2]

template<class Type>
Foam::tmp< Foam::GeometricField< Type, Foam::fvsPatchField, Foam::surfaceMesh > > zeroFilter ( const tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > & tphi) const

Definition at line 27 of file MRFZoneListTemplates.C.

References forAll, name, Foam::New(), UPtrList< MRFZone >::operator[](), tmp< T >::ref(), UPtrList< MRFZone >::size(), and MRFZone::zero().

Here is the call graph for this function:

◆ operator<<

Ostream & operator<< ( Ostream & os,
const MRFZoneList & models )
friend

Ostream operator.

References os().

Member Data Documentation

◆ mesh_

const fvMesh& mesh_
protected

Reference to the mesh database.

Definition at line 78 of file MRFZoneList.H.

Referenced by correctBoundaryFlux(), MRFZoneList(), phi(), reset(), and update().


The documentation for this class was generated from the following files: