MercuryDPM  Alpha
 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...
 
virtual ~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
 Returns true if torques have to be calculated. More...
 
void mix (SlidingFrictionSpecies *const S, SlidingFrictionSpecies *const 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...
 
- 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 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 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...
 

Detailed Description

SlidingFrictionSpecies contains the parameters used to describe sliding friction.

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

Definition at line 36 of file SlidingFrictionSpecies.h.

Member Typedef Documentation

Constructor & Destructor Documentation

SlidingFrictionSpecies::SlidingFrictionSpecies ( )

The default constructor.

Definition at line 35 of file SlidingFrictionSpecies.cc.

References slidingDissipation_, slidingFrictionCoefficient_, slidingFrictionCoefficientStatic_, and slidingStiffness_.

36 {
41 #ifdef DEBUG_CONSTRUCTOR
42  std::cout<<"SlidingFrictionSpecies::SlidingFrictionSpecies() finished"<<std::endl;
43 #endif
44 }
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 49 of file SlidingFrictionSpecies.cc.

References slidingDissipation_, slidingFrictionCoefficient_, slidingFrictionCoefficientStatic_, and slidingStiffness_.

50 {
55 #ifdef DEBUG_CONSTRUCTOR
56  std::cout<<"SlidingFrictionSpecies::SlidingFrictionSpecies(const SlidingFrictionSpecies &p) finished"<<std::endl;
57 #endif
58 }
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 ( )
virtual

The default destructor.

Definition at line 60 of file SlidingFrictionSpecies.cc.

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

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 95 of file SlidingFrictionSpecies.cc.

96 {
97  return "SlidingFriction";
98 }
Mdouble SlidingFrictionSpecies::getSlidingDissipation ( ) const

Allows the tangential viscosity to be accessed.

Definition at line 132 of file SlidingFrictionSpecies.cc.

References slidingDissipation_.

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

133 {
134  return slidingDissipation_;
135 }
Mdouble slidingDissipation_
tangential dissipation coefficient.
Mdouble SlidingFrictionSpecies::getSlidingFrictionCoefficient ( ) const

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

Definition at line 154 of file SlidingFrictionSpecies.cc.

References slidingFrictionCoefficient_.

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

155 {
157 }
Mdouble slidingFrictionCoefficient_
(dynamic) Coulomb friction coefficient
Mdouble SlidingFrictionSpecies::getSlidingFrictionCoefficientStatic ( ) const

Allows the static Coulomb friction coefficient to be accessed.

Definition at line 174 of file SlidingFrictionSpecies.cc.

References slidingFrictionCoefficientStatic_.

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

175 {
177 }
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 115 of file SlidingFrictionSpecies.cc.

References slidingStiffness_.

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

116 {
117  return slidingStiffness_;
118 }
Mdouble slidingStiffness_
tangential stiffness.
bool SlidingFrictionSpecies::getUseAngularDOFs ( ) const
virtual

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 BaseSpecies.

Definition at line 185 of file SlidingFrictionSpecies.cc.

186 {
187  return true;
188 }
void SlidingFrictionSpecies::mix ( SlidingFrictionSpecies *const  SFrictional,
SlidingFrictionSpecies *const  TFrictional 
)

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 196 of file SlidingFrictionSpecies.cc.

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

197 {
198  slidingStiffness_ = average(SFrictional->getSlidingStiffness(), TFrictional->getSlidingStiffness());
202 }
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)
Mdouble average(Mdouble a, Mdouble b)
defines the average of two variables by the harmonic mean.
Definition: BaseSpecies.cc:85
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)
virtual

Reads the species properties from an input stream.

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

Implements BaseObject.

Definition at line 82 of file SlidingFrictionSpecies.cc.

References slidingDissipation_, slidingFrictionCoefficient_, slidingFrictionCoefficientStatic_, and slidingStiffness_.

Referenced by FrictionSpecies::read().

83 {
84  //BaseSpecies::read(is);
85  std::string dummy;
86  is >> dummy >> slidingStiffness_;
87  is >> dummy >> slidingDissipation_;
88  is >> dummy >> slidingFrictionCoefficient_;
89  is >> dummy >> slidingFrictionCoefficientStatic_;
90 }
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 205 of file SlidingFrictionSpecies.cc.

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

206 {
207  Mdouble stiffness;
208  //the dynamic cast is needed to check if the normal force species is LinearViscoelasticSpecies; otherwise this function cannot be used
210  if (species!= nullptr)
211  {
212  species->setCollisionTimeAndRestitutionCoefficient(tc, eps, mass);
213  stiffness = species->getStiffness();
214  }
215  else
216  {
218  if (species2 != nullptr)
219  {
220  species2->setDissipation(-mass / tc * std::log(eps));
221  species2->setLoadingStiffness(.5 * mass * (mathsFunc::square(constants::pi/tc) + mathsFunc::square(species2->getDissipation()) /mass));
222  stiffness = species2->getLoadingStiffness();
223  }
224  else
225  {
226  std::cerr << "SlidingFrictionSpecies::setCollisionTimeAndNormalAndTangentialRestitutionCoefficient only works for LinearViscoelasticSlidingFrictionSpecies or LinearPlasticViscoelasticSlidingFrictionSpecies" << std::endl;
227  exit(-1);
228  }
229  }
230 
231  //from Deen...Kuipers2006, eq. 43 and 30
233  if (beta != 0.0)
234  setSlidingDissipation(-2 * log(beta) * sqrt(1.0 / 7.0 * mass * getSlidingStiffness() / (mathsFunc::square(constants::pi) + mathsFunc::square(log(beta)))));
235  else
236  setSlidingDissipation(2. * sqrt(1.0 / 7.0 * mass * getSlidingStiffness()));
237 }
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...
Mdouble getStiffness() const
Allows the spring constant to be accessed.
double Mdouble
Mdouble log(Mdouble Power)
Definition: ExtendedMath.cc:97
T square(T val)
squares a number
Definition: ExtendedMath.h:91
LinearViscoelasticNormalSpecies contains the parameters used to describe a linear elastic-dissipative...
const Mdouble pi
Definition: ExtendedMath.h:42
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...
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 240 of file SlidingFrictionSpecies.cc.

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

241 {
242  //the dynamic cast is needed to check if the normal force species is LinearViscoelasticSpecies; otherwise this function cannot be used
244  if (species == nullptr)
245  {
246  std::cerr << "SlidingFrictionSpecies::setCollisionTimeAndNormalAndTangentialRestitutionCoefficient only works for LinearViscoelasticSlidingFrictionSpecies" << std::endl;
247  exit(-1);
248  }
249  species->setCollisionTimeAndRestitutionCoefficient(tc, eps, mass);
250  //from BeckerSchwagerPoeschel2008, eq. 56
251  setSlidingStiffness(2.0 / 7.0 * species->getStiffness() * mathsFunc::square(acos(-beta) / constants::pi));
253 }
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...
Mdouble getStiffness() const
Allows the spring constant to be accessed.
T square(T val)
squares a number
Definition: ExtendedMath.h:91
LinearViscoelasticNormalSpecies contains the parameters used to describe a linear elastic-dissipative...
const Mdouble pi
Definition: ExtendedMath.h:42
void setSlidingStiffness(Mdouble new_kt)
Allows the spring constant to be changed.
void setSlidingDissipation(Mdouble new_dispt)
Allows the tangential viscosity to be changed.
void SlidingFrictionSpecies::setSlidingDissipation ( Mdouble  new_dispt)

Allows the tangential viscosity to be changed.

Definition at line 121 of file SlidingFrictionSpecies.cc.

References slidingDissipation_.

Referenced by setCollisionTimeAndNormalAndTangentialRestitutionCoefficient(), and setCollisionTimeAndNormalAndTangentialRestitutionCoefficientNoDispt().

122 {
123  if (new_dispt >= 0)
124  slidingDissipation_ = new_dispt;
125  else
126  {
127  std::cerr << "Error in setSlidingDissipation" << std::endl;
128  exit(-1);
129  }
130 }
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 139 of file SlidingFrictionSpecies.cc.

References slidingFrictionCoefficient_, and slidingFrictionCoefficientStatic_.

Referenced by ChuteBottom::makeRoughBottom().

140 {
141  if (new_mu >= 0)
142  {
145  }
146  else
147  {
148  std::cerr << "Error in setSlidingFrictionCoefficient" << std::endl;
149  exit(-1);
150  }
151 }
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 160 of file SlidingFrictionSpecies.cc.

References slidingFrictionCoefficientStatic_.

161 {
162  if (new_mu >= 0)
163  {
165  }
166  else
167  {
168  std::cerr << "Error in setSlidingFrictionCoefficientStatic" << std::endl;
169  exit(-1);
170  }
171 }
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 101 of file SlidingFrictionSpecies.cc.

References slidingStiffness_.

Referenced by setCollisionTimeAndNormalAndTangentialRestitutionCoefficient(), and setCollisionTimeAndNormalAndTangentialRestitutionCoefficientNoDispt().

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

Writes the species properties to an output stream.

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

Implements BaseObject.

Definition at line 70 of file SlidingFrictionSpecies.cc.

References slidingDissipation_, slidingFrictionCoefficient_, slidingFrictionCoefficientStatic_, and slidingStiffness_.

Referenced by FrictionSpecies::write().

71  {
72  //BaseSpecies::write(os);
73  os << " slidingStiffness " << slidingStiffness_;
74  os << " slidingDissipation " << slidingDissipation_;
75  os << " slidingFrictionCoefficient " << slidingFrictionCoefficient_;
76  os << " slidingFrictionCoefficientStatic " << slidingFrictionCoefficientStatic_;
77 }
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

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 117 of file SlidingFrictionSpecies.h.

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

Mdouble SlidingFrictionSpecies::slidingFrictionCoefficient_
private

(dynamic) Coulomb friction coefficient

Definition at line 120 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 123 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 107 of file SlidingFrictionSpecies.h.

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


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