24#ifndef STOKESDRAGFORCE_3D_HH
25#define STOKESDRAGFORCE_3D_HH
31#define M_PI 3.14159265358979323846
36template<
typename T,
template<
typename U>
class PARTICLETYPE,
typename DESCRIPTOR>
42 _C1 = 6. *
M_PI * _mu * dT ;
47template<
typename T,
template<
typename U>
class PARTICLETYPE,
typename DESCRIPTOR>
61template<
typename T,
template<
typename U>
class PARTICLETYPE,
typename DESCRIPTOR>
65 _scaleFactor(scaleFactor)
76template<
typename T,
template<
typename U>
class PARTICLETYPE,
typename DESCRIPTOR>
78 typename std::deque<PARTICLETYPE<T> >::iterator p,
int pInt,
81 T fluidVel[3] = {0., 0., 0.};
84 _getVel(fluidVel, &p->getPos()[0], p->getCuboid());
85 fluidVel[0] *= _scaleFactor;
86 fluidVel[1] *= _scaleFactor;
87 fluidVel[2] *= _scaleFactor;
89 T c = _C1 * p->getRad() * p->getInvMass();
95 p->getForce()[0] += p->getMass() * _dTinv
96 * ((c * fluidVel[0] + p->getVel()[0]) * C2 - p->getVel()[0]);
97 p->getForce()[1] += p->getMass() * _dTinv
98 * ((c * fluidVel[1] + p->getVel()[1]) * C2 - p->getVel()[1]);
99 p->getForce()[2] += p->getMass() * _dTinv
100 * ((c * fluidVel[2] + p->getVel()[2]) * C2 - p->getVel()[2]);
103template<
typename T,
template<
typename U>
class PARTICLETYPE,
typename DESCRIPTOR>
107 T fluidVel[3] = {0., 0., 0.};
109 _getVel(fluidVel, &psSys->operator[](pInt).getPos()[0], psSys->operator[](pInt).getCuboid());
111 T c = _C1 * psSys->operator[](pInt).getRad() * psSys->operator[](pInt).getInvMass();
112 T C2 = 1. / (1. + c);
113 T mass = psSys->operator[](pInt).getMass();
114 std::vector<T> vel = psSys->operator[](pInt).getVel();
115 force[0] = mass * _dTinv * ((c * fluidVel[0] + vel[0]) * C2 - vel[0]);
116 force[1] = mass * _dTinv * ((c * fluidVel[1] + vel[1]) * C2 - vel[1]);
117 force[2] = mass * _dTinv * ((c * fluidVel[2] + vel[2]) * C2 - vel[2]);
Prototype for all particle forces.
StokesDragForce3D(SuperLatticeInterpPhysVelocity3D< T, DESCRIPTOR > &getVel, T dT, T mu)
Constructor, FluidVelocity, physicalTimeStep, physicalDynamicViscosity.
void computeForce(int pInt, ParticleSystem3D< T, PARTICLETYPE > *psSys, T force[3])
Compute Force for subgrid scale particles.
void applyForce(typename std::deque< PARTICLETYPE< T > >::iterator p, int pInt, ParticleSystem3D< T, PARTICLETYPE > &psSys) override
6 Pi r mu (u_f-u_p)
Conversion between physical and lattice units, as well as discretization.
constexpr T getPhysDensity() const
return density in physical units
constexpr T getPhysViscosity() const
return viscosity in physical units
constexpr T getConversionFactorTime() const
access (read-only) to private member variable
Top level namespace for all of OpenLB.