MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
InsertionBoundary Class Referenceabstract

Boundary structure for boundaries used for insertion of particles. More...

#include <InsertionBoundary.h>

+ Inheritance diagram for InsertionBoundary:

Public Types

enum  Distribution { Distribution::Uniform, Distribution::Normal_1_5 }
 Defines a custom particle size distribution; distribution_ will always be used, unless particleSizeDistribution_ is non-empty. More...
 

Public Member Functions

 InsertionBoundary ()
 Default constructor: set everything to 0/nullptr. More...
 
 InsertionBoundary (const InsertionBoundary &other)
 Copy constructor (with deep copy) More...
 
 ~InsertionBoundary () override
 Destructor: delete the particle that has to be copied at every insertion. More...
 
void set (BaseParticle *particleToCopy, unsigned int maxFailed)
 Sets the particle that will be inserted and the maximum number of times for which insertion may fail. More...
 
virtual BaseParticlegenerateParticle (RNG &random)
 Virtual function that generates the intrinsic properties (species, radius) of one particle. More...
 
virtual void placeParticle (BaseParticle *p, RNG &random)=0
 Purely virtual function that generates the extrinsic properties (position, velocity) of a particle. More...
 
void checkBoundaryBeforeTimeStep (DPMBase *md) override
 Fills the boundary with particles. More...
 
void insertParticles (DPMBase *md)
 
unsigned int getNumberOfParticlesInserted () const
 Gets the number of particles inserted by the boundary. More...
 
double getMassOfParticlesInserted () const
 
double getVolumeOfParticlesInserted () const
 
void reset ()
 
void activate ()
 Turns on the InsertionBoundary. More...
 
void deactivate ()
 Turns off the InsertionBoundary. More...
 
bool isActivated ()
 Returns whether the InsertionBoundary is activated. More...
 
void setMaxFailed (unsigned int maxFailed)
 Sets the number of times that the wall may fail to insert a particle. More...
 
unsigned int getMaxFailed () const
 Gets the number of times that the boundary may fail to insert a particle. More...
 
void setParticleToCopy (BaseParticle *particleToCopy)
 Sets the particle that will be inserted through the insertion boundary. More...
 
BaseParticlegetParticleToCopy () const
 Gets the particle that will be inserted through the insertion boundary. More...
 
void read (std::istream &is) override
 Reads the boundary's id_ and maxFailed_. More...
 
void write (std::ostream &os) const override
 Writes the boundary's id_ and maxFailed_. More...
 
Mdouble getVolumeFlowRate () const
 
void setVolumeFlowRate (Mdouble volumeFlowRate_)
 
Mdouble getInitialVolume () const
 
void setInitialVolume (Mdouble initialVolume)
 
void setPSD (PSD psd)
 Sets the range of particle radii that may be generated from a user defined PSD. More...
 
PSD getPSD ()
 
void setDistribution (Distribution distribution)
 Sets the range of particle radii that may be generated to custom distributions. More...
 
Distribution getDistribution ()
 Gets the range of particle radii that may be generated. More...
 
void setVariableVolumeFlowRate (const std::vector< Mdouble > &variableCumulativeVolumeFlowRate, Mdouble samplingInterval)
 
bool insertParticle (Mdouble time)
 
bool getCheckParticleForInteraction () const
 
void setCheckParticleForInteraction (bool checkParticleForInteraction)
 
void setManualInsertion (bool manualInsertion)
 Set the flag for a manual PSD insertion routine. More...
 
- Public Member Functions inherited from BaseBoundary
 BaseBoundary ()
 default constructor. More...
 
 BaseBoundary (const BaseBoundary &b)
 copy constructor More...
 
 ~BaseBoundary () override
 destructor More...
 
virtual BaseBoundarycopy () const =0
 Used to create a copy of the object NB: purely virtual function. More...
 
virtual void createPeriodicParticle (BaseParticle *p UNUSED, ParticleHandler &pH UNUSED)
 Creates a periodic particle in case of periodic boundaries in serial build. More...
 
virtual void createPeriodicParticles (ParticleHandler &pH UNUSED)
 Creates periodic copies of given particle in case of periodic boundaries. More...
 
virtual void checkBoundaryAfterParticlesMove (ParticleHandler &pH)
 Virtual function that does things to particles, each time step after particles have moved. More...
 
virtual void actionsBeforeTimeLoop ()
 Virtual function that does something after DPMBase::setupInitialConditions but before the first time step. More...
 
virtual void modifyGhostAfterCreation (BaseParticle *particle, int i)
 
virtual void writeVTK (std::fstream &file)
 
void setHandler (BoundaryHandler *handler)
 Sets the boundary's BoundaryHandler. More...
 
BoundaryHandlergetHandler () const
 Returns the boundary's BoundaryHandler. More...
 
- Public Member Functions inherited from BaseObject
 BaseObject ()=default
 Default constructor. More...
 
 BaseObject (const BaseObject &p)=default
 Copy constructor, copies all the objects BaseObject contains. More...
 
virtual ~BaseObject ()=default
 virtual destructor More...
 
virtual std::string getName () const =0
 A purely virtual function. More...
 
virtual void moveInHandler (unsigned int index)
 Except that it is virtual, it does the same thing as setIndex() does. More...
 
void setIndex (unsigned int index)
 Allows one to assign an index to an object in the handler/container. More...
 
void setId (unsigned long id)
 Assigns a unique identifier to each object in the handler (container) which remains constant even after the object is deleted from the container/handler. More...
 
unsigned int getIndex () const
 Returns the index of the object in the handler. More...
 
unsigned int getId () const
 Returns the unique identifier of any particular object. More...
 
void setGroupId (unsigned groupId)
 
unsigned getGroupId () const
 

Protected Attributes

BaseParticleparticleToCopy_
 Particle that will be inserted through the insertion boundary. More...
 
unsigned int maxFailed_
 Number of times that the wall may fail to insert a particle. More...
 
unsigned int numberOfParticlesInserted_
 Number of particles that are already inserted. More...
 
Mdouble massInserted_
 Total mass of particles inserted. More...
 
Mdouble volumeInserted_
 Total volume of particles inserted. More...
 
bool isActivated_
 The InsertionBoundary is activated by default. If the InsertionBoundary is deactivated, then it introduces no particles (useful for trying to maintain a certain insertion rate). More...
 
Mdouble volumeFlowRate_
 
Mdouble initialVolume_
 
std::vector< MdoublevariableCumulativeVolumeFlowRate_
 
Mdouble samplingInterval_
 
bool checkParticleForInteraction_
 
PSD particleSizeDistribution_
 Defines a particle size distribution as an object of the PSD class; if particleSizeDistribution_ is empty, distribution_ is used instead. More...
 
Mdouble radMin_
 Minimum and maximum radii of the generated particles. More...
 
Mdouble radMax_
 
Distribution distribution_ = Distribution::Uniform
 defines a custom particle size distribution, which by default is uniform More...
 
bool isManuallyInserting_
 A flag to enable a top-down class-by-class manual insertion of a PSD; default is FALSE. More...
 

Friends

std::ostream & operator<< (std::ostream &os, InsertionBoundary::Distribution type)
 write Distribution class to file. More...
 
std::istream & operator>> (std::istream &is, InsertionBoundary::Distribution &type)
 read Distribution class from file. More...
 

Detailed Description

Boundary structure for boundaries used for insertion of particles.

To cite the InsertionBoundary algorithm: A. R. Thornton, D. Krijgsman, A. Te Voortwis, V. Ogarko, S. Luding, R. Fransen, S. Gonzalez, O. Bokhove, O. Imole, and T. Weinhart. A review of recent work on the discrete particle method at the University of Twente: An introduction to the open-source package MercuryDPM. DEM6 - International Conference on DEMs, 2013.

Definition at line 49 of file InsertionBoundary.h.

Member Enumeration Documentation

Defines a custom particle size distribution; distribution_ will always be used, unless particleSizeDistribution_ is non-empty.

Enumerator
Uniform 
Normal_1_5 

Definition at line 56 of file InsertionBoundary.h.

57  {
58  Uniform,
59  Normal_1_5
60  // TODO add LogNormal distribution to generateParticle()
61  // LogNormal
62  };

Constructor & Destructor Documentation

InsertionBoundary::InsertionBoundary ( )

Default constructor: set everything to 0/nullptr.

Default constructor, sets all data members to 0, nullptr or default.

Definition at line 38 of file InsertionBoundary.cc.

References checkParticleForInteraction_, constants::inf, initialVolume_, isActivated_, isManuallyInserting_, massInserted_, maxFailed_, numberOfParticlesInserted_, particleToCopy_, radMax_, radMin_, samplingInterval_, volumeFlowRate_, and volumeInserted_.

39 {
41  massInserted_ = 0;
42  volumeInserted_ = 0;
43  particleToCopy_ = nullptr;
44  maxFailed_ = 0;
45  isActivated_ = true;
47  initialVolume_ = 0;
50  radMin_ = 0;
51  radMax_ = 0;
52  isManuallyInserting_ = false;
53 }
bool isManuallyInserting_
A flag to enable a top-down class-by-class manual insertion of a PSD; default is FALSE.
Mdouble radMin_
Minimum and maximum radii of the generated particles.
BaseParticle * particleToCopy_
Particle that will be inserted through the insertion boundary.
unsigned int maxFailed_
Number of times that the wall may fail to insert a particle.
const Mdouble inf
Definition: GeneralDefine.h:44
Mdouble volumeInserted_
Total volume of particles inserted.
unsigned int numberOfParticlesInserted_
Number of particles that are already inserted.
Mdouble massInserted_
Total mass of particles inserted.
bool isActivated_
The InsertionBoundary is activated by default. If the InsertionBoundary is deactivated, then it introduces no particles (useful for trying to maintain a certain insertion rate).
InsertionBoundary::InsertionBoundary ( const InsertionBoundary other)

Copy constructor (with deep copy)

Copy constructor

Definition at line 58 of file InsertionBoundary.cc.

References checkParticleForInteraction_, BaseParticle::copy(), distribution_, initialVolume_, isActivated_, isManuallyInserting_, massInserted_, maxFailed_, numberOfParticlesInserted_, particleSizeDistribution_, particleToCopy_, radMax_, radMin_, samplingInterval_, variableCumulativeVolumeFlowRate_, volumeFlowRate_, and volumeInserted_.

59  : BaseBoundary(other)
60 {
64  maxFailed_ = other.maxFailed_;
65  isActivated_ = other.isActivated_;
73  radMin_ = other.radMin_;
74  radMax_ = other.radMax_;
76 
77  if (other.particleToCopy_ != nullptr)
78  {
80  }
81  else
82  {
83  particleToCopy_ = nullptr;
84  }
85 }
std::vector< Mdouble > variableCumulativeVolumeFlowRate_
bool isManuallyInserting_
A flag to enable a top-down class-by-class manual insertion of a PSD; default is FALSE.
Mdouble radMin_
Minimum and maximum radii of the generated particles.
BaseParticle * particleToCopy_
Particle that will be inserted through the insertion boundary.
virtual BaseParticle * copy() const =0
Particle copy method. It calls to copy constructor of this Particle, useful for polymorfism.
unsigned int maxFailed_
Number of times that the wall may fail to insert a particle.
Distribution distribution_
defines a custom particle size distribution, which by default is uniform
Mdouble volumeInserted_
Total volume of particles inserted.
unsigned int numberOfParticlesInserted_
Number of particles that are already inserted.
Mdouble massInserted_
Total mass of particles inserted.
BaseBoundary()
default constructor.
Definition: BaseBoundary.cc:32
PSD particleSizeDistribution_
Defines a particle size distribution as an object of the PSD class; if particleSizeDistribution_ is e...
bool isActivated_
The InsertionBoundary is activated by default. If the InsertionBoundary is deactivated, then it introduces no particles (useful for trying to maintain a certain insertion rate).
InsertionBoundary::~InsertionBoundary ( )
override

Destructor: delete the particle that has to be copied at every insertion.

Destructor that deletes the BaseParticle that is copied and inserted at every insertion.

Definition at line 91 of file InsertionBoundary.cc.

References particleToCopy_.

92 {
93  delete particleToCopy_;
94 }
BaseParticle * particleToCopy_
Particle that will be inserted through the insertion boundary.

Member Function Documentation

void InsertionBoundary::activate ( )

Turns on the InsertionBoundary.

Definition at line 358 of file InsertionBoundary.cc.

References isActivated_.

359 {
360  isActivated_ = true;
361 }
bool isActivated_
The InsertionBoundary is activated by default. If the InsertionBoundary is deactivated, then it introduces no particles (useful for trying to maintain a certain insertion rate).
void InsertionBoundary::checkBoundaryBeforeTimeStep ( DPMBase md)
overridevirtual

Fills the boundary with particles.

Is used to fill the insides of the boundary with particles until it is filled up.

Parameters
[in,out]mdthe problem's DPMBase object
Todo:
rename to something like "insertUntilMaxFailed"?

HERE

Todo:
create a definition for zero-size particles. Right now the zero-size particle is only used as a stop criterion for the manual PSD insertion

HERE

Reimplemented from BaseBoundary.

Reimplemented in RandomClusterInsertionBoundary.

Definition at line 192 of file InsertionBoundary.cc.

References MPIContainer::broadcast(), DPMBase::checkParticleForInteraction(), checkParticleForInteraction_, BaseHandler< T >::copyAndAddObject(), copyDataFromMPIParticleToParticle(), MPISphericalParticle::copyDataFromParticleToMPIParticle(), generateParticle(), DPMBase::getNextTime(), insertParticle(), MPIContainer::Instance(), isActivated_, logger, massInserted_, maxFailed_, NUMBER_OF_PROCESSORS, numberOfParticlesInserted_, PARTICLE, DPMBase::particleHandler, placeParticle(), PROCESSOR_ID, DPMBase::random, VERBOSE, and volumeInserted_.

Referenced by insertParticles().

193 {
194  logger(VERBOSE, "In InsertionBoundary::checkBoundaryBeforeTimeStep\n");
195 
196  if (!isActivated_)
197  return;
198 
199  /* Each timestep, the InsertionBoundary attempts to fill up a region with
200  * particles.
201  *
202  * It first calls generateParticle() to get a randomised particle, subject
203  * to a specified distribution over sizes and species. (The basic class
204  * supports size dispersity only but PolydisperseInsertionBoundary will
205  * support species dispersity.)
206  * Then it repeatedly calls placeParticle(), which gives the particle a
207  * random location (and possibly velocity) in a specified,
208  * geometry-dependent bound. Each time, it checks whether the new particle
209  * would have an interaction with another particle or a wall.
210  *
211  * If it manages to do that within maxFailed_ tries, then:
212  * * the new particle is inserted,
213  * * the failure counter is reset, and
214  * the processes is repeated with a new generateParticle().
215  *
216  * Otherwise, the processes terminates for this timestep.
217  * */
218 
219  // Keep count of how many successive times we have failed to place a new
220  // particle.
221  unsigned int failed = 0;
222  while (failed <= maxFailed_ && insertParticle(md->getNextTime())) // 'generating' loop
223  {
224  /* Generate random *intrinsic* properties for the new particle. */
225  logger(VERBOSE, "about to call generateParticle\n");
226 
227 
228 
229 
231 
232 
233 
234 
235  auto p0 = generateParticle(md->random);
236  // Important for particle generation with a particle size distribution as it generates a particle with zero
237  // radius. If a particle is not allowed to be inserted by the PSD criteria it will generate a particle with
238  // zero diameter. This if statement prevents inserting particles with zero radius, which would else be a problem.
240  if (p0->getRadius() == 0)
241  {
242  logger(VERBOSE, "The PSD for the specified volume is fully set");
243  // free up memory space
244  delete p0;
245  // out of the 'placing' loop
246  failed = maxFailed_ + 1;
247  continue;
248  }
249  logger(VERBOSE, "generated a particle with intrinsics %", p0);
250 
251  while (true) // 'placing' loop
252  {
253  /* Generate extrinsic properties (position and velocity) for this
254  * new particle. */
255 
256 
257 
259 
260 
261 
262 
263 
264  placeParticle(p0, md->random);
265  logger(VERBOSE, "attempting to place particle at %, vel %", p0->getPosition(), p0->getVelocity());
266 
267 #ifdef MERCURY_USE_MPI
268  /* Communicate the new particle's properties by setHandler (note
269  * that this doesn't actually add the particle to the handler). */
270  if (NUMBER_OF_PROCESSORS > 1)
271  {
272  MPIParticle particle;
273  // //Every domain generates a particle (to get the species right etc)
274 
275  //Send particle data from root to other processors to sync the particle properties
276  if (PROCESSOR_ID == 0)
277  {
279  }
280 
282 
283  //Process the received data
284  if (PROCESSOR_ID != 0)
285  {
286  copyDataFromMPIParticleToParticle(&particle, p0, &(md->particleHandler));
287  }
288  }
289 #endif
290  p0->setHandler(&md->particleHandler);
291  /* Check whether the particle has any interactions. */
293  {
294  //Note: in parallel only one of the domains will actually add the particle
295  auto p = md->particleHandler.copyAndAddObject(p0);
296  failed = 0;
297 
299  const double volume = p0->getVolume();
300  volumeInserted_ += volume;
301  massInserted_ += p0->getSpecies()->getDensity() * volume;
302  logger(VERBOSE, "successfully placed a particle %, with position: % after % fails.", p0,
303  p0->getPosition(), failed);
304 
305  /* JMFT: The generateParticle() routine allocates memory, so we should
306  * free it here. (Don't worry, the particle will have been copied to the
307  * particleHandler by this point iff we want it.) */
308  delete p0;
309 
310  break; // out of the 'placing' loop
311  }
312  else
313  {
314  failed++;
315  logger(VERBOSE, "failed to place a particle; have failed % times", failed);
316  }
317 
318  if (failed > maxFailed_)
319  {
320  logger(VERBOSE, "failed too many times; giving up");
321  break; // out of the 'placing' loop (and will leave the 'generating' loop too
322  }
323  }
324  logger(VERBOSE, "failed % times, so breaking out of InsertionBoundary loop for this timestep.", failed);
325  }
326  // logger(INFO, "volumeInserted_ = %", volumeInserted_);
327 }
void copyDataFromParticleToMPIParticle(BaseParticle *p)
static MPIContainer & Instance()
fetch the instance to be used for communication
Definition: MpiContainer.h:130
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
bool insertParticle(Mdouble time)
unsigned int maxFailed_
Number of times that the wall may fail to insert a particle.
void copyDataFromMPIParticleToParticle(MPIParticle *bP, BaseParticle *p, ParticleHandler *particleHandler)
Copies data from an MPIParticle class to a BaseParticle and sets the particleHandler and species...
virtual void placeParticle(BaseParticle *p, RNG &random)=0
Purely virtual function that generates the extrinsic properties (position, velocity) of a particle...
virtual bool checkParticleForInteraction(const BaseParticle &P)
Checks whether a particle P has any interaction with walls or other particles.
Definition: DPMBase.cc:4588
Mdouble volumeInserted_
Total volume of particles inserted.
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
Definition: DPMBase.h:1329
Data class to send a particle over MPI.
Definition: MpiDataClass.h:81
#define PROCESSOR_ID
Definition: GeneralDefine.h:63
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
#define NUMBER_OF_PROCESSORS
For the MPI communication routines this quantity is often required. defining this macro makes the cod...
Definition: GeneralDefine.h:62
RNG random
This is a random generator, often used for setting up the initial conditions etc...
Definition: DPMBase.h:1324
std::enable_if< std::is_scalar< T >::value, void >::type broadcast(T &t, int fromProcessor=0)
Broadcasts a scalar from the root to all other processors.
Definition: MpiContainer.h:429
virtual BaseParticle * generateParticle(RNG &random)
Virtual function that generates the intrinsic properties (species, radius) of one particle...
Mdouble getNextTime() const
Returns the current simulation time.
Definition: DPMBase.cc:805
unsigned int numberOfParticlesInserted_
Number of particles that are already inserted.
Mdouble massInserted_
Total mass of particles inserted.
bool isActivated_
The InsertionBoundary is activated by default. If the InsertionBoundary is deactivated, then it introduces no particles (useful for trying to maintain a certain insertion rate).
void InsertionBoundary::deactivate ( )

Turns off the InsertionBoundary.

Definition at line 363 of file InsertionBoundary.cc.

References isActivated_.

364 {
365  isActivated_ = false;
366 }
bool isActivated_
The InsertionBoundary is activated by default. If the InsertionBoundary is deactivated, then it introduces no particles (useful for trying to maintain a certain insertion rate).
BaseParticle * InsertionBoundary::generateParticle ( RNG random)
virtual

Virtual function that generates the intrinsic properties (species, radius) of one particle.

Parameters
[in]randomRandom number generator

The default behaviour will be to return particleToCopy_, but this can be overridden by the children (to get size or species dispersity).

Todo:
TP: can we add a variable seed here? Let the user choose a seed and for reproducible results you always take the same seed.

Reimplemented in PolydisperseInsertionBoundary, FixedClusterInsertionBoundary, and BidisperseCubeInsertionBoundary.

Definition at line 114 of file InsertionBoundary.cc.

References BaseParticle::copy(), distribution_, PSD::drawSample(), BaseBoundary::getHandler(), PSD::getParticleSizeDistribution(), getParticleToCopy(), RNG::getRandomNumber(), getVolumeFlowRate(), initialVolume_, PSD::insertManuallyByVolume(), isManuallyInserting_, logger, Normal_1_5, particleSizeDistribution_, radMax_, radMin_, and BaseParticle::setRadius().

Referenced by RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), and checkBoundaryBeforeTimeStep().

115 {
118  {
119  switch (distribution_)
120  {
121  default:
122  // default is a uniform distribution between radMin_ and radMax_
124  break;
126  // normal distribution
128  static std::mt19937 gen(0);
129  Mdouble particleRadius = 0.5 * (radMax_ + radMin_);
130  Mdouble polydispersity = 0.5 * (radMax_ - radMin_);
131  static std::normal_distribution<> d(particleRadius, polydispersity);
132  static const Mdouble radiusMin = particleRadius - 1.5 * polydispersity;
133  static const Mdouble radiusMax = particleRadius + 1.5 * polydispersity;
134  Mdouble radius = d(gen);
135  while (radius > radiusMax || radius < radiusMin) radius = d(gen);
136  P->setRadius(radius);
137  break;
138  }
139  }
140  // manual insertion routine to insert PSDs as accurate as possible into a given volume
141  else if (isManuallyInserting_)
142  {
143  logger.assert(initialVolume_ > 0.0, "Use setInitialVolume to define the particle insertion volume");
144  Mdouble radius;
145  // getVolumeFlowRate() * time + initialVolume_ - volumeInserted_ lead to more inaccurate results, therfore
146  // -volumeInserted was removed.
148  getHandler()->getDPMBase()->getTime() +
150  P->setRadius(radius);
151  }
152  else
153  {
154  Mdouble radius;
156  P->setRadius(radius);
157  }
158  return P;
159 }
bool isManuallyInserting_
A flag to enable a top-down class-by-class manual insertion of a PSD; default is FALSE.
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
double Mdouble
Definition: GeneralDefine.h:34
virtual void setRadius(Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
Mdouble getVolumeFlowRate() const
Mdouble insertManuallyByVolume(Mdouble volume)
Draw sample radius manually per size class and check the volumeAllowed of each size class to insert t...
Definition: PSD.cc:137
Mdouble radMin_
Minimum and maximum radii of the generated particles.
const std::vector< RadiusAndProbability > getParticleSizeDistribution() const
Get the PSD vector.
Definition: PSD.cc:718
Mdouble getRandomNumber()
This is a random generating routine can be used for initial positions.
Definition: RNG.cc:143
virtual BaseParticle * copy() const =0
Particle copy method. It calls to copy constructor of this Particle, useful for polymorfism.
Distribution distribution_
defines a custom particle size distribution, which by default is uniform
Mdouble drawSample()
Draw a sample radius from a CUMULATIVE_NUMBER_DISTRIBUTION.
Definition: PSD.cc:109
BaseParticle * getParticleToCopy() const
Gets the particle that will be inserted through the insertion boundary.
BoundaryHandler * getHandler() const
Returns the boundary's BoundaryHandler.
PSD particleSizeDistribution_
Defines a particle size distribution as an object of the PSD class; if particleSizeDistribution_ is e...
bool InsertionBoundary::getCheckParticleForInteraction ( ) const
inline

Definition at line 195 of file InsertionBoundary.h.

References checkParticleForInteraction_.

196  {
198  }
InsertionBoundary::Distribution InsertionBoundary::getDistribution ( )

Gets the range of particle radii that may be generated.

Definition at line 588 of file InsertionBoundary.cc.

References distribution_.

589 {
590  return distribution_;
591 }
Distribution distribution_
defines a custom particle size distribution, which by default is uniform
Mdouble InsertionBoundary::getInitialVolume ( ) const

Definition at line 529 of file InsertionBoundary.cc.

References initialVolume_.

530 {
531  return initialVolume_;
532 }
Mdouble InsertionBoundary::getMassOfParticlesInserted ( ) const

Definition at line 338 of file InsertionBoundary.cc.

References massInserted_.

339 {
340  return massInserted_;
341 }
Mdouble massInserted_
Total mass of particles inserted.
unsigned int InsertionBoundary::getMaxFailed ( ) const

Gets the number of times that the boundary may fail to insert a particle.

Return maxFailed_ (see InsertionBoundary::setMaxFailed).

Returns
the maximum number of particle insertion trials

Definition at line 387 of file InsertionBoundary.cc.

References maxFailed_.

388 {
389  return maxFailed_;
390 }
unsigned int maxFailed_
Number of times that the wall may fail to insert a particle.
unsigned int InsertionBoundary::getNumberOfParticlesInserted ( ) const

Gets the number of particles inserted by the boundary.

Returns the number of particles inserted in the boundary

Returns
the number of particles inserted

Definition at line 333 of file InsertionBoundary.cc.

References numberOfParticlesInserted_.

Referenced by insertParticles(), and Chute::write().

334 {
336 }
unsigned int numberOfParticlesInserted_
Number of particles that are already inserted.
BaseParticle * InsertionBoundary::getParticleToCopy ( ) const

Gets the particle that will be inserted through the insertion boundary.

returns pointer to the particle copies of which are to be inserted

Todo:
make this a debug check

Definition at line 407 of file InsertionBoundary.cc.

References particleToCopy_.

Referenced by FixedClusterInsertionBoundary::generateParticle(), and generateParticle().

408 {
410  //if (particleToCopy_==nullptr)
411  // std::cerr << "Error: particleToCopy not set" << std::endl;
412  return particleToCopy_;
413 }
BaseParticle * particleToCopy_
Particle that will be inserted through the insertion boundary.
PSD InsertionBoundary::getPSD ( )

gets the user defined particle size distribution

Returns
a vector of the PSD::RadiusAndProbability class containing the particle size distribution

Definition at line 566 of file InsertionBoundary.cc.

References particleSizeDistribution_.

567 {
569 }
PSD particleSizeDistribution_
Defines a particle size distribution as an object of the PSD class; if particleSizeDistribution_ is e...
Mdouble InsertionBoundary::getVolumeFlowRate ( ) const

Definition at line 519 of file InsertionBoundary.cc.

References volumeFlowRate_.

Referenced by generateParticle(), and insertParticle().

520 {
521  return volumeFlowRate_;
522 }
Mdouble InsertionBoundary::getVolumeOfParticlesInserted ( ) const

Definition at line 343 of file InsertionBoundary.cc.

References volumeInserted_.

344 {
345  return volumeInserted_;
346 }
Mdouble volumeInserted_
Total volume of particles inserted.
bool InsertionBoundary::insertParticle ( Mdouble  time)

Definition at line 161 of file InsertionBoundary.cc.

References getVolumeFlowRate(), constants::i, initialVolume_, logger, samplingInterval_, variableCumulativeVolumeFlowRate_, volumeInserted_, and WARN.

Referenced by RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), and checkBoundaryBeforeTimeStep().

162 {
163  // check if the flow rate limit has been reached
165  {
167  }
168  else
169  {
170  const Mdouble iMax = (Mdouble) variableCumulativeVolumeFlowRate_.size() - 2;
171  const Mdouble i = std::min(time / samplingInterval_, iMax);
172  if (i == iMax)
173  {
174  static unsigned count = 0;
175  if (count == 0) logger(WARN, "Reached end of volume flowrate function");
176  ++count;
177  }
178  const size_t id = i;
179  const Mdouble allowedVolume = variableCumulativeVolumeFlowRate_[id] +
181  variableCumulativeVolumeFlowRate_[id]) * (i - id);
182  return volumeInserted_ < allowedVolume;
183  }
184 }
std::vector< Mdouble > variableCumulativeVolumeFlowRate_
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
double Mdouble
Definition: GeneralDefine.h:34
Mdouble getVolumeFlowRate() const
const std::complex< Mdouble > i
Definition: ExtendedMath.h:50
Mdouble volumeInserted_
Total volume of particles inserted.
void InsertionBoundary::insertParticles ( DPMBase md)
inline

Definition at line 106 of file InsertionBoundary.h.

References checkBoundaryBeforeTimeStep(), getNumberOfParticlesInserted(), INFO, and logger.

Referenced by DPMBase::fillDomainWithParticles().

106  {
108  logger(INFO,"Inserted % particles",getNumberOfParticlesInserted());
109  }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
void checkBoundaryBeforeTimeStep(DPMBase *md) override
Fills the boundary with particles.
unsigned int getNumberOfParticlesInserted() const
Gets the number of particles inserted by the boundary.
bool InsertionBoundary::isActivated ( )

Returns whether the InsertionBoundary is activated.

Definition at line 368 of file InsertionBoundary.cc.

References isActivated_.

369 {
370  return isActivated_;
371 }
bool isActivated_
The InsertionBoundary is activated by default. If the InsertionBoundary is deactivated, then it introduces no particles (useful for trying to maintain a certain insertion rate).
virtual void InsertionBoundary::placeParticle ( BaseParticle p,
RNG random 
)
pure virtual

Purely virtual function that generates the extrinsic properties (position, velocity) of a particle.

Parameters
[in]pThe particle to be placed
[in]randomRandom number generator

This should be implemented by the children such as CubeInsertionBoundary, as the implementation will be geometry-dependent.

Implemented in BaseClusterInsertionBoundary, PolydisperseInsertionBoundary, CubeInsertionBoundary, RandomClusterInsertionBoundary, HopperInsertionBoundary, FixedClusterInsertionBoundary, and ChuteInsertionBoundary.

Referenced by checkBoundaryBeforeTimeStep().

void InsertionBoundary::read ( std::istream &  is)
overridevirtual

Reads the boundary's id_ and maxFailed_.

reads the boundary's id_ and maxFailed_ from the given istream

Parameters
[in,out]isstream the data members are read from
Todo:
make theses reads non-optional

Implements BaseBoundary.

Reimplemented in PolydisperseInsertionBoundary.

Definition at line 419 of file InsertionBoundary.cc.

References checkParticleForInteraction_, distribution_, BaseHandler< T >::getDPMBase(), BaseBoundary::getHandler(), BaseInteractable::getIndSpecies(), BaseHandler< T >::getObject(), PSD::getParticleSizeDistribution(), constants::i, initialVolume_, isActivated_, massInserted_, maxFailed_, numberOfParticlesInserted_, DPMBase::particleHandler, particleSizeDistribution_, particleToCopy_, BaseBoundary::read(), ParticleHandler::readAndCreateObject(), helpers::readOptionalVariable(), samplingInterval_, BaseParticle::setSpecies(), variableCumulativeVolumeFlowRate_, volumeFlowRate_, and volumeInserted_.

Referenced by ChuteInsertionBoundary::read(), HopperInsertionBoundary::read(), CubeInsertionBoundary::read(), PolydisperseInsertionBoundary::read(), and BaseClusterInsertionBoundary::read().

420 {
421  BaseBoundary::read(is);
422  std::string dummy, type;
423  is >> dummy >> maxFailed_ >> dummy;
424  if (dummy == "volumeFlowRate")
425  is >> volumeFlowRate_ >> dummy;
426  is >> massInserted_;
427  is >> dummy >> volumeInserted_;
428  is >> dummy >> numberOfParticlesInserted_;
429  is >> dummy >> isActivated_;
431  {
433  {
434  is >> dummy >> p.radius;
435  is >> dummy >> p.probability;
436  }
437  }
438  else
439  {
440  is >> dummy >> distribution_;
441  }
443  helpers::readOptionalVariable(is, "checkParticleForInteraction", checkParticleForInteraction_);
444  helpers::readOptionalVariable(is, "initialVolume", initialVolume_);
445  if (helpers::readOptionalVariable(is, "samplingInterval", samplingInterval_))
446  {
447  size_t n;
448  Mdouble flowRate;
449  is >> dummy >> n;
450  //variableCumulativeVolumeFlowRate_.clear();
452  for (size_t i = 0; i < n; ++i)
453  {
454  is >> flowRate;
455  variableCumulativeVolumeFlowRate_.push_back(flowRate);
456  }
457  }
458  is >> dummy;
459  if (dummy != "noParticleToCopy")
460  {
461  delete particleToCopy_;
463  // The .restart file records the index of the particle's species, but
464  // doesn't record the pointer, i.e. the memory address of the species within
465  // the speciesHandler. The latter needs to be reset now.
466  particleToCopy_->setSpecies(getHandler()->getDPMBase()->speciesHandler.getObject(
468  ));
469  }
470 }
std::vector< Mdouble > variableCumulativeVolumeFlowRate_
double Mdouble
Definition: GeneralDefine.h:34
const std::complex< Mdouble > i
Definition: ExtendedMath.h:50
BaseParticle * particleToCopy_
Particle that will be inserted through the insertion boundary.
const std::vector< RadiusAndProbability > getParticleSizeDistribution() const
Get the PSD vector.
Definition: PSD.cc:718
void setSpecies(const ParticleSpecies *species)
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
unsigned int maxFailed_
Number of times that the wall may fail to insert a particle.
Distribution distribution_
defines a custom particle size distribution, which by default is uniform
Mdouble volumeInserted_
Total volume of particles inserted.
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
Definition: DPMBase.h:1329
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
BoundaryHandler * getHandler() const
Returns the boundary's BoundaryHandler.
bool readOptionalVariable(std::istream &is, const std::string &name, T &variable)
Reads optional variables in the restart file.
Definition: Helpers.h:247
unsigned int getIndSpecies() const
Returns the index of the species associated with the interactable object.
unsigned int numberOfParticlesInserted_
Number of particles that are already inserted.
DPMBase * getDPMBase()
Gets the problem that is solved using this handler.
Definition: BaseHandler.h:725
Mdouble massInserted_
Total mass of particles inserted.
BaseParticle * readAndCreateObject(std::istream &is)
Create a new particle, based on the information provided in a restart file.
PSD particleSizeDistribution_
Defines a particle size distribution as an object of the PSD class; if particleSizeDistribution_ is e...
bool isActivated_
The InsertionBoundary is activated by default. If the InsertionBoundary is deactivated, then it introduces no particles (useful for trying to maintain a certain insertion rate).
void InsertionBoundary::reset ( )

reset() does not activate or deactivate the InsertionBoundary.

Definition at line 351 of file InsertionBoundary.cc.

References massInserted_, numberOfParticlesInserted_, and volumeInserted_.

352 {
354  massInserted_ = 0;
355  volumeInserted_ = 0;
356 }
Mdouble volumeInserted_
Total volume of particles inserted.
unsigned int numberOfParticlesInserted_
Number of particles that are already inserted.
Mdouble massInserted_
Total mass of particles inserted.
void InsertionBoundary::set ( BaseParticle particleToCopy,
unsigned int  maxFailed 
)

Sets the particle that will be inserted and the maximum number of times for which insertion may fail.

Sets the particle that will be inserted and the maximum number of times for which insertion may fail.

Parameters
[in]particleToCopyParticle that will be copied and inserted in the domain
[in]maxFailedNumber of times that the wall may fail to insert a particle

Definition at line 102 of file InsertionBoundary.cc.

References BaseParticle::copy(), maxFailed_, and particleToCopy_.

103 {
104  if (particleToCopy != nullptr)
105  particleToCopy_ = particleToCopy->copy();
106  maxFailed_ = maxFailed;
107 }
BaseParticle * particleToCopy_
Particle that will be inserted through the insertion boundary.
virtual BaseParticle * copy() const =0
Particle copy method. It calls to copy constructor of this Particle, useful for polymorfism.
unsigned int maxFailed_
Number of times that the wall may fail to insert a particle.
void InsertionBoundary::setCheckParticleForInteraction ( bool  checkParticleForInteraction)
inline

Definition at line 200 of file InsertionBoundary.h.

References checkParticleForInteraction_.

201  {
202  checkParticleForInteraction_ = checkParticleForInteraction;
203  }
void InsertionBoundary::setDistribution ( InsertionBoundary::Distribution  distribution)

Sets the range of particle radii that may be generated to custom distributions.

Definition at line 580 of file InsertionBoundary.cc.

References distribution_.

581 {
582  distribution_ = distribution;
583 }
Distribution distribution_
defines a custom particle size distribution, which by default is uniform
void InsertionBoundary::setInitialVolume ( Mdouble  initialVolume)

Definition at line 534 of file InsertionBoundary.cc.

References initialVolume_, and volumeFlowRate_.

535 {
536  initialVolume_ = initialVolume;
537  if (!std::isfinite(volumeFlowRate_)) volumeFlowRate_ = 0;
538 }
void InsertionBoundary::setManualInsertion ( bool  isManuallyInserting)

Set the flag for a manual PSD insertion routine.

sets the isManuallyInserting_ to TRUE, resulting in a top-down class-by-class insertion routine to insert PSDs as accurate as possible.

Definition at line 575 of file InsertionBoundary.cc.

References isManuallyInserting_.

576 {
577  isManuallyInserting_ = isManuallyInserting;
578 }
bool isManuallyInserting_
A flag to enable a top-down class-by-class manual insertion of a PSD; default is FALSE.
void InsertionBoundary::setMaxFailed ( unsigned int  maxFailed)

Sets the number of times that the wall may fail to insert a particle.

Sets the maximum number of times InsertionBoundary::checkBoundaryBeforeTimeStep() may try to insert a particle and fail, before the insertion of particles stops.

Parameters
[in]maxFailedthe maximum number of particle insertion trials

Definition at line 378 of file InsertionBoundary.cc.

References maxFailed_.

Referenced by ChuteInsertionBoundary::oldRead(), HopperInsertionBoundary::oldRead(), CubeInsertionBoundary::oldRead(), ChuteInsertionBoundary::set(), RandomClusterInsertionBoundary::set(), CubeInsertionBoundary::set(), HopperInsertionBoundary::set(), and PolydisperseInsertionBoundary::setGeometry().

379 {
380  maxFailed_ = maxFailed;
381 }
unsigned int maxFailed_
Number of times that the wall may fail to insert a particle.
void InsertionBoundary::setParticleToCopy ( BaseParticle particleToCopy)

Sets the particle that will be inserted through the insertion boundary.

Sets the pointer to the particle, copies of which are inserted

Parameters
[in]particleToCopypointer to the particle to be inserted

Definition at line 396 of file InsertionBoundary.cc.

References BaseParticle::copy(), ERROR, logger, and particleToCopy_.

Referenced by ChuteInsertionBoundary::set(), RandomClusterInsertionBoundary::set(), FixedClusterInsertionBoundary::set(), CubeInsertionBoundary::set(), and HopperInsertionBoundary::set().

397 {
398  if (particleToCopy != nullptr)
399  particleToCopy_ = particleToCopy->copy();
400  else
401  logger(ERROR, "Setting particleToCopy to be a null pointer?");
402 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
BaseParticle * particleToCopy_
Particle that will be inserted through the insertion boundary.
virtual BaseParticle * copy() const =0
Particle copy method. It calls to copy constructor of this Particle, useful for polymorfism.
void InsertionBoundary::setPSD ( PSD  psd)

Sets the range of particle radii that may be generated from a user defined PSD.

Sets the range of particle radii that may be generated to a PSD defined by the user.

Todo:
TP: Consider std::move instead of a set function. This would result in a speedup + no one has to set the PSD for insertionBoundaries again as it is set when a PSD is inserted.

Definition at line 557 of file InsertionBoundary.cc.

558 {
560 }
PSD particleSizeDistribution_
Defines a particle size distribution as an object of the PSD class; if particleSizeDistribution_ is e...
void InsertionBoundary::setVariableVolumeFlowRate ( const std::vector< Mdouble > &  variableCumulativeVolumeFlowRate,
Mdouble  samplingInterval 
)
See also
variableCumulativeVolumeFlowRate_

Definition at line 540 of file InsertionBoundary.cc.

References BaseBoundary::getHandler(), INFO, logger, samplingInterval_, and variableCumulativeVolumeFlowRate_.

542 {
543  logger.assert(samplingInterval > 0, "sampling interval needs to be positive");
544  const Mdouble endTime = variableCumulativeVolumeFlowRate.size() * samplingInterval;
545  logger(INFO, "variable flowrate is defined up to %", endTime);
546  logger.assert_always(getHandler()->getDPMBase()->getTimeMax() < endTime,
547  "variable flowrate is defined up to %, but tMax is set to %", endTime,
548  getHandler()->getDPMBase()->getTimeMax());
549  variableCumulativeVolumeFlowRate_ = variableCumulativeVolumeFlowRate;
550  samplingInterval_ = samplingInterval;
551 }
std::vector< Mdouble > variableCumulativeVolumeFlowRate_
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
double Mdouble
Definition: GeneralDefine.h:34
BoundaryHandler * getHandler() const
Returns the boundary's BoundaryHandler.
void InsertionBoundary::setVolumeFlowRate ( Mdouble  volumeFlowRate_)

Definition at line 524 of file InsertionBoundary.cc.

References volumeFlowRate_.

525 {
526  volumeFlowRate_ = volumeFlowRate;
527 }
void InsertionBoundary::write ( std::ostream &  os) const
overridevirtual

Writes the boundary's id_ and maxFailed_.

adds the boundary's id_ and maxFailed_ to the given ostream

Parameters
[in,out]isstream the data members are to be added to

Implements BaseBoundary.

Reimplemented in PolydisperseInsertionBoundary.

Definition at line 476 of file InsertionBoundary.cc.

References checkParticleForInteraction_, distribution_, PSD::getParticleSizeDistribution(), initialVolume_, isActivated_, logger, massInserted_, maxFailed_, numberOfParticlesInserted_, particleSizeDistribution_, particleToCopy_, samplingInterval_, variableCumulativeVolumeFlowRate_, VERBOSE, volumeFlowRate_, volumeInserted_, and BaseBoundary::write().

Referenced by ChuteInsertionBoundary::write(), HopperInsertionBoundary::write(), CubeInsertionBoundary::write(), PolydisperseInsertionBoundary::write(), and BaseClusterInsertionBoundary::write().

477 {
478  logger(VERBOSE, "In InsertionBoundary::write\n");
480  os << " maxFailed " << maxFailed_;
481  if (std::isfinite(volumeFlowRate_))
482  os << " volumeFlowRate " << volumeFlowRate_;
483  os << " massInserted " << massInserted_;
484  os << " volumeInserted " << volumeInserted_;
485  os << " numberOfParticlesInserted " << numberOfParticlesInserted_;
486  os << " isActivated " << isActivated_;
488  {
489  os << " psd " << particleSizeDistribution_.getParticleSizeDistribution().size();
491  {
492  os << " " << p.radius
493  << " " << p.probability;
494  }
495  }
496  else
497  {
498  os << " distribution " << distribution_;
499  }
500  if (checkParticleForInteraction_ == false)
501  {
502  os << " checkParticleForInteraction " << checkParticleForInteraction_;
503  }
504  os << " initialVolume " << initialVolume_;
505  os << " samplingInterval " << samplingInterval_;
506  os << " variableCumulativeVolumeFlowRate " << variableCumulativeVolumeFlowRate_.size();
507  for (const auto flowRate : variableCumulativeVolumeFlowRate_)
508  {
509  os << ' ' << flowRate;
510  }
511  if (particleToCopy_ == nullptr)
512  os << " noParticleToCopy";
513  else
514  {
515  os << " particleToCopy " << *particleToCopy_;
516  }
517 }
std::vector< Mdouble > variableCumulativeVolumeFlowRate_
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
BaseParticle * particleToCopy_
Particle that will be inserted through the insertion boundary.
const std::vector< RadiusAndProbability > getParticleSizeDistribution() const
Get the PSD vector.
Definition: PSD.cc:718
unsigned int maxFailed_
Number of times that the wall may fail to insert a particle.
Distribution distribution_
defines a custom particle size distribution, which by default is uniform
Mdouble volumeInserted_
Total volume of particles inserted.
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
unsigned int numberOfParticlesInserted_
Number of particles that are already inserted.
Mdouble massInserted_
Total mass of particles inserted.
PSD particleSizeDistribution_
Defines a particle size distribution as an object of the PSD class; if particleSizeDistribution_ is e...
bool isActivated_
The InsertionBoundary is activated by default. If the InsertionBoundary is deactivated, then it introduces no particles (useful for trying to maintain a certain insertion rate).

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
InsertionBoundary::Distribution  type 
)
friend

write Distribution class to file.

write distribution type variables to file.

Definition at line 596 of file InsertionBoundary.cc.

597 {
598  os << static_cast<unsigned>(type);
599  return os;
600 }
std::istream& operator>> ( std::istream &  is,
InsertionBoundary::Distribution type 
)
friend

read Distribution class from file.

write Distribution type variables from file.

Definition at line 605 of file InsertionBoundary.cc.

606 {
607  unsigned uType;
608  is >> uType;
609  type = static_cast<InsertionBoundary::Distribution>(uType);
610  return is;
611 }
Distribution
Defines a custom particle size distribution; distribution_ will always be used, unless particleSizeDi...

Member Data Documentation

bool InsertionBoundary::checkParticleForInteraction_
protected
Distribution InsertionBoundary::distribution_ = Distribution::Uniform
protected

defines a custom particle size distribution, which by default is uniform

Definition at line 295 of file InsertionBoundary.h.

Referenced by generateParticle(), getDistribution(), InsertionBoundary(), read(), setDistribution(), and write().

Mdouble InsertionBoundary::initialVolume_
protected
bool InsertionBoundary::isActivated_
protected

The InsertionBoundary is activated by default. If the InsertionBoundary is deactivated, then it introduces no particles (useful for trying to maintain a certain insertion rate).

Definition at line 252 of file InsertionBoundary.h.

Referenced by activate(), FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), checkBoundaryBeforeTimeStep(), deactivate(), InsertionBoundary(), isActivated(), read(), and write().

bool InsertionBoundary::isManuallyInserting_
protected

A flag to enable a top-down class-by-class manual insertion of a PSD; default is FALSE.

Definition at line 300 of file InsertionBoundary.h.

Referenced by generateParticle(), InsertionBoundary(), and setManualInsertion().

unsigned int InsertionBoundary::maxFailed_
protected

Number of times that the wall may fail to insert a particle.

Definition at line 230 of file InsertionBoundary.h.

Referenced by RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), checkBoundaryBeforeTimeStep(), getMaxFailed(), InsertionBoundary(), read(), set(), setMaxFailed(), and write().

unsigned int InsertionBoundary::numberOfParticlesInserted_
protected
PSD InsertionBoundary::particleSizeDistribution_
protected

Defines a particle size distribution as an object of the PSD class; if particleSizeDistribution_ is empty, distribution_ is used instead.

Definition at line 285 of file InsertionBoundary.h.

Referenced by generateParticle(), getPSD(), InsertionBoundary(), read(), and write().

BaseParticle* InsertionBoundary::particleToCopy_
protected

Particle that will be inserted through the insertion boundary.

Definition at line 225 of file InsertionBoundary.h.

Referenced by getParticleToCopy(), InsertionBoundary(), read(), set(), setParticleToCopy(), write(), and ~InsertionBoundary().

Mdouble InsertionBoundary::samplingInterval_
protected
std::vector<Mdouble> InsertionBoundary::variableCumulativeVolumeFlowRate_
protected

Defines a variable volume flow rate, taken at fixed sampling intervals; the values are cumulative; thus, we need to ensure the volume inserted before time t=n*samplingInterval is less than variableCumulativeVolumeFlowRate[n].

By default, this vector is empty; in that case, a constant volume flow rate will be used.

See also
volumeFlowRate_.

Definition at line 274 of file InsertionBoundary.h.

Referenced by InsertionBoundary(), insertParticle(), read(), setVariableVolumeFlowRate(), and write().

Mdouble InsertionBoundary::volumeFlowRate_
protected

The inflow can be controlled by setting a volume flow rate and an initial volume thus, this ensures the volume V inserted before time t is less than V = initialVolume_+volumeFlowRate_*t

The default value is volumeFlowRate_=inf, i.e. the volume is not controlled.

See also
To set a variable flow rate instead, see variableCumulativeVolumeFlowRate_.

Definition at line 263 of file InsertionBoundary.h.

Referenced by getVolumeFlowRate(), InsertionBoundary(), read(), setInitialVolume(), setVolumeFlowRate(), and write().


The documentation for this class was generated from the following files: