OpenLB 1.7
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
olb::particles::dynamics Namespace Reference

Classes

class  NoParticleDynamics
 No particle dynamics equivalent to no lattice dynamics. More...
 
class  ParticleDetachmentDynamics
 Verlet dynamics for particles aware of their DYNAMIC_STATE. More...
 
struct  ParticleDynamics
 Basic particle dynamics. More...
 
struct  ParticleDynamicStateAngle
 
struct  ParticleDynamicStateNoAngle
 
class  ParticleManager
 
struct  torque_from_force
 
class  VerletParticleDynamics
 Standard dynamics for particles. More...
 
class  VerletParticleDynamicsCubicBoundsAdhesion
 Velocity verlet particle dynamics with limitation of position and velocity by checking domain bounds in cartesion direcion and simple adhesive force threshold allowing particles only to move when both a normal and tangential force threshold have been surpassed. More...
 
class  VerletParticleDynamicsCubicBoundsDeposition
 Velocity verlet particle dynamics with deposition modelling by checking domain bounds in cartesion direcion. More...
 
class  VerletParticleDynamicsEscape
 Standard dynamics with escape. More...
 
class  VerletParticleDynamicsMaterialAwareEscape
 Standard dynamics with wall capture and material number checks. More...
 
class  VerletParticleDynamicsMaterialAwareWallCapture
 Standard dynamics with wall capture and material number checks. More...
 
class  VerletParticleDynamicsMaterialAwareWallCaptureAndEscape
 Standard dynamics with wall capture nd escape and material number checks. More...
 
class  VerletParticleDynamicsMaterialCapture
 Standard dynamics with material capture. More...
 
class  VerletParticleDynamicsMaterialCaptureAndEscape
 Standard dynamics with material capture and escape. More...
 
class  VerletParticleDynamicsMaterialEscape
 Standard dynamics with material capture. More...
 
class  VerletParticleDynamicsRotationOnly
 Verlet particle dynamics only considering rotation (ignoring translation) More...
 
class  VerletParticleDynamicsRotor
 
class  VerletParticleDynamicsTranslationOnly
 Verlet particle dynamics only considering translation (ignoring rotation) More...
 
class  VerletParticleDynamicsVelocityWallReflection
 Standard dynamics with wall reflection. More...
 
class  VerletParticleDynamicsWallCapture
 Standard dynamics with wall capture. More...
 

Typedefs

template<typename T , typename PARTICLETYPE >
using DynState
 

Functions

template<typename T , typename PARTICLETYPE >
void updateRotationMatrix (Particle< T, PARTICLETYPE > &particle)
 
template<typename T , typename PARTICLETYPE , typename F >
void doAtCubicBoundPenetration (Particle< T, PARTICLETYPE > &particle, Vector< T, PARTICLETYPE::d > domainMin, Vector< T, PARTICLETYPE::d > domainMax, F boundTreatment)
 Helper functions.
 
template<typename T , typename PARTICLETYPE >
void resetDirection (Particle< T, PARTICLETYPE > &particle, Vector< T, PARTICLETYPE::d > positionPre, int iDir)
 
template<typename T , typename PARTICLETYPE >
void resetMovement (Particle< T, PARTICLETYPE > &particle, Vector< T, PARTICLETYPE::d > positionPre, Vector< T, utilities::dimensions::convert< PARTICLETYPE::d >::rotation > anglePre=Vector< T, utilities::dimensions::convert< PARTICLETYPE::d >::rotation >(0.))
 
template<typename T , typename PARTICLETYPE >
constexpr Vector< T, PARTICLETYPE::d > calculateLocalVelocity (Particle< T, PARTICLETYPE > &particle, const PhysR< T, PARTICLETYPE::d > &input)
 
template<typename T , typename PARTICLETYPE >
void unserializeForceTorqueVoxels (Vector< T, PARTICLETYPE::d > &force, Vector< T, utilities::dimensions::convert< PARTICLETYPE::d >::rotation > &torque, T serializedFunctorForceField[], int iP)
 Unserialize force field provieded by force integration functor (e.g. momentumExchange)
 
template<typename T , typename PARTICLETYPE >
void unserializeForce (Vector< T, PARTICLETYPE::d > &force, T serializedFunctorForceField[], int iP)
 Unserialize force field provieded by force integration functor (e.g. stokesDragForce)
 
template<typename T , typename PARTICLETYPE , typename FORCEFUNCTOR >
void applySerializableParticleForce (FORCEFUNCTOR &forceF, ParticleSystem< T, PARTICLETYPE > &particleSystem, std::size_t iP0=0)
 Apply boundary force provided by force functor to the particle center as torque and force.
 
template<typename T , typename PARTICLETYPE , typename FORCEFUNCTOR , typename PCONDITION = conditions::valid_particles>
void applyLocalParticleForce (FORCEFUNCTOR &forceF, ParticleSystem< T, PARTICLETYPE > &particleSystem, std::size_t iP0=0)
 Apply boundary force provided by force functor to the particle center as torque and force.
 
template<typename T , typename PARTICLETYPE >
void initializeParticle (DynamicFieldGroupsD< T, typename PARTICLETYPE::fields_t > &dynamicFieldGroups, std::size_t iP)
 Initialize all fields in particle (necessary for clang)
 
template<typename T , typename DESCRIPTOR , typename PARTICLETYPE , typename PARTICLECONTACTTYPE , typename WALLCONTACTTYPE , typename F = decltype(defaults::periodicity<DESCRIPTOR::d>)>
void coupleResolvedParticlesToLattice (ParticleSystem< T, PARTICLETYPE > &particleSystem, contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE > &contactContainer, const SuperGeometry< T, DESCRIPTOR::d > &sGeometry, SuperLattice< T, DESCRIPTOR > &sLattice, UnitConverter< T, DESCRIPTOR > const &converter, std::vector< SolidBoundary< T, DESCRIPTOR::d > > &solidBoundaries, F getSetupPeriodicity=defaults::periodicity< DESCRIPTOR::d >)
 Couple particle to lattice and detect contacts of resolved particles.
 
template<typename T , typename DESCRIPTOR , typename PARTICLETYPE , typename PARTICLECONTACTTYPE , typename WALLCONTACTTYPE , typename F = decltype(defaults::periodicity<DESCRIPTOR::d>)>
void coupleResolvedParticlesToLattice (ParticleSystem< T, PARTICLETYPE > &particleSystem, contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE > &contactContainer, const SuperGeometry< T, DESCRIPTOR::d > &sGeometry, SuperLattice< T, DESCRIPTOR > &sLattice, UnitConverter< T, DESCRIPTOR > const &converter, F getSetupPeriodicity=defaults::periodicity< DESCRIPTOR::d >)
 Couple particle to lattice and detect contacts of resolved particles.
 
template<typename T , typename DESCRIPTOR , typename PARTICLETYPE , typename PARTICLECONTACTTYPE , typename WALLCONTACTTYPE , typename F = decltype(defaults::periodicity<DESCRIPTOR::d>)>
void coupleResolvedParticlesToLattice (SuperParticleSystem< T, PARTICLETYPE > &sParticleSystem, contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE > &contactContainer, const SuperGeometry< T, DESCRIPTOR::d > &sGeometry, SuperLattice< T, DESCRIPTOR > &sLattice, UnitConverter< T, DESCRIPTOR > const &converter, std::vector< SolidBoundary< T, DESCRIPTOR::d > > &solidBoundaries, F getSetupPeriodicity=defaults::periodicity< DESCRIPTOR::d >)
 Couple particle to lattice and detect contacts of resolved particles.
 
template<typename T , typename DESCRIPTOR , typename PARTICLETYPE , typename PARTICLECONTACTTYPE , typename WALLCONTACTTYPE , typename F = decltype(defaults::periodicity<DESCRIPTOR::d>)>
void coupleResolvedParticlesToLattice (SuperParticleSystem< T, PARTICLETYPE > &sParticleSystem, contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE > &contactContainer, const SuperGeometry< T, DESCRIPTOR::d > &sGeometry, SuperLattice< T, DESCRIPTOR > &sLattice, UnitConverter< T, DESCRIPTOR > const &converter, F getSetupPeriodicity=defaults::periodicity< DESCRIPTOR::d >)
 Couple particle to lattice and detect contacts of resolved particles.
 
template<typename T , typename PARTICLETYPE >
calcKineticEnergy (Particle< T, PARTICLETYPE > &particle)
 
template<typename T , typename PARTICLETYPE >
void velocityVerletTranslation (Particle< T, PARTICLETYPE > &particle, T delTime, T delTime2, Vector< T, PARTICLETYPE::d > acceleration)
 
template<typename T , typename PARTICLETYPE >
void velocityVerletRotation (Particle< T, PARTICLETYPE > &particle, T delTime, T delTime2, Vector< T, utilities::dimensions::convert< PARTICLETYPE::d >::rotation > angularAcceleration)
 
template<typename T , typename PARTICLETYPE >
void velocityVerletRotor (Particle< T, PARTICLETYPE > &particle, T delTime, Vector< T, PARTICLETYPE::d > angVel)
 
template<typename T , typename PARTICLETYPE >
void velocityVerletIntegration (Particle< T, PARTICLETYPE > &particle, T delTime, Vector< T, PARTICLETYPE::d > acceleration, Vector< T, utilities::dimensions::convert< PARTICLETYPE::d >::rotation > angularAcceleration)
 
template<typename T , typename PARTICLETYPE >
void eulerIntegrationTranslation (Particle< T, PARTICLETYPE > &particle, T delTime, Vector< T, PARTICLETYPE::d > acceleration)
 Euler integration.
 
template<typename T , typename PARTICLETYPE >
void eulerIntegrationRotation (Particle< T, PARTICLETYPE > &particle, T delTime, Vector< T, utilities::dimensions::convert< PARTICLETYPE::d >::rotation > angularAcceleration)
 
template<typename T , typename PARTICLETYPE >
void eulerIntegration (Particle< T, PARTICLETYPE > &particle, T delTime, Vector< T, PARTICLETYPE::d > acceleration, Vector< T, utilities::dimensions::convert< PARTICLETYPE::d >::rotation > angularAcceleration)
 
template<typename T , typename PARTICLETYPE >
void analyticalTranslation (Particle< T, PARTICLETYPE > &particle, Vector< T, PARTICLETYPE::d > acceleration, T delTime, Vector< T, PARTICLETYPE::d > fluid_vel)
 

Typedef Documentation

◆ DynState

template<typename T , typename PARTICLETYPE >
using olb::particles::dynamics::DynState
Initial value:
std::conditional_t<
PARTICLETYPE::template providesNested<descriptors::SURFACE,descriptors::ANGLE>(),
ParticleDynamicStateAngle<T,PARTICLETYPE>,
ParticleDynamicStateNoAngle<T,PARTICLETYPE>
>

Definition at line 151 of file particleDynamicsUtilities.h.

Function Documentation

◆ analyticalTranslation()

template<typename T , typename PARTICLETYPE >
void olb::particles::dynamics::analyticalTranslation ( Particle< T, PARTICLETYPE > & particle,
Vector< T, PARTICLETYPE::d > acceleration,
T delTime,
Vector< T, PARTICLETYPE::d > fluid_vel )

Definition at line 195 of file particleMotionFunctions.h.

198{
199
200 using namespace descriptors;
201 constexpr unsigned D = PARTICLETYPE::d;
202 //Check field existence
203 static_assert(PARTICLETYPE::template providesNested<GENERAL,POSITION>(), "Field POSITION has to be provided");
204 static_assert(PARTICLETYPE::template providesNested<MOBILITY,VELOCITY>(), "Field VELOCITY has to be provided");
205 //Calculate quant accelearation[0]
206 if (acceleration[0]!=0){
207 T tau_p0 = 1./(acceleration[0])*(fluid_vel[0]-particle.template getField<MOBILITY,VELOCITY>()[0]);
208 Vector<T,D> velocity( fluid_vel+ std::exp((-delTime/tau_p0))*(particle.template getField<MOBILITY,VELOCITY>()- fluid_vel));
209 Vector<T,D> position( particle.template getField<GENERAL,POSITION>() + delTime*(fluid_vel) + tau_p0*(1- std::exp((-delTime/tau_p0)))*(particle.template getField<MOBILITY,VELOCITY>()-fluid_vel));
210 //Update values
211 particle.template setField<GENERAL,POSITION>( position );
212 particle.template setField<MOBILITY,VELOCITY>( velocity );
213 } else {
214 Vector<T,D> position( particle.template getField<GENERAL,POSITION>() + delTime*particle.template getField<MOBILITY,VELOCITY>());
215 //Update values
216 particle.template setField<GENERAL,POSITION>( position );
217 //particle.template setField<MOBILITY,VELOCITY>( velocity );
218 }
219}
Plain old scalar vector.
Definition vector.h:47

◆ applyLocalParticleForce()

template<typename T , typename PARTICLETYPE , typename FORCEFUNCTOR , typename PCONDITION = conditions::valid_particles>
void olb::particles::dynamics::applyLocalParticleForce ( FORCEFUNCTOR & forceF,
ParticleSystem< T, PARTICLETYPE > & particleSystem,
std::size_t iP0 = 0 )

Apply boundary force provided by force functor to the particle center as torque and force.

  • allows for additional specification of PCONDITION (as opposed to applySerializedParticleForce)

Definition at line 198 of file particleDynamicsFunctions.h.

199{
200 //Iterate over particles and apply functor's evaluate() directly
201 for (std::size_t iP=iP0; iP!=particleSystem.size(); iP++) {
202 auto particle = particleSystem.get(iP);
203 //Execute F when particle meets condition
204 doWhenMeetingCondition<T,PARTICLETYPE,PCONDITION>( particle,
205 [&](auto& particle){
206 //Evaluate force functor
207 T output[1]; //dummy output
208 forceF.evaluate(output, particle, iP);
209 });
210 }
211}
auto & get()
Expose container.
constexpr std::size_t size()
Size of ParticleSystem.

References olb::particles::ParticleSystem< T, PARTICLETYPE >::get(), and olb::particles::ParticleSystem< T, PARTICLETYPE >::size().

+ Here is the call graph for this function:

◆ applySerializableParticleForce()

template<typename T , typename PARTICLETYPE , typename FORCEFUNCTOR >
void olb::particles::dynamics::applySerializableParticleForce ( FORCEFUNCTOR & forceF,
ParticleSystem< T, PARTICLETYPE > & particleSystem,
std::size_t iP0 = 0 )

Apply boundary force provided by force functor to the particle center as torque and force.

Definition at line 151 of file particleDynamicsFunctions.h.

152{
153 constexpr unsigned D = PARTICLETYPE::d;
154 constexpr unsigned Drot = utilities::dimensions::convert<D>::rotation;
155
156 //Create serialized force field and dummy input
157 int input[1]{};
158 T serializedFunctorForceField[forceF.getTargetDim()]; //TODO: could be decreased by only considering valid_particles
159
160 //Initialize serialized force field when directly using block functors
161 // -as this is usually done inside the super functor
162 if constexpr (std::is_base_of<BlockF<T,PARTICLETYPE::d>, FORCEFUNCTOR>::value){
163 for (int iS=0; iS<forceF.getTargetDim(); ++iS) {
164 serializedFunctorForceField[iS] = 0.;
165 }
166 }
167
168 //Retrieve boundary force field
169 forceF(serializedFunctorForceField, input);
170
171 //Loop over particles and apply individual force and torque contribution
172 //TODO: for parallized particles, this represents a redundant loop over the particle system
173 for (std::size_t iP=iP0; iP<particleSystem.size(); iP++) {
174 auto particle = particleSystem.get(iP);
175
176 Vector<T,D> force;
177 std::size_t iPeval = iP-iP0; //Shift, if iP!=0
178 if constexpr ( PARTICLETYPE::template providesNested<descriptors::FORCING,descriptors::TORQUE>() ) {
179 Vector<T,Drot> torque;
180 unserializeForceTorqueVoxels<T,PARTICLETYPE>( force, torque, serializedFunctorForceField, iPeval );
181 particle.template setField<descriptors::FORCING,descriptors::TORQUE>(
182 utilities::dimensions::convert<D>::serialize_rotation(torque) );
183 }
184 else {
185 unserializeForce<T,PARTICLETYPE>( force, serializedFunctorForceField, iPeval );
186 }
187
188 //DEBUG OUTPUT
189// int rank = singleton::mpi().getRank();
190// std::cout << " force(pSys=" << &particleSystem << ",rank=" << rank << ")=" << force << std::endl;
191 particle.template setField<descriptors::FORCING,descriptors::FORCE>( force );
192 }
193}
Converts dimensions by deriving from given cartesian dimension D.

References olb::particles::ParticleSystem< T, PARTICLETYPE >::get(), and olb::particles::ParticleSystem< T, PARTICLETYPE >::size().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calcKineticEnergy()

template<typename T , typename PARTICLETYPE >
T olb::particles::dynamics::calcKineticEnergy ( Particle< T, PARTICLETYPE > & particle)

Definition at line 335 of file particleDynamicsFunctions.h.

336{
337 using namespace descriptors;
338 constexpr unsigned D = PARTICLETYPE::d;
339 constexpr unsigned Drot = utilities::dimensions::convert<D>::rotation;
340 static_assert(D==3, "ERROR: 2D version of calcKineticEnergy not implemented yet!");
341
342 T pMass = particle.template getField<PHYSPROPERTIES, MASS>();
343 Vector<T,D> vel(particle.template getField<MOBILITY, VELOCITY>());
344 Vector<T,Drot> pMofi(particle.template getField<PHYSPROPERTIES, MOFI>());
345 Vector<T,Drot> angVel(particle.template getField<MOBILITY, ANG_VELOCITY>());
346
347 T eTrans = T{0.5} * pMass * util::normSqr<T,D>(vel);
348 T eRot = .5*(pMofi[0]*angVel[0]*angVel[0]
349 +pMofi[1]*angVel[1]*angVel[1]
350 +pMofi[2]*angVel[2]*angVel[2]);
351 T eKin = eTrans+eRot;
352
353 return eKin;
354}
+ Here is the caller graph for this function:

◆ calculateLocalVelocity()

template<typename T , typename PARTICLETYPE >
constexpr Vector< T, PARTICLETYPE::d > olb::particles::dynamics::calculateLocalVelocity ( Particle< T, PARTICLETYPE > & particle,
const PhysR< T, PARTICLETYPE::d > & input )
constexpr

Definition at line 91 of file particleDynamicsFunctions.h.

92{
93 using namespace descriptors;
94
95 const PhysR<T,PARTICLETYPE::d> position =
96 particle.template getField<GENERAL,POSITION>();
97 const Vector<T,PARTICLETYPE::d> velocity =
98 particle.template getField<MOBILITY,VELOCITY>();
100 angVelocity(particle.template getField<MOBILITY,ANG_VELOCITY>());
101
102 return util::calculateLocalVelocity(position, velocity, angVelocity, input);
103}

References olb::util::calculateLocalVelocity().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ coupleResolvedParticlesToLattice() [1/4]

template<typename T , typename DESCRIPTOR , typename PARTICLETYPE , typename PARTICLECONTACTTYPE , typename WALLCONTACTTYPE , typename F = decltype(defaults::periodicity<DESCRIPTOR::d>)>
void olb::particles::dynamics::coupleResolvedParticlesToLattice ( ParticleSystem< T, PARTICLETYPE > & particleSystem,
contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE > & contactContainer,
const SuperGeometry< T, DESCRIPTOR::d > & sGeometry,
SuperLattice< T, DESCRIPTOR > & sLattice,
UnitConverter< T, DESCRIPTOR > const & converter,
F getSetupPeriodicity = defaults::periodicity<DESCRIPTOR::d> )

Couple particle to lattice and detect contacts of resolved particles.

Definition at line 270 of file particleDynamicsFunctions.h.

277{
278 std::vector<SolidBoundary<T,DESCRIPTOR::d>> solidBoundaries = std::vector<SolidBoundary<T,DESCRIPTOR::d>>();
279 coupleResolvedParticlesToLattice(particleSystem, contactContainer, sGeometry, sLattice, converter, solidBoundaries, getSetupPeriodicity);
280}
void coupleResolvedParticlesToLattice(ParticleSystem< T, PARTICLETYPE > &particleSystem, contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE > &contactContainer, const SuperGeometry< T, DESCRIPTOR::d > &sGeometry, SuperLattice< T, DESCRIPTOR > &sLattice, UnitConverter< T, DESCRIPTOR > const &converter, std::vector< SolidBoundary< T, DESCRIPTOR::d > > &solidBoundaries, F getSetupPeriodicity=defaults::periodicity< DESCRIPTOR::d >)
Couple particle to lattice and detect contacts of resolved particles.

References coupleResolvedParticlesToLattice().

+ Here is the call graph for this function:

◆ coupleResolvedParticlesToLattice() [2/4]

template<typename T , typename DESCRIPTOR , typename PARTICLETYPE , typename PARTICLECONTACTTYPE , typename WALLCONTACTTYPE , typename F = decltype(defaults::periodicity<DESCRIPTOR::d>)>
void olb::particles::dynamics::coupleResolvedParticlesToLattice ( ParticleSystem< T, PARTICLETYPE > & particleSystem,
contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE > & contactContainer,
const SuperGeometry< T, DESCRIPTOR::d > & sGeometry,
SuperLattice< T, DESCRIPTOR > & sLattice,
UnitConverter< T, DESCRIPTOR > const & converter,
std::vector< SolidBoundary< T, DESCRIPTOR::d > > & solidBoundaries,
F getSetupPeriodicity = defaults::periodicity<DESCRIPTOR::d> )

Couple particle to lattice and detect contacts of resolved particles.

Definition at line 235 of file particleDynamicsFunctions.h.

243{
244 static_assert(DESCRIPTOR::template provides<descriptors::CONTACT_DETECTION>(),
245 "The field CONTACT_DETECTION must be provided.");
246 constexpr unsigned D = DESCRIPTOR::d;
247 using namespace descriptors;
248
249 contactContainer.cleanContacts();
250
251 const PhysR<T,D> min = communication::getCuboidMin<T,D>(sGeometry.getCuboidGeometry());
252 const PhysR<T,D> max = communication::getCuboidMax<T,D>(sGeometry.getCuboidGeometry(), min);
253
254 //Loop over particles
255 for (std::size_t iP=0; iP<particleSystem.size(); ++iP) {
256 auto particle = particleSystem.get(iP);
257 //Write particle field
258 setSuperParticleField( sGeometry, min, max, sLattice, converter,
259 particleSystem, contactContainer, iP, particle,
260 solidBoundaries, getSetupPeriodicity );
261
262 }
263
264 contact::communicateContacts<T,PARTICLECONTACTTYPE,WALLCONTACTTYPE>(contactContainer);
265}
CuboidGeometry< T, D > & getCuboidGeometry()
Read and write access to cuboid geometry.
void setSuperParticleField(const SuperGeometry< T, DESCRIPTOR::d > &sGeometry, SuperLattice< T, DESCRIPTOR > &sLattice, UnitConverter< T, DESCRIPTOR > const &converter, Particle< T, PARTICLETYPE > &particle, const Vector< bool, DESCRIPTOR::d > &periodicity)
Set particle field with peridic support.
void cleanContacts()
Clean contacts - remove "empty" contacts.

References olb::particles::contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE >::cleanContacts(), olb::particles::ParticleSystem< T, PARTICLETYPE >::get(), olb::SuperStructure< T, D >::getCuboidGeometry(), olb::particles::setSuperParticleField(), and olb::particles::ParticleSystem< T, PARTICLETYPE >::size().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ coupleResolvedParticlesToLattice() [3/4]

template<typename T , typename DESCRIPTOR , typename PARTICLETYPE , typename PARTICLECONTACTTYPE , typename WALLCONTACTTYPE , typename F = decltype(defaults::periodicity<DESCRIPTOR::d>)>
void olb::particles::dynamics::coupleResolvedParticlesToLattice ( SuperParticleSystem< T, PARTICLETYPE > & sParticleSystem,
contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE > & contactContainer,
const SuperGeometry< T, DESCRIPTOR::d > & sGeometry,
SuperLattice< T, DESCRIPTOR > & sLattice,
UnitConverter< T, DESCRIPTOR > const & converter,
F getSetupPeriodicity = defaults::periodicity<DESCRIPTOR::d> )

Couple particle to lattice and detect contacts of resolved particles.

Definition at line 321 of file particleDynamicsFunctions.h.

328{
329 std::vector<SolidBoundary<T,DESCRIPTOR::d>> solidBoundaries = std::vector<SolidBoundary<T,DESCRIPTOR::d>>();
330 coupleResolvedParticlesToLattice(sParticleSystem, contactContainer, sGeometry, sLattice, converter, solidBoundaries, getSetupPeriodicity);
331}

References coupleResolvedParticlesToLattice().

+ Here is the call graph for this function:

◆ coupleResolvedParticlesToLattice() [4/4]

template<typename T , typename DESCRIPTOR , typename PARTICLETYPE , typename PARTICLECONTACTTYPE , typename WALLCONTACTTYPE , typename F = decltype(defaults::periodicity<DESCRIPTOR::d>)>
void olb::particles::dynamics::coupleResolvedParticlesToLattice ( SuperParticleSystem< T, PARTICLETYPE > & sParticleSystem,
contact::ContactContainer< T, PARTICLECONTACTTYPE, WALLCONTACTTYPE > & contactContainer,
const SuperGeometry< T, DESCRIPTOR::d > & sGeometry,
SuperLattice< T, DESCRIPTOR > & sLattice,
UnitConverter< T, DESCRIPTOR > const & converter,
std::vector< SolidBoundary< T, DESCRIPTOR::d > > & solidBoundaries,
F getSetupPeriodicity = defaults::periodicity<DESCRIPTOR::d> )

Couple particle to lattice and detect contacts of resolved particles.

Definition at line 286 of file particleDynamicsFunctions.h.

294{
295 static_assert(DESCRIPTOR::template provides<descriptors::CONTACT_DETECTION>(),
296 "The field CONTACT_DETECTION must be provided.");
297 constexpr unsigned D = DESCRIPTOR::d;
298 using namespace descriptors;
299
300 const PhysR<T,D> min = communication::getCuboidMin<T,D>(sGeometry.getCuboidGeometry());
301 const PhysR<T,D> max = communication::getCuboidMax<T,D>(sGeometry.getCuboidGeometry(), min);
302
303 //Loop over particles
304 communication::forParticlesInSuperParticleSystem<T, PARTICLETYPE, conditions::valid_particles>(
305 sParticleSystem,
306 [&](Particle<T, PARTICLETYPE>& particle,
307 ParticleSystem<T, PARTICLETYPE>& particleSystem, int globiC) {
308 const std::size_t globalParticleID =
309 particle.template getField<PARALLELIZATION, ID>();
310 //Write particle field
311 setSuperParticleField(sGeometry, min, max, sLattice, converter,
312 particleSystem, contactContainer,
313 globalParticleID, particle, solidBoundaries,
314 getSetupPeriodicity, globiC );
315 });
316}

References olb::SuperStructure< T, D >::getCuboidGeometry(), and olb::particles::setSuperParticleField().

+ Here is the call graph for this function:

◆ doAtCubicBoundPenetration()

template<typename T , typename PARTICLETYPE , typename F >
void olb::particles::dynamics::doAtCubicBoundPenetration ( Particle< T, PARTICLETYPE > & particle,
Vector< T, PARTICLETYPE::d > domainMin,
Vector< T, PARTICLETYPE::d > domainMax,
F boundTreatment )

Helper functions.

Definition at line 59 of file particleDynamicsUtilities.h.

64{
65 using namespace particles::access;
66 auto radius = getRadius<T,PARTICLETYPE>( particle );
67 auto position = getPosition<T,PARTICLETYPE>( particle );
68 for (int iDim=0; iDim<PARTICLETYPE::d; ++iDim) {
69 T distToLowerBound = (position[iDim] - radius) - domainMin[iDim];
70 T distToUpperBound = domainMax[iDim] - (position[iDim] + radius);
72 if ( distToLowerBound <= 0. ) {
73 normal[iDim] = 1.;
74 boundTreatment(iDim, normal, distToLowerBound);
75 }
76 if ( distToUpperBound <= 0. ) {
77 normal[iDim] = -1.;
78 boundTreatment(iDim, normal, distToUpperBound);
79 }
80 }
81}
+ Here is the caller graph for this function:

◆ eulerIntegration()

template<typename T , typename PARTICLETYPE >
void olb::particles::dynamics::eulerIntegration ( Particle< T, PARTICLETYPE > & particle,
T delTime,
Vector< T, PARTICLETYPE::d > acceleration,
Vector< T, utilities::dimensions::convert< PARTICLETYPE::d >::rotation > angularAcceleration )

Definition at line 180 of file particleMotionFunctions.h.

183{
184 //Calculate cartesian directions
185 eulerIntegrationTranslation( particle, delTime, acceleration );
186 //Calculate rotational directions
187 if constexpr ( access::providesSurface<PARTICLETYPE>() ) {
188 eulerIntegrationRotation( particle, delTime, angularAcceleration );
189 }
190}
void eulerIntegrationRotation(Particle< T, PARTICLETYPE > &particle, T delTime, Vector< T, utilities::dimensions::convert< PARTICLETYPE::d >::rotation > angularAcceleration)
void eulerIntegrationTranslation(Particle< T, PARTICLETYPE > &particle, T delTime, Vector< T, PARTICLETYPE::d > acceleration)
Euler integration.

References eulerIntegrationRotation(), and eulerIntegrationTranslation().

+ Here is the call graph for this function:

◆ eulerIntegrationRotation()

template<typename T , typename PARTICLETYPE >
void olb::particles::dynamics::eulerIntegrationRotation ( Particle< T, PARTICLETYPE > & particle,
T delTime,
Vector< T, utilities::dimensions::convert< PARTICLETYPE::d >::rotation > angularAcceleration )

Definition at line 160 of file particleMotionFunctions.h.

163{
164 using namespace descriptors;
165 constexpr unsigned D = PARTICLETYPE::d;
167 //Check field existence
168 static_assert(PARTICLETYPE::template providesNested<SURFACE,ANGLE>(), "Field SURFACE:ANGLE has to be provided");
169 static_assert(PARTICLETYPE::template providesNested<MOBILITY,ANG_VELOCITY>(), "Field MOBILITY:ANG_VELOCITY has to be provided");
170 //Calculate quantities
171 Vector<T,Drot> angularVelocity( particle.getMobility().getAngularVelocity()
172 + angularAcceleration * delTime );
173 Vector<T,Drot> angle( particle.getSurface().getAngle() + angularVelocity * delTime );
174 //Update values
175 particle.template setField<SURFACE,ANGLE>( angle );
176 particle.template setField<MOBILITY,ANG_VELOCITY>( angularVelocity );
177}
+ Here is the caller graph for this function:

◆ eulerIntegrationTranslation()

template<typename T , typename PARTICLETYPE >
void olb::particles::dynamics::eulerIntegrationTranslation ( Particle< T, PARTICLETYPE > & particle,
T delTime,
Vector< T, PARTICLETYPE::d > acceleration )

Euler integration.

Definition at line 142 of file particleMotionFunctions.h.

145{
146 using namespace descriptors;
147 constexpr unsigned D = PARTICLETYPE::d;
148 //Check field existence
149 static_assert(PARTICLETYPE::template providesNested<GENERAL,POSITION>(), "Field POSITION has to be provided");
150 static_assert(PARTICLETYPE::template providesNested<MOBILITY,VELOCITY>(), "Field VELOCITY has to be provided");
151 //Calculate quantities
152 Vector<T,D> velocity( particle.template getField<MOBILITY,VELOCITY>() + acceleration * delTime );
153 Vector<T,D> position( particle.template getField<GENERAL,POSITION>() + velocity * delTime );
154 //Update values
155 particle.template setField<GENERAL,POSITION>( position );
156 particle.template setField<MOBILITY,VELOCITY>( velocity );
157}
+ Here is the caller graph for this function:

◆ initializeParticle()

template<typename T , typename PARTICLETYPE >
void olb::particles::dynamics::initializeParticle ( DynamicFieldGroupsD< T, typename PARTICLETYPE::fields_t > & dynamicFieldGroups,
std::size_t iP )

Initialize all fields in particle (necessary for clang)

Definition at line 215 of file particleDynamicsFunctions.h.

216{
217 //Define init lambda expression
218 typedef std::function<bool(const std::type_info&,int,std::string)> FunctionType;
219 FunctionType initFunction = [](const std::type_info& typeInfo, int fieldSize, std::string fieldContentStr) {
220 return true; //resetField=true
221 };
222 //Call recursive field traversal function with lambda expression
224 initFunction, dynamicFieldGroups, iP );
225}
Traversal of nested field contents for output and initialization.

◆ resetDirection()

template<typename T , typename PARTICLETYPE >
void olb::particles::dynamics::resetDirection ( Particle< T, PARTICLETYPE > & particle,
Vector< T, PARTICLETYPE::d > positionPre,
int iDir )

Definition at line 84 of file particleDynamicsUtilities.h.

86{
87 using namespace descriptors;
88 const unsigned D = PARTICLETYPE::d;
89 Vector<T,D> position( particle.template getField<GENERAL,POSITION>() );
90 Vector<T,D> velocity( particle.template getField<MOBILITY,VELOCITY>() );
91 position[iDir] = positionPre[iDir];
92 velocity[iDir] = 0.;
93 particle.template setField<GENERAL,POSITION>( position );
94 particle.template setField<MOBILITY,VELOCITY>( velocity );
95}
+ Here is the caller graph for this function:

◆ resetMovement()

template<typename T , typename PARTICLETYPE >
void olb::particles::dynamics::resetMovement ( Particle< T, PARTICLETYPE > & particle,
Vector< T, PARTICLETYPE::d > positionPre,
Vector< T, utilities::dimensions::convert< PARTICLETYPE::d >::rotation > anglePre = Vector<T,utilities::dimensions::convert<PARTICLETYPE::d>::rotation>(0.) )

Definition at line 98 of file particleDynamicsUtilities.h.

102{
103 using namespace descriptors;
104 const unsigned D = PARTICLETYPE::d;
106 particle.template setField<GENERAL,POSITION>( positionPre );
107 particle.template setField<MOBILITY,VELOCITY>( Vector<T,D>(0.) );
108 if constexpr ( PARTICLETYPE::template providesNested<SURFACE,ANGLE>() ) {
109 particle.template setField<SURFACE,ANGLE>( anglePre );
110 particle.template setField<MOBILITY,ANG_VELOCITY>( Vector<T,Drot>(0.) );
111 }
112}
+ Here is the caller graph for this function:

◆ unserializeForce()

template<typename T , typename PARTICLETYPE >
void olb::particles::dynamics::unserializeForce ( Vector< T, PARTICLETYPE::d > & force,
T serializedFunctorForceField[],
int iP )

Unserialize force field provieded by force integration functor (e.g. stokesDragForce)

Definition at line 134 of file particleDynamicsFunctions.h.

136{
137 constexpr unsigned D = PARTICLETYPE::d;
138 constexpr int serialSize = D;
139
140 const int idxForce = iP*(serialSize);
141 const int idxForceEnd = idxForce+D;
142
143 //Get force
144 //TODO: include funcionality to OLB-Vector someday to avoid std::vector cast
145 force = std::vector<T>( serializedFunctorForceField+idxForce,
146 serializedFunctorForceField+idxForceEnd);
147}

◆ unserializeForceTorqueVoxels()

template<typename T , typename PARTICLETYPE >
void olb::particles::dynamics::unserializeForceTorqueVoxels ( Vector< T, PARTICLETYPE::d > & force,
Vector< T, utilities::dimensions::convert< PARTICLETYPE::d >::rotation > & torque,
T serializedFunctorForceField[],
int iP )

Unserialize force field provieded by force integration functor (e.g. momentumExchange)

Definition at line 110 of file particleDynamicsFunctions.h.

113{
114 constexpr unsigned D = PARTICLETYPE::d;
115 constexpr unsigned Drot = utilities::dimensions::convert<D>::rotation;
116 constexpr int serialSize = D+Drot+1;
117
118 const int idxForce = iP*(serialSize);
119 const int idxTorque = idxForce+D;
120 const int idxTorqueEnd = idxTorque+Drot;
121
122 //Get force
123 //TODO: include funcionality to OLB-Vector someday to avoid std::vector cast
124 force = std::vector<T>( serializedFunctorForceField+idxForce,
125 serializedFunctorForceField+idxTorque);
126 //Get torque
127 torque = std::vector<T>( serializedFunctorForceField+idxTorque,
128 serializedFunctorForceField+idxTorqueEnd );
129}

◆ updateRotationMatrix()

template<typename T , typename PARTICLETYPE >
void olb::particles::dynamics::updateRotationMatrix ( Particle< T, PARTICLETYPE > & particle)

Definition at line 40 of file particleDynamicsUtilities.h.

41{
42 using namespace descriptors;
43 auto rotationMatrix = util::calculateRotationMatrix<T,PARTICLETYPE::d>(
44 particle.template getField<SURFACE,ANGLE>() );
45 if constexpr ( PARTICLETYPE::template providesNested<SURFACE,ROT_MATRIX>() ) {
46 particle.template setField<SURFACE,ROT_MATRIX>( rotationMatrix );
47 } else {
48 std::cerr << "ERROR: The field ROT_MATRIX must be provided." << std::endl;
49 }
50}
+ Here is the caller graph for this function:

◆ velocityVerletIntegration()

template<typename T , typename PARTICLETYPE >
void olb::particles::dynamics::velocityVerletIntegration ( Particle< T, PARTICLETYPE > & particle,
T delTime,
Vector< T, PARTICLETYPE::d > acceleration,
Vector< T, utilities::dimensions::convert< PARTICLETYPE::d >::rotation > angularAcceleration )

Definition at line 122 of file particleMotionFunctions.h.

125{
126 //Calculate squared time step
127 T delTime2 = delTime*delTime;
128 //Calculate cartesian directions
129 velocityVerletTranslation( particle, delTime, delTime2, acceleration );
130 //Calculate rotational directions
131 if constexpr ( access::providesSurface<PARTICLETYPE>() ) {
132 velocityVerletRotation( particle, delTime, delTime2, angularAcceleration );
133 }
134}
void velocityVerletTranslation(Particle< T, PARTICLETYPE > &particle, T delTime, T delTime2, Vector< T, PARTICLETYPE::d > acceleration)
void velocityVerletRotation(Particle< T, PARTICLETYPE > &particle, T delTime, T delTime2, Vector< T, utilities::dimensions::convert< PARTICLETYPE::d >::rotation > angularAcceleration)

References velocityVerletRotation(), and velocityVerletTranslation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ velocityVerletRotation()

template<typename T , typename PARTICLETYPE >
void olb::particles::dynamics::velocityVerletRotation ( Particle< T, PARTICLETYPE > & particle,
T delTime,
T delTime2,
Vector< T, utilities::dimensions::convert< PARTICLETYPE::d >::rotation > angularAcceleration )

Definition at line 67 of file particleMotionFunctions.h.

69{
70 using namespace descriptors;
71 constexpr unsigned D = PARTICLETYPE::d;
72 constexpr unsigned Drot = utilities::dimensions::convert<D>::rotation;
73 //Check field existence
74 static_assert(PARTICLETYPE::template providesNested<SURFACE,ANGLE>(), "Field SURFACE:ANGLE has to be provided");
75 static_assert(PARTICLETYPE::template providesNested<MOBILITY,ANG_VELOCITY>(), "Field MOBILITY:ANG_VELOCITY has to be provided");
76 static_assert(PARTICLETYPE::template providesNested<MOBILITY,ANG_ACC_STRD>(), "Field MOBILITY:ANG_ACC_STRD has to be provided");
77 //Calculate quantities
78 Vector<T,Drot> angle( particle.template getField<SURFACE,ANGLE>()
79 + particle.template getField<MOBILITY,ANG_VELOCITY>() * delTime
80 + (0.5 * particle.template getField<MOBILITY,ANG_ACC_STRD>() * delTime2) );
81 Vector<T,Drot> avgAngularAcceleration( .5*(particle.template getField<MOBILITY,ANG_ACC_STRD>() + angularAcceleration) );
82 Vector<T,Drot> angularVelocity( particle.template getField<MOBILITY,ANG_VELOCITY>() + avgAngularAcceleration * delTime );
83 //Treat full rotation
84 angle = util::fmod( angle, 2.*M_PI );
85 //Update values
86 particle.template setField<SURFACE,ANGLE>(
88 particle.template setField<MOBILITY,ANG_VELOCITY>(
90 particle.template setField<MOBILITY,ANG_ACC_STRD>(
92
93}
#define M_PI

References olb::util::fmod(), and M_PI.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ velocityVerletRotor()

template<typename T , typename PARTICLETYPE >
void olb::particles::dynamics::velocityVerletRotor ( Particle< T, PARTICLETYPE > & particle,
T delTime,
Vector< T, PARTICLETYPE::d > angVel )

Definition at line 96 of file particleMotionFunctions.h.

97{
98 using namespace descriptors;
99 constexpr unsigned D = PARTICLETYPE::d;
100 constexpr unsigned Drot = utilities::dimensions::convert<D>::rotation;
101 //Check field existence
102 static_assert(PARTICLETYPE::template providesNested<SURFACE,ANGLE>(), "Field SURFACE:ANGLE has to be provided");
103 static_assert(PARTICLETYPE::template providesNested<MOBILITY,ANG_VELOCITY>(), "Field MOBILITY:ANG_VELOCITY has to be provided");
104 static_assert(PARTICLETYPE::template providesNested<MOBILITY,ANG_ACC_STRD>(), "Field MOBILITY:ANG_ACC_STRD has to be provided");
105 //Calculate quantities
106 Vector<T,Drot> angle( particle.template getField<SURFACE,ANGLE>() + angVel * delTime);
107 Vector<T,Drot> avgAngularAcceleration({0.});
108 Vector<T,Drot> angularVelocity( angVel );
109 //Treat full rotation
110 angle = util::fmod( angle, 2.*M_PI );
111 //Update values
112 particle.template setField<SURFACE,ANGLE>(
114 particle.template setField<MOBILITY,ANG_VELOCITY>(
116 particle.template setField<MOBILITY,ANG_ACC_STRD>(
118
119}

References olb::util::fmod(), and M_PI.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ velocityVerletTranslation()

template<typename T , typename PARTICLETYPE >
void olb::particles::dynamics::velocityVerletTranslation ( Particle< T, PARTICLETYPE > & particle,
T delTime,
T delTime2,
Vector< T, PARTICLETYPE::d > acceleration )

Definition at line 45 of file particleMotionFunctions.h.

47{
48 using namespace descriptors;
49 constexpr unsigned D = PARTICLETYPE::d;
50 //Check field existence
51 static_assert(PARTICLETYPE::template providesNested<GENERAL,POSITION>(), "Field POSITION has to be provided");
52 static_assert(PARTICLETYPE::template providesNested<MOBILITY,VELOCITY>(), "Field VELOCITY has to be provided");
53 static_assert(PARTICLETYPE::template providesNested<MOBILITY,ACCELERATION_STRD>(), "Field ACCELERATION_STRD has to be provided");
54 //Calculate quantities
55 Vector<T,D> position( particle.template getField<GENERAL,POSITION>()
56 + particle.template getField<MOBILITY,VELOCITY>() * delTime
57 + (0.5 * particle.template getField<MOBILITY,ACCELERATION_STRD>() * delTime2) );
58 Vector<T,D> avgAcceleration( .5*(particle.template getField<MOBILITY,ACCELERATION_STRD>() + acceleration) );
59 Vector<T,D> velocity( particle.template getField<MOBILITY,VELOCITY>() + avgAcceleration * delTime );
60 //Update values
61 particle.template setField<GENERAL,POSITION>( position );
62 particle.template setField<MOBILITY,VELOCITY>( velocity );
63 particle.template setField<MOBILITY,ACCELERATION_STRD>( acceleration );
64}
+ Here is the caller graph for this function: