|
Contains the computed field values, like density, momentum and stress. More...
#include <StandardFields.h>
Public Member Functions | |
StandardFields () | |
Default constructor, sets all field values to zero. More... | |
StandardFields (const StandardFields &P)=default | |
Default copy constructor, copies the values of all fields. More... | |
~StandardFields ()=default | |
Destructor, it simply destructs the StandardFields and all the objects it contains. More... | |
void | write (std::ostream &os) const |
Writes class content into an output stream, typically a stat file. More... | |
void | output (std::ostream &os) const |
Writes human-readable class content into an output stream, typically a stat file. More... | |
void | setZero () |
Sets all fields to zero. More... | |
StandardFields | getSquared () const |
Returns the square of all field values (to calculate standard deviation). More... | |
StandardFields & | operator= (const StandardFields &P) |
Copies all field values. More... | |
StandardFields & | operator+= (const StandardFields &P) |
Adds the field values on the RHS to the LHS of the equation. More... | |
StandardFields & | operator-= (const StandardFields &P) |
Subtracts the field values on the RHS from the LHS of the equation. More... | |
StandardFields & | operator/= (Mdouble a) |
Divides the field values on the LHS by the RHS of the equation. More... | |
StandardFields | operator* (Mdouble a) const |
Multiplies the field values on the left of the '*' by the scalar value on the right of the '*' and returns the answer. More... | |
void | addParticleStatistics (Mdouble phi, const StandardFields ¤tInteraction) |
This function should be called from within a loop over all particles to compute all the fields that are defined as a sum over all particles (e.g. density, momentum). More... | |
void | addParticleDifferentialStatistics (Vec3D &dphi, const StandardFields ¤tInteraction) |
void | addInteractionStatistics (Mdouble psi, const StandardFields ¤tInteraction) |
This function should be called from within a loop over all Interactions to compute all the fields that are defined as a sum over all Interactions (e.g. stress). More... | |
void | addContactPointStatistics (Mdouble phi, const StandardFields ¤tInteraction) |
This function should be called from within a loop over all Interactions to compute all the fields that are defined as a sum over all Interactions with external objects (e.g. IFD). More... | |
void | setFields (const BaseInteraction &c, IntegralType type) |
void | setCylindricalFields (const BaseInteraction &c, IntegralType type) |
void | setFields (const BaseParticle &p) |
void | setCylindricalFields (const BaseParticle &p) |
Mdouble | getVolumeFraction () const |
Mdouble | getDensity () const |
Vec3D | getMomentum () const |
MatrixSymmetric3D | getMomentumFlux () const |
Matrix3D | getContactStress () const |
Vec3D | getInteractionForceDensity () const |
Mdouble | getParticleSizeDensity (size_t i) const |
std::array< Mdouble, 6 > | getParticleSizeDensity () const |
std::array< Mdouble, 6 > | getParticleSizeMomenta () const |
std::array< Mdouble, 6 > | getCentralParticleSizeMomenta () const |
std::array< Mdouble, 6 > | getStandardisedParticleSizeMomenta () const |
void | outputStandardisedParticleSizeMomenta (std::ostream &os) const |
Static Public Member Functions | |
static void | writeNames (std::ostream &os, unsigned countVariables) |
static bool | doInteractionStatistics () |
Returns true if the class contains fields that are defined as a sum over all Interactions (e.g. stress), else returns false. More... | |
static bool | evaluateFixedParticles () |
static bool | isDifferentialField () |
Private Attributes | |
Mdouble | volumeFraction_ |
Mdouble | density_ |
Vec3D | momentum_ |
MatrixSymmetric3D | momentumFlux_ |
Matrix3D | contactStress_ |
Vec3D | interactionForceDensity_ |
std::array< Mdouble, 6 > | particleSizeDensity_ |
Contains the computed field values, like density, momentum and stress.
CGPoints inherits from this class; CGPoints::evaluate adds to the values of these variables.
CGFields::StandardFields::StandardFields | ( | ) |
Default constructor, sets all field values to zero.
References setZero().
|
default |
Default copy constructor, copies the values of all fields.
|
default |
Destructor, it simply destructs the StandardFields and all the objects it contains.
void CGFields::StandardFields::addContactPointStatistics | ( | Mdouble | phi, |
const StandardFields & | currentInteraction | ||
) |
This function should be called from within a loop over all Interactions to compute all the fields that are defined as a sum over all Interactions with external objects (e.g. IFD).
[in] | phi | the value of the cg function for the contact point of c and the current CGPoint |
[in] | c | the interaction which is used in the cg function |
References getInteractionForceDensity(), and interactionForceDensity_.
void CGFields::StandardFields::addInteractionStatistics | ( | Mdouble | psi, |
const StandardFields & | currentInteraction | ||
) |
This function should be called from within a loop over all Interactions to compute all the fields that are defined as a sum over all Interactions (e.g. stress).
[in] | psi | the value of the line integral from C to P at the current CGPoint |
[in] | c | the contact which is used in the line integral |
References contactStress_, and getContactStress().
void CGFields::StandardFields::addParticleDifferentialStatistics | ( | Vec3D & | dphi, |
const StandardFields & | currentInteraction | ||
) |
void CGFields::StandardFields::addParticleStatistics | ( | Mdouble | phi, |
const StandardFields & | currentInteraction | ||
) |
This function should be called from within a loop over all particles to compute all the fields that are defined as a sum over all particles (e.g. density, momentum).
[in] | phi | the value of the cg function at the current CGPoint |
[in] | currentInteraction | the fields which are produced due to the particle at its centre |
References density_, getDensity(), getMomentum(), getMomentumFlux(), getParticleSizeDensity(), getVolumeFraction(), constants::i, momentum_, momentumFlux_, particleSizeDensity_, and volumeFraction_.
|
static |
Returns true if the class contains fields that are defined as a sum over all Interactions (e.g. stress), else returns false.
If the functions returns false, addInteractionStatistics and addContactPointStatistics are never called.
|
inlinestatic |
std::array< Mdouble, 6 > CGFields::StandardFields::getCentralParticleSizeMomenta | ( | ) | const |
References getParticleSizeMomenta().
Referenced by getStandardisedParticleSizeMomenta().
|
inline |
References contactStress_.
Referenced by addInteractionStatistics().
|
inline |
References density_.
Referenced by addParticleStatistics(), and testCGHandler().
|
inline |
References interactionForceDensity_.
Referenced by addContactPointStatistics(), and testCGHandler().
|
inline |
|
inline |
References momentumFlux_.
Referenced by addParticleStatistics().
|
inline |
References particleSizeDensity_.
|
inline |
References constants::i, and particleSizeDensity_.
Referenced by addParticleStatistics().
std::array< Mdouble, 6 > CGFields::StandardFields::getParticleSizeMomenta | ( | ) | const |
StandardFields CGFields::StandardFields::getSquared | ( | ) | const |
Returns the square of all field values (to calculate standard deviation).
References contactStress_, density_, interactionForceDensity_, momentum_, momentumFlux_, Global_Physical_Variables::P, particleSizeDensity_, Matrix3D::square(), MatrixSymmetric3D::square(), mathsFunc::square(), Vec3D::square(), and volumeFraction_.
std::array< Mdouble, 6 > CGFields::StandardFields::getStandardisedParticleSizeMomenta | ( | ) | const |
References getCentralParticleSizeMomenta().
Referenced by outputStandardisedParticleSizeMomenta().
|
inline |
References volumeFraction_.
Referenced by addParticleStatistics().
|
inlinestatic |
StandardFields CGFields::StandardFields::operator* | ( | Mdouble | a | ) | const |
Multiplies the field values on the left of the '*' by the scalar value on the right of the '*' and returns the answer.
[in] | a | the scalar that we multiply with |
References contactStress_, density_, constants::i, interactionForceDensity_, momentum_, momentumFlux_, particleSizeDensity_, and volumeFraction_.
StandardFields & CGFields::StandardFields::operator+= | ( | const StandardFields & | P | ) |
Adds the field values on the RHS to the LHS of the equation.
[in] | P | the CGField that has to be added |
References contactStress_, density_, constants::i, interactionForceDensity_, momentum_, momentumFlux_, Global_Physical_Variables::P, particleSizeDensity_, and volumeFraction_.
StandardFields & CGFields::StandardFields::operator-= | ( | const StandardFields & | P | ) |
Subtracts the field values on the RHS from the LHS of the equation.
[in] | P | the CGField that has to be subtracted |
References contactStress_, density_, constants::i, interactionForceDensity_, momentum_, momentumFlux_, Global_Physical_Variables::P, particleSizeDensity_, and volumeFraction_.
StandardFields & CGFields::StandardFields::operator/= | ( | Mdouble | a | ) |
Divides the field values on the LHS by the RHS of the equation.
[in] | a | the scalar that we divide by |
References contactStress_, density_, interactionForceDensity_, momentum_, momentumFlux_, particleSizeDensity_, and volumeFraction_.
|
default |
Copies all field values.
[in] | P | the CGField that has to be copied |
void CGFields::StandardFields::output | ( | std::ostream & | os | ) | const |
Writes human-readable class content into an output stream, typically a stat file.
[in,out] | os | the ostream into which the data is written. |
References contactStress_, density_, interactionForceDensity_, momentum_, momentumFlux_, particleSizeDensity_, and volumeFraction_.
void CGFields::StandardFields::outputStandardisedParticleSizeMomenta | ( | std::ostream & | os | ) | const |
References getStandardisedParticleSizeMomenta().
void CGFields::StandardFields::setCylindricalFields | ( | const BaseInteraction & | c, |
IntegralType | type | ||
) |
References contactStress_, BaseInteraction::getContactPoint(), Matrix3D::getCylindricalTensorField(), Vec3D::getCylindricalTensorField(), interactionForceDensity_, and setFields().
void CGFields::StandardFields::setCylindricalFields | ( | const BaseParticle & | p | ) |
References MatrixSymmetric3D::getCylindricalTensorField(), Vec3D::getCylindricalTensorField(), BaseInteractable::getPosition(), momentum_, momentumFlux_, and setFields().
void CGFields::StandardFields::setFields | ( | const BaseInteraction & | c, |
IntegralType | type | ||
) |
References contactStress_, Matrix3D::dyadic(), BaseInteraction::getCP(), BaseInteraction::getForce(), BaseInteraction::getIC(), BaseInteraction::getIP(), I_TO_CONTACT, I_TO_P, and interactionForceDensity_.
Referenced by setCylindricalFields().
void CGFields::StandardFields::setFields | ( | const BaseParticle & | p | ) |
References density_, BaseParticle::getMass(), BaseParticle::getRadius(), BaseInteractable::getVelocity(), BaseParticle::getVolume(), momentum_, momentumFlux_, particleSizeDensity_, MatrixSymmetric3D::selfDyadic(), and volumeFraction_.
void CGFields::StandardFields::setZero | ( | ) |
Sets all fields to zero.
References contactStress_, density_, interactionForceDensity_, momentum_, momentumFlux_, particleSizeDensity_, Matrix3D::setZero(), MatrixSymmetric3D::setZero(), Vec3D::setZero(), and volumeFraction_.
Referenced by StandardFields().
void CGFields::StandardFields::write | ( | std::ostream & | os | ) | const |
Writes class content into an output stream, typically a stat file.
[in,out] | os | the ostream into which the data is written. |
References contactStress_, density_, interactionForceDensity_, momentum_, momentumFlux_, particleSizeDensity_, and volumeFraction_.
|
static |
[in,out] | os | the ostream into which the data is written. |
[in] | countVariables | The number of variables in the field (including time), e.g. 1 for O, 4 for XYZ |
|
private |
Contact stress, computed as the sum over all contacts between particle i and particle/wall/fixed particle j
\[\mathbf \sigma^{c}(\vec r,t)=\sum_{ij} \vec f_{ij} \otimes \vec l_{ij} \psi(\vec r,\vec r_i,\vec r_j),\]
with contact force \(\vec f_{ij}\), branch vector \(\vec l_{ij}= \vec c_{ij}-\vec r_i\), particle position \(\vec r_i\), contact point \(\vec c_{ij}\), and cg line integral \(\psi(\vec r,\vec r_i,\vec r_j)\), see CGFunctions::Gauss::evaluateCGIntegral.
Referenced by addInteractionStatistics(), getContactStress(), getSquared(), operator*(), operator+=(), operator-=(), operator/=(), output(), setCylindricalFields(), setFields(), setZero(), and write().
|
private |
(Mass) density, computed as the sum over all particles i
\[\rho(\vec r,t)=\sum_i m_i \phi(\vec r,\vec r_i)\]
with particle mass m_i and cg function \(\phi(\vec r,\vec r_i),\), see CGFunctions::Gauss::evaluateCGFunction.
Referenced by addParticleStatistics(), getDensity(), getSquared(), operator*(), operator+=(), operator-=(), operator/=(), output(), setFields(), setZero(), and write().
|
private |
Interaction force density, computed as the sum over all contacts between particle i and (external) wall/fixed particle j
\[\vec{IFD}(\vec r,t)=\sum_{ij} f_{ij} \phi(\vec r,\vec c_{ij}),\]
with contact force \(\vec f_{ij}\) and cg function \(\phi(\vec r,\vec r_i)\), see CGFunctions::Gauss::evaluateCGFunction.
Referenced by addContactPointStatistics(), getInteractionForceDensity(), getSquared(), operator*(), operator+=(), operator-=(), operator/=(), output(), setCylindricalFields(), setFields(), setZero(), and write().
|
private |
Momentum, computed as the sum over all particles i
\[\vec j(\vec r,t)=\sum_i m_i \vec v_i\phi(\vec r,\vec r_i),\]
with particle momentum \(m_i\vec v_i\) and cg function \(\phi(\vec r,\vec r_i)\), see CGFunctions::Gauss::evaluateCGFunction.
Velocity can be calculated in a post-processing step from momentum and density as
\[\vec V(\vec r,t) = \frac{\vec j(\vec r,t)}{\rho(\vec r,t)}.\]
Referenced by addParticleStatistics(), getMomentum(), getSquared(), operator*(), operator+=(), operator-=(), operator/=(), output(), setCylindricalFields(), setFields(), setZero(), and write().
|
private |
Momentum, computed as the sum over all particles i
\[\mathbf k(\vec r,t)=\sum_i m_i \vec v_i \otimes \vec v_i\phi(\vec r,\vec r_i),\]
with particle momentum flux \(m_i\vec v_i \otimes \vec v_i\) and cg function \(\phi(\vec r,\vec r_i)\), see CGFunctions::Gauss::evaluateCGFunction.
Kinetic stress can be calculated in a post-processing step from momentum flux and density as
\[\mathbf \sigma^{k} = \mathbf k - \rho \vec V \otimes \vec V.\]
Referenced by addParticleStatistics(), getMomentumFlux(), getSquared(), operator*(), operator+=(), operator-=(), operator/=(), output(), setCylindricalFields(), setFields(), setZero(), and write().
|
private |
Density of particle size, and powers of particle size,
\[ \vec{PS}_k(\vec r,t)= \sum_i r_i^k \phi(\vec r),\]
with radius \(r_i\).
Used to compute the first five moments of the particle size distribution,
\[ <r^k>(\vec r,t)= \vec{PS}_k / \vec{PS}_0, \]
with \(\vec{PS}_0\) denoting the number density.
Referenced by addParticleStatistics(), getParticleSizeDensity(), getParticleSizeMomenta(), getSquared(), operator*(), operator+=(), operator-=(), operator/=(), output(), setFields(), setZero(), and write().
|
private |
Particle volume fraction, computed as the sum over all particles i
\[\nu(\vec r,t)=\sum_i V_i \phi(\vec r,\vec r_i),\]
with particle volume V_i and cg function \(\phi(\vec r,\vec r_i)\), see CGFunctions::Gauss::evaluateCGFunction.
Referenced by addParticleStatistics(), getSquared(), getVolumeFraction(), operator*(), operator+=(), operator-=(), operator/=(), output(), setFields(), setZero(), and write().