MercuryDPM  Alpha
 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...
 
virtual ~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 *const SBase, HertzianViscoelasticNormalSpecies *const TBase)
 Calculates collision time for two copies of a particle of given disp, k, mass. More...
 
void setElasticModulus (Mdouble elasticModulus)
 Allows the spring constant to be changed. More...
 
void setElasticModulusAndRestitutionCoefficient (Mdouble elasticModulus, Mdouble rest)
 Allows the spring constant to be changed. More...
 
Mdouble getElasticModulus () 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...
 
- Public Member Functions inherited from BaseSpecies
 BaseSpecies ()
 The default constructor. More...
 
 BaseSpecies (const BaseSpecies &p)
 The copy constructor. More...
 
virtual ~BaseSpecies ()
 The default destructor. More...
 
virtual BaseSpeciescopy () const =0
 Creates a deep copy of the object from which it is called. More...
 
void setHandler (SpeciesHandler *handler)
 Sets the pointer to the handler to which this species belongs. More...
 
SpeciesHandlergetHandler () const
 Returns the pointer to the handler to which this species belongs. More...
 
Mdouble average (Mdouble a, Mdouble b)
 defines the average of two variables by the harmonic mean. More...
 
virtual void mixAll (BaseSpecies *const S, BaseSpecies *const T)=0
 creates default values for mixed species More...
 
virtual Mdouble getInteractionDistance () const =0
 returns the largest separation distance at which adhesive short-range forces can occur. More...
 
virtual bool getUseAngularDOFs () const =0
 Returns true if torques (i.e. angular degrees of freedom) have to be calculated. More...
 
virtual BaseInteractiongetNewInteraction (BaseInteractable *P, BaseInteractable *I, Mdouble timeStamp) const =0
 returns new Interaction object. More...
 
- Public Member Functions inherited from BaseObject
 BaseObject ()
 Default constructor. More...
 
 BaseObject (const BaseObject &p)
 Copy constructor, copies all the objects BaseObject contains. More...
 
virtual ~BaseObject ()
 virtual destructor More...
 
virtual std::string getName () const =0
 A purely virtual function. More...
 
virtual void moveInHandler (const unsigned int index)
 Except that it is virtual, it does the same thing as setIndex() does. More...
 
void setIndex (const unsigned int index)
 Allows one to assign an index to an object in the handler/container. More...
 
void setId (const unsigned int id)
 Assigns a unique identifier to each object in the handler (container) which remains constant even after the object is deleted from the container/handler. More...
 
unsigned int getIndex () const
 Returns the index of the object in the handler. More...
 
unsigned int getId () const
 Returns the unique identifier of any particular object. More...
 

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 36 of file HertzianViscoelasticNormalSpecies.h.

Member Typedef Documentation

Constructor & Destructor Documentation

HertzianViscoelasticNormalSpecies::HertzianViscoelasticNormalSpecies ( )

The default constructor.

Definition at line 35 of file HertzianViscoelasticNormalSpecies.cc.

References dissipation_, and elasticModulus_.

36 {
37  elasticModulus_ = 0;
38  dissipation_ = 0;
39 #ifdef DEBUG_CONSTRUCTOR
40  std::cout<<"HertzianViscoelasticNormalSpecies::HertzianViscoelasticNormalSpecies() finished"<<std::endl;
41 #endif
42 }
Mdouble dissipation_
normal dissipation constant
HertzianViscoelasticNormalSpecies::HertzianViscoelasticNormalSpecies ( const HertzianViscoelasticNormalSpecies p)

The default copy constructor.

Parameters
[in]thespecies that is copied

Definition at line 47 of file HertzianViscoelasticNormalSpecies.cc.

References dissipation_, and elasticModulus_.

48 {
51 #ifdef DEBUG_CONSTRUCTOR
52  std::cout<<"HertzianViscoelasticNormalSpecies::HertzianViscoelasticNormalSpecies(const HertzianViscoelasticNormalSpecies &p) finished"<<std::endl;
53 #endif
54 }
Mdouble dissipation_
normal dissipation constant
HertzianViscoelasticNormalSpecies::~HertzianViscoelasticNormalSpecies ( )
virtual

The default destructor.

Definition at line 56 of file HertzianViscoelasticNormalSpecies.cc.

57 {
58 #ifdef DEBUG_DESTRUCTOR
59  std::cout<<"HertzianViscoelasticNormalSpecies::~HertzianViscoelasticNormalSpecies() finished"<<std::endl;
60 #endif
61 }

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 85 of file HertzianViscoelasticNormalSpecies.cc.

86 {
87  return "HertzianViscoelastic";
88 }
Mdouble HertzianViscoelasticNormalSpecies::getCollisionTime ( Mdouble  particleDiameter,
Mdouble  particleDensity,
Mdouble  relativeVelocity 
) const

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

Definition at line 219 of file HertzianViscoelasticNormalSpecies.cc.

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

219  {
220  // Here is a very nice paper describing contact modelling
221  // http://people.ds.cam.ac.uk/jae1001/CUS/research/pfizer/Antypov_Elliott_EPL_2011.pdf
222  //caution: this function assumes the contact is elastic (no dissipation)
223  //Mdouble omega0 = 2.0/constants::sqrt_pi*sqrt(getElasticModulus()/particleDensity)/relativeVelocity;
224  //Mdouble omega1 = sqrt(omega0*omega0-getDissipation()*getDissipation());
225  return 2.214*pow(mathsFunc::square(particleDensity/getElasticModulus())/relativeVelocity,0.2)*particleDiameter;
226 }
Mdouble getElasticModulus() const
Allows the spring constant to be accessed.
T square(T val)
squares a number
Definition: ExtendedMath.h:91
Mdouble HertzianViscoelasticNormalSpecies::getDissipation ( ) const

Allows the normal dissipation to be accessed.

Definition at line 141 of file HertzianViscoelasticNormalSpecies.cc.

References dissipation_.

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

142 {
143  return dissipation_;
144 }
Mdouble dissipation_
normal dissipation constant
Mdouble HertzianViscoelasticNormalSpecies::getElasticModulus ( ) const
void HertzianViscoelasticNormalSpecies::mix ( HertzianViscoelasticNormalSpecies *const  S,
HertzianViscoelasticNormalSpecies *const  T 
)

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 213 of file HertzianViscoelasticNormalSpecies.cc.

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

214 {
217 }
Mdouble getElasticModulus() const
Allows the spring constant to be accessed.
Mdouble getDissipation() const
Allows the normal dissipation to be accessed.
Mdouble average(Mdouble a, Mdouble b)
defines the average of two variables by the harmonic mean.
Definition: BaseSpecies.cc:85
Mdouble dissipation_
normal dissipation constant
void HertzianViscoelasticNormalSpecies::read ( std::istream &  is)
virtual

Reads the species properties from an input stream.

Parameters
[in]inputstream (typically the restart file)

Implements BaseObject.

Definition at line 75 of file HertzianViscoelasticNormalSpecies.cc.

References dissipation_, and elasticModulus_.

76 {
77  std::string dummy;
78  is >> dummy >> elasticModulus_
79  >> dummy >> dissipation_;
80 }
Mdouble dissipation_
normal dissipation constant
void HertzianViscoelasticNormalSpecies::setDissipation ( Mdouble  dissipation)

Allows the normal dissipation to be changed.

Definition at line 127 of file HertzianViscoelasticNormalSpecies.cc.

References dissipation_.

128 {
129  if (dissipation >= 0)
130  {
131  dissipation_ = dissipation;
132  }
133  else
134  {
135  std::cerr << "Error in setDissipation(" << dissipation << ")" << std::endl;
136  exit(-1);
137  }
138 }
Mdouble dissipation_
normal dissipation constant
void HertzianViscoelasticNormalSpecies::setElasticModulus ( Mdouble  elasticModulus)

Allows the spring constant to be changed.

Definition at line 91 of file HertzianViscoelasticNormalSpecies.cc.

References elasticModulus_.

92 {
93  if (elasticModulus >= 0)
94  elasticModulus_ = elasticModulus;
95  else
96  {
97  std::cerr << "Error in setElasticModulus" << std::endl;
98  exit(-1);
99  }
100 }
void HertzianViscoelasticNormalSpecies::setElasticModulusAndRestitutionCoefficient ( Mdouble  elasticModulus,
Mdouble  rest 
)

Allows the spring constant to be changed.

Definition at line 103 of file HertzianViscoelasticNormalSpecies.cc.

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

103  {
104  // Here is a very nice paper describing contact modelling
105  // http://people.ds.cam.ac.uk/jae1001/CUS/research/pfizer/Antypov_Elliott_EPL_2011.pdf
106  // see also: https://answers.launchpad.net/yade/+question/235934
107  if (elasticModulus >= 0.0 && rest > 0.0 && rest <= 1.0)
108  {
109  elasticModulus_ = elasticModulus;
110  Mdouble logRestSquared = log(rest)*log(rest);
111  dissipation_ = sqrt(5.0 * logRestSquared / (logRestSquared + constants::sqr_pi));
112  logger(INFO,"Dissipation % set to match restitution coefficient % logE % sqrPi %",dissipation_,rest,log(rest),constants::sqr_pi);
113  }
114  else
115  {
116  logger(ERROR,"Error in setElasticModulusAndRestitutionCoefficient");
117  }
118 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
double Mdouble
Mdouble log(Mdouble Power)
Definition: ExtendedMath.cc:97
Mdouble dissipation_
normal dissipation constant
const Mdouble sqr_pi
Definition: ExtendedMath.h:44
void HertzianViscoelasticNormalSpecies::write ( std::ostream &  os) const
virtual

Writes the species properties to an output stream.

Parameters
[out]outputstream (typically the restart file)

Implements BaseObject.

Definition at line 66 of file HertzianViscoelasticNormalSpecies.cc.

References dissipation_, and elasticModulus_.

67  {
68  os << " stiffness " << elasticModulus_
69  << " dissipation " << dissipation_;
70 }
Mdouble dissipation_
normal dissipation constant

Member Data Documentation

Mdouble HertzianViscoelasticNormalSpecies::dissipation_
private
Mdouble HertzianViscoelasticNormalSpecies::elasticModulus_
private

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