24#ifndef SUPERPARTICLESYSTEM_3D_H
25#define SUPERPARTICLESYSTEM_3D_H
50template<
typename T,
template<
typename U>
class PARTICLETYPE>
51class SuperParticleSysVtuWriter;
54class SuperParticleSysVtuWriterMag;
56template<
typename T,
template<
typename U>
class PARTICLETYPE>
59template<
typename T,
template<
typename U>
class PARTICLETYPE>
62template <
typename T,
typename DESCRIPTOR>
78template<
typename T,
template<
typename U>
class PARTICLETYPE>
106 std::vector<T> vel, std::vector<T> dMoment, std::vector<T> aVel,
107 std::vector<T> torque, T magnetisation,
int sActivity)
115 std::vector<T> vel = {0., 0., 0.});
116 void addHL3DParticle(IndicatorF3D<T>& ind, std::set<int> material, T mas, T rad,
int no = 1,
117 std::vector<T> vel = {0., 0., 0.}, T surface=1., T volume=1.);
119 std::vector<T> vel, std::vector<T> dMoment, std::vector<T> aVel,
120 std::vector<T> torque, T magnetisation,
int sActivity)
126 void addParticle(std::set<int> material,
int no, T mas, T rad, std::vector<T> vel = {0., 0., 0.});
131 int nox,
int noy,
int noz, std::vector<T> vel = {0., 0., 0.});
140 template<
typename DESCRIPTOR>
142 IndicatorCircle3D<T>& indicatorCircle, T particleMassConcentration, T charPhysVelocity,
143 T conversionFactorTime, SuperLatticeInterpPhysVelocity3D<T, DESCRIPTOR>& getVel,
144 PARTICLETYPE<T>& p, std::set<int> material,
int iT, T& particlesPerPhyTimeStep,
145 std::vector<T>& inletVec, std::deque<std::vector<T>>& posDeq,
int deqSize);
155 void addTracerParticle(IndicatorF3D<T>& ind,
int idTP, T mas, T rad,
int noTP = 1, std::vector<T> vel = {0., 0., 0.});
159 void addParticleBoxMuller(IndicatorF3D<T>& ind, T partRho, T mu, T sigma,
int no = 1, T appProb = 1., std::vector<T> vel
170 T pMass, T pRad, std::vector<T> vel,
177 void simulate(T dT,
bool scale =
false);
179 void simulate(T dT, std::set<int> sActivityOfFreeParticle,
bool scale =
false)
187 int material,
int subSteps = 1,
bool resetExternalField =
true,
bool scale =
false );
191 int material,
int subSteps = 1,
bool resetExternalField =
true,
bool scale =
false );
201 void setMagneticParticles(std::vector<T> dMoment, std::vector<T> vel, std::vector<T> aVel, std::vector<T> torque,
203 void setMagneticParticles(std::vector<T> dMoment, std::vector<T> vel, std::vector<T> aVel, std::vector<T> torque,
204 T magnetisation,
int sActivity) {};
249 std::vector<ParticleSystem3D<T, PARTICLETYPE>*>&
getPSystems();
269 template<
typename DESCRIPTOR>
285 void print(std::list<int> mat);
295 int iT,
int iTConsole, T genPartPerTimeStep = 0);
297 int iT,
int iTConsole, T genPartPerTimeStep,
298 T& avDiffEscapeRate, T latticeTimeStart, T latticeTimeEnd);
302 void getOutput(std::string filename,
int iT, T conversionFactorTime,
306 template<
typename DESCRIPTOR>
330 bool findCuboid(PARTICLETYPE<T>&,
int overlap);
335 bool checkCuboid(PARTICLETYPE<T>& p, T overlap,
int iC);
348 std::vector<ParticleSystem3D<T, PARTICLETYPE>*>
_pSystems;
367 double rad,
int no,
int id,
368 std::vector<double> vel, std::vector<double> dMoment, std::vector<double> aVel,
369 std::vector<double> torque,
double magnetisation,
int sActivity);
372 double rad,
int no,
int id,
373 std::vector<double> vel, std::vector<double> dMoment, std::vector<double> aVel,
374 std::vector<double> torque,
double magnetisation,
int sActivity);
377 std::set<int> material,
double mas,
double rad,
int no,
int id,
378 std::vector<double> vel, std::vector<double> dMoment, std::vector<double> aVel,
379 std::vector<double> torque,
double magnetisation,
int sActivity);
385 std::vector<double> vel, std::vector<double> aVel,
386 std::vector<double> torque,
double magnetisation,
int sActivity);
401 int material,
int subSteps,
bool resetExternalField,
bool scale );
406 int material,
int subSteps,
bool resetExternalField,
bool scale );
Groups all the 3D include files in the boundaryConditions directory.
AnalyticalConst: DD -> XD, where XD is defined by value.size()
Abstact base class for BaseBackCouplingModel.
Prototype for all particle boundaries.
A cuboid geometry represents a voxel mesh.
Prototype for all particle forces.
Abstact base class for all the forward-coupling models Its raison d'etre consists of not being temple...
IndicatorF3D is an application from .
Base class for all LoadBalancer.
class for marking output with some text
Representation of a statistic for a parallel 2D geometry.
The class superParticleSystem is the basis for particulate flows within OpenLB.
void addParticleOperation(std::shared_ptr< ParticleOperation3D< T, PARTICLETYPE > > o)
Add an operation to system.
void saveToFile(std::string name)
Save Particles to file. Add using addParticlesFromFile(std::string name, T mass, T radius);.
std::vector< std::vector< int > > _cuboidNeighbours
Numbers of neighboring cuboids.
void setMagneticParticles(std::vector< T > dMoment, std::vector< T > vel, std::vector< T > aVel, std::vector< T > torque, T magnetisation, int sActivity)
void setParticlesPosRandom(T posFactor)
Changes particle positions randomly.
void setMagneticParticlesdMomRandom()
Gives random dipolemoment orientation to all MagneticParticle3D.
void addBoundary(std::shared_ptr< Boundary3D< T, PARTICLETYPE > > b)
Add a boundary to system.
void setOverlap(T)
Set overlap of ParticleSystems, overlap has to be in lattice units particle system _overlap+1 <= _sup...
void clearParticles()
Removes all particles from System.
void simulate(T dT, std::set< int > sActivityOfFreeParticle, bool scale=false)
void updateParticleDistribution()
Redistribute particles on compute nodes.
int globalNumOfShadowParticles()
Get global number of shadow particles (particles hold in overlap)
void setParticlesVelRandom(T velFactor)
Gives random velocity to all particles.
void addParticleEquallyDistributed(IndicatorCuboid3D< T > &cuboid, T pMass, T pRad, int nox, int noy, int noz, std::vector< T > vel={0., 0., 0.})
Add a number of identical particles equally distributed in a given Material Number.
std::vector< ParticleSystem3D< T, PARTICLETYPE > * > & getPSystems()
Get ParticleSystems.
T getOverlap()
Get overlap of ParticleSystems.
void printDeep(std::string message="")
void simulateWithTwoWayCoupling_Davide(T dT, ForwardCouplingModel< T, PARTICLETYPE > &forwardCoupling, BackCouplingModel< T, PARTICLETYPE > &backCoupling, int material, int subSteps=1, bool resetExternalField=true, bool scale=false)
void addParticle(PARTICLETYPE< T > &p)
Add a Particle to SuperParticleSystem.
void init()
Init the SuperParticleSystem.
~SuperParticleSystem3D() override
Destructor.
void addForce(std::shared_ptr< Force3D< T, PARTICLETYPE > > f)
Add a force to system.
void prepareAgglomerates()
Agglomerate detection functions: Todo: enable for parallel mode Initializes an empty agglomerate list...
int rankNumOfShadowParticles()
Get number of shadow particles computed on this node.
void addParticlesFromParaviewFile(std::string name)
Add particles form a File. Save using saveToFile(std::string name)
void addParticleWithDistance(IndicatorCuboid3D< T > &ind, T pMass, T pRad, std::vector< T > vel, T conc, T minDist, bool checkDist)
Generates particles with specific volume concentration conc equally and randomly distributed in given...
void captureEscapeRate(std::list< int > mat)
console output of escape (E), capture (C) rate for material numbers mat
std::multimap< int, PARTICLETYPE< T > > _relocateShadow
void findAgglomerates(int iT, int itVtkOutputMagParticles)
Detects and manages particle agglomerates.
bool checkCuboid(PARTICLETYPE< T > &p, T overlap)
Check if particle is still on cuboid.
void setVelToAnalyticalVel(AnalyticalConst3D< T, T > &)
Set particle velocity to analytical velocity (e.g. as initial condition.
bool findCuboid(PARTICLETYPE< T > &, int overlap)
Find the cuboid the particle is on.
SuperGeometry< T, 3 > & _superGeometry
The superGeometry.
std::list< int > & getRankNeighbours()
std::vector< ParticleSystem3D< T, PARTICLETYPE > * > _pSystems
The particleSystems. One per cuboid.
void addParticleBoxMuller(IndicatorF3D< T > &ind, T partRho, T mu, T sigma, int no=1, T appProb=1., std::vector< T > vel={0., 0., 0.})
Add a number of nonidentical particles with normally distributed radius (Box-Muller Method) in a give...
void getOutput(std::string filename, int iT, T conversionFactorTime, unsigned short particleProperties)
Get Output of particleMovement Write the data of the particle movement into an txtFile.
int globalNumOfActiveParticles()
Get global number of active particles.
std::list< int > _rankNeighbours
Rank of neighboring cuboids.
void diffEscapeRate(std::list< int > mat, int &globalPSum, int &pSumOutlet, T &diffEscapeRate, T &maxDiffEscapeRate, int iT, int iTConsole, T genPartPerTimeStep=0)
Console output of differential escape rate for material numbers mat (e.g.
std::map< int, std::vector< double > > _send_buffer
temporary variables
void addShadowParticle(PARTICLETYPE< T > &p)
Add a shadow particle to system.
T getStokes(UnitConverter< T, DESCRIPTOR > &conv, T pRho, T rad)
returns the Stokes number
int countMaterial(int mat)
Get number of particles in the vicinity of material number mat.
void simulateWithTwoWayCoupling_Mathias(T dT, ForwardCouplingModel< T, PARTICLETYPE > &forwardCoupling, BackCouplingModel< T, PARTICLETYPE > &backCoupling, int material, int subSteps=1, bool resetExternalField=true, bool scale=false)
Integrate on Timestep dT with two-way coupling, scale = true keeps the particle velocity in stable ra...
int rankNumOfParticles()
Get number of particles computed on this node.
void addTracerParticle(IndicatorF3D< T > &ind, int idTP, T mas, T rad, int noTP=1, std::vector< T > vel={0., 0., 0.})
Add a number of particles with a certain ID (TracerParticle) equally distributed in a given Indicator...
void setVelToFluidVel(SuperLatticeInterpPhysVelocity3D< T, DESCRIPTOR > &)
Set particle velocity to fluid velocity (e.g. as initial condition.
void simulate(T dT, bool scale=false)
Integrate on Timestep dT, scale = true keeps the particle velocity in stable range.
int rankNumOfTracerParticles()
Get number of TracerParticles computed on this node.
void setMagneticParticles(std::vector< T > dMoment, std::vector< T > vel, std::vector< T > aVel, std::vector< T > torque, T magnetisation)
Gives specific attributes to all MagneticParticle3D.
bool particleSActivityTest(int sActivity)
Tests if particles with specific sActivity exist.
void addParticle(IndicatorF3D< T > &ind, std::set< int > material, T mas, T rad, int no, int id, std::vector< T > vel, std::vector< T > dMoment, std::vector< T > aVel, std::vector< T > torque, T magnetisation, int sActivity)
int globalNumOfTracerParticles()
Get number of TracerParticles computed on this node.
std::vector< int > numOfForces()
Get number of linked Forces.
std::vector< ParticleSystem3D< T, PARTICLETYPE > * > getParticleSystems()
Get ParticleSystems.
SuperParticleSystem3D(CuboidGeometry3D< T > &cuboidGeometry, LoadBalancer< T > &loadBalancer, SuperGeometry< T, 3 > &)
Constructor for SuperParticleSystem.
int rankNumOfActiveParticles()
Get number of active particles computed on this node.
ParticleSystem3D< T, PARTICLETYPE > & operator[](int i)
Get a ParticleSystem.
void generateParticlesCircleInletMassConcentration(IndicatorCircle3D< T > &indicatorCircle, T particleMassConcentration, T charPhysVelocity, T conversionFactorTime, SuperLatticeInterpPhysVelocity3D< T, DESCRIPTOR > &getVel, PARTICLETYPE< T > &p, std::set< int > material, int iT, T &particlesPerPhyTimeStep, std::vector< T > &inletVec, std::deque< std::vector< T > > &posDeq, int deqSize)
Generates particle at a circle shaped inlet, amount given by mass concentration in feedstream.
void setContactDetection(ContactDetection< T, PARTICLETYPE > &contactDetection)
Set contact detection algorithm for particle-particle contact. Not yet implemented.
int countLocMaterial(int mat)
void addParticle(IndicatorF3D< T > &ind, T mas, T rad, int no, int id, std::vector< T > vel, std::vector< T > dMoment, std::vector< T > aVel, std::vector< T > torque, T magnetisation, int sActivity)
int globalNumOfParticles()
Get global number of particles.
void addParticlesFromFile(std::string name, T mass, T radius)
Add particles form a File. Save using saveToFile(std::string name)
void addHL3DParticle(IndicatorF3D< T > &ind, std::set< int > material, T mas, T rad, int no=1, std::vector< T > vel={0., 0., 0.}, T surface=1., T volume=1.)
std::multimap< int, PARTICLETYPE< T > > _relocate
void setContactDetectionForPSys(ContactDetection< T, PARTICLETYPE > &contactDetection, int pSysNr)
Set contact detection algorithm for particle-particle contact. Not yet implemented.
void initAggloParticles()
Adds new generated particles to the list of non agglomerated Particles.
int numOfPSystems()
Get number of ParticleSystems.
Conversion between physical and lattice units, as well as discretization.
constexpr T getCharPhysLength() const
return characteristic length in physical units
constexpr T getPhysDensity() const
return density in physical units
constexpr T getPhysViscosity() const
return viscosity in physical units
constexpr T getCharPhysVelocity() const
return characteristic velocity in physical units
The description of a vector of 3D cuboid – header file.
Wrapper functions that simplify the use of MPI.
cpu::simd::Pack< T > pow(cpu::simd::Pack< T > base, cpu::simd::Pack< T > exp)
Top level namespace for all of OpenLB.
Representation of a parallel 2D geometry – header file.