ChuteInsertionBoundary Class Reference

Used for modeling chute inflow. Inherits from InsertionBoundary. More...

#include <ChuteInsertionBoundary.h>

+ Inheritance diagram for ChuteInsertionBoundary:

Public Member Functions

 ChuteInsertionBoundary ()
 Default constructor. More...
 
 ChuteInsertionBoundary (const ChuteInsertionBoundary &other)
 Copy constructor. More...
 
ChuteInsertionBoundarycopy () const override
 Copy method; creates a copy on the heap. More...
 
void set (std::vector< BaseParticle * > particleToCopy, unsigned int maxFailed, Vec3D posMin, Vec3D posMax, double fixedParticleRadius, double inflowVelocity, double inflowVelocityVariance)
 Sets all boundary properties at once. More...
 
void set (BaseParticle *particleToCopy, unsigned int maxFailed, Vec3D posMin, Vec3D posMax, double fixedParticleRadius, double inflowVelocity, double inflowVelocityVariance)
 Sets all boundary properties at once. More...
 
void set (BaseParticle *particleToCopy, unsigned int maxFailed, Vec3D posMin, Vec3D posMax, Mdouble rMin, Mdouble rMax, double fixedParticleRadius, double inflowVelocity, double inflowVelocityVariance)
 old style set function which assumes a uniform psd. More...
 
void placeParticle (BaseParticle *p, RNG &random) override
 
void read (std::istream &is) override
 reads boundary properties from istream More...
 
void write (std::ostream &os) const override
 writes boundary properties to ostream More...
 
std::string getName () const override
 Returns the name of the object. More...
 
- Public Member Functions inherited from InsertionBoundary
 InsertionBoundary ()
 
 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...
 
virtual BaseParticlegenerateParticle (RNG &random)
 Sets the properties of the InsertionBoundary for a single particle type ‍/ virtual void set(BaseParticle* particleToCopy, unsigned int maxFailed, Vec3D velMin, Vec3D velMax, double radMin, double radMax)=0;. More...
 
virtual void shiftBoundary (Vec3D shift)
 virtual function that shifts the boundary. More...
 
virtual void rotateBoundary (Vec3D angle)
 virtual function that rotates the boundary. More...
 
void checkBoundaryBeforeTimeStep (DPMBase *md) override
 Fills the boundary with particles. More...
 
void insertParticles (DPMBase *md)
 Fill a certain domain with particles. More...
 
unsigned int getNumberOfParticlesInserted () const
 Gets the number of particles inserted by the boundary. More...
 
Mdouble getMassOfParticlesInserted () const
 Gets the mass of particles inserted by the boundary. More...
 
Mdouble getVolumeOfParticlesInserted () const
 Gets the volume of particles inserted by the boundary. More...
 
void reset ()
 resets particle property counter variables. More...
 
void activate ()
 Turns on the InsertionBoundary. More...
 
void deactivate ()
 Turns off the InsertionBoundary. More...
 
bool isActivated ()
 Returns whether the InsertionBoundary is activated. More...
 
unsigned int getMaxFailed () const
 Gets the number of times that the boundary may fail to insert a particle. More...
 
void setParticleToCopy (std::vector< BaseParticle * > particleToCopy)
 Sets multiple different particles that will be inserted through the insertion boundary. More...
 
void setParticleToCopy (BaseParticle *particleToCopy)
 Sets the particle that will be inserted through the insertion boundary. More...
 
std::vector< BaseParticle * > getParticleToCopy ()
 Gets the particles 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
 Gets the volume flow rate of the insertion routine. More...
 
void setVolumeFlowRate (Mdouble volumeFlowRate)
 Sets the volume flow rate of the insertion routine. More...
 
Mdouble getInitialVolume () const
 Gets the initialVolume() . More...
 
void setInitialVolume (Mdouble initialVolume)
 Gets the Volume which should be inserted by the insertion routine. More...
 
void setPSD (const PSD psd)
 Sets the range of particle radii that may be generated from a user defined PSD. More...
 
void setPSD (std::vector< PSD > psd, std::vector< Mdouble > probability)
 Sets the ranges of particle radii that may be generated from user defined PSDs. More...
 
std::vector< PSDgetPSD ()
 Gets the particle size distributions set by the user. More...
 
void setVariableVolumeFlowRate (const std::vector< Mdouble > &variableCumulativeVolumeFlowRate, Mdouble samplingInterval)
 Sets a variable volume flow rate. More...
 
bool insertParticle (Mdouble time)
 Checks the inserted total volume and returns if a particle is still allowed to be inserted. More...
 
bool getCheckParticleForInteraction () const
 Gets the variable that checks if a particle has an interaction. More...
 
void setCheckParticleForInteraction (bool checkParticleForInteraction)
 Sets the variable that checks if a particle has an interaction. More...
 
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 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 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
 

Private Attributes

Vec3D posMin_
 The two extremal corners of the cuboidal insertion boundary. More...
 
Vec3D posMax_
 
double fixedParticleRadius_
 radius of the fixed bottom particles, mean particle velocity in X-direction, and allowed maximum randomly added/subtracted velocities in all three directions while generating particles (expressed as % of inflowVelocity_). NB: see also documentation of ChuteInsertionBoundary::generateParticle(). More...
 
double inflowVelocity_
 
double inflowVelocityVariance_
 

Additional Inherited Members

- Public Attributes inherited from InsertionBoundary
std::vector< BaseParticle * > particleToCopy_
 read Distribution class from file. ‍/ friend std::istream& operator>>(std::istream& is, InsertionBoundary::Distribution& type); 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_
 Checks if a particle has an interaction with a wall or other particles. More...
 
std::vector< PSDparticleSizeDistributionVector_
 Defines a particle size distribution as an object of the PSD class; if particleSizeDistributionVector_ is empty, distribution_ is used instead. More...
 
Vec3D velMin_
 Minimum and maximum velocity of the particles to be inserted. More...
 
Vec3D velMax_
 
bool isManuallyInserting_
 A flag to enable a top-down class-by-class manual insertion of a PSD; default is FALSE. More...
 
std::vector< Mdoubleprobability_
 vector of probabilities in range [0,1] which determine the mixing ratio of partice size distributions. More...
 
int chosenSpecies_
 stores the chosen species for each timestep. More...
 
BaseParticlep0 = nullptr
 pointer to the next particle that should be inserted (needs to be stored across time steps). More...
 

Detailed Description

Used for modeling chute inflow. Inherits from InsertionBoundary.

Constructor & Destructor Documentation

◆ ChuteInsertionBoundary() [1/2]

ChuteInsertionBoundary::ChuteInsertionBoundary ( )

Default constructor.

Default constructor. Initiates all properties with 0 value.

15 {
16  posMax_ = Vec3D(0.0, 0.0, 0.0);
17  posMin_ = Vec3D(0.0, 0.0, 0.0);
19  inflowVelocity_ = 0.0;
21 }
double inflowVelocityVariance_
Definition: ChuteInsertionBoundary.h:84
double fixedParticleRadius_
radius of the fixed bottom particles, mean particle velocity in X-direction, and allowed maximum rand...
Definition: ChuteInsertionBoundary.h:84
Vec3D posMax_
Definition: ChuteInsertionBoundary.h:76
Vec3D posMin_
The two extremal corners of the cuboidal insertion boundary.
Definition: ChuteInsertionBoundary.h:76
double inflowVelocity_
Definition: ChuteInsertionBoundary.h:84
InsertionBoundary()
Definition: InsertionBoundary.cc:17
Definition: Kernel/Math/Vector.h:30

References fixedParticleRadius_, inflowVelocity_, inflowVelocityVariance_, posMax_, and posMin_.

Referenced by copy().

◆ ChuteInsertionBoundary() [2/2]

ChuteInsertionBoundary::ChuteInsertionBoundary ( const ChuteInsertionBoundary other)

Copy constructor.

Copy constructor. Calls InsertionBoundary parent copy constructor.

27  : InsertionBoundary(other)
28 {
29  posMax_ = other.posMax_;
30  posMin_ = other.posMin_;
34 }

References fixedParticleRadius_, inflowVelocity_, inflowVelocityVariance_, posMax_, and posMin_.

Member Function Documentation

◆ copy()

ChuteInsertionBoundary * ChuteInsertionBoundary::copy ( ) const
overridevirtual

Copy method; creates a copy on the heap.

Copy method. Creates a copy on the heap.

Returns
Pointer to the copy.

Implements BaseBoundary.

41 {
42 #ifdef DEBUG_CONSTRUCTOR
43  std::cout << "ChuteInsertionBoundary::copy() const finished" << std::endl;
44 #endif
45  return new ChuteInsertionBoundary(*this);
46 }
ChuteInsertionBoundary()
Default constructor.
Definition: ChuteInsertionBoundary.cc:14

References ChuteInsertionBoundary().

◆ getName()

std::string ChuteInsertionBoundary::getName ( ) const
overridevirtual

Returns the name of the object.

Returns the name of the object class

Returns
the object's class' name, i.e. 'ChuteInsertionBoundary'

Implements BaseObject.

205 {
206  return "ChuteInsertionBoundary";
207 }

◆ placeParticle()

void ChuteInsertionBoundary::placeParticle ( BaseParticle p,
RNG random 
)
overridevirtual

place a particle within the boundary with random radius, position and velocity (within the allowed intervals). Notable properties:

  • The minimal Z-position is fixedParticleRadius_ (the radius of the particles fixed at the bottom) above the minimal Z-value of the boundary
  • The particles have an mean velocity of inflowVelocity_ in the X-direction. Furthermore, each particle has a velocity added in all three directions, based on a given inflowVelocityVariance_, which is expressed as a percentage of the inflowVelocity_.
    Parameters
    [in]randoma random number generator
    Returns
    pointer to the generated particle
Todo:
change to driver level (ask Thomas)

Implements InsertionBoundary.

143 {
144  Vec3D position, velocity;
145 
146  position.X = posMin_.X + p->getRadius();
147 
149 // if (mathsFunc::isEqual(posMax_.Y - posMin_.Y, 2.0 * radMax_, 1e-10))
150 // {
151 // position.Y = posMin_.Y + p->getRadius();
152 // }
153 
154  position.Y = random.getRandomNumber(posMin_.Y - p->getRadius(), posMax_.Y + p->getRadius());
155  position.Z = random.getRandomNumber(posMin_.Z - p->getRadius(), posMax_.Z + p->getRadius() + fixedParticleRadius_);
156 
157  // The velocity components are first stored in a Vec3D, because if you pass them
158  // directly into setVelocity the compiler is allowed to change the order in
159  // which the numbers are generated
164 
165  p->setPosition(position);
166  p->setVelocity(velocity);
167 
168 
169 }
float * p
Definition: Tutorial_Map_using.cpp:9
Mdouble getRandomNumber()
This is a random generating routine can be used for initial positions.
Definition: RNG.cc:123
Mdouble Y
Definition: Kernel/Math/Vector.h:45
Mdouble Z
Definition: Kernel/Math/Vector.h:45
Mdouble X
the vector components
Definition: Kernel/Math/Vector.h:45
double velocity(const double &t)
Angular velocity as function of time t.
Definition: jeffery_orbit.cc:107

References fixedParticleRadius_, RNG::getRandomNumber(), inflowVelocity_, inflowVelocityVariance_, p, posMax_, posMin_, Jeffery_Solution::velocity(), Vec3D::X, Vec3D::Y, and Vec3D::Z.

◆ read()

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

reads boundary properties from istream

Reads the boundary properties from an istream

Parameters
[in,out]isthe istream

Implements BaseBoundary.

176 {
178  std::string dummy;
179  is >> dummy >> posMin_
180  >> dummy >> posMax_
181  >> dummy >> fixedParticleRadius_
182  >> dummy >> inflowVelocity_
183  >> dummy >> inflowVelocityVariance_;
184 }
void read(std::istream &is) override
Reads the boundary's id_ and maxFailed_.
Definition: InsertionBoundary.cc:448
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286

References fixedParticleRadius_, inflowVelocity_, inflowVelocityVariance_, posMax_, posMin_, InsertionBoundary::read(), and oomph::Global_string_for_annotation::string().

◆ set() [1/3]

void ChuteInsertionBoundary::set ( BaseParticle particleToCopy,
unsigned int  maxFailed,
Vec3D  posMin,
Vec3D  posMax,
double  fixedParticleRadius,
double  inflowVelocity,
double  inflowVelocityVariance 
)

Sets all boundary properties at once.

Sets all the properties of the chute insertion boundary.

Parameters
[in]particleToCopyPointer to the BaseParticle which is used as a basis for the particles to be inserted
[in]maxFailedThe maximum number of times the insertion of a particle may be tried and failed before the insertion of particles is considered done. NB: this property is used in the parent's InsertionBoundary::checkBoundaryBeforeTimeStep().
[in]posMinFirst defining corner of the chute insertion boundary
[in]posMaxSecond defining corner of the chute insertion boundary
[in]fixedParticleRadiusradius of the fixed bottom (i.e., positioned at the minimal Z-position) particles
[in]inflowVelocitythe mean particle velocity, which is in the X-direction
[in]inflowVelocityVariancevalue of minimum (minus ~) and maximum added velocities which are added to the given mean in each of the three dimensions. Expressed as a percentage of inflowVelocity_. See also the documentation of ChuteInsertionBoundary::generateParticle().
104 {
105  setParticleToCopy(particleToCopy);
106  posMin_ = posMin;
107  posMax_ = posMax;
108  maxFailed_ = maxFailed;
109  fixedParticleRadius_ = fixedParticleRadius;
110  inflowVelocity_ = inflowVelocity;
111  inflowVelocityVariance_ = inflowVelocityVariance;
112 }
void setParticleToCopy(std::vector< BaseParticle * > particleToCopy)
Sets multiple different particles that will be inserted through the insertion boundary.
Definition: InsertionBoundary.cc:378
unsigned int maxFailed_
Number of times that the wall may fail to insert a particle.
Definition: InsertionBoundary.h:265

References fixedParticleRadius_, inflowVelocity_, inflowVelocityVariance_, InsertionBoundary::maxFailed_, posMax_, posMin_, and InsertionBoundary::setParticleToCopy().

◆ set() [2/3]

void ChuteInsertionBoundary::set ( BaseParticle particleToCopy,
unsigned int  maxFailed,
Vec3D  posMin,
Vec3D  posMax,
Mdouble  rMin,
Mdouble  rMax,
double  fixedParticleRadius,
double  inflowVelocity,
double  inflowVelocityVariance 
)

old style set function which assumes a uniform psd.

old style set function which also assumes a uniform psd. Note if you want a specific PSD do not use but this is quicker for a uniform in size PSD

121 {
122  PSD uniformPSD;
123  uniformPSD.setDistributionUniform(rMin, rMax, 2);
124  setPSD(uniformPSD);
125  set(particleToCopy, maxFailed, posMin, posMax, fixedParticleRadius, inflowVelocity, inflowVelocityVariance);
126 }
void set(std::vector< BaseParticle * > particleToCopy, unsigned int maxFailed, Vec3D posMin, Vec3D posMax, double fixedParticleRadius, double inflowVelocity, double inflowVelocityVariance)
Sets all boundary properties at once.
Definition: ChuteInsertionBoundary.cc:68
void setPSD(const PSD psd)
Sets the range of particle radii that may be generated from a user defined PSD.
Definition: InsertionBoundary.cc:652
Contains a vector with radii and probabilities of a user defined particle size distribution (PSD)
Definition: PSD.h:47
void setDistributionUniform(Mdouble radMin, Mdouble radMax, int numberOfBins)
create a PSD vector for a uniform distribution.
Definition: PSD.cc:294

References set(), PSD::setDistributionUniform(), and InsertionBoundary::setPSD().

◆ set() [3/3]

void ChuteInsertionBoundary::set ( std::vector< BaseParticle * >  particleToCopy,
unsigned int  maxFailed,
Vec3D  posMin,
Vec3D  posMax,
double  fixedParticleRadius,
double  inflowVelocity,
double  inflowVelocityVariance 
)

Sets all boundary properties at once.

Sets all the properties of the chute insertion boundary.

Parameters
[in]particleToCopyvector of pointers to the BaseParticles which are used as a basis for the particles to be inserted
[in]maxFailedThe maximum number of times the insertion of a particle may be tried and failed before the insertion of particles is considered done. NB: this property is used in the parent's InsertionBoundary::checkBoundaryBeforeTimeStep().
[in]posMinFirst defining corner of the chute insertion boundary
[in]posMaxSecond defining corner of the chute insertion boundary
[in]fixedParticleRadiusradius of the fixed bottom (i.e., positioned at the minimal Z-position) particles
[in]inflowVelocitythe mean particle velocity, which is in the X-direction
[in]inflowVelocityVariancevalue of minimum (minus ~) and maximum added velocities which are added to the given mean in each of the three dimensions. Expressed as a percentage of inflowVelocity_. See also the documentation of ChuteInsertionBoundary::generateParticle().
71 {
72  setParticleToCopy(particleToCopy);
73  posMin_ = posMin;
74  posMax_ = posMax;
75  maxFailed_ = maxFailed;
76  fixedParticleRadius_ = fixedParticleRadius;
77  inflowVelocity_ = inflowVelocity;
78  inflowVelocityVariance_ = inflowVelocityVariance;
79 }

References fixedParticleRadius_, inflowVelocity_, inflowVelocityVariance_, InsertionBoundary::maxFailed_, posMax_, posMin_, and InsertionBoundary::setParticleToCopy().

Referenced by set(), FullRestartTest::setupInitialConditions(), and Chute::setupInitialConditions().

◆ write()

void ChuteInsertionBoundary::write ( std::ostream &  os) const
overridevirtual

writes boundary properties to ostream

Writes boundary's properties to an ostream

Parameters
[in]osthe ostream

Implements BaseBoundary.

191 {
193  os << " posMin " << posMin_
194  << " posMax " << posMax_
195  << " fixedParticleRadius " << fixedParticleRadius_
196  << " inflowVelocity " << inflowVelocity_
197  << " inflowVelocityVariance " << inflowVelocityVariance_;
198 }
void write(std::ostream &os) const override
Writes the boundary's id_ and maxFailed_.
Definition: InsertionBoundary.cc:536

References fixedParticleRadius_, inflowVelocity_, inflowVelocityVariance_, posMax_, posMin_, and InsertionBoundary::write().

Member Data Documentation

◆ fixedParticleRadius_

double ChuteInsertionBoundary::fixedParticleRadius_
private

radius of the fixed bottom particles, mean particle velocity in X-direction, and allowed maximum randomly added/subtracted velocities in all three directions while generating particles (expressed as % of inflowVelocity_). NB: see also documentation of ChuteInsertionBoundary::generateParticle().

Referenced by ChuteInsertionBoundary(), placeParticle(), read(), set(), and write().

◆ inflowVelocity_

double ChuteInsertionBoundary::inflowVelocity_
private

◆ inflowVelocityVariance_

double ChuteInsertionBoundary::inflowVelocityVariance_
private

◆ posMax_

Vec3D ChuteInsertionBoundary::posMax_
private

◆ posMin_

Vec3D ChuteInsertionBoundary::posMin_
private

The two extremal corners of the cuboidal insertion boundary.

Referenced by ChuteInsertionBoundary(), placeParticle(), read(), set(), and write().


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