Simple sintering process

Problem description:

This tutorial present a simple case of sintering between two particles. The code can be found in SinterPair.cpp.

Sintering of two particles.

Headers

Before the main function

class SinterPair : public Mercury3D
{
public:
explicit SinterPair (Mdouble radius)
{
std::string r = helpers::toString(radius);
setName("SinterPair"+r);
helpers::writeToFile("SinterPair"+r+".gnu",
"set xlabel 'time [s]'\n"
"set ylabel 'x/a [nm]'\n"
"r="+r+"\n"
"plot 'SinterPair"+r+".fstat' u ($1):(sqrt($7/r)) w lp\n"
);
setGravity({0,0,0});
setSaveCount(20000);
setMin({-2*radius,-radius,-radius});
setMax({2*radius,radius,radius});
const Mdouble stiffness = 1e-2 * radius;
const Mdouble restitutionCoefficient = 0.1;
const Mdouble density = 1005;
s.setDensity(density);
const Mdouble mass = s.getMassFromRadius(radius);
s.setStiffnessAndRestitutionCoefficient(stiffness,restitutionCoefficient,mass);
s.setPlasticParameters(stiffness, 10*stiffness, stiffness, 0.16);
const Mdouble collisionTime = s.getCollisionTime(mass);
logger(INFO,"Collision time %",collisionTime);
s.setSinterType(SINTERTYPE::CONSTANT_RATE);
s.setSinterRate(4e-10/radius);
s.setSinterAdhesion(0.013*stiffness);
//adhesiveForce = sinterAdhesion*radius;
auto species = speciesHandler.copyAndAddObject(s);
setTimeStep(0.02*collisionTime);
p.setSpecies(species);
p.setRadius(radius);
p.setPosition({-(1-1e-15)*radius,0,0});
}
void printTime() const override
{
logger(INFO, "t=%3, tmax=%3, r=%3", getTime(), getTimeMax(), particleHandler.getLastObject()->getRadius());
//<< ", Ekin=" << std::setprecision(3) << std::left << std::setw(6) << getKineticEnergy()/getElasticEnergy()
}
};
double Mdouble
Definition: GeneralDefine.h:34
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
@ INFO
std::enable_if<!std::is_pointer< U >::value, U * >::type copyAndAddObject(const U &object)
Creates a copy of a Object and adds it to the BaseHandler.
Definition: BaseHandler.h:379
T * getLastObject()
Gets a pointer to the last Object in this BaseHandler.
Definition: BaseHandler.h:634
virtual void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: BaseInteractable.h:239
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Definition: BaseInteractable.h:218
Mdouble getRadius() const
Returns the particle's radius.
Definition: BaseParticle.h:348
virtual void setRadius(Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species)
Definition: BaseParticle.cc:553
void setSpecies(const ParticleSpecies *species)
Definition: BaseParticle.cc:818
void setHandler(SpeciesHandler *handler)
Sets the pointer to the handler to which this species belongs.
Definition: BaseSpecies.cc:91
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:408
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1427
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:808
void setMin(const Vec3D &min)
Sets the minimum coordinates of the problem domain.
Definition: DPMBase.cc:1118
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1437
void setParticlesWriteVTK(bool writeParticlesVTK)
Sets whether particles are written in a VTK file.
Definition: DPMBase.cc:942
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1234
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:873
void setMax(const Vec3D &max)
Sets the maximum coordinates of the problem domain.
Definition: DPMBase.cc:1082
Mdouble getTimeMax() const
Returns the maximum simulation duration.
Definition: DPMBase.cc:888
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1383
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:37
void setDensity(Mdouble density)
Definition: ParticleSpecies.cc:108
Mdouble getMassFromRadius(Mdouble radius) const
Definition: ParticleSpecies.cc:123
[St:headers]
Definition: SinterPair.cpp:35
void printTime() const override
Displays the current simulation time and the maximum simulation duration.
Definition: SinterPair.cpp:88
SinterPair(Mdouble radius)
Definition: SinterPair.cpp:37
Contains material and contact force properties.
Definition: Species.h:35
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:37
std::string toString(Mdouble value, unsigned precision)
converts a floating point number into a string with a given precision
Definition: StringHelpers.cc:38
bool writeToFile(std::string filename, std::string filecontent)
Writes a string to a file.
Definition: FileIOHelpers.cc:58

Main function

There are three different radii for this tutorial: 1.5e-6, 2.0e-6, 5.0e-7

int main(int argc UNUSED, char *argv[] UNUSED)
{
SinterPair sp0(2e-6);
sp0.solve();
SinterPair sp1(1.5e-6);
sp1.solve();
SinterPair sp2(5e-7);
sp2.solve();
helpers::writeToFile("SinterPair.gnu",
"set xlabel 'time [s]'\n"
"set ylabel 'x/a'\n"
"plot [0:200] 'SinterPair5e-07.fstat' u ($1):(sqrt($7/5e-07)) w lp lt rgb 'royalblue'\n"
"replot 'SinterPair1.5e-06.fstat' u ($1):(sqrt($7/1.5e-06)) w lp lt rgb 'light-red'\n"
"replot 'SinterPair2e-06.fstat' u ($1):(sqrt($7/2e-06)) w lp lt rgb 'sea-green'"
);
logger(INFO, "Execute 'gnuplot SinterPair.gnu' to view output");
}
#define UNUSED
Definition: GeneralDefine.h:39
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
int main(int argc, char *argv[])
Definition: T_protectiveWall.cpp:215

Reference:

Fuchs, R., Weinhart, T., Ye, M., Luding, S., Butt, H. J., & Kappl, M. (2017). Initial stage sintering of polymer particles–Experiments and modelling of size-, temperature-and time-dependent contacts. In EPJ Web of Conferences (Vol. 140, p. 13012). EDP Sciences.

(Return to Overview of advanced tutorials)