MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HertzianViscoelasticNormalSpecies Class Reference

HertzianViscoelasticNormalSpecies contains the parameters used to describe a Hertzian normal force (The Mindlin model). More...

#include <HertzianViscoelasticNormalSpecies.h>

+ Inheritance diagram for HertzianViscoelasticNormalSpecies:

Public Types

typedef
HertzianViscoelasticInteraction 
InteractionType
 The correct Interaction type for this FrictionForceSpecies. More...
 

Public Member Functions

 HertzianViscoelasticNormalSpecies ()
 The default constructor. More...
 
 HertzianViscoelasticNormalSpecies (const HertzianViscoelasticNormalSpecies &p)
 The default copy constructor. More...
 
 ~HertzianViscoelasticNormalSpecies ()
 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 getCollisionTime (Mdouble particleDiameter, Mdouble particleDensity, Mdouble relativeVelocity) const
 Used in Species::getName to obtain a unique name for each Species. More...
 
void mix (HertzianViscoelasticNormalSpecies *SBase, HertzianViscoelasticNormalSpecies *TBase)
 Calculates collision time for two copies of a particle of given disp, k, mass. More...
 
void setEffectiveElasticModulus (Mdouble elasticModulus)
 Allows the spring constant to be changed. More...
 
void setEffectiveElasticModulusAndRestitutionCoefficient (Mdouble elasticModulus, Mdouble rest)
 Allows the spring constant to be changed. More...
 
Mdouble getEffectiveElasticModulus () const
 Allows the spring constant to be accessed. More...
 
void setEffectiveElasticModulusAndPoissonRatio (Mdouble elasticModulus, Mdouble poissonRatio)
 Allows the elastic modulus and the poisson ratio to be changed in order to compute the shear modulus. More...
 
void setEffectiveElasticModulusAndEffectiveShearModulus (Mdouble elasticModulus, Mdouble shearModulus)
 Allows the elastic modulus and the shear modulus to be changed in order to compute the poisson ratio. More...
 
void setDissipation (Mdouble dissipation)
 Allows the normal dissipation to be changed. More...
 
Mdouble getDissipation () const
 Allows the normal dissipation to be accessed. More...
 
- Public Member Functions inherited from BaseNormalForce
 BaseNormalForce ()
 
 BaseNormalForce (const BaseNormalForce &p)
 
bool getConstantRestitution () const
 
void setConstantRestitution (bool constantRestitution)
 
- Public Member Functions inherited from BaseForce
BaseSpeciesgetBaseSpecies () const
 
void setBaseSpecies (BaseSpecies *baseSpecies)
 

Private Attributes

Mdouble elasticModulus_
 normal spring constant More...
 
Mdouble dissipation_
 normal dissipation constant More...
 

Detailed Description

HertzianViscoelasticNormalSpecies contains the parameters used to describe a Hertzian normal force (The Mindlin model).

See HertzianViscoelasticNormalInteraction::computeForce for a description of the force law.

Definition at line 37 of file HertzianViscoelasticNormalSpecies.h.

Member Typedef Documentation

Constructor & Destructor Documentation

HertzianViscoelasticNormalSpecies::HertzianViscoelasticNormalSpecies ( )

The default constructor.

Definition at line 38 of file HertzianViscoelasticNormalSpecies.cc.

References dissipation_, and elasticModulus_.

39  : BaseNormalForce()
40 {
41  elasticModulus_ = 0;
42  dissipation_ = 0;
43 #ifdef DEBUG_CONSTRUCTOR
44  std::cout<<"HertzianViscoelasticNormalSpecies::HertzianViscoelasticNormalSpecies() finished"<<std::endl;
45 #endif
46 }
Mdouble dissipation_
normal dissipation constant
HertzianViscoelasticNormalSpecies::HertzianViscoelasticNormalSpecies ( const HertzianViscoelasticNormalSpecies p)

The default copy constructor.

Parameters
[in]thespecies that is copied

Definition at line 51 of file HertzianViscoelasticNormalSpecies.cc.

References dissipation_, and elasticModulus_.

52  : BaseNormalForce(p)
53 {
56 #ifdef DEBUG_CONSTRUCTOR
57  std::cout<<"HertzianViscoelasticNormalSpecies::HertzianViscoelasticNormalSpecies(const HertzianViscoelasticNormalSpecies &p) finished"<<std::endl;
58 #endif
59 }
Mdouble dissipation_
normal dissipation constant
HertzianViscoelasticNormalSpecies::~HertzianViscoelasticNormalSpecies ( )

The default destructor.

Definition at line 61 of file HertzianViscoelasticNormalSpecies.cc.

62 {
63 #ifdef DEBUG_DESTRUCTOR
64  std::cout<<"HertzianViscoelasticNormalSpecies::~HertzianViscoelasticNormalSpecies() finished"<<std::endl;
65 #endif
66 }

Member Function Documentation

std::string HertzianViscoelasticNormalSpecies::getBaseName ( ) const

Used in Species::getName to obtain a unique name for each Species.

Returns
a string containing the name of the species (minus the word "Species")

Definition at line 90 of file HertzianViscoelasticNormalSpecies.cc.

91 {
92  return "HertzianViscoelastic";
93 }
Mdouble HertzianViscoelasticNormalSpecies::getCollisionTime ( Mdouble  particleDiameter,
Mdouble  particleDensity,
Mdouble  relativeVelocity 
) const

Used in Species::getName to obtain a unique name for each Species.

Parameters
[in]relativeVelocityinput the maximum relative velocity in your system to get the mininimum collision time
[in]particleDiameterinput the minimum particle diameter in your system to get the mininimum collision time
[in]particleDensityinput the minimum particle density in your system to get the mininimum collision time

Definition at line 286 of file HertzianViscoelasticNormalSpecies.cc.

References getEffectiveElasticModulus(), and mathsFunc::square().

288 {
289  // Here is a very nice paper describing contact modelling
290  // http://people.ds.cam.ac.uk/jae1001/CUS/research/pfizer/Antypov_Elliott_EPL_2011.pdf
291  //caution: this function assumes the contact is elastic (no dissipation)
292  //Mdouble omega0 = 2.0/constants::sqrt_pi*sqrt(getEffectiveElasticModulus()/particleDensity)/relativeVelocity;
293  //Mdouble omega1 = sqrt(omega0*omega0-getDissipation()*getDissipation());
294  return 2.214 * pow(mathsFunc::square(particleDensity / getEffectiveElasticModulus()) / relativeVelocity, 0.2) *
295  particleDiameter;
296 }
Mdouble getEffectiveElasticModulus() const
Allows the spring constant to be accessed.
T square(const T val)
squares a number
Definition: ExtendedMath.h:104
Mdouble HertzianViscoelasticNormalSpecies::getDissipation ( ) const

Allows the normal dissipation to be accessed.

Definition at line 202 of file HertzianViscoelasticNormalSpecies.cc.

References dissipation_.

Referenced by HertzianViscoelasticInteraction::computeNormalForce(), and mix().

203 {
204  return dissipation_;
205 }
Mdouble dissipation_
normal dissipation constant
Mdouble HertzianViscoelasticNormalSpecies::getEffectiveElasticModulus ( ) const
void HertzianViscoelasticNormalSpecies::mix ( HertzianViscoelasticNormalSpecies SBase,
HertzianViscoelasticNormalSpecies TBase 
)

Calculates collision time for two copies of a particle of given disp, k, mass.

Calculates restitution coefficient for two copies of given disp, k, masscreates 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.

Parameters
[in]S,Tthe two species whose properties are mixed to create the new species

Definition at line 274 of file HertzianViscoelasticNormalSpecies.cc.

References BaseSpecies::average(), dissipation_, elasticModulus_, getDissipation(), and getEffectiveElasticModulus().

276 {
277  elasticModulus_ = BaseSpecies::average(S->getEffectiveElasticModulus(), T->getEffectiveElasticModulus());
278  dissipation_ = BaseSpecies::average(S->getDissipation(), T->getDissipation());
279 }
static Mdouble average(Mdouble a, Mdouble b)
Returns the harmonic mean of two variables.
Definition: BaseSpecies.cc:110
Mdouble dissipation_
normal dissipation constant
void HertzianViscoelasticNormalSpecies::read ( std::istream &  is)

Reads the species properties from an input stream.

Parameters
[in]inputstream (typically the restart file)

Definition at line 80 of file HertzianViscoelasticNormalSpecies.cc.

References dissipation_, and elasticModulus_.

81 {
82  std::string dummy;
83  is >> dummy >> elasticModulus_
84  >> dummy >> dissipation_;
85 }
Mdouble dissipation_
normal dissipation constant
void HertzianViscoelasticNormalSpecies::setDissipation ( Mdouble  dissipation)

Allows the normal dissipation to be changed.

Definition at line 188 of file HertzianViscoelasticNormalSpecies.cc.

References dissipation_.

189 {
190  if (dissipation >= 0)
191  {
192  dissipation_ = dissipation;
193  }
194  else
195  {
196  std::cerr << "Error in setDissipation(" << dissipation << ")" << std::endl;
197  exit(-1);
198  }
199 }
Mdouble dissipation_
normal dissipation constant
void HertzianViscoelasticNormalSpecies::setEffectiveElasticModulus ( Mdouble  elasticModulus)

Allows the spring constant to be changed.

Definition at line 96 of file HertzianViscoelasticNormalSpecies.cc.

References elasticModulus_.

97 {
98  if (elasticModulus >= 0)
99  elasticModulus_ = elasticModulus;
100  else
101  {
102  std::cerr << "Error in setEffectiveElasticModulus" << std::endl;
103  exit(-1);
104  }
105 }
void HertzianViscoelasticNormalSpecies::setEffectiveElasticModulusAndEffectiveShearModulus ( Mdouble  elasticModulus,
Mdouble  shearModulus 
)

Allows the elastic modulus and the shear modulus to be changed in order to compute the poisson ratio.

Allows to change elastic modulus and shear modulus to compute poisson ratio.

Definition at line 161 of file HertzianViscoelasticNormalSpecies.cc.

References elasticModulus_, ERROR, BaseForce::getBaseSpecies(), BaseSpecies::getFrictionForce(), and logger.

162 {
163  if (elasticModulus < 0.0)
164  logger(ERROR,
165  "[HertzianViscoelasticNormalSpecies::setEffectiveElasticModulusAndEffectiveShearModulus] elasticModulus % should be nonnegative",
166  elasticModulus);
167 
168  else if (shearModulus < 0.0)
169  logger(ERROR,
170  "[HertzianViscoelasticNormalSpecies::setEffectiveElasticModulusAndEffectiveShearModulus] shearModulus % should be nonnegative",
171  shearModulus);
172  else
173  {
174  elasticModulus_ = elasticModulus;
175  auto mindlin = dynamic_cast<MindlinSpecies*>(getBaseSpecies()->getFrictionForce());
176  logger.assert(mindlin, "Please define HertzianViscoelasticMindlinSpecies to use this setter");
177  mindlin->setEffectiveShearModulus(shearModulus);
178  }
179 }
BaseSpecies * getBaseSpecies() const
Definition: BaseForce.h:35
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
MindlinSpecies contains the parameters used to describe sliding friction.
BaseFrictionForce * getFrictionForce() const
Definition: BaseSpecies.h:150
void HertzianViscoelasticNormalSpecies::setEffectiveElasticModulusAndPoissonRatio ( Mdouble  elasticModulus,
Mdouble  poissonRatio 
)

Allows the elastic modulus and the poisson ratio to be changed in order to compute the shear modulus.

Allows to change elastic modulus and poisson ratio to compute shear modulus.

Definition at line 140 of file HertzianViscoelasticNormalSpecies.cc.

References elasticModulus_, ERROR, BaseForce::getBaseSpecies(), and logger.

141 {
142  if (elasticModulus < 0.0)
143  logger(ERROR,
144  "[HertzianViscoelasticNormalSpecies::setEffectiveElasticModulusAndRestitutionCoefficient] elasticModulus % should be nonnegative",
145  elasticModulus);
146 
147  else if (poissonRatio < 0.0 || poissonRatio > 1.0)
148  logger(ERROR,
149  "[HertzianViscoelasticNormalSpecies::setEffectiveElasticModulusAndRestitutionCoefficient] poissonRatio % should be between 0 and 1 (inclusive)",
150  poissonRatio);
151  else
152  {
153  elasticModulus_ = elasticModulus;
154  auto mindlin = dynamic_cast<MindlinSpecies*>(getBaseSpecies());
155  logger.assert(mindlin, "Please define HertzianViscoelasticMindlinSpecies to use this setter");
156  mindlin->setEffectiveShearModulus(elasticModulus / 2 * (1 + poissonRatio));
157  }
158 }
BaseSpecies * getBaseSpecies() const
Definition: BaseForce.h:35
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
MindlinSpecies contains the parameters used to describe sliding friction.
void HertzianViscoelasticNormalSpecies::setEffectiveElasticModulusAndRestitutionCoefficient ( Mdouble  elasticModulus,
Mdouble  rest 
)

Allows the spring constant to be changed.

Definition at line 108 of file HertzianViscoelasticNormalSpecies.cc.

References dissipation_, elasticModulus_, ERROR, mathsFunc::log(), logger, and constants::sqr_pi.

109 {
110  // Here is a very nice paper describing contact modelling
111  // http://people.ds.cam.ac.uk/jae1001/CUS/research/pfizer/Antypov_Elliott_EPL_2011.pdf
112  // see also: https://answers.launchpad.net/yade/+question/235934
113  if (elasticModulus < 0.0)
114  logger(ERROR,
115  "[HertzianViscoelasticNormalSpecies::setEffectiveElasticModulusAndRestitutionCoefficient] elasticModulus % should be nonnegative",
116  elasticModulus);
117 
118  else if (rest < 0.0 || rest > 1.0)
119  logger(ERROR,
120  "[HertzianViscoelasticNormalSpecies::setEffectiveElasticModulusAndRestitutionCoefficient] rest % should be between 0 and 1 (inclusive)",
121  rest);
122 
123  else
124  {
125  elasticModulus_ = elasticModulus;
126  if (rest > 0.0)
127  {
128  Mdouble logRestSquared = log(rest) * log(rest);
129  dissipation_ = sqrt(5.0 * logRestSquared / (logRestSquared + constants::sqr_pi));
130  }
131  else
132  dissipation_ = sqrt(5.0);
133 
134  //logger(INFO, "Effective elastic modulus %", elasticModulus_);
135  //logger(INFO, "Set dissipation % to match restitution coefficient %", dissipation_, rest);
136  }
137 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
double Mdouble
Definition: GeneralDefine.h:34
Mdouble log(Mdouble Power)
Mdouble dissipation_
normal dissipation constant
const Mdouble sqr_pi
Definition: ExtendedMath.h:47
void HertzianViscoelasticNormalSpecies::write ( std::ostream &  os) const

Writes the species properties to an output stream.

Parameters
[out]outputstream (typically the restart file)

Definition at line 71 of file HertzianViscoelasticNormalSpecies.cc.

References dissipation_, and elasticModulus_.

72 {
73  os << " elasticModulus " << elasticModulus_
74  << " dissipation " << dissipation_;
75 }
Mdouble dissipation_
normal dissipation constant

Member Data Documentation

Mdouble HertzianViscoelasticNormalSpecies::dissipation_
private

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