|
SPHNormalSpecies contains the parameters used to describe a SPH model. More...
#include <SPHNormalSpecies.h>
Public Types | |
typedef SPHInteraction | InteractionType |
The correct Interaction type for this FrictionForceSpecies. More... | |
Public Member Functions | |
SPHNormalSpecies () | |
The default constructor. More... | |
SPHNormalSpecies (const SPHNormalSpecies &p) | |
The default copy constructor. More... | |
~SPHNormalSpecies () | |
The default destructor. More... | |
void | read (std::istream &is) |
Reads the species properties from an input stream. More... | |
void | write (std::ostream &os) const |
Writes the species properties to an output stream. More... | |
std::string | getBaseName () const |
Used in Species::getName to obtain a unique name for each Species. More... | |
Mdouble | getMaximumVelocity (Mdouble radius, Mdouble mass) const |
Calculates the maximum velocity allowed for a collision of two copies of P (for higher velocities particles could pass through each other) More... | |
void | setStiffnessAndRestitutionCoefficient (Mdouble k_, Mdouble eps, Mdouble mass) |
Sets k, disp such that it matches a given tc and eps for a collision of two copies of P. More... | |
void | setRestitutionCoefficient (double eps, Mdouble mass) |
Sets disp to obtain a restitution coefficient eps for a collision of two particles of mass m. More... | |
void | setCollisionTimeAndRestitutionCoefficient (Mdouble tc, Mdouble eps, BaseParticle *p) |
Sets k, disp such that it matches a given tc and eps for a collision of two copies of particle p. More... | |
void | setCollisionTimeAndRestitutionCoefficient (Mdouble tc, Mdouble eps, Mdouble mass) |
Sets k, disp such that it matches a given tc and eps for a collision of two copies of equal mass m. More... | |
void | setCollisionTimeAndRestitutionCoefficient (Mdouble collisionTime, Mdouble restitutionCoefficient, Mdouble mass1, Mdouble mass2) |
Mdouble | getCollisionTime (Mdouble mass) const |
Calculates collision time for two copies of a particle of given disp, k, mass. More... | |
Mdouble | getRestitutionCoefficient (Mdouble mass) const |
Calculates restitution coefficient for two copies of given disp, k, mass. More... | |
void | mix (SPHNormalSpecies *SBase, SPHNormalSpecies *TBase) |
creates default values for mixed species More... | |
void | setStiffness (Mdouble new_k) |
Allows the spring constant to be changed. More... | |
Mdouble | getStiffness () const |
Allows the spring constant to be accessed. More... | |
void | setDissipation (Mdouble dissipation) |
Allows the normal dissipation to be changed. More... | |
Mdouble | getDissipation () const |
Allows the normal dissipation to be accessed. More... | |
MERCURYDPM_DEPRECATED void | setStiffnessAndDissipation (helpers::KAndDisp new_) |
Allows the spring and dissipation constants to be changed simultaneously. More... | |
Public Member Functions inherited from BaseNormalForce | |
BaseNormalForce () | |
BaseNormalForce (const BaseNormalForce &p) | |
bool | getConstantRestitution () const |
void | setConstantRestitution (bool constantRestitution) |
virtual void | actionsAfterTimeStep (BaseParticle *particle) const |
Public Member Functions inherited from BaseForce | |
BaseSpecies * | getBaseSpecies () const |
void | setBaseSpecies (BaseSpecies *baseSpecies) |
Private Attributes | |
Mdouble | stiffness_ |
(normal) spring constant More... | |
Mdouble | dissipation_ |
(normal) viscosity More... | |
SPHNormalSpecies contains the parameters used to describe a SPH model.
See SPHNormalInteraction::computeForce for a description of the force law.
The correct Interaction type for this FrictionForceSpecies.
SPHNormalSpecies::SPHNormalSpecies | ( | ) |
The default constructor.
References dissipation_, and stiffness_.
SPHNormalSpecies::SPHNormalSpecies | ( | const SPHNormalSpecies & | p | ) |
The default copy constructor.
[in] | the | species that is copied |
References dissipation_, and stiffness_.
SPHNormalSpecies::~SPHNormalSpecies | ( | ) |
std::string SPHNormalSpecies::getBaseName | ( | ) | const |
Calculates collision time for two copies of a particle of given disp, k, mass.
Calculates collision time for two copies of a particle of given disp, k, mass
[in] | mass | mass of a typical particle |
References dissipation_, constants::pi, mathsFunc::square(), and stiffness_.
Referenced by getRestitutionCoefficient().
Mdouble SPHNormalSpecies::getDissipation | ( | ) | const |
Allows the normal dissipation to be accessed.
References dissipation_.
Referenced by SPHInteraction::computeNormalForce(), mix(), and setCollisionTimeAndRestitutionCoefficient().
Calculates the maximum velocity allowed for a collision of two copies of P (for higher velocities particles could pass through each other)
References stiffness_.
Calculates restitution coefficient for two copies of given disp, k, mass.
References dissipation_, mathsFunc::exp(), and getCollisionTime().
Mdouble SPHNormalSpecies::getStiffness | ( | ) | const |
Allows the spring constant to be accessed.
References stiffness_.
Referenced by SPHInteraction::computeNormalForce(), SPHInteraction::getElasticEnergy(), SPHInteraction::getElasticEnergyAtEquilibrium(), mix(), setCollisionTimeAndRestitutionCoefficient(), and setRestitutionCoefficient().
void SPHNormalSpecies::mix | ( | SPHNormalSpecies * | SBase, |
SPHNormalSpecies * | TBase | ||
) |
creates default values for mixed species
For all parameters we assume that the harmonic mean of the parameters of the original two species is a sensible default.
[in] | S,T | the two species whose properties are mixed to create the new species |
References BaseSpecies::average(), dissipation_, getDissipation(), getStiffness(), and stiffness_.
void SPHNormalSpecies::read | ( | std::istream & | is | ) |
Reads the species properties from an input stream.
[in] | input | stream (typically the restart file) |
References dissipation_, and stiffness_.
void SPHNormalSpecies::setCollisionTimeAndRestitutionCoefficient | ( | Mdouble | collisionTime, |
Mdouble | restitutionCoefficient, | ||
Mdouble | mass1, | ||
Mdouble | mass2 | ||
) |
Set k, disp such that is matches a given tc and eps for a collision of two different masses. Recall the resitution constant is a function of k, disp and the mass of each particle in the collision See also setCollisionTimeAndRestitutionCoefficient(Mdouble tc, Mdouble eps, Mdouble mass)
Set k, disp such that is matches a given tc and eps for a collision of two different masses. Recall the resitution constant is a function of k, disp and the mass of each particle in the collision See also setCollisionTimeAndRestitutionCoefficient(Mdouble tc, Mdouble eps, Mdouble mass)
[in] | collision | time |
References setCollisionTimeAndRestitutionCoefficient().
void SPHNormalSpecies::setCollisionTimeAndRestitutionCoefficient | ( | Mdouble | tc, |
Mdouble | eps, | ||
BaseParticle * | p | ||
) |
Sets k, disp such that it matches a given tc and eps for a collision of two copies of particle p.
References ParticleSpecies::getDensity(), BaseInteractable::getSpecies(), and BaseParticle::getVolume().
Referenced by setCollisionTimeAndRestitutionCoefficient().
void SPHNormalSpecies::setCollisionTimeAndRestitutionCoefficient | ( | Mdouble | tc, |
Mdouble | eps, | ||
Mdouble | mass | ||
) |
Sets k, disp such that it matches a given tc and eps for a collision of two copies of equal mass m.
Sets k, disp such that it matches a given tc and eps for a collision of two copies of equal mass m
[in] | tc | collision time |
[in] | eps | restitution coefficient |
[in] | mass | harmonic average particle mass, \(\frac{2}{1/m1+1/m2}\) |
References dissipation_, getDissipation(), getStiffness(), INFO, mathsFunc::log(), logger, constants::pi, mathsFunc::square(), and stiffness_.
void SPHNormalSpecies::setDissipation | ( | Mdouble | dissipation | ) |
Allows the normal dissipation to be changed.
References dissipation_.
Referenced by setStiffnessAndDissipation().
Sets disp to obtain a restitution coefficient eps for a collision of two particles of mass m.
Sets k, disp such that it matches a given tc and eps for a collision of two copies of P
[in] | stiffness | stiffness |
[in] | eps | restitution coefficient |
[in] | mass | effective particle mass, \(\frac{2}{1/m1+1/m2}\) |
References dissipation_, getStiffness(), mathsFunc::log(), constants::sqr_pi, and mathsFunc::square().
Referenced by setStiffnessAndRestitutionCoefficient().
void SPHNormalSpecies::setStiffness | ( | Mdouble | new_k | ) |
Allows the spring constant to be changed.
References stiffness_.
Referenced by setStiffnessAndDissipation().
void SPHNormalSpecies::setStiffnessAndDissipation | ( | helpers::KAndDisp | new_ | ) |
Allows the spring and dissipation constants to be changed simultaneously.
References helpers::KAndDisp::disp, helpers::KAndDisp::k, setDissipation(), and setStiffness().
void SPHNormalSpecies::setStiffnessAndRestitutionCoefficient | ( | Mdouble | stiffness, |
Mdouble | eps, | ||
Mdouble | mass | ||
) |
Sets k, disp such that it matches a given tc and eps for a collision of two copies of P.
Sets k, disp such that it matches a given tc and eps for a collision of two copies of P
[in] | stiffness | stiffness |
[in] | eps | restitution coefficient |
[in] | harmonic | mean of particle masses, \(\frac{2}{1/m1+1/m2}\) |
References setRestitutionCoefficient(), and stiffness_.
void SPHNormalSpecies::write | ( | std::ostream & | os | ) | const |
Writes the species properties to an output stream.
[out] | output | stream (typically the restart file) |
References dissipation_, and stiffness_.
|
private |
(normal) viscosity
Referenced by getCollisionTime(), getDissipation(), getRestitutionCoefficient(), mix(), read(), setCollisionTimeAndRestitutionCoefficient(), setDissipation(), setRestitutionCoefficient(), SPHNormalSpecies(), and write().
|
private |
(normal) spring constant
Referenced by getCollisionTime(), getMaximumVelocity(), getStiffness(), mix(), read(), setCollisionTimeAndRestitutionCoefficient(), setStiffness(), setStiffnessAndRestitutionCoefficient(), SPHNormalSpecies(), and write().