revision: v0.14
SinterNormalSpecies.h
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 #ifndef SinterNormalSpecies_H
27 #define SinterNormalSpecies_H
28 
30 #include "Math/ExtendedMath.h"
32 #include "Math/Helpers.h"
33 
34 enum class SINTERTYPE : unsigned char
35 {
36  PARHAMI_MCKEEPING = 0,
37  CONSTANT_RATE = 1,
38  TEMPERATURE_DEPENDENT_FRENKEL = 2,
40 };
41 
47 {
48 public:
51 
54 
57 
60 
62  void read(std::istream& is);
63 
65  void write(std::ostream& os) const;
66 
68  std::string getBaseName() const;
69 
70 // Species-specific functions
71 
74 
79 
82 
87 
88 //setters and getters
89 
93  void setPlasticParameters(Mdouble loadingStiffness, Mdouble unloadingStiffnessMax, Mdouble cohesionStiffness,
94  Mdouble penetrationDepthMax);
95 
100 
105 
110 
115 
119  void setLoadingStiffness(Mdouble loadingStiffness);
120 
124  void setUnloadingStiffnessMax(Mdouble unloadingStiffnessMax);
125 
129  void setCohesionStiffness(Mdouble cohesionStiffness);
130 
134  void setPenetrationDepthMax(Mdouble penetrationDepthMax);
135 
139  void setDissipation(Mdouble dissipation);
140 
144  Mdouble getDissipation() const;
145 
149  void setSinterAdhesion(Mdouble sinterAdhesion);
150 
154  Mdouble getSinterAdhesion() const;
155 
159  void setInverseSinterViscosity(Mdouble inverseSinterViscosity);
160 
165 
170 
175 
176  void setSinterForceAndTime(Mdouble adhesionForce, Mdouble sinterTime, Mdouble radius);
177 
182  (Mdouble alpha, Mdouble beta, Mdouble atomicVolume /*Omega*/, Mdouble surfaceEnergy /*gamma_s*/,
183  Mdouble thicknessDiffusion /*deltaB*D0B*/, Mdouble activationEnergy /*QB*/, Mdouble temperature /*T*/);
184 
188  void setSinterRate(Mdouble sinterRate);
189 
193  void setSinterType(SINTERTYPE sinterType);
194 
198  Mdouble getSinterRate() const;
199 
200  SINTERTYPE getSinterType() const;
201 
202  std::function<double(double temperature)> getTemperatureDependentSinterRate() const;
203 
204  double getTemperatureDependentSinterRate(double temperature) const;
205 
206  void setTemperatureDependentSinterRate(std::function<double(double temperature)> temperatureDependentSinterRate);
207 
208  void setComplianceZero(Mdouble complianceZero);
209 
210  Mdouble getComplianceZero() const;
211 
212  void setSurfTension(Mdouble complianceZero);
213 
214  Mdouble getSurfTension() const;
215 
217 
218  Mdouble getConstantC1() const;
219 
220  void setSeparationDis(Mdouble separationDis);
221 
222  Mdouble getSeparationDis() const;
223 
224 
225 private:
228 
231 
234 
237 
240 
245 
250 
255 
260 
266 
272 
277 
284 
288  std::function<double(double temperature)> temperatureDependentSinterRate_ = [this](
289  double temperature) { return sinterRate_; };
290 };
291 
292 #endif
SinterNormalSpecies::getTemperatureDependentSinterRate
std::function< double(double temperature)> getTemperatureDependentSinterRate() const
Definition: SinterNormalSpecies.cc:474
SinterNormalSpecies::setSinterType
void setSinterType(SINTERTYPE sinterType)
Sets sinterRate_.
Definition: SinterNormalSpecies.cc:340
SinterInteraction
Computes normal forces in case of a linear plastic visco-elastic interaction.
Definition: SinterInteraction.h:40
mathsFunc::square
T square(const T val)
squares a number
Definition: ExtendedMath.h:106
SinterNormalSpecies::loadingStiffness_
Mdouble loadingStiffness_
(normal) spring constant (k_1)
Definition: SinterNormalSpecies.h:227
SinterNormalSpecies::getSurfTension
Mdouble getSurfTension() const
Definition: SinterNormalSpecies.cc:449
SinterNormalSpecies::sinterAdhesion_
Mdouble sinterAdhesion_
Definition: SinterNormalSpecies.h:244
SinterNormalSpecies::read
void read(std::istream &is)
Reads the species properties from an input stream.
Definition: SinterNormalSpecies.cc:111
SinterNormalSpecies::cohesionStiffness_
Mdouble cohesionStiffness_
the adhesive spring constant (k^c) for plastic deformations
Definition: SinterNormalSpecies.h:233
BaseSpecies.h
SinterNormalSpecies::setUnloadingStiffnessMax
void setUnloadingStiffnessMax(Mdouble unloadingStiffnessMax)
Sets the maximum unloading stiffness of the linear plastic-viscoelastic normal force.
Definition: SinterNormalSpecies.cc:223
SinterNormalSpecies::setSinterRate
void setSinterRate(Mdouble sinterRate)
Sets sinterRate_.
Definition: SinterNormalSpecies.cc:288
SinterNormalSpecies::setPlasticParameters
void setPlasticParameters(Mdouble loadingStiffness, Mdouble unloadingStiffnessMax, Mdouble cohesionStiffness, Mdouble penetrationDepthMax)
Sets all parameters of the linear plastic-viscoelastic normal force at once.
Definition: SinterNormalSpecies.cc:166
SinterNormalSpecies::InteractionType
SinterInteraction InteractionType
The correct Interaction type for this FrictionForceSpecies.
Definition: SinterNormalSpecies.h:50
constants::pi
const Mdouble pi
Definition: ExtendedMath.h:45
SinterNormalSpecies::setStiffnessAndRestitutionCoefficient
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: SinterNormalSpecies.cc:515
SinterNormalSpecies::setSinterAdhesion
void setSinterAdhesion(Mdouble sinterAdhesion)
Sets sinterAdhesion_.
Definition: SinterNormalSpecies.cc:275
SinterNormalSpecies::getSeparationDis
Mdouble getSeparationDis() const
Definition: SinterNormalSpecies.cc:459
SINTERTYPE::PARHAMI_MCKEEPING
@ PARHAMI_MCKEEPING
SinterNormalSpecies::unloadingStiffnessMax_
Mdouble unloadingStiffnessMax_
the maximum elastic constant (k_2^max) for plastic deformations
Definition: SinterNormalSpecies.h:230
constants::sqr_pi
const Mdouble sqr_pi
Definition: ExtendedMath.h:47
SinterNormalSpecies::getComplianceZero
Mdouble getComplianceZero() const
Definition: SinterNormalSpecies.cc:444
logger
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
mathsFunc::exp
Mdouble exp(Mdouble Exponent)
Definition: ExtendedMath.cc:84
SinterNormalSpecies::getSinterRate
Mdouble getSinterRate() const
Accesses sinterRate_.
Definition: SinterNormalSpecies.cc:439
SinterNormalSpecies::getCollisionTime
Mdouble getCollisionTime(Mdouble mass)
Calculates collision time for two copies of a particle of given disp, k, mass.
Definition: SinterNormalSpecies.cc:531
SinterNormalSpecies::computeTimeStep
Mdouble computeTimeStep(Mdouble mass)
Returns the optimal time step to resolve a collision of two particles of a given mass.
Definition: SinterNormalSpecies.cc:248
SinterNormalSpecies::setCohesionStiffness
void setCohesionStiffness(Mdouble cohesionStiffness)
Sets the cohesive stiffness of the linear plastic-viscoelastic normal force.
Definition: SinterNormalSpecies.cc:231
BaseNormalForce
Definition: BaseNormalForce.h:31
INFO
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
BaseInteractable
Defines the basic properties that a interactable object can have.
Definition: BaseInteractable.h:55
mathsFunc::log
Mdouble log(Mdouble Power)
Definition: ExtendedMath.cc:104
helpers::KAndDisp::disp
Mdouble disp
Definition: Helpers.h:49
SinterNormalSpecies::setSurfTension
void setSurfTension(Mdouble complianceZero)
Definition: SinterNormalSpecies.cc:306
Helpers.h
SinterNormalSpecies::getUnloadingStiffnessMax
Mdouble getUnloadingStiffnessMax() const
Returns the maximum unloading stiffness of the linear plastic-viscoelastic normal force.
Definition: SinterNormalSpecies.cc:191
SinterInteraction.h
Mdouble
double Mdouble
Definition: GeneralDefine.h:34
SinterNormalSpecies::temperatureDependentSinterRate_
std::function< double(double temperature)> temperatureDependentSinterRate_
Definition: SinterNormalSpecies.h:288
char
SinterNormalSpecies::getCohesionStiffness
Mdouble getCohesionStiffness() const
Returns the cohesive stiffness of the linear plastic-viscoelastic normal force.
Definition: SinterNormalSpecies.cc:199
SinterNormalSpecies::mix
void mix(SinterNormalSpecies *S, SinterNormalSpecies *T)
creates default values for mixed species
Definition: SinterNormalSpecies.cc:144
SinterNormalSpecies::getSinterType
SINTERTYPE getSinterType() const
Definition: SinterNormalSpecies.cc:464
SinterNormalSpecies::setCollisionTimeAndRestitutionCoefficient
void setCollisionTimeAndRestitutionCoefficient(Mdouble tc, Mdouble eps, Mdouble mass)
Definition: SinterNormalSpecies.cc:493
double
SinterNormalSpecies::setSinterForceAndTime
void setSinterForceAndTime(Mdouble adhesionForce, Mdouble sinterTime, Mdouble radius)
Definition: SinterNormalSpecies.cc:370
ERROR
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:53
SinterNormalSpecies::getPenetrationDepthMax
Mdouble getPenetrationDepthMax() const
Returns the maximum penetration depth of the linear plastic-viscoelastic normal force.
Definition: SinterNormalSpecies.cc:207
Logger.h
MERCURY_DEPRECATED
#define MERCURY_DEPRECATED
Definition: GeneralDefine.h:37
BaseSpecies::average
static Mdouble average(Mdouble a, Mdouble b)
Returns the harmonic mean of two variables.
Definition: BaseSpecies.cc:110
SinterNormalSpecies::sinterRate_
Mdouble sinterRate_
Definition: SinterNormalSpecies.h:254
SinterNormalSpecies::setInverseSinterViscosity
void setInverseSinterViscosity(Mdouble inverseSinterViscosity)
Sets inverseSinterViscosity_.
Definition: SinterNormalSpecies.cc:359
SinterNormalSpecies::setLoadingStiffnessAndDissipation
MERCURY_DEPRECATED void setLoadingStiffnessAndDissipation(helpers::KAndDisp new_)
Allows the spring and dissipation constants to be changed simultaneously.
Definition: SinterNormalSpecies.cc:406
SinterNormalSpecies::getConstantC1
Mdouble getConstantC1() const
Definition: SinterNormalSpecies.cc:454
SinterNormalSpecies::getLoadingStiffness
Mdouble getLoadingStiffness() const
Returns the loading stiffness of the linear plastic-viscoelastic normal force.
Definition: SinterNormalSpecies.cc:183
SinterNormalSpecies::inverseSinterViscosity_
Mdouble inverseSinterViscosity_
Definition: SinterNormalSpecies.h:249
SinterNormalSpecies::setConstantC1
void setConstantC1(Mdouble constantC1_)
Definition: SinterNormalSpecies.cc:315
SinterNormalSpecies.h
SinterNormalSpecies::setLoadingStiffness
void setLoadingStiffness(Mdouble loadingStiffness)
Sets the loading stiffness of the linear plastic-viscoelastic normal force.
Definition: SinterNormalSpecies.cc:215
SinterNormalSpecies::setComplianceZero
void setComplianceZero(Mdouble complianceZero)
Definition: SinterNormalSpecies.cc:297
SinterNormalSpecies::write
void write(std::ostream &os) const
Writes the species properties to an output stream.
Definition: SinterNormalSpecies.cc:91
SinterNormalSpecies::~SinterNormalSpecies
~SinterNormalSpecies()
The default destructor.
Definition: SinterNormalSpecies.cc:81
SinterNormalSpecies::setParhamiMcKeeping
void setParhamiMcKeeping(Mdouble alpha, Mdouble beta, Mdouble atomicVolume, Mdouble surfaceEnergy, Mdouble thicknessDiffusion, Mdouble activationEnergy, Mdouble temperature)
Sets the sinterAdhesion_ and inverseSinterViscosity_ based on the Parhami-McKeeping parameters.
Definition: SinterNormalSpecies.cc:385
SinterNormalSpecies::constantC1_
Mdouble constantC1_
Definition: SinterNormalSpecies.h:271
BaseParticle
Definition: BaseParticle.h:54
helpers::KAndDisp::k
Mdouble k
Definition: Helpers.h:48
SinterNormalSpecies::surfTension_
Mdouble surfTension_
Definition: SinterNormalSpecies.h:265
SinterNormalSpecies::complianceZero_
Mdouble complianceZero_
Definition: SinterNormalSpecies.h:259
helpers::KAndDisp
return type specifically for fuctions returning k and disp at once
Definition: Helpers.h:46
mathsFunc::beta
Mdouble beta(Mdouble z, Mdouble w)
This is the beta function, returns the approximation based on cmath's implementation of ln(gamma)
Definition: ExtendedMath.cc:164
unsigned
SinterNormalSpecies::separationDis_
Mdouble separationDis_
Definition: SinterNormalSpecies.h:276
SinterNormalSpecies::setTemperatureDependentSinterRate
void setTemperatureDependentSinterRate(std::function< double(double temperature)> temperatureDependentSinterRate)
Definition: SinterNormalSpecies.cc:479
SinterNormalSpecies::dissipation_
Mdouble dissipation_
linear dissipation coefficient
Definition: SinterNormalSpecies.h:239
SinterNormalSpecies::getSinterAdhesion
Mdouble getSinterAdhesion() const
Accesses sinterAdhesion_.
Definition: SinterNormalSpecies.cc:423
SinterNormalSpecies::getDissipation
Mdouble getDissipation() const
Allows the normal dissipation to be accessed.
Definition: SinterNormalSpecies.cc:415
SinterNormalSpecies
SinterNormalSpecies contains the parameters used to describe a plastic-cohesive normal force (Stefan ...
Definition: SinterNormalSpecies.h:47
SinterNormalSpecies::setPenetrationDepthMax
void setPenetrationDepthMax(Mdouble penetrationDepthMax)
Sets the maximum penetration depth of the linear plastic-viscoelastic normal force.
Definition: SinterNormalSpecies.cc:239
SINTERTYPE
SINTERTYPE
Definition: SinterNormalSpecies.h:35
SinterNormalSpecies::getBaseName
std::string getBaseName() const
Used in Species::getName to obtain a unique name for each Species.
Definition: SinterNormalSpecies.cc:134
ExtendedMath.h
SinterNormalSpecies::penetrationDepthMax_
Mdouble penetrationDepthMax_
the depth (relative to the normalized radius) at which k_2^max is used (phi_f)
Definition: SinterNormalSpecies.h:236
SinterNormalSpecies::sinterType_
SINTERTYPE sinterType_
sinterType options determin how the rate of sintering, d(equilibriumOverlap)/dt is computed PARHAMI_M...
Definition: SinterNormalSpecies.h:283
SinterNormalSpecies::SinterNormalSpecies
SinterNormalSpecies()
The default constructor.
Definition: SinterNormalSpecies.cc:36
SinterNormalSpecies::setSeparationDis
void setSeparationDis(Mdouble separationDis)
Definition: SinterNormalSpecies.cc:324
SinterNormalSpecies::setDissipation
void setDissipation(Mdouble dissipation)
Sets the linear dissipation coefficient of the linear plastic-viscoelastic normal force.
Definition: SinterNormalSpecies.cc:262
SinterNormalSpecies::getInverseSinterViscosity
Mdouble getInverseSinterViscosity() const
Accesses inverseSinterViscosity_.
Definition: SinterNormalSpecies.cc:431
BaseNormalForce.h