OpenLB 1.7
|
Particle distribution for time and size discretization. More...
#include <ParticleDistribution.h>
Public Member Functions | |
template<typename C > | |
ParticleDistribution (FunctorPtr< AnalyticalF1D< T, S > > &&distribution, C numberOfParticles, C numberOfParticleSizeGroups, T minRadius, T maxRadius, T lengthConversion=1) | |
bool | calculateParticleArray (bool getExactParticleNumber=false) |
template<typename DESCRIPTOR > | |
bool | calculateTimeArray (AnalyticalF1D< T, S > &timeDistribution, UnitConverter< T, DESCRIPTOR > &converter, T begin, T end) |
void | printTimeArray () |
prints out all time-steps a new particle should appear | |
template<typename C > | |
void | spawnSphericalParticles (SuperParticleSystem3D< T, Particle3D > &supParticleSystem, IndicatorF3D< S > &indicator, T density, C iT, bool loopAround=false, bool reshuffleAfterLoop=false) |
template<typename C > | |
void | timeActivateParticles (SuperParticleSystem3D< T, Particle3D > &supParticleSystem, C iT, C idOfset=0) |
void | deactivateParticles (SuperParticleSystem3D< T, Particle3D > &supParticleSystem, int beginID, int endID) |
Sets the particle state 'active' to 'false' for particles with ids from 'beginID' to 'endID'. | |
void | preSpawnSphericalParticles (SuperParticleSystem3D< T, Particle3D > &supParticleSystem, IndicatorF3D< S > &indicator, T density, int beginID=1, bool shuffle=false) |
void | getParticleArray (std::vector< T > &particleArray) |
T | nextParticleRadius (bool loopAround=false, bool reshuffleAfterLoop=false) |
void | shuffleParticleArray () |
shuffles particle array using random_shuffle | |
void | printSizeMatrix () |
prints the calculation matrix to the console | |
void | printParticleArray () |
prints the particle Radii to the console | |
~ParticleDistribution () | |
destructor | |
Particle distribution for time and size discretization.
size discretization This class uses a given particle distribution ('distribution') and discretizes it in 'numberOfParticleSizeGroups' Radius-size categories, ranging from 'minRadius' to 'maxRadius'. The particles are stored in '_particleArray', where every entry equals the particle Radius (in meter) of one particle according to the distribution. To get the exact No of particles use 'calculateParticleArray(true)'. WARNING: leaving getExactParticleNumber = false may result in fewer or more particles than specified. BUT when putting getExactParticleNumber = true it may not converge. If the particles should appear random according to the distribution use 'shuffleParticleArray'. *
time discretization To calculate when a new particle shall be spawned, use 'calculateTimeArray' with the corresponding time distribution and the time interval ranging from 'begin' to 'end'. Every time-step ('iT') when a new particle should be spawned is stored in '_timeArray'. 'spawnSphericalParticles' can be called every time-step to automatically spawn a spherical particle according to the time and size discretization. Use 'loopAround = true', to start at the beginning of '_particleArray' after reaching its end and 'reshuffleAfterLoop = true' to reshuffle it at the end
time activation When dealing with large number of particles adding them will get more time consuming because of the needed communication between sub-grids of all threads. To counteract this, the particles can be added as passive particles in bulk with 'preSpawnSphericalParticles' and calling 'timeActivateParticles' will activate the particles according to the time distribution.
Definition at line 85 of file ParticleDistribution.h.
olb::ParticleDistribution< T, S >::ParticleDistribution | ( | FunctorPtr< AnalyticalF1D< T, S > > && | distribution, |
C | numberOfParticles, | ||
C | numberOfParticleSizeGroups, | ||
T | minRadius, | ||
T | maxRadius, | ||
T | lengthConversion = 1 ) |
Definition at line 60 of file ParticleDistribution.hh.
References olb::ParticleDistribution< T, S >::calculateParticleArray().
olb::ParticleDistribution< T, S >::~ParticleDistribution | ( | ) |
destructor
Definition at line 331 of file ParticleDistribution.hh.
bool olb::ParticleDistribution< T, S >::calculateParticleArray | ( | bool | getExactParticleNumber = false | ) |
Definition at line 87 of file ParticleDistribution.hh.
bool olb::ParticleDistribution< T, S >::calculateTimeArray | ( | AnalyticalF1D< T, S > & | timeDistribution, |
UnitConverter< T, DESCRIPTOR > & | converter, | ||
T | begin, | ||
T | end ) |
Definition at line 200 of file ParticleDistribution.hh.
References olb::UnitConverter< T, DESCRIPTOR >::getLatticeTime(), and olb::UnitConverter< T, DESCRIPTOR >::getPhysTime().
void olb::ParticleDistribution< T, S >::deactivateParticles | ( | SuperParticleSystem3D< T, Particle3D > & | supParticleSystem, |
int | beginID, | ||
int | endID ) |
Sets the particle state 'active' to 'false' for particles with ids from 'beginID' to 'endID'.
Definition at line 299 of file ParticleDistribution.hh.
References olb::SuperParticleSystem3D< T, PARTICLETYPE >::getParticleSystems(), and olb::SuperParticleSystem3D< T, PARTICLETYPE >::numOfPSystems().
void olb::ParticleDistribution< T, S >::getParticleArray | ( | std::vector< T > & | particleArray | ) |
Definition at line 131 of file ParticleDistribution.hh.
T olb::ParticleDistribution< T, S >::nextParticleRadius | ( | bool | loopAround = false, |
bool | reshuffleAfterLoop = false ) |
Definition at line 138 of file ParticleDistribution.hh.
void olb::ParticleDistribution< T, S >::preSpawnSphericalParticles | ( | SuperParticleSystem3D< T, Particle3D > & | supParticleSystem, |
IndicatorF3D< S > & | indicator, | ||
T | density, | ||
int | beginID = 1, | ||
bool | shuffle = false ) |
Definition at line 318 of file ParticleDistribution.hh.
References olb::SuperParticleSystem3D< T, PARTICLETYPE >::addTracerParticle(), M_PI, and olb::util::pow().
void olb::ParticleDistribution< T, S >::printParticleArray | ( | ) |
prints the particle Radii to the console
Definition at line 186 of file ParticleDistribution.hh.
void olb::ParticleDistribution< T, S >::printSizeMatrix | ( | ) |
prints the calculation matrix to the console
Definition at line 172 of file ParticleDistribution.hh.
void olb::ParticleDistribution< T, S >::printTimeArray | ( | ) |
prints out all time-steps a new particle should appear
Definition at line 245 of file ParticleDistribution.hh.
void olb::ParticleDistribution< T, S >::shuffleParticleArray | ( | ) |
shuffles particle array using random_shuffle
Definition at line 166 of file ParticleDistribution.hh.
void olb::ParticleDistribution< T, S >::spawnSphericalParticles | ( | SuperParticleSystem3D< T, Particle3D > & | supParticleSystem, |
IndicatorF3D< S > & | indicator, | ||
T | density, | ||
C | iT, | ||
bool | loopAround = false, | ||
bool | reshuffleAfterLoop = false ) |
Definition at line 260 of file ParticleDistribution.hh.
References olb::SuperParticleSystem3D< T, PARTICLETYPE >::addParticle(), M_PI, and olb::util::pow().
void olb::ParticleDistribution< T, S >::timeActivateParticles | ( | SuperParticleSystem3D< T, Particle3D > & | supParticleSystem, |
C | iT, | ||
C | idOfset = 0 ) |
Definition at line 274 of file ParticleDistribution.hh.
References olb::SuperParticleSystem3D< T, PARTICLETYPE >::getParticleSystems().