OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
olb::StokesDragForce3D< T, PARTICLETYPE, DESCRIPTOR > Class Template Reference

#include <stokesDragForce3D.h>

+ Inheritance diagram for olb::StokesDragForce3D< T, PARTICLETYPE, DESCRIPTOR >:
+ Collaboration diagram for olb::StokesDragForce3D< T, PARTICLETYPE, DESCRIPTOR >:

Public Member Functions

 StokesDragForce3D (SuperLatticeInterpPhysVelocity3D< T, DESCRIPTOR > &getVel, T dT, T mu)
 Constructor, FluidVelocity, physicalTimeStep, physicalDynamicViscosity.
 
 StokesDragForce3D (SuperLatticeInterpPhysVelocity3D< T, DESCRIPTOR > &getVel, UnitConverter< T, DESCRIPTOR > const &converter)
 Constructor using values from converter.
 
 StokesDragForce3D (SuperLatticeInterpPhysVelocity3D< T, DESCRIPTOR > &getVel, UnitConverter< T, DESCRIPTOR > const &converter, T scaleFactor)
 Constructor using values from converter.
 
 ~StokesDragForce3D () override
 Destructor.
 
void applyForce (typename std::deque< PARTICLETYPE< T > >::iterator p, int pInt, ParticleSystem3D< T, PARTICLETYPE > &psSys) override
 6 Pi r mu (u_f-u_p)
 
void computeForce (int pInt, ParticleSystem3D< T, PARTICLETYPE > *psSys, T force[3])
 Compute Force for subgrid scale particles.
 
- Public Member Functions inherited from olb::Force3D< T, PARTICLETYPE >
 Force3D ()
 
 Force3D (Force3D< T, PARTICLETYPE > &)
 
 Force3D (const Force3D< T, PARTICLETYPE > &)
 
virtual ~Force3D ()
 

Additional Inherited Members

- Protected Attributes inherited from olb::Force3D< T, PARTICLETYPE >
OstreamManager clout
 

Detailed Description

template<typename T, template< typename U > class PARTICLETYPE, typename DESCRIPTOR>
class olb::StokesDragForce3D< T, PARTICLETYPE, DESCRIPTOR >

Definition at line 44 of file stokesDragForce3D.h.

Constructor & Destructor Documentation

◆ StokesDragForce3D() [1/3]

template<typename T , template< typename U > class PARTICLETYPE, typename DESCRIPTOR >
olb::StokesDragForce3D< T, PARTICLETYPE, DESCRIPTOR >::StokesDragForce3D ( SuperLatticeInterpPhysVelocity3D< T, DESCRIPTOR > & getVel,
T dT,
T mu )

Constructor, FluidVelocity, physicalTimeStep, physicalDynamicViscosity.

Definition at line 37 of file stokesDragForce3D.hh.

38 : Force3D<T, PARTICLETYPE>(),
39 _getVel(getVel),
40 _mu(mu)
41{
42 _C1 = 6. * M_PI * _mu * dT ;
43 _dTinv = 1. / dT;
44 _scaleFactor = 1.;
45}
#define M_PI

References M_PI.

◆ StokesDragForce3D() [2/3]

template<typename T , template< typename U > class PARTICLETYPE, typename DESCRIPTOR >
olb::StokesDragForce3D< T, PARTICLETYPE, DESCRIPTOR >::StokesDragForce3D ( SuperLatticeInterpPhysVelocity3D< T, DESCRIPTOR > & getVel,
UnitConverter< T, DESCRIPTOR > const & converter )

Constructor using values from converter.

Definition at line 48 of file stokesDragForce3D.hh.

49 : Force3D<T, PARTICLETYPE>(),
50 _getVel(getVel)
51{
52 //implicit formulation
53 _C1 = 6. * M_PI * converter.getPhysViscosity() * converter.getPhysDensity() * converter.getConversionFactorTime();
54 _mu = converter.getPhysViscosity() * converter.getPhysDensity();
55 // explicit formulation
56 // _C1 = 6. * M_PI * converter.getDynamicViscosity();
57 _dTinv = 1. / converter.getConversionFactorTime();
58 _scaleFactor = 1. ;
59}

References olb::UnitConverter< T, DESCRIPTOR >::getConversionFactorTime(), olb::UnitConverter< T, DESCRIPTOR >::getPhysDensity(), olb::UnitConverter< T, DESCRIPTOR >::getPhysViscosity(), and M_PI.

+ Here is the call graph for this function:

◆ StokesDragForce3D() [3/3]

template<typename T , template< typename U > class PARTICLETYPE, typename DESCRIPTOR >
olb::StokesDragForce3D< T, PARTICLETYPE, DESCRIPTOR >::StokesDragForce3D ( SuperLatticeInterpPhysVelocity3D< T, DESCRIPTOR > & getVel,
UnitConverter< T, DESCRIPTOR > const & converter,
T scaleFactor )

Constructor using values from converter.

Definition at line 62 of file stokesDragForce3D.hh.

63 : Force3D<T, PARTICLETYPE>(),
64 _getVel(getVel),
65 _scaleFactor(scaleFactor)
66{
67 //implicit formulation
68 _C1 = 6. * M_PI * converter.getPhysViscosity() * converter.getPhysDensity() * converter.getConversionFactorTime();
69 _mu = converter.getPhysViscosity() * converter.getPhysDensity();
70 // explicit formulation
71 // _C1 = 6. * M_PI * converter.getDynamicViscosity();
72 _dTinv = 1. / converter.getConversionFactorTime();
73}

References olb::UnitConverter< T, DESCRIPTOR >::getConversionFactorTime(), olb::UnitConverter< T, DESCRIPTOR >::getPhysDensity(), olb::UnitConverter< T, DESCRIPTOR >::getPhysViscosity(), and M_PI.

+ Here is the call graph for this function:

◆ ~StokesDragForce3D()

template<typename T , template< typename U > class PARTICLETYPE, typename DESCRIPTOR >
olb::StokesDragForce3D< T, PARTICLETYPE, DESCRIPTOR >::~StokesDragForce3D ( )
inlineoverride

Destructor.

Definition at line 54 of file stokesDragForce3D.h.

54{}

Member Function Documentation

◆ applyForce()

template<typename T , template< typename U > class PARTICLETYPE, typename DESCRIPTOR >
void olb::StokesDragForce3D< T, PARTICLETYPE, DESCRIPTOR >::applyForce ( typename std::deque< PARTICLETYPE< T > >::iterator p,
int pInt,
ParticleSystem3D< T, PARTICLETYPE > & psSys )
overridevirtual

6 Pi r mu (u_f-u_p)

Implements olb::Force3D< T, PARTICLETYPE >.

Definition at line 77 of file stokesDragForce3D.hh.

80{
81 T fluidVel[3] = {0., 0., 0.};
82
83 //implicit formulation
84 _getVel(fluidVel, &p->getPos()[0], p->getCuboid());
85 fluidVel[0] *= _scaleFactor;
86 fluidVel[1] *= _scaleFactor;
87 fluidVel[2] *= _scaleFactor;
88
89 T c = _C1 * p->getRad() * p->getInvMass();
90 T C2 = 1. / (1. + c);
91
92 // p->getVel() is particle velocity of the last time step
93 // formulation of new force with particle velocity of the last time step with
94 // implicit Euler
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]);
101}
platform_constant int c[Q][D]

◆ computeForce()

template<typename T , template< typename U > class PARTICLETYPE, typename DESCRIPTOR >
void olb::StokesDragForce3D< T, PARTICLETYPE, DESCRIPTOR >::computeForce ( int pInt,
ParticleSystem3D< T, PARTICLETYPE > * psSys,
T force[3] )

Compute Force for subgrid scale particles.

Definition at line 104 of file stokesDragForce3D.hh.

106{
107 T fluidVel[3] = {0., 0., 0.};
108
109 _getVel(fluidVel, &psSys->operator[](pInt).getPos()[0], psSys->operator[](pInt).getCuboid());
110
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]);
118}
T getMass(Particle< T, PARTICLETYPE > particle, T shapeFactor=T{1})

The documentation for this class was generated from the following files: