Loading...
Searching...
No Matches
ParticleForceList< CloudType > Class Template Reference

List of particle forces. More...

#include <ParticleForceList.H>

Inheritance diagram for ParticleForceList< CloudType >:
Collaboration diagram for ParticleForceList< CloudType >:

Public Member Functions

 ParticleForceList (CloudType &owner, const fvMesh &mesh)
 Null constructor.
 ParticleForceList (CloudType &owner, const fvMesh &mesh, const dictionary &dict, const bool readFields)
 Construct from mesh.
 ParticleForceList (const ParticleForceList &pfl)
 Construct copy.
virtual ~ParticleForceList ()
 Destructor.
const CloudTypeowner () const
 Return const access to the cloud owner.
CloudTypeowner ()
 Return reference to the cloud owner.
const fvMeshmesh () const
 Return the mesh database.
const dictionarydict () const
 Return the forces dictionary.
void setCalcCoupled (bool flag)
 Set the calcCoupled flag.
void setCalcNonCoupled (bool flag)
 Set the calcNonCoupled flag.
virtual void cacheFields (const bool store)
 Cache fields.
virtual forceSuSp calcCoupled (const typename CloudType::parcelType &p, const typename CloudType::parcelType::trackingData &td, const scalar dt, const scalar mass, const scalar Re, const scalar muc) const
 Calculate the coupled force.
virtual forceSuSp calcNonCoupled (const typename CloudType::parcelType &p, const typename CloudType::parcelType::trackingData &td, const scalar dt, const scalar mass, const scalar Re, const scalar muc) const
 Calculate the non-coupled force.
virtual scalar massEff (const typename CloudType::parcelType &p, const typename CloudType::parcelType::trackingData &td, const scalar mass) const
 Return the effective mass.
Public Member Functions inherited from PtrList< ParticleForce< CloudType > >
Foam::PtrList< ParticleForce< CloudType > > clone (Args &&... args) const
constexpr PtrList () noexcept
 Default construct.
 ~PtrList ()
 Destructor. Frees all pointers.
const ParticleForce< CloudType > * set (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.
ParticleForce< CloudType > & emplace_back (Args &&... args)
 Construct and append an element to the end of the list, return reference to the new list element.
void push_back (ParticleForce< CloudType > *ptr)
 Append an element to the end of the list.
ParticleForce< CloudType > & emplace_set (const label i, Args &&... args)
 Construct and set a new element at given position, (discard old element at that location).
ParticleForce< CloudType > & emplace (const label i, Args &&... args)
 Same as emplace_set().
ParticleForce< CloudType > & try_emplace (const label i, Args &&... args)
 Like emplace_set() but will not overwrite an occupied (non-null) location.
autoPtr< ParticleForce< CloudType > > release (const label i)
 Release ownership of the pointer at the given position.
void transfer (PtrList< ParticleForce< CloudType > > &list)
 Transfer into this list and annul the argument list.
void operator= (const UPtrList< ParticleForce< CloudType > > &list)
 Copy assignment.
void setSize (const label n)
 Same as resize().
void append (autoPtr< ParticleForce< CloudType > > &ptr)
 Move append an element to the end of the list.
Public Member Functions inherited from UPtrList< ParticleForce< CloudType > >
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.
ParticleForce< CloudType > & front ()
 Reference to the first element of the list.
ParticleForce< CloudType > & back ()
 Reference to the last element of the list.
const ParticleForce< CloudType > * test (const label i) const
 Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).
const ParticleForce< CloudType > * get (const label i) const
 Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).
const ParticleForce< CloudType > * set (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 (ParticleForce< CloudType > *ptr)
 Append an element to the end of the list.
void swap (UPtrList< ParticleForce< CloudType > > &list) noexcept
 Swap content.
void transfer (UPtrList< ParticleForce< CloudType > > &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 ParticleForce< CloudType > & at (const label i) const
 Return const reference to the element at given position. FatalError for bounds problem or nullptr.
const ParticleForce< CloudType > & operator[] (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 ParticleForce< CloudType > *operator()(const label i) const
 Deprecated(2022-09) - same as get().
void operator= (const UPtrList< ParticleForce< CloudType > > &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.
ParticleForce< CloudType > ** begin_ptr () noexcept
 Iterator to begin of raw pointers traversal (use with caution).
ParticleForce< CloudType > ** 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().
ParticleForce< CloudType > & first ()
 Reference to the first element of the list.
ParticleForce< CloudType > & last ()
 Return reference to the last element of the list.
void append (ParticleForce< CloudType > *ptr)
 Append an element to the end of the list.
label count () const noexcept
 The number of non-nullptr entries in the list.

Additional Inherited Members

Public Types inherited from UPtrList< ParticleForce< CloudType > >
typedef ParticleForce< CloudTypevalue_type
 Type of values the list contains.
typedef ParticleForce< CloudType > & reference
 A non-const reference to the value_type.
typedef const ParticleForce< CloudType > & const_reference
 A const reference to the value_type.
Protected Member Functions inherited from PtrList< ParticleForce< CloudType > >
void readIstream (Istream &is, const INew &inew)
 Read from Istream using Istream constructor class.
Protected Member Functions inherited from UPtrList< ParticleForce< CloudType > >
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< ParticleForce< CloudType > > &&ptrs) noexcept
 Low-level move construct.
Protected Attributes inherited from UPtrList< ParticleForce< CloudType > >
Detail::PtrListDetail< ParticleForce< CloudType > > ptrs_
 The list of pointers.

Detailed Description

template<class CloudType>
class Foam::ParticleForceList< CloudType >

List of particle forces.

Source files

Definition at line 49 of file ParticleForceList.H.

Constructor & Destructor Documentation

◆ ParticleForceList() [1/3]

template<class CloudType>
ParticleForceList ( CloudType & owner,
const fvMesh & mesh )

Null constructor.

Definition at line 28 of file ParticleForceList.C.

References mesh(), owner(), and PtrList< ParticleForce< CloudType > >::PtrList().

Here is the call graph for this function:

◆ ParticleForceList() [2/3]

template<class CloudType>
ParticleForceList ( CloudType & owner,
const fvMesh & mesh,
const dictionary & dict,
const bool readFields )

◆ ParticleForceList() [3/3]

template<class CloudType>
ParticleForceList ( const ParticleForceList< CloudType > & pfl)

Construct copy.

Definition at line 109 of file ParticleForceList.C.

◆ ~ParticleForceList()

template<class CloudType>
~ParticleForceList ( )
virtual

Destructor.

Definition at line 124 of file ParticleForceList.C.

Member Function Documentation

◆ owner() [1/2]

template<class CloudType>
const CloudType & owner ( ) const
inline

Return const access to the cloud owner.

Definition at line 24 of file ParticleForceListI.H.

Referenced by ParticleForceList(), and ParticleForceList().

Here is the caller graph for this function:

◆ owner() [2/2]

template<class CloudType>
CloudType & owner ( )
inline

Return reference to the cloud owner.

Definition at line 31 of file ParticleForceListI.H.

◆ mesh()

template<class CloudType>
const Foam::fvMesh & mesh ( ) const
inline

Return the mesh database.

Definition at line 38 of file ParticleForceListI.H.

Referenced by ParticleForceList(), and ParticleForceList().

Here is the caller graph for this function:

◆ dict()

template<class CloudType>
const Foam::dictionary & dict ( ) const
inline

Return the forces dictionary.

Definition at line 45 of file ParticleForceListI.H.

Referenced by ParticleForceList().

Here is the caller graph for this function:

◆ setCalcCoupled()

template<class CloudType>
void setCalcCoupled ( bool flag)
inline

Set the calcCoupled flag.

Definition at line 52 of file ParticleForceListI.H.

◆ setCalcNonCoupled()

template<class CloudType>
void setCalcNonCoupled ( bool flag)
inline

Set the calcNonCoupled flag.

Definition at line 59 of file ParticleForceListI.H.

◆ cacheFields()

template<class CloudType>
void cacheFields ( const bool store)
virtual

Cache fields.

Definition at line 131 of file ParticleForceList.C.

References forAll, and UPtrList< ParticleForce< CloudType > >::operator[]().

Here is the call graph for this function:

◆ calcCoupled()

template<class CloudType>
Foam::forceSuSp calcCoupled ( const typename CloudType::parcelType & p,
const typename CloudType::parcelType::trackingData & td,
const scalar dt,
const scalar mass,
const scalar Re,
const scalar muc ) const
virtual

Calculate the coupled force.

Definition at line 141 of file ParticleForceList.C.

References p, Foam::Re(), td(), and Foam::Zero.

Here is the call graph for this function:

◆ calcNonCoupled()

template<class CloudType>
Foam::forceSuSp calcNonCoupled ( const typename CloudType::parcelType & p,
const typename CloudType::parcelType::trackingData & td,
const scalar dt,
const scalar mass,
const scalar Re,
const scalar muc ) const
virtual

Calculate the non-coupled force.

Definition at line 166 of file ParticleForceList.C.

References p, and td().

Here is the call graph for this function:

◆ massEff()

template<class CloudType>
Foam::scalar massEff ( const typename CloudType::parcelType & p,
const typename CloudType::parcelType::trackingData & td,
const scalar mass ) const
virtual

Return the effective mass.

Definition at line 192 of file ParticleForceList.C.

References forAll, massEff(), UPtrList< ParticleForce< CloudType > >::operator[](), p, and td().

Referenced by massEff().

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

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