revision: v0.14
DropletBoundary.h
Go to the documentation of this file.
1 #ifndef DROPLETBOUNDARY_H
2 #define DROPLETBOUNDARY_H
3 
4 #include "DPMBase.h"
5 #include "BaseBoundary.h"
6 #include "Math/Vector.h"
7 #include "Math/RNG.h"
8 
9 class DPMBase;
10 
11 class ParticleHandler;
12 
13 class BaseParticle;
14 
15 class RNG;
16 
26 {
27 public:
28 
29  struct Droplet {
32  double radius;
33  };
34 
35  std::vector<Droplet> droplets_;
36 
37 private:
38 
39  std::function<void(DropletBoundary&)> generateDroplets_
40  = [] (DropletBoundary&) {};
41 
42 public:
43 
45 
47  droplets_ = other.droplets_;
49  }
50 
51  ~DropletBoundary() override {
52  logger(VERBOSE, "A DropletBoundary has been destroyed.");
53  }
54 
55  DropletBoundary* copy() const override {
56  return new DropletBoundary(*this);
57  }
58 
59  std::string getName() const override {
60  return "DropletBoundary";
61  }
62 
67 
71  void read(std::istream& is) override;
72 
76  void write(std::ostream& os) const override;
77 
78  void setGenerateDroplets(std::function<void(DropletBoundary&)> generateDroplets) {
79  generateDroplets_=generateDroplets;
80  }
81 
82  void writeVTK(std::fstream& file) override;
83 
84  // this is the number of timesteps between checks whether the droplet is in contact with a particle or wall.
85  unsigned checkCount = 3;
86 };
87 
88 #endif
DrivenParticleClass
Definition: DrivenParticleUnitTest.cpp:38
DPMBase::setName
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:420
DrivenParticleClass::actionsAfterTimeStep
void actionsAfterTimeStep() override
A virtual function which allows to define operations to be executed after time step.
Definition: DrivenParticleUnitTest.cpp:64
DPMBase::setTimeStep
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1225
DPMBase::getTimeStep
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1241
Vector.h
constants::pi
const Mdouble pi
Definition: ExtendedMath.h:45
DropletBoundary::generateDroplets_
std::function< void(DropletBoundary &)> generateDroplets_
Definition: DropletBoundary.h:40
DropletBoundary::Droplet::position
Vec3D position
Definition: DropletBoundary.h:30
DropletBoundary::Droplet::radius
double radius
Definition: DropletBoundary.h:32
BaseParticle::fixParticle
void fixParticle()
Fix Particle function. It fixes a Particle by setting its inverse mass and inertia and velocities to ...
Definition: BaseParticle.cc:165
BaseInteractable::setPosition
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: BaseInteractable.h:239
BaseWall
Basic class for walls.
Definition: BaseWall.h:48
logger
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
LiquidFilmParticle.h
DropletBoundary::~DropletBoundary
~DropletBoundary() override
Definition: DropletBoundary.h:51
Vec3D::X
Mdouble X
the vector components
Definition: Vector.h:65
DPMBase::setYMax
void setYMax(Mdouble newYMax)
Sets the value of YMax, the upper bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1182
BaseBoundary::write
void write(std::ostream &os) const override=0
Adds object's id_ to given ostream NB: purely virtual function, overriding the version of BaseObject.
Definition: BaseBoundary.cc:70
DropletBoundary::Droplet::velocity
Vec3D velocity
Definition: DropletBoundary.h:31
ParticleHandler.h
DropletBoundary::setGenerateDroplets
void setGenerateDroplets(std::function< void(DropletBoundary &)> generateDroplets)
Definition: DropletBoundary.h:78
BaseBoundary::read
void read(std::istream &is) override=0
Reads the object's id_ from given istream NB: purely virtual function, overriding the version of Base...
Definition: BaseBoundary.cc:61
BaseBoundary
Definition: BaseBoundary.h:49
BaseParticle::setRadius
virtual void setRadius(Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species)
Definition: BaseParticle.cc:542
Vec3D
Definition: Vector.h:50
DPMBase::solve
void solve()
The work horse of the code.
Definition: DPMBase.cc:4003
DPMBase::setZMax
void setZMax(Mdouble newZMax)
Sets the value of ZMax, the upper bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1208
DropletBoundary::getName
std::string getName() const override
A purely virtual function.
Definition: DropletBoundary.h:59
RNG.h
RNG
This is a class that generates random numbers i.e. named the Random Number Generator (RNG).
Definition: RNG.h:53
double
VERBOSE
LL< Log::VERBOSE > VERBOSE
Verbose information.
Definition: Logger.cc:57
LiquidFilmParticle
Definition: LiquidFilmParticle.h:36
mathsFunc::sin
Mdouble sin(Mdouble x)
Definition: ExtendedMath.cc:44
BaseParticle::setSpecies
void setSpecies(const ParticleSpecies *species)
Definition: BaseParticle.cc:804
LinearViscoelasticSpecies
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
Definition: LinearViscoelasticSpecies.h:33
MercuryBase
This is the base class for both Mercury2D and Mercury3D. Note the actually abstract grid is defined i...
Definition: MercuryBase.h:126
Vec3D::getLength
static Mdouble getLength(const Vec3D &a)
Calculates the length of a Vec3D: .
Definition: Vector.cc:331
MercuryBase::hGridFindParticleContacts
virtual std::vector< BaseParticle * > hGridFindParticleContacts(const BaseParticle *obj)=0
Purely virtual function that returns all particles that have a contact with a given particle.
LinearViscoelasticSpecies.h
DPMBase::setXMax
void setXMax(Mdouble newXMax)
Sets the value of XMax, the upper bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1156
DropletBoundary
Supplies a 'constant heat flux' to a cuboidal region (specified by two corner points) by adding a ran...
Definition: DropletBoundary.h:26
DPMBase::speciesHandler
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1385
DropletBoundary::Droplet
Definition: DropletBoundary.h:29
DPMBase.h
SphericalParticle
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:37
DropletBoundary::copy
DropletBoundary * copy() const override
Used to create a copy of the object NB: purely virtual function.
Definition: DropletBoundary.h:55
DPMBase::wallHandler
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:1405
LiquidFilmParticle::addLiquidVolume
void addLiquidVolume(Mdouble liquidVolume)
Definition: LiquidFilmParticle.h:113
DPMBase::setTimeMax
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:870
Vec3D::Y
Mdouble Y
Definition: Vector.h:65
main
int main(int argc, char *argv[])
Definition: DrivenParticleUnitTest.cpp:81
FATAL
LL< Log::FATAL > FATAL
Definition of the different loglevels by its wrapper class LL. These are used as tags in template met...
Definition: Logger.cc:52
DropletBoundary::DropletBoundary
DropletBoundary(const DropletBoundary &other)
Definition: DropletBoundary.h:46
constants::i
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51
DrivenParticleClass::setupInitialConditions
void setupInitialConditions() override
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: DrivenParticleUnitTest.cpp:40
DPMBase::setFileType
void setFileType(FileType fileType)
Sets File::fileType_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:457
BaseInteractable::setPrescribedPosition
void setPrescribedPosition(const std::function< Vec3D(double)> &prescribedPosition)
Allows the position of an infinite mass interactable to be prescribed.
Definition: BaseInteractable.cc:413
BaseHandler::getLastObject
T * getLastObject()
Gets a pointer to the last Object in this BaseHandler.
Definition: BaseHandler.h:634
BaseHandler::getObject
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
DropletBoundary::writeVTK
void writeVTK(std::fstream &file) override
Definition: DropletBoundary.cc:94
BaseHandler::getDPMBase
DPMBase * getDPMBase()
Gets the problem that is solved using this handler.
Definition: BaseHandler.h:725
DropletBoundary::DropletBoundary
DropletBoundary()
Definition: DropletBoundary.h:44
DropletBoundary::checkCount
unsigned checkCount
Definition: DropletBoundary.h:85
BaseParticle
Definition: BaseParticle.h:54
DropletBoundary::droplets_
std::vector< Droplet > droplets_
Definition: DropletBoundary.h:35
BaseHandler::copyAndAddObject
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
n
const unsigned n
Definition: CG3DPackingUnitTest.cpp:32
DPMBase::getGravity
Vec3D getGravity() const
Returns the gravitational acceleration.
Definition: DPMBase.cc:1382
BaseBoundary::getHandler
BoundaryHandler * getHandler() const
Returns the boundary's BoundaryHandler.
Definition: BaseBoundary.cc:143
ParticleHandler
Container to store all BaseParticle.
Definition: ParticleHandler.h:48
MercuryBase.h
DropletBoundary::read
void read(std::istream &is) override
Reads some boundary properties from an std::istream.
Definition: DropletBoundary.cc:61
DPMBase::particleHandler
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1395
Vec3D::Z
Mdouble Z
Definition: Vector.h:65
BaseBoundary.h
BaseWall::getDistanceNormalOverlap
virtual bool getDistanceNormalOverlap(const BaseParticle &P, Mdouble &distance, Vec3D &normal_return, Mdouble &overlap) const
Definition: BaseWall.cc:523
DropletBoundary::checkBoundaryAfterParticlesMove
void checkBoundaryAfterParticlesMove(ParticleHandler &pH) override
Runs at the end of each time step.
Definition: DropletBoundary.cc:7
ExtendedMath.h
DropletBoundary::write
void write(std::ostream &os) const override
Writes the boundary properties to an std::ostream.
Definition: DropletBoundary.cc:82
DropletBoundary.h
BaseParticle.h
DPMBase::getNumberOfTimeSteps
unsigned int getNumberOfTimeSteps() const
Returns the current counter of time-steps, i.e. the number of time-steps that the simulation has unde...
Definition: DPMBase.cc:821
mathsFunc::cos
Mdouble cos(Mdouble x)
Definition: ExtendedMath.cc:64
BaseInteractable::getPosition
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Definition: BaseInteractable.h:218
DPMBase
The DPMBase header includes quite a few header files, defining all the handlers, which are essential....
Definition: DPMBase.h:76