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

SlidingFrictionSpecies contains the parameters used to describe sliding friction. More...

#include <SlidingFrictionSpecies.h>

+ Inheritance diagram for SlidingFrictionSpecies:

Public Types

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

Public Member Functions

 SlidingFrictionSpecies ()
 The default constructor. More...
 
 SlidingFrictionSpecies (const SlidingFrictionSpecies &s)
 The default copy constructor. More...
 
 ~SlidingFrictionSpecies ()
 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...
 
virtual std::string getBaseName () const
 Used in Species::getName to obtain a unique name for each Species. More...
 
void setSlidingStiffness (Mdouble new_kt)
 Allows the spring constant to be changed. More...
 
Mdouble getSlidingStiffness () const
 Allows the spring constant to be accessed. More...
 
void setSlidingDissipation (Mdouble new_dispt)
 Allows the tangential viscosity to be changed. More...
 
Mdouble getSlidingDissipation () const
 Allows the tangential viscosity to be accessed. More...
 
void setSlidingFrictionCoefficient (Mdouble new_mu)
 Allows the (dynamic) Coulomb friction coefficient to be changed; also sets mu_s by default. More...
 
Mdouble getSlidingFrictionCoefficient () const
 Allows the (dynamic) Coulomb friction coefficient to be accessed. More...
 
void setSlidingFrictionCoefficientStatic (Mdouble new_mu)
 Allows the static Coulomb friction coefficient to be changed. More...
 
Mdouble getSlidingFrictionCoefficientStatic () const
 Allows the static Coulomb friction coefficient to be accessed. More...
 
bool getUseAngularDOFs () const override
 Returns true if torques have to be calculated. More...
 
void mix (SlidingFrictionSpecies *S, SlidingFrictionSpecies *T)
 creates default values for mixed species More...
 
void setCollisionTimeAndNormalAndTangentialRestitutionCoefficient (Mdouble tc, Mdouble eps, Mdouble beta, Mdouble mass)
 Sets k, disp, kt, dispt such that it matches a given tc and eps for a collision of two particles of masses m0,m1. More...
 
void setCollisionTimeAndNormalAndTangentialRestitutionCoefficientNoDispt (Mdouble tc, Mdouble eps, Mdouble beta, Mdouble mass)
 Sets k, disp, kt (with dispt=0) such that it matches a given tc and eps for a collision of two particles of mass m. More...
 
void setIsSuperquadricSpecies (bool isSuperquadricSpecies)
 
bool getIsSuperquadricSpecies () const
 
- Public Member Functions inherited from BaseForce
BaseSpeciesgetBaseSpecies () const
 
void setBaseSpecies (BaseSpecies *baseSpecies)
 

Private Attributes

Mdouble slidingStiffness_
 tangential stiffness. More...
 
Mdouble slidingDissipation_
 tangential dissipation coefficient. More...
 
Mdouble slidingFrictionCoefficient_
 (dynamic) Coulomb friction coefficient More...
 
Mdouble slidingFrictionCoefficientStatic_
 static Coulomb friction coefficient (by default set equal to mu) More...
 
bool isSuperquadricSpecies_
 

Detailed Description

SlidingFrictionSpecies contains the parameters used to describe sliding friction.

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

Definition at line 37 of file SlidingFrictionSpecies.h.

Member Typedef Documentation

Constructor & Destructor Documentation

SlidingFrictionSpecies::SlidingFrictionSpecies ( )

The default constructor.

Definition at line 36 of file SlidingFrictionSpecies.cc.

References isSuperquadricSpecies_, slidingDissipation_, slidingFrictionCoefficient_, slidingFrictionCoefficientStatic_, and slidingStiffness_.

37 {
42  isSuperquadricSpecies_ = false;
43 #ifdef DEBUG_CONSTRUCTOR
44  std::cout<<"SlidingFrictionSpecies::SlidingFrictionSpecies() finished"<<std::endl;
45 #endif
46 }
Mdouble slidingStiffness_
tangential stiffness.
Mdouble slidingFrictionCoefficientStatic_
static Coulomb friction coefficient (by default set equal to mu)
Mdouble slidingDissipation_
tangential dissipation coefficient.
Mdouble slidingFrictionCoefficient_
(dynamic) Coulomb friction coefficient
SlidingFrictionSpecies::SlidingFrictionSpecies ( const SlidingFrictionSpecies s)

The default copy constructor.

Parameters
[in]sthe species that is copied

Definition at line 51 of file SlidingFrictionSpecies.cc.

References isSuperquadricSpecies_, slidingDissipation_, slidingFrictionCoefficient_, slidingFrictionCoefficientStatic_, and slidingStiffness_.

52 {
58 #ifdef DEBUG_CONSTRUCTOR
59  std::cout<<"SlidingFrictionSpecies::SlidingFrictionSpecies(const SlidingFrictionSpecies &p) finished"<<std::endl;
60 #endif
61 }
Mdouble slidingStiffness_
tangential stiffness.
Mdouble slidingFrictionCoefficientStatic_
static Coulomb friction coefficient (by default set equal to mu)
Mdouble slidingDissipation_
tangential dissipation coefficient.
Mdouble slidingFrictionCoefficient_
(dynamic) Coulomb friction coefficient
SlidingFrictionSpecies::~SlidingFrictionSpecies ( )

The default destructor.

Definition at line 63 of file SlidingFrictionSpecies.cc.

64 {
65 #ifdef DEBUG_DESTRUCTOR
66  std::cout<<"SlidingFrictionSpecies::~SlidingFrictionSpecies() finished"<<std::endl;
67 #endif
68 }

Member Function Documentation

std::string SlidingFrictionSpecies::getBaseName ( ) const
virtual

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")

Reimplemented in FrictionSpecies.

Definition at line 98 of file SlidingFrictionSpecies.cc.

99 {
100  return "SlidingFriction";
101 }
bool SlidingFrictionSpecies::getIsSuperquadricSpecies ( ) const
Mdouble SlidingFrictionSpecies::getSlidingDissipation ( ) const

Allows the tangential viscosity to be accessed.

Definition at line 136 of file SlidingFrictionSpecies.cc.

References slidingDissipation_.

Referenced by SlidingFrictionInteraction::computeFrictionForce(), and mix().

137 {
138  return slidingDissipation_;
139 }
Mdouble slidingDissipation_
tangential dissipation coefficient.
Mdouble SlidingFrictionSpecies::getSlidingFrictionCoefficient ( ) const

Allows the (dynamic) Coulomb friction coefficient to be accessed.

Definition at line 158 of file SlidingFrictionSpecies.cc.

References slidingFrictionCoefficient_.

Referenced by SlidingFrictionInteraction::computeFrictionForce(), and mix().

159 {
161 }
Mdouble slidingFrictionCoefficient_
(dynamic) Coulomb friction coefficient
Mdouble SlidingFrictionSpecies::getSlidingFrictionCoefficientStatic ( ) const

Allows the static Coulomb friction coefficient to be accessed.

Definition at line 178 of file SlidingFrictionSpecies.cc.

References slidingFrictionCoefficientStatic_.

Referenced by SlidingFrictionInteraction::computeFrictionForce(), and mix().

179 {
181 }
Mdouble slidingFrictionCoefficientStatic_
static Coulomb friction coefficient (by default set equal to mu)
Mdouble SlidingFrictionSpecies::getSlidingStiffness ( ) const

Allows the spring constant to be accessed.

Definition at line 118 of file SlidingFrictionSpecies.cc.

References slidingStiffness_.

Referenced by SlidingFrictionInteraction::computeFrictionForce(), SlidingFrictionInteraction::getElasticEnergy(), mix(), and setCollisionTimeAndNormalAndTangentialRestitutionCoefficient().

119 {
120  return slidingStiffness_;
121 }
Mdouble slidingStiffness_
tangential stiffness.
bool SlidingFrictionSpecies::getUseAngularDOFs ( ) const
overridevirtual

Returns true if torques have to be calculated.

Returns true for any FrictionForceSpecies except EmptyFrictionSpecies, because for spherical particles, torques are only caused by tangential forces. See SpeciesHandler::useAngularDOFs for more details

Returns
true

Implements BaseFrictionForce.

Definition at line 189 of file SlidingFrictionSpecies.cc.

190 {
191  return true;
192 }
void SlidingFrictionSpecies::mix ( SlidingFrictionSpecies S,
SlidingFrictionSpecies T 
)

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.

Parameters
[in]SFrictionalthe first species whose properties are mixed to create the new species
[in]TFrictionalthe second species whose properties are mixed to create the new species

Definition at line 200 of file SlidingFrictionSpecies.cc.

References BaseSpecies::average(), getSlidingDissipation(), getSlidingFrictionCoefficient(), getSlidingFrictionCoefficientStatic(), getSlidingStiffness(), slidingDissipation_, slidingFrictionCoefficient_, slidingFrictionCoefficientStatic_, and slidingStiffness_.

201 {
208 }
Mdouble slidingStiffness_
tangential stiffness.
Mdouble getSlidingFrictionCoefficientStatic() const
Allows the static Coulomb friction coefficient to be accessed.
Mdouble slidingFrictionCoefficientStatic_
static Coulomb friction coefficient (by default set equal to mu)
static Mdouble average(Mdouble a, Mdouble b)
Returns the harmonic mean of two variables.
Definition: BaseSpecies.cc:110
Mdouble slidingDissipation_
tangential dissipation coefficient.
Mdouble getSlidingStiffness() const
Allows the spring constant to be accessed.
Mdouble getSlidingDissipation() const
Allows the tangential viscosity to be accessed.
Mdouble slidingFrictionCoefficient_
(dynamic) Coulomb friction coefficient
Mdouble getSlidingFrictionCoefficient() const
Allows the (dynamic) Coulomb friction coefficient to be accessed.
void SlidingFrictionSpecies::read ( std::istream &  is)

Reads the species properties from an input stream.

Parameters
[in]isinput stream (typically the restart file)

Definition at line 85 of file SlidingFrictionSpecies.cc.

References slidingDissipation_, slidingFrictionCoefficient_, slidingFrictionCoefficientStatic_, and slidingStiffness_.

Referenced by FrictionSpecies::read().

86 {
87  //BaseSpecies::read(is);
88  std::string dummy;
89  is >> dummy >> slidingStiffness_;
90  is >> dummy >> slidingDissipation_;
91  is >> dummy >> slidingFrictionCoefficient_;
92  is >> dummy >> slidingFrictionCoefficientStatic_;
93 }
Mdouble slidingStiffness_
tangential stiffness.
Mdouble slidingFrictionCoefficientStatic_
static Coulomb friction coefficient (by default set equal to mu)
Mdouble slidingDissipation_
tangential dissipation coefficient.
Mdouble slidingFrictionCoefficient_
(dynamic) Coulomb friction coefficient
void SlidingFrictionSpecies::setCollisionTimeAndNormalAndTangentialRestitutionCoefficient ( Mdouble  tc,
Mdouble  eps,
Mdouble  beta,
Mdouble  mass 
)

Sets k, disp, kt, dispt such that it matches a given tc and eps for a collision of two particles of masses m0,m1.

Definition at line 211 of file SlidingFrictionSpecies.cc.

References ERROR, LinearPlasticViscoelasticNormalSpecies::getDissipation(), LinearPlasticViscoelasticNormalSpecies::getLoadingStiffness(), getSlidingStiffness(), LinearViscoelasticNormalSpecies::getStiffness(), mathsFunc::log(), logger, constants::pi, LinearViscoelasticNormalSpecies::setCollisionTimeAndRestitutionCoefficient(), LinearPlasticViscoelasticNormalSpecies::setDissipation(), LinearPlasticViscoelasticNormalSpecies::setLoadingStiffness(), setSlidingDissipation(), setSlidingStiffness(), and mathsFunc::square().

213 {
214  Mdouble stiffness;
215  //the dynamic cast is needed to check if the normal force species is LinearViscoelasticSpecies; otherwise this function cannot be used
217  if (species != nullptr)
218  {
219  species->setCollisionTimeAndRestitutionCoefficient(tc, eps, mass);
220  stiffness = species->getStiffness();
221  }
222  else
223  {
225  if (species2 != nullptr)
226  {
227  species2->setDissipation(-mass / tc * std::log(eps));
228  species2->setLoadingStiffness(.5 * mass * (mathsFunc::square(constants::pi / tc) +
229  mathsFunc::square(species2->getDissipation()) / mass));
230  stiffness = species2->getLoadingStiffness();
231  }
232  else
233  {
234  logger(ERROR,
235  "SlidingFrictionSpecies::setCollisionTimeAndNormalAndTangentialRestitutionCoefficient only works for LinearViscoelasticSlidingFrictionSpecies or LinearPlasticViscoelasticSlidingFrictionSpecies"
236  );
237  }
238  }
239 
240  // from: N. G. Deen et. al. https://doi.org/10.1016/j.ces.2006.08.014
241  // eq. 43 and 30
244  if (beta != 0.0)
245  setSlidingDissipation(-2 * log(beta) * sqrt(1.0 / 7.0 * mass * getSlidingStiffness() /
247  else
248  setSlidingDissipation(2. * sqrt(1.0 / 7.0 * mass * getSlidingStiffness()));
249 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
double Mdouble
Definition: GeneralDefine.h:34
Mdouble getStiffness() const
Allows the spring constant to be accessed.
Mdouble beta(Mdouble z, Mdouble w)
This is the beta function, returns the approximation based on cmath's implementation of ln(gamma) ...
Mdouble log(Mdouble Power)
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...
LinearViscoelasticNormalSpecies contains the parameters used to describe a linear elastic-dissipative...
const Mdouble pi
Definition: ExtendedMath.h:45
Mdouble getDissipation() const
Allows the normal dissipation to be accessed.
void setLoadingStiffness(Mdouble loadingStiffness)
Sets the loading stiffness of the linear plastic-viscoelastic normal force.
void setSlidingStiffness(Mdouble new_kt)
Allows the spring constant to be changed.
void setDissipation(Mdouble dissipation)
Sets the linear dissipation coefficient of the linear plastic-viscoelastic normal force...
Mdouble getSlidingStiffness() const
Allows the spring constant to be accessed.
void setSlidingDissipation(Mdouble new_dispt)
Allows the tangential viscosity to be changed.
LinearPlasticViscoelasticNormalSpecies contains the parameters used to describe a plastic-cohesive no...
T square(const T val)
squares a number
Definition: ExtendedMath.h:104
Mdouble getLoadingStiffness() const
Returns the loading stiffness of the linear plastic-viscoelastic normal force.
void SlidingFrictionSpecies::setCollisionTimeAndNormalAndTangentialRestitutionCoefficientNoDispt ( Mdouble  tc,
Mdouble  eps,
Mdouble  beta,
Mdouble  mass 
)

Sets k, disp, kt (with dispt=0) such that it matches a given tc and eps for a collision of two particles of mass m.

Sets k, disp, kt, dispt such that it matches a given tc and eps for a collision of two particles of masses m0,m1.

Definition at line 253 of file SlidingFrictionSpecies.cc.

References LinearViscoelasticNormalSpecies::getStiffness(), constants::pi, LinearViscoelasticNormalSpecies::setCollisionTimeAndRestitutionCoefficient(), setSlidingDissipation(), setSlidingStiffness(), and mathsFunc::square().

255 {
256  //the dynamic cast is needed to check if the normal force species is LinearViscoelasticSpecies; otherwise this function cannot be used
258  if (species == nullptr)
259  {
260  std::cerr
261  << "SlidingFrictionSpecies::setCollisionTimeAndNormalAndTangentialRestitutionCoefficient only works for LinearViscoelasticSlidingFrictionSpecies"
262  << std::endl;
263  exit(-1);
264  }
265  species->setCollisionTimeAndRestitutionCoefficient(tc, eps, mass);
266  // from: V. Becker et. al. https://doi.org/10.1103/PhysRevE.77.011304
267  // eq. 56
268  setSlidingStiffness(2.0 / 7.0 * species->getStiffness() * mathsFunc::square(acos(-beta) / constants::pi));
270 }
Mdouble getStiffness() const
Allows the spring constant to be accessed.
Mdouble beta(Mdouble z, Mdouble w)
This is the beta function, returns the approximation based on cmath's implementation of ln(gamma) ...
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...
LinearViscoelasticNormalSpecies contains the parameters used to describe a linear elastic-dissipative...
const Mdouble pi
Definition: ExtendedMath.h:45
void setSlidingStiffness(Mdouble new_kt)
Allows the spring constant to be changed.
void setSlidingDissipation(Mdouble new_dispt)
Allows the tangential viscosity to be changed.
T square(const T val)
squares a number
Definition: ExtendedMath.h:104
void SlidingFrictionSpecies::setIsSuperquadricSpecies ( bool  isSuperquadricSpecies)

Definition at line 272 of file SlidingFrictionSpecies.cc.

References isSuperquadricSpecies_.

273 {
274  SlidingFrictionSpecies::isSuperquadricSpecies_ = isSuperquadricSpecies;
275 }
void SlidingFrictionSpecies::setSlidingDissipation ( Mdouble  new_dispt)

Allows the tangential viscosity to be changed.

Definition at line 124 of file SlidingFrictionSpecies.cc.

References slidingDissipation_.

Referenced by setCollisionTimeAndNormalAndTangentialRestitutionCoefficient(), and setCollisionTimeAndNormalAndTangentialRestitutionCoefficientNoDispt().

125 {
126  if (new_dispt >= 0)
127  slidingDissipation_ = new_dispt;
128  else
129  {
130  std::cerr << "Error in setSlidingDissipation" << std::endl;
131  exit(-1);
132  }
133 }
Mdouble slidingDissipation_
tangential dissipation coefficient.
void SlidingFrictionSpecies::setSlidingFrictionCoefficient ( Mdouble  new_mu)

Allows the (dynamic) Coulomb friction coefficient to be changed; also sets mu_s by default.

Definition at line 143 of file SlidingFrictionSpecies.cc.

References slidingFrictionCoefficient_, and slidingFrictionCoefficientStatic_.

Referenced by ChuteBottom::makeRoughBottom().

144 {
145  if (new_mu >= 0)
146  {
149  }
150  else
151  {
152  std::cerr << "Error in setSlidingFrictionCoefficient" << std::endl;
153  exit(-1);
154  }
155 }
Mdouble slidingFrictionCoefficientStatic_
static Coulomb friction coefficient (by default set equal to mu)
Mdouble slidingFrictionCoefficient_
(dynamic) Coulomb friction coefficient
void SlidingFrictionSpecies::setSlidingFrictionCoefficientStatic ( Mdouble  new_mu)

Allows the static Coulomb friction coefficient to be changed.

Allows the static Coulomb friction coefficient to be changed; also sets mu_s by default.

Definition at line 164 of file SlidingFrictionSpecies.cc.

References slidingFrictionCoefficientStatic_.

165 {
166  if (new_mu >= 0)
167  {
169  }
170  else
171  {
172  std::cerr << "Error in setSlidingFrictionCoefficientStatic" << std::endl;
173  exit(-1);
174  }
175 }
Mdouble slidingFrictionCoefficientStatic_
static Coulomb friction coefficient (by default set equal to mu)
void SlidingFrictionSpecies::setSlidingStiffness ( Mdouble  new_kt)

Allows the spring constant to be changed.

Definition at line 104 of file SlidingFrictionSpecies.cc.

References slidingStiffness_.

Referenced by setCollisionTimeAndNormalAndTangentialRestitutionCoefficient(), and setCollisionTimeAndNormalAndTangentialRestitutionCoefficientNoDispt().

105 {
106  if (new_kt >= 0)
107  {
108  slidingStiffness_ = new_kt;
109  }
110  else
111  {
112  std::cerr << "Error in setSlidingStiffness" << std::endl;
113  exit(-1);
114  }
115 }
Mdouble slidingStiffness_
tangential stiffness.
void SlidingFrictionSpecies::write ( std::ostream &  os) const

Writes the species properties to an output stream.

Parameters
[out]osoutput stream (typically the restart file)

Definition at line 73 of file SlidingFrictionSpecies.cc.

References slidingDissipation_, slidingFrictionCoefficient_, slidingFrictionCoefficientStatic_, and slidingStiffness_.

Referenced by FrictionSpecies::write().

74 {
75  //BaseSpecies::write(os);
76  os << " slidingStiffness " << slidingStiffness_;
77  os << " slidingDissipation " << slidingDissipation_;
78  os << " slidingFrictionCoefficient " << slidingFrictionCoefficient_;
79  os << " slidingFrictionCoefficientStatic " << slidingFrictionCoefficientStatic_;
80 }
Mdouble slidingStiffness_
tangential stiffness.
Mdouble slidingFrictionCoefficientStatic_
static Coulomb friction coefficient (by default set equal to mu)
Mdouble slidingDissipation_
tangential dissipation coefficient.
Mdouble slidingFrictionCoefficient_
(dynamic) Coulomb friction coefficient

Member Data Documentation

bool SlidingFrictionSpecies::isSuperquadricSpecies_
private
Mdouble SlidingFrictionSpecies::slidingDissipation_
private

tangential dissipation coefficient.

Typically set to 2/7 of the normal force dissipation, as both the tangential and the normal spring have the same restitution coefficients (if the tangential and normal stiffnesses also have a ratio of 2/7). should always satisfy \(4*dispt*dt<mass, dispt \approx disp\), otherwise the restitution is zero and the particles stick.

Definition at line 123 of file SlidingFrictionSpecies.h.

Referenced by getSlidingDissipation(), mix(), read(), setSlidingDissipation(), SlidingFrictionSpecies(), and write().

Mdouble SlidingFrictionSpecies::slidingFrictionCoefficient_
private

(dynamic) Coulomb friction coefficient

Definition at line 126 of file SlidingFrictionSpecies.h.

Referenced by getSlidingFrictionCoefficient(), mix(), read(), setSlidingFrictionCoefficient(), SlidingFrictionSpecies(), and write().

Mdouble SlidingFrictionSpecies::slidingFrictionCoefficientStatic_
private

static Coulomb friction coefficient (by default set equal to mu)

Definition at line 129 of file SlidingFrictionSpecies.h.

Referenced by getSlidingFrictionCoefficientStatic(), mix(), read(), setSlidingFrictionCoefficient(), setSlidingFrictionCoefficientStatic(), SlidingFrictionSpecies(), and write().

Mdouble SlidingFrictionSpecies::slidingStiffness_
private

tangential stiffness.

Typically set to 2/7 of the stiffness of the normal force, as both the tangential and the normal spring have the same oscillation frequency (and thus require the same timeStep)in this case.

Definition at line 113 of file SlidingFrictionSpecies.h.

Referenced by getSlidingStiffness(), mix(), read(), setSlidingStiffness(), SlidingFrictionSpecies(), and write().


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