chrono::particlefactory::ChParticleEmitter Class Reference

Description

Class for emitters of particles, with random positions, rotations, and random shapes.

You can setup a variety of different emitters by assembling different types of items inherited by classes like ChRandomShapeCreator, ChRandomParticlePosition, etc.

#include <ChParticleEmitter.h>

Public Types

enum  eChFlowMode { FLOW_PARTICLESPERSECOND, FLOW_MASSPERSECOND }
 

Public Member Functions

void EmitParticles (ChSystem &msystem, double mdt, ChFrameMoving<> pre_transform=ChFrameMoving<>())
 Function that creates random particles with random shape, position and alignment each time it is called. More...
 
void RegisterAddBodyCallback (ChRandomShapeCreator::AddBodyCallback *callback)
 Pass an object from a ChPostCreationCallback-inherited class if you want to set additional stuff on each created particle (ex.set some random asset, set some random material, or such)
 
void SetParticleCreator (std::shared_ptr< ChRandomShapeCreator > mc)
 Set the particle creator, that is an object whose class is inherited from ChRandomShapeCreator.
 
void SetParticlePositioner (std::shared_ptr< ChRandomParticlePosition > mc)
 Set the particle positioner, that generates different positions for each particle.
 
void SetParticleAligner (std::shared_ptr< ChRandomParticleAlignment > mc)
 Set the particle aligner, that generates different rotations for each particle.
 
void SetParticleVelocity (std::shared_ptr< ChRandomParticleVelocity > mc)
 Set the generator of particle velocities, that generates different initial speed for each particle.
 
void SetParticleAngularVelocity (std::shared_ptr< ChRandomParticleVelocity > mc)
 Set the generator of angular velocities, for different initial angular velocity for each particle.
 
void SetFlowControlMode (eChFlowMode mymode)
 define a flow rate measured as n.of particles per second [part/s], as by default or a flow rate measured as kg per second [kg/s]. More...
 
eChFlowMode GetFlowControlMode ()
 Report if flow rate is measured as [part/s] or [kg/s].
 
double & ParticlesPerSecond ()
 Access the flow rate, measured as n.of particles per second [part/s]. More...
 
double & MassPerSecond ()
 Access the flow rate, measured as kg per second [kg/s].
 
void SetUseParticleReservoir (bool ml)
 Turn on this to limit on max amount of particles.
 
void SetUseMassReservoir (bool ml)
 Turn on this to limit on max mass of particles.
 
int & ParticleReservoirAmount ()
 Access the max number of particles to create - after this goes to 0, the creation stops. More...
 
double & MassReservoirAmount ()
 Access the max mass of particles to create - after this goes to 0, the creation stops. More...
 
int GetTotCreatedParticles ()
 Get the total amount of created particles.
 
double GetTotCreatedMass ()
 Get the total mass of created particles.
 
void SetInheritSpeed (bool mi)
 Turn on this to have the particles 'inherit' the speed of the owner body in pre_transform.
 
void SetJitterDeclustering (bool mj)
 Turn on this to avoid quantization if generating from an object that has high speed in pre_transform (so avoids clusters in jets of particles). More...
 

Member Function Documentation

void chrono::particlefactory::ChParticleEmitter::EmitParticles ( ChSystem msystem,
double  mdt,
ChFrameMoving<>  pre_transform = ChFrameMoving<>() 
)

Function that creates random particles with random shape, position and alignment each time it is called.

Typically, one calls this function once per timestep.

double& chrono::particlefactory::ChParticleEmitter::MassReservoirAmount ( )

Access the max mass of particles to create - after this goes to 0, the creation stops.

Remember to turn on this limit with SetLimitMassAmount()

int& chrono::particlefactory::ChParticleEmitter::ParticleReservoirAmount ( )

Access the max number of particles to create - after this goes to 0, the creation stops.

Remember to turn on this limit with SetLimitParticleAmount()

double& chrono::particlefactory::ChParticleEmitter::ParticlesPerSecond ( )

Access the flow rate, measured as n.of particles per second [part/s].

This is meaningful only if in

void chrono::particlefactory::ChParticleEmitter::SetFlowControlMode ( eChFlowMode  mymode)

define a flow rate measured as n.of particles per second [part/s], as by default or a flow rate measured as kg per second [kg/s].

Then, use ParticlesPerSecond() or MassPerSecond() to tune the flow.

void chrono::particlefactory::ChParticleEmitter::SetJitterDeclustering ( bool  mj)

Turn on this to avoid quantization if generating from an object that has high speed in pre_transform (so avoids clusters in jets of particles).