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

#include <buoyancyForce3D.h>

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

Public Member Functions

 BuoyancyForce3D (UnitConverter< T, DESCRIPTOR > const &converter, std::vector< T > direction, T g=9.81)
 
 ~BuoyancyForce3D () override
 
void applyForce (typename std::deque< PARTICLETYPE< T > >::iterator p, int pInt, ParticleSystem3D< T, PARTICLETYPE > &psSys) override
 
- 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::BuoyancyForce3D< T, PARTICLETYPE, DESCRIPTOR >

Definition at line 39 of file buoyancyForce3D.h.

Constructor & Destructor Documentation

◆ BuoyancyForce3D()

template<typename T , template< typename U > class PARTICLETYPE, typename DESCRIPTOR >
olb::BuoyancyForce3D< T, PARTICLETYPE, DESCRIPTOR >::BuoyancyForce3D ( UnitConverter< T, DESCRIPTOR > const & converter,
std::vector< T > direction,
T g = 9.81 )

Definition at line 37 of file buoyancyForce3D.hh.

39 :
40 Force3D<T, PARTICLETYPE>(),
41 _direction(direction), _g(g), _physDensity(converter.getPhysDensity() )
42{
43 T directionNorm = util::sqrt(
44 util::pow(_direction[0], 2.) + util::pow(_direction[1], 2.)
45 + util::pow(_direction[2], 2.));
46 for (int i = 0; i < 3; ++i) {
47 _direction[i] /= directionNorm;
48 }
49}
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100
cpu::simd::Pack< T > pow(cpu::simd::Pack< T > base, cpu::simd::Pack< T > exp)
Definition pack.h:112

References olb::util::pow(), and olb::util::sqrt().

+ Here is the call graph for this function:

◆ ~BuoyancyForce3D()

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

Definition at line 44 of file buoyancyForce3D.h.

44{ };

Member Function Documentation

◆ applyForce()

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

Implements olb::Force3D< T, PARTICLETYPE >.

Definition at line 52 of file buoyancyForce3D.hh.

55{
56 // weight force of fluid in similar volume like particle that replaces the fluid
57 // acts in direction opposite to weight force of particle
58
59 T factor = 4. / 3. * M_PI * util::pow(p->getRad(), 3) * _g
60 * _physDensity;
61 for (int j = 0; j < 3; ++j) {
62 p->getForce()[j] -= factor * _direction[j];
63 }
64}
#define M_PI

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

+ Here is the call graph for this function:

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