FrictionSpecies Class Reference

FrictionSpecies contains the parameters used to describe sliding, rolling and torsional friction. More...

#include <FrictionSpecies.h>

+ Inheritance diagram for FrictionSpecies:

Public Types

typedef FrictionInteraction InteractionType
 The correct Interaction type for this FrictionForceSpecies. More...
 
- Public Types inherited from SlidingFrictionSpecies
typedef SlidingFrictionInteraction InteractionType
 The correct Interaction type for this FrictionForceSpecies. More...
 

Public Member Functions

 FrictionSpecies ()
 The default constructor. More...
 
 FrictionSpecies (const FrictionSpecies &s)
 The default copy constructor. More...
 
 ~FrictionSpecies ()
 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 override
 Used in Species::getName to obtain a unique name for each Species. More...
 
bool getUseAngularDOFs () const override
 Returns true if torques have to be calculated. More...
 
void mix (FrictionSpecies *S, FrictionSpecies *T)
 creates default values for mixed species More...
 
void setRollingStiffness (Mdouble new_kt)
 Allows the spring constant to be changed. More...
 
Mdouble getRollingStiffness () const
 Allows the spring constant to be accessed. More...
 
void setRollingDissipation (Mdouble new_dispt)
 Allows the tangential viscosity to be changed. More...
 
Mdouble getRollingDissipation () const
 Allows the tangential viscosity to be accessed. More...
 
void setRollingFrictionCoefficient (Mdouble new_mu)
 Allows the (dynamic) Coulomb friction coefficient to be changed; also sets mu_s by default. More...
 
Mdouble getRollingFrictionCoefficient () const
 Allows the (dynamic) Coulomb friction coefficient to be accessed. More...
 
void setRollingFrictionCoefficientStatic (Mdouble new_mu)
 Allows the static Coulomb rolling friction coefficient to be changed. More...
 
Mdouble getRollingFrictionCoefficientStatic () const
 Allows the static Coulomb rolling friction coefficient to be accessed. More...
 
void setTorsionStiffness (Mdouble new_kt)
 Allows the torsion stiffness to be changed. More...
 
Mdouble getTorsionStiffness () const
 Allows the torsion stiffness to be accessed. More...
 
void setTorsionDissipation (Mdouble new_dispt)
 Allows the torsion viscosity to be changed. More...
 
Mdouble getTorsionDissipation () const
 Allows the torsion viscosity to be accessed. More...
 
void setTorsionFrictionCoefficient (Mdouble new_mu)
 Allows the (dynamic) Coulomb torsion friction coefficient to be changed; also sets mu_s by default. More...
 
Mdouble getTorsionFrictionCoefficient () const
 Allows the (dynamic) Coulomb torsion friction coefficient to be accessed. More...
 
void setTorsionFrictionCoefficientStatic (Mdouble new_mu)
 Allows the static Coulomb torsion friction coefficient to be accessed. More...
 
Mdouble getTorsionFrictionCoefficientStatic () const
 Allows the static Coulomb torsion friction coefficient to be accessed. More...
 
- Public Member Functions inherited from SlidingFrictionSpecies
 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...
 
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 rollingStiffness_
 rolling stiffness. More...
 
Mdouble rollingDissipation_
 rolling dissipation coefficient. More...
 
Mdouble rollingFrictionCoefficient_
 (dynamic) Coulomb rolling friction coefficient. More...
 
Mdouble rollingFrictionCoefficientStatic_
 static Coulomb rolling friction coefficient
(by default set equal to the dynamic one). More...
 
Mdouble torsionStiffness_
 rolling stiffness. More...
 
Mdouble torsionDissipation_
 rolling dissipation coefficient. More...
 
Mdouble torsionFrictionCoefficient_
 (dynamic) Coulomb torsion friction coefficient. More...
 
Mdouble torsionFrictionCoefficientStatic_
 static Coulomb torsion friction coefficient
(by default set equal to the dynamic one). More...
 

Detailed Description

FrictionSpecies contains the parameters used to describe sliding, rolling and torsional friction.

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

Todo:
TW: should this class be renamed SlidingRollingTorsionFrictionSpecies?

Member Typedef Documentation

◆ InteractionType

The correct Interaction type for this FrictionForceSpecies.

Constructor & Destructor Documentation

◆ FrictionSpecies() [1/2]

FrictionSpecies::FrictionSpecies ( )

The default constructor.

36 {
37  rollingStiffness_ = 0.0;
38  rollingDissipation_ = 0.0;
41  torsionStiffness_ = 0.0;
42  torsionDissipation_ = 0.0;
45 #ifdef DEBUG_CONSTRUCTOR
46  std::cout<<"FrictionSpecies::FrictionSpecies() finished"<<std::endl;
47 #endif
48 }
Mdouble rollingFrictionCoefficient_
(dynamic) Coulomb rolling friction coefficient.
Definition: FrictionSpecies.h:143
Mdouble torsionStiffness_
rolling stiffness.
Definition: FrictionSpecies.h:157
Mdouble rollingStiffness_
rolling stiffness.
Definition: FrictionSpecies.h:129
Mdouble rollingDissipation_
rolling dissipation coefficient.
Definition: FrictionSpecies.h:137
Mdouble rollingFrictionCoefficientStatic_
static Coulomb rolling friction coefficient (by default set equal to the dynamic one).
Definition: FrictionSpecies.h:149
Mdouble torsionDissipation_
rolling dissipation coefficient.
Definition: FrictionSpecies.h:165
Mdouble torsionFrictionCoefficientStatic_
static Coulomb torsion friction coefficient (by default set equal to the dynamic one).
Definition: FrictionSpecies.h:176
Mdouble torsionFrictionCoefficient_
(dynamic) Coulomb torsion friction coefficient.
Definition: FrictionSpecies.h:170
SlidingFrictionSpecies()
The default constructor.
Definition: SlidingFrictionSpecies.cc:36

References rollingDissipation_, rollingFrictionCoefficient_, rollingFrictionCoefficientStatic_, rollingStiffness_, torsionDissipation_, torsionFrictionCoefficient_, torsionFrictionCoefficientStatic_, and torsionStiffness_.

◆ FrictionSpecies() [2/2]

FrictionSpecies::FrictionSpecies ( const FrictionSpecies s)

◆ ~FrictionSpecies()

FrictionSpecies::~FrictionSpecies ( )

The default destructor.

70 {
71 #ifdef DEBUG_DESTRUCTOR
72  std::cout<<"FrictionSpecies::~FrictionSpecies() finished"<<std::endl;
73 #endif
74 }

Member Function Documentation

◆ getBaseName()

std::string FrictionSpecies::getBaseName ( ) const
overridevirtual

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 from SlidingFrictionSpecies.

113 {
114  return "Friction";
115 }

◆ getRollingDissipation()

Mdouble FrictionSpecies::getRollingDissipation ( ) const

Allows the tangential viscosity to be accessed.

179 {
180  return rollingDissipation_;
181 }

References rollingDissipation_.

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

◆ getRollingFrictionCoefficient()

Mdouble FrictionSpecies::getRollingFrictionCoefficient ( ) const

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

198 {
200 }

References rollingFrictionCoefficient_.

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

◆ getRollingFrictionCoefficientStatic()

Mdouble FrictionSpecies::getRollingFrictionCoefficientStatic ( ) const

Allows the static Coulomb rolling friction coefficient to be accessed.

Allows the static Coulomb friction coefficient to be accessed.

215 {
217 }

References rollingFrictionCoefficientStatic_.

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

◆ getRollingStiffness()

Mdouble FrictionSpecies::getRollingStiffness ( ) const

Allows the spring constant to be accessed.

162 {
163  return rollingStiffness_;
164 }

References rollingStiffness_.

Referenced by FrictionInteraction::computeFrictionForce(), FrictionInteraction::getElasticEnergy(), and mix().

◆ getTorsionDissipation()

Mdouble FrictionSpecies::getTorsionDissipation ( ) const

Allows the torsion viscosity to be accessed.

Allows the tangential viscosity to be accessed.

252 {
253  return torsionDissipation_;
254 }

References torsionDissipation_.

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

◆ getTorsionFrictionCoefficient()

Mdouble FrictionSpecies::getTorsionFrictionCoefficient ( ) const

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

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

273 {
275 }

References torsionFrictionCoefficient_.

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

◆ getTorsionFrictionCoefficientStatic()

Mdouble FrictionSpecies::getTorsionFrictionCoefficientStatic ( ) const

Allows the static Coulomb torsion friction coefficient to be accessed.

Allows the static Coulomb friction coefficient to be accessed.

292 {
294 }

References torsionFrictionCoefficientStatic_.

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

◆ getTorsionStiffness()

Mdouble FrictionSpecies::getTorsionStiffness ( ) const

Allows the torsion stiffness to be accessed.

Allows the spring constant to be accessed.

235 {
236  return torsionStiffness_;
237 }

References torsionStiffness_.

Referenced by FrictionInteraction::computeFrictionForce(), FrictionInteraction::getElasticEnergy(), and mix().

◆ getUseAngularDOFs()

bool FrictionSpecies::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.

124 {
125  return true;
126 }

◆ mix()

void FrictionSpecies::mix ( FrictionSpecies S,
FrictionSpecies 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]S,Tthe two species whose properties are mixed to create the new species
134 {
145 }
static Mdouble average(Mdouble a, Mdouble b)
Returns the harmonic mean of two variables.
Definition: BaseSpecies.cc:110
static Mdouble averageInf(Mdouble a, Mdouble b)
Returns the harmonic mean of two variables, returning inf if either is inf.
Definition: BaseSpecies.cc:120
Mdouble getRollingStiffness() const
Allows the spring constant to be accessed.
Definition: FrictionSpecies.cc:161
Mdouble getRollingFrictionCoefficient() const
Allows the (dynamic) Coulomb friction coefficient to be accessed.
Definition: FrictionSpecies.cc:197
Mdouble getTorsionFrictionCoefficientStatic() const
Allows the static Coulomb torsion friction coefficient to be accessed.
Definition: FrictionSpecies.cc:291
Mdouble getRollingDissipation() const
Allows the tangential viscosity to be accessed.
Definition: FrictionSpecies.cc:178
Mdouble getTorsionDissipation() const
Allows the torsion viscosity to be accessed.
Definition: FrictionSpecies.cc:251
Mdouble getTorsionStiffness() const
Allows the torsion stiffness to be accessed.
Definition: FrictionSpecies.cc:234
Mdouble getRollingFrictionCoefficientStatic() const
Allows the static Coulomb rolling friction coefficient to be accessed.
Definition: FrictionSpecies.cc:214
Mdouble getTorsionFrictionCoefficient() const
Allows the (dynamic) Coulomb torsion friction coefficient to be accessed.
Definition: FrictionSpecies.cc:272

References BaseSpecies::average(), BaseSpecies::averageInf(), getRollingDissipation(), getRollingFrictionCoefficient(), getRollingFrictionCoefficientStatic(), getRollingStiffness(), getTorsionDissipation(), getTorsionFrictionCoefficient(), getTorsionFrictionCoefficientStatic(), getTorsionStiffness(), rollingDissipation_, rollingFrictionCoefficient_, rollingFrictionCoefficientStatic_, rollingStiffness_, torsionDissipation_, torsionFrictionCoefficient_, torsionFrictionCoefficientStatic_, and torsionStiffness_.

◆ read()

void FrictionSpecies::read ( std::istream &  is)

Reads the species properties from an input stream.

Parameters
[in]isinput stream (typically the restart file)
96 {
98  std::string dummy;
99  is >> dummy >> rollingStiffness_;
100  is >> dummy >> rollingDissipation_;
101  is >> dummy >> rollingFrictionCoefficient_;
102  is >> dummy >> rollingFrictionCoefficientStatic_;
103  is >> dummy >> torsionStiffness_;
104  is >> dummy >> torsionDissipation_;
105  is >> dummy >> torsionFrictionCoefficient_;
106  is >> dummy >> torsionFrictionCoefficientStatic_;
107 }
void read(std::istream &is)
Reads the species properties from an input stream.
Definition: SlidingFrictionSpecies.cc:85

References SlidingFrictionSpecies::read(), rollingDissipation_, rollingFrictionCoefficient_, rollingFrictionCoefficientStatic_, rollingStiffness_, torsionDissipation_, torsionFrictionCoefficient_, torsionFrictionCoefficientStatic_, and torsionStiffness_.

◆ setRollingDissipation()

void FrictionSpecies::setRollingDissipation ( Mdouble  new_dispt)

Allows the tangential viscosity to be changed.

168 {
169  if (new_dispt >= 0)
170  rollingDissipation_ = new_dispt;
171  else
172  {
173  logger(ERROR, "Error in setRollingDissipation");
174  }
175 }
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
@ ERROR

References ERROR, logger, and rollingDissipation_.

◆ setRollingFrictionCoefficient()

void FrictionSpecies::setRollingFrictionCoefficient ( Mdouble  new_mu)

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

186 {
187  if (new_mu >= 0)
188  {
191  }
192  else
193  logger(ERROR, "[FrictionSpecies::setRollingFrictionCoefficient(Mdouble)] The coefficient of friction must be nonnegative.");
194 }

References ERROR, logger, rollingFrictionCoefficient_, and rollingFrictionCoefficientStatic_.

◆ setRollingFrictionCoefficientStatic()

void FrictionSpecies::setRollingFrictionCoefficientStatic ( Mdouble  new_mu)

Allows the static Coulomb rolling friction coefficient to be changed.

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

204 {
205  if (new_mu >= 0)
206  {
208  }
209  else
210  logger(ERROR, "[FrictionSpecies::setRollingFrictionCoefficientStatic(Mdouble)] The coefficient of friction must be nonnegative.");
211 }

References ERROR, logger, and rollingFrictionCoefficientStatic_.

◆ setRollingStiffness()

void FrictionSpecies::setRollingStiffness ( Mdouble  new_kt)

Allows the spring constant to be changed.

149 {
150  if (new_kt >= 0)
151  {
152  rollingStiffness_ = new_kt;
153  }
154  else
155  {
156  logger(ERROR, "Error in setRollingStiffness");
157  }
158 }

References ERROR, logger, and rollingStiffness_.

◆ setTorsionDissipation()

void FrictionSpecies::setTorsionDissipation ( Mdouble  new_dispt)

Allows the torsion viscosity to be changed.

Allows the tangential viscosity to be changed.

241 {
242  if (new_dispt >= 0)
243  torsionDissipation_ = new_dispt;
244  else
245  {
246  logger(ERROR, "Error in setTorsionDissipation");
247  }
248 }

References ERROR, logger, and torsionDissipation_.

◆ setTorsionFrictionCoefficient()

void FrictionSpecies::setTorsionFrictionCoefficient ( Mdouble  new_mu)

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

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

259 {
260  if (new_mu >= 0)
261  {
264  }
265  else
266  {
267  logger(ERROR, "Error in setSlidingFrictionCoefficient");
268  }
269 }

References ERROR, logger, torsionFrictionCoefficient_, and torsionFrictionCoefficientStatic_.

◆ setTorsionFrictionCoefficientStatic()

void FrictionSpecies::setTorsionFrictionCoefficientStatic ( Mdouble  new_mu)

Allows the static Coulomb torsion friction coefficient to be accessed.

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

279 {
280  if (new_mu >= 0)
281  {
283  }
284  else
285  {
286  logger(ERROR, "Error in setSlidingFrictionCoefficientStatic");
287  }
288 }

References ERROR, logger, and torsionFrictionCoefficientStatic_.

◆ setTorsionStiffness()

void FrictionSpecies::setTorsionStiffness ( Mdouble  new_kt)

Allows the torsion stiffness to be changed.

Allows the spring constant to be changed.

222 {
223  if (new_kt >= 0)
224  {
225  torsionStiffness_ = new_kt;
226  }
227  else
228  {
229  logger(ERROR, "Error in setTorsionStiffness");
230  }
231 }

References ERROR, logger, and torsionStiffness_.

◆ write()

void FrictionSpecies::write ( std::ostream &  os) const

Writes the species properties to an output stream.

Parameters
[out]osoutput stream (typically the restart file)
80 {
82  os << " rollingStiffness " << rollingStiffness_;
83  os << " rollingDissipation " << rollingDissipation_;
84  os << " rollingFrictionCoefficient " << rollingFrictionCoefficient_;
85  os << " rollingFrictionCoefficientStatic " << rollingFrictionCoefficientStatic_;
86  os << " torsionStiffness " << torsionStiffness_;
87  os << " torsionDissipation " << torsionDissipation_;
88  os << " torsionFrictionCoefficient " << torsionFrictionCoefficient_;
89  os << " torsionFrictionCoefficientStatic " << torsionFrictionCoefficientStatic_;
90 }
void write(std::ostream &os) const
Writes the species properties to an output stream.
Definition: SlidingFrictionSpecies.cc:73

References rollingDissipation_, rollingFrictionCoefficient_, rollingFrictionCoefficientStatic_, rollingStiffness_, torsionDissipation_, torsionFrictionCoefficient_, torsionFrictionCoefficientStatic_, torsionStiffness_, and SlidingFrictionSpecies::write().

Member Data Documentation

◆ rollingDissipation_

Mdouble FrictionSpecies::rollingDissipation_
private

rolling dissipation coefficient.

Typically set to 2/5 of the normal force dissipation, as both the tangential and the normal spring have the same restitution coefficients (if the rolling and normal stiffnesses also have a ratio of 2/5).

Referenced by FrictionSpecies(), getRollingDissipation(), mix(), read(), setRollingDissipation(), and write().

◆ rollingFrictionCoefficient_

Mdouble FrictionSpecies::rollingFrictionCoefficient_
private

(dynamic) Coulomb rolling friction coefficient.

Referenced by FrictionSpecies(), getRollingFrictionCoefficient(), mix(), read(), setRollingFrictionCoefficient(), and write().

◆ rollingFrictionCoefficientStatic_

Mdouble FrictionSpecies::rollingFrictionCoefficientStatic_
private

static Coulomb rolling friction coefficient
(by default set equal to the dynamic one).

Referenced by FrictionSpecies(), getRollingFrictionCoefficientStatic(), mix(), read(), setRollingFrictionCoefficient(), setRollingFrictionCoefficientStatic(), and write().

◆ rollingStiffness_

Mdouble FrictionSpecies::rollingStiffness_
private

rolling stiffness.

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

Referenced by FrictionSpecies(), getRollingStiffness(), mix(), read(), setRollingStiffness(), and write().

◆ torsionDissipation_

Mdouble FrictionSpecies::torsionDissipation_
private

rolling dissipation coefficient.

Typically set to 2/5 of the normal force dissipation, as both the tangential and the normal spring have the same restitution coefficients (if the rolling and normal stiffnesses also have a ratio of 2/5).

Referenced by FrictionSpecies(), getTorsionDissipation(), mix(), read(), setTorsionDissipation(), and write().

◆ torsionFrictionCoefficient_

Mdouble FrictionSpecies::torsionFrictionCoefficient_
private

(dynamic) Coulomb torsion friction coefficient.

Referenced by FrictionSpecies(), getTorsionFrictionCoefficient(), mix(), read(), setTorsionFrictionCoefficient(), and write().

◆ torsionFrictionCoefficientStatic_

Mdouble FrictionSpecies::torsionFrictionCoefficientStatic_
private

static Coulomb torsion friction coefficient
(by default set equal to the dynamic one).

Referenced by FrictionSpecies(), getTorsionFrictionCoefficientStatic(), mix(), read(), setTorsionFrictionCoefficient(), setTorsionFrictionCoefficientStatic(), and write().

◆ torsionStiffness_

Mdouble FrictionSpecies::torsionStiffness_
private

rolling stiffness.

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

Referenced by FrictionSpecies(), getTorsionStiffness(), mix(), read(), setTorsionStiffness(), and write().


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