LinearViscoelasticNormalSpecies.h
Go to the documentation of this file.
1 // This file is part of the MercuryDPM project (https://www.mercurydpm.org).
2 // Copyright (c), The MercuryDPM Developers Team. All rights reserved.
3 // License: BSD 3-Clause License; see the LICENSE file in the root directory.
4 
5 #ifndef LinearViscoelasticNormalSpecies_H
6 #define LinearViscoelasticNormalSpecies_H
7 
9 #include "Math/ExtendedMath.h"
11 #include "Math/Helpers.h"
12 
18 {
19 public:
22 
25 
28 
31 
33  void read(std::istream& is);
34 
36  void write(std::ostream& os) const;
37 
39  std::string getBaseName() const;
40 
41 // Species-specific functions
42 
45 
48 
50  void setRestitutionCoefficient(double eps, Mdouble mass);
51 
54 
57 
61  void setCollisionTimeAndRestitutionCoefficient(Mdouble collisionTime, Mdouble restitutionCoefficient, Mdouble mass1,
62  Mdouble mass2);
63 
67  Mdouble getCollisionTime(Mdouble mass) const;
68 
73 
76 
77 //setters and getters
78 
80  void setStiffness(Mdouble new_k);
81 
83  Mdouble getStiffness() const;
84 
85  void setDissipation(Mdouble dissipation);
86 
88  Mdouble getDissipation() const;
89 
93 
95  {
96  return 0.02 * constants::pi /
97  std::sqrt(stiffness_ / (.5 * mass) - mathsFunc::square(dissipation_ / mass));
98  }
99 
100 private:
103 };
104 
105 #endif
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
#define MERCURYDPM_DEPRECATED
Definition: GeneralDefine.h:16
float * p
Definition: Tutorial_Map_using.cpp:9
Definition: BaseNormalForce.h:11
Definition: BaseParticle.h:33
Enables one to compute normal forces in case of a linear visco-elastic interaction.
Definition: LinearViscoelasticInteraction.h:19
LinearViscoelasticNormalSpecies contains the parameters used to describe a linear elastic-dissipative...
Definition: LinearViscoelasticNormalSpecies.h:18
void setStiffnessAndRestitutionCoefficient(Mdouble k_, Mdouble eps, Mdouble mass)
Sets k, disp such that it matches a given tc and eps for a collision of two copies of P.
Definition: LinearViscoelasticNormalSpecies.cc:165
Mdouble dissipation_
(normal) viscosity
Definition: LinearViscoelasticNormalSpecies.h:102
void setRestitutionCoefficient(double eps, Mdouble mass)
Sets disp to obtain a restitution coefficient eps for a collision of two particles of mass m.
Definition: LinearViscoelasticNormalSpecies.cc:178
Mdouble getMaximumVelocity(Mdouble radius, Mdouble mass) const
Calculates the maximum velocity allowed for a collision of two copies of P (for higher velocities par...
Definition: LinearViscoelasticNormalSpecies.cc:154
void write(std::ostream &os) const
Writes the species properties to an output stream.
Definition: LinearViscoelasticNormalSpecies.cc:47
Mdouble stiffness_
(normal) spring constant
Definition: LinearViscoelasticNormalSpecies.h:101
Mdouble getStiffness() const
Allows the spring constant to be accessed.
Definition: LinearViscoelasticNormalSpecies.cc:83
Mdouble getCollisionTime(Mdouble mass) const
Calculates collision time for two copies of a particle of given disp, k, mass.
Definition: LinearViscoelasticNormalSpecies.cc:116
void setDissipation(Mdouble dissipation)
Allows the normal dissipation to be changed.
Definition: LinearViscoelasticNormalSpecies.cc:96
LinearViscoelasticInteraction InteractionType
The correct Interaction type for this FrictionForceSpecies.
Definition: LinearViscoelasticNormalSpecies.h:21
~LinearViscoelasticNormalSpecies()
The default destructor.
Definition: LinearViscoelasticNormalSpecies.cc:37
Mdouble computeTimeStep(Mdouble mass)
Definition: LinearViscoelasticNormalSpecies.h:94
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.
Definition: LinearViscoelasticNormalSpecies.cc:191
void read(std::istream &is)
Reads the species properties from an input stream.
Definition: LinearViscoelasticNormalSpecies.cc:56
Mdouble getDissipation() const
Allows the normal dissipation to be accessed.
Definition: LinearViscoelasticNormalSpecies.cc:109
LinearViscoelasticNormalSpecies()
The default constructor.
Definition: LinearViscoelasticNormalSpecies.cc:14
void setStiffness(Mdouble new_k)
Allows the spring constant to be changed.
Definition: LinearViscoelasticNormalSpecies.cc:72
Mdouble getRestitutionCoefficient(Mdouble mass) const
Calculates restitution coefficient for two copies of given disp, k, mass.
Definition: LinearViscoelasticNormalSpecies.cc:147
MERCURYDPM_DEPRECATED void setStiffnessAndDissipation(helpers::KAndDisp new_)
Allows the spring and dissipation constants to be changed simultaneously.
Definition: LinearViscoelasticNormalSpecies.cc:89
void mix(LinearViscoelasticNormalSpecies *SBase, LinearViscoelasticNormalSpecies *TBase)
creates default values for mixed species
Definition: LinearViscoelasticNormalSpecies.cc:246
std::string getBaseName() const
Used in Species::getName to obtain a unique name for each Species.
Definition: LinearViscoelasticNormalSpecies.cc:66
double eps
Definition: crbond_bessel.cc:24
radius
Definition: UniformPSDSelfTest.py:15
const Mdouble pi
Definition: ExtendedMath.h:23
T square(const T val)
squares a number
Definition: ExtendedMath.h:86
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
return type specifically for fuctions returning k and disp at once
Definition: FormulaHelpers.h:17