MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HertzianSinterNormalSpecies.cc
Go to the documentation of this file.
1 //Copyright (c) 2013-2020, The MercuryDPM Developers Team. All rights reserved.
2 //For the list of developers, see <http://www.MercuryDPM.org/Team>.
3 //
4 //Redistribution and use in source and binary forms, with or without
5 //modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name MercuryDPM nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 //ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 //WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 //DISCLAIMED. IN NO EVENT SHALL THE MERCURYDPM DEVELOPERS TEAM BE LIABLE FOR ANY
19 //DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 //ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 //(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 
29 #include "BaseHandler.h"
31 //#include <cassert>
32 
33 class BaseParticle;
34 
35 class BaseInteractable;
36 
38  : BaseNormalForce()
39 {
40  loadingModulus_ = 0.0;
42  cohesionModulus_ = 0.0;
44  dissipation_ = 0.0;
45  sinterRate_ = 0.0;
46 #ifdef DEBUG_CONSTRUCTOR
47  std::cout<<"HertzianSinterNormalSpecies::HertzianSinterNormalSpecies() finished"<<std::endl;
48 #endif
49 }
50 
55  : BaseNormalForce(p)
56 {
63 #ifdef DEBUG_CONSTRUCTOR
64  std::cout<<"HertzianSinterNormalSpecies::HertzianSinterNormalSpecies(const HertzianSinterNormalSpecies &p) finished"<<std::endl;
65 #endif
66 }
67 
69 {
70 #ifdef DEBUG_DESTRUCTOR
71  std::cout<<"HertzianSinterNormalSpecies::~HertzianSinterNormalSpecies() finished"<<std::endl;
72 #endif
73 }
74 
78 void HertzianSinterNormalSpecies::write(std::ostream& os) const
79 {
80  os << " loadingModulus " << loadingModulus_;
81  os << " maxUnloadingModulus " << unloadingModulusMax_;
82  os << " cohesionModulus " << cohesionModulus_;
83  os << " maxPenetration " << penetrationDepthMax_;
84  os << " dissipation " << dissipation_;
85  os << " sinterRate " << sinterRate_;
86 }
87 
91 void HertzianSinterNormalSpecies::read(std::istream& is)
92 {
93  std::string dummy;
94  is >> dummy >> loadingModulus_;
95  is >> dummy >> unloadingModulusMax_;
96  is >> dummy >> cohesionModulus_;
97  is >> dummy >> penetrationDepthMax_;
98  is >> dummy >> dissipation_;
99  is >> dummy >> sinterRate_;
100 }
101 
106 {
107  return "HertzianSinter";
108 }
109 
116 {
123 }
124 
131 void HertzianSinterNormalSpecies::setPlasticParameters(Mdouble loadingModulus, Mdouble unloadingModulusMax,
132  Mdouble cohesionModulus, Mdouble penetrationDepthMax)
133 {
134  if (loadingModulus <= 0 || unloadingModulusMax <= 1.000001 * (loadingModulus + cohesionModulus) ||
135  cohesionModulus < 0 || penetrationDepthMax < 0)
136  {
137  logger(ERROR, "Arguments of setPlasticParameters do not make sense");
138  }
139  setLoadingModulus(loadingModulus);
140  setUnloadingModulusMax(unloadingModulusMax);
141  setCohesionModulus(cohesionModulus);
142  setPenetrationDepthMax(penetrationDepthMax);
143 }
144 
149 {
150  return loadingModulus_;
151 }
152 
157 {
158  return unloadingModulusMax_;
159 }
160 
165 {
166  return cohesionModulus_;
167 }
168 
173 {
174  return penetrationDepthMax_;
175 }
176 
181 {
182  loadingModulus_ = loadingModulus;
183 }
184 
189 {
190  unloadingModulusMax_ = unloadingModulusMax;
191 }
192 
197 {
198  cohesionModulus_ = cohesionModulus;
199 }
200 
205 {
206  penetrationDepthMax_ = penetrationDepthMax;
207 }
208 
214 {
215 // if (stiffnessMax / (.5 * mass) < mathsFunc::square(dissipation_ /mass)) {
216 // std::cerr << "Dissipation too high; max. allowed " << sqrt(2.0 * stiffnessMax * mass) << std::endl;
217 // return 0.02 * constants::pi / std::sqrt(2.0*stiffnessMax / mass);
218 // } else {
219  logger(WARN, "Warning: Dissipation is not taken into account when computing the time step");
220  ParticleSpecies* p = dynamic_cast<ParticleSpecies*>(getBaseSpecies());
221  logger.assert_debug(p,"Empty particle handler");
222  Mdouble radius = cbrt(mass * 3. / (4. * constants::pi * p->getDensity()));
223  return 0.02 * constants::pi / std::sqrt(2.0 * getUnloadingModulusMax() * getPenetrationDepthMax() * radius / mass);
224 }
225 
231 {
232  if (dissipation >= 0)
233  {
234  dissipation_ = dissipation;
235  }
236  else
237  {
238  logger(ERROR, "setDissipation(%) argument has to be non-negative", dissipation);
239  }
240 }
241 
247 {
248  if (sinterRate >= 0)
249  {
250  sinterRate_ = sinterRate;
251  }
252  else
253  {
254  logger(ERROR, "setSinterRate(%) argument has to be non-negative", sinterRate);
255  }
256 }
257 
262 {
263  return dissipation_;
264 }
265 
270 {
271  return sinterRate_;
272 }
HertzianSinterNormalSpecies()
The default constructor.
Mdouble getLoadingModulus() const
Returns the loading stiffness of the linear plastic-viscoelastic normal force.
BaseSpecies * getBaseSpecies() const
Definition: BaseForce.h:35
~HertzianSinterNormalSpecies()
The default destructor.
Mdouble computeTimeStep(Mdouble mass)
Returns the optimal time step to resolve a collision of two particles of a given mass.
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here...
Mdouble dissipation_
linear dissipation coefficient
double Mdouble
Definition: GeneralDefine.h:34
void write(std::ostream &os) const
Writes the species properties to an output stream.
Mdouble unloadingModulusMax_
the maximum elastic constant (k_2^max) for plastic deformations
Mdouble getDissipation() const
Allows the normal dissipation to be accessed.
void setPenetrationDepthMax(Mdouble penetrationDepthMax)
Sets the maximum penetration depth of the linear plastic-viscoelastic normal force.
Mdouble getSinterRate() const
Allows the normal dissipation to be accessed.
std::string getBaseName() const
Used in Species::getName to obtain a unique name for each Species.
const Mdouble pi
Definition: ExtendedMath.h:45
Mdouble getCohesionModulus() const
Returns the cohesive stiffness of the linear plastic-viscoelastic normal force.
static Mdouble average(Mdouble a, Mdouble b)
Returns the harmonic mean of two variables.
Definition: BaseSpecies.cc:110
void mix(HertzianSinterNormalSpecies *S, HertzianSinterNormalSpecies *T)
creates default values for mixed species
void setSinterRate(Mdouble sinterRate)
Sets the linear dissipation coefficient of the linear plastic-viscoelastic normal force...
HertzianSinterNormalSpecies contains the parameters used to describe a plastic-cohesive normal force ...
void setCohesionModulus(Mdouble cohesionModulus)
Sets the cohesive stiffness of the linear plastic-viscoelastic normal force.
void read(std::istream &is)
Reads the species properties from an input stream.
void setLoadingModulus(Mdouble loadingModulus)
Sets the loading stiffness of the linear plastic-viscoelastic normal force.
Mdouble cohesionModulus_
the adhesive spring constant (k^c) for plastic deformations
Defines the basic properties that a interactable object can have.
Mdouble getDensity() const
Allows density_ to be accessed.
void setDissipation(Mdouble dissipation)
Sets the linear dissipation coefficient of the linear plastic-viscoelastic normal force...
Mdouble loadingModulus_
(normal) spring constant (k_1)
void setPlasticParameters(Mdouble loadingModulus, Mdouble unloadingModulusMax, Mdouble cohesionModulus, Mdouble penetrationDepthMax)
Sets all parameters of the linear plastic-viscoelastic normal force at once.
Mdouble getUnloadingModulusMax() const
Returns the maximum unloading stiffness of the linear plastic-viscoelastic normal force...
void setUnloadingModulusMax(Mdouble unloadingModulusMax)
Sets the maximum unloading stiffness of the linear plastic-viscoelastic normal force.
Mdouble getPenetrationDepthMax() const
Returns the maximum penetration depth of the linear plastic-viscoelastic normal force.
Mdouble penetrationDepthMax_
the depth (relative to the normalized radius) at which k_2^max is used (phi_f)