OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::BlockLatticeHaiderLevenspielDragForce< T, DESCRIPTOR, PARTICLETYPE > Class Template Referencefinal

#include <latticeHaiderLevenspielDragForce.h>

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

Public Member Functions

 BlockLatticeHaiderLevenspielDragForce (BlockLattice< T, DESCRIPTOR > &blockLattice, const BlockGeometry< T, DESCRIPTOR::d > &blockGeometry, particles::ParticleSystem< T, PARTICLETYPE > &particleSystem, const UnitConverter< T, DESCRIPTOR > &converter, PhysR< T, DESCRIPTOR::d > cellMin=PhysR< T, DESCRIPTOR::d >(0.), PhysR< T, DESCRIPTOR::d > cellMax=PhysR< T, DESCRIPTOR::d >(0.), Vector< bool, DESCRIPTOR::d > periodic=Vector< bool, DESCRIPTOR::d >(false), std::size_t iP0=0)
 
void evaluate (T output[], particles::Particle< T, PARTICLETYPE > &particle, int iP)
 
bool operator() (T output[], const int input[]) override
 

Static Public Attributes

static constexpr bool serializeForce = false
 

Detailed Description

template<typename T, typename DESCRIPTOR, typename PARTICLETYPE>
class olb::BlockLatticeHaiderLevenspielDragForce< T, DESCRIPTOR, PARTICLETYPE >

Definition at line 49 of file latticeHaiderLevenspielDragForce.h.

Constructor & Destructor Documentation

◆ BlockLatticeHaiderLevenspielDragForce()

template<typename T , typename DESCRIPTOR , typename PARTICLETYPE >
olb::BlockLatticeHaiderLevenspielDragForce< T, DESCRIPTOR, PARTICLETYPE >::BlockLatticeHaiderLevenspielDragForce ( BlockLattice< T, DESCRIPTOR > & blockLattice,
const BlockGeometry< T, DESCRIPTOR::d > & blockGeometry,
particles::ParticleSystem< T, PARTICLETYPE > & particleSystem,
const UnitConverter< T, DESCRIPTOR > & converter,
PhysR< T, DESCRIPTOR::d > cellMin = PhysR<T,DESCRIPTOR::d> (0.),
PhysR< T, DESCRIPTOR::d > cellMax = PhysR<T,DESCRIPTOR::d> (0.),
Vector< bool, DESCRIPTOR::d > periodic = Vector<bool,DESCRIPTOR::d> (false),
std::size_t iP0 = 0 )

Definition at line 32 of file latticeHaiderLevenspielDragForce.hh.

40 : BlockLatticePhysF<T,DESCRIPTOR>(blockLattice, converter,
41 (DESCRIPTOR::d)*(particleSystem.size()-iP0)),
42 _blockGeometry(blockGeometry), _blockLattice(blockLattice),
43 _particleSystem(particleSystem),
44 _cellMin(cellMin), _cellMax(cellMax), _periodic(periodic), _iP0(iP0)
45{
46 this->getName() = "physHaiderLevenspielDragForce";
47}
std::conditional_t< DESCRIPTOR::d==2, BlockLatticePhysF2D< T, DESCRIPTOR >, BlockLatticePhysF3D< T, DESCRIPTOR > > BlockLatticePhysF
Definition aliases.h:328
std::string getName(OperatorScope scope)
Returns human-readable name of scope.

References olb::getName().

+ Here is the call graph for this function:

Member Function Documentation

◆ evaluate()

template<typename T , typename DESCRIPTOR , typename PARTICLETYPE >
void olb::BlockLatticeHaiderLevenspielDragForce< T, DESCRIPTOR, PARTICLETYPE >::evaluate ( T output[],
particles::Particle< T, PARTICLETYPE > & particle,
int iP )

Definition at line 50 of file latticeHaiderLevenspielDragForce.hh.

51{
52 constexpr unsigned Dd = DESCRIPTOR::d;
53 const int serialSize = Dd;
54 using namespace descriptors;
55 using namespace Haider_Levenspiel;
56 static_assert(PARTICLETYPE::template providesNested<MOBILITY, FLUIDVEL>(), "Field MOBILITY:FLUIDVEL has to be provided");
57
58 //Retrieve particle quantities
59 Vector<T,Dd> position = particle.template getField<GENERAL,POSITION>();
60 Vector<T,Dd> velocity = particle.template getField<MOBILITY,VELOCITY>();
61 T radius = particle.template getField<PHYSPROPERTIES,RADIUS>();
62 T mass = particle.template getField<PHYSPROPERTIES,MASS>();
63 T* positionArray = position.data();
64
65 //TODO: check, whether creation can be avoided by using a second _blockF list
66 const auto& cuboid = _blockGeometry.getCuboid();
68 _blockLattice, this->_converter, cuboid);
69
70 //Calculate general constants
71 T part_density = particle.template getField<PHYSPROPERTIES,DENSITY>();;
72
73 T Coeff = 18* this->_converter.getPhysViscosity()*this->_converter.getPhysDensity()/(part_density*2*radius*2*radius);
74 //Calculate particle coefficiants
75 T fluidVelArray[Dd] = {0.};
76
77 //Check whether inside cuboid (when not parallelized)
78 bool inside = true;
80 inside = cuboid.isInside(position);
81 }
82 if (inside){
83 //Retrieve interpolated velocity at position
84 blockInterpPhysVelF(fluidVelArray, positionArray);
85 particle.template setField<MOBILITY, FLUIDVEL>(fluidVelArray);
86 T relVel = std::sqrt((velocity[0]-fluidVelArray[0])*(velocity[0]-fluidVelArray[0])+(velocity[1]-fluidVelArray[1])*(velocity[1]-fluidVelArray[1])+(velocity[2]-fluidVelArray[2])*(velocity[2]-fluidVelArray[2]));
87 T Re_p = relVel*2*radius/this->_converter.getPhysViscosity();
88 T C_d;
89 C_d = 24./Re_p*(1. + particle.template getField<NUMERICPROPERTIES,A>()*util::pow(Re_p, particle.template getField<NUMERICPROPERTIES,B>()))+ particle.template getField<NUMERICPROPERTIES,C>()/(1.+particle.template getField<NUMERICPROPERTIES,D>()/Re_p);
90 if (Re_p < 0.00000001)
91 C_d = 0.;
92 //Calculate HaiderLevenspiel force
93 T tmpForce[Dd] = {0.};
94 for (int iDim = 0; iDim < PARTICLETYPE::d; ++iDim) {
95 tmpForce[iDim] = C_d*Coeff*(fluidVelArray[iDim] - velocity[iDim])*mass/24.*Re_p;
96
97 }
98 particle.template setField<FORCING,FORCE> (tmpForce);
99
100 }
101}
Cuboid< T, D > & getCuboid()
constexpr bool providesParallelization()
Provides group PARALLELIZATION.
Expr pow(Expr base, Expr exp)
Definition expr.cpp:235
std::conditional_t< DESCRIPTOR::d==2, BlockLatticeInterpPhysVelocity2D< T, DESCRIPTOR >, BlockLatticeInterpPhysVelocity3D< T, DESCRIPTOR > > BlockLatticeInterpPhysVelocity
Definition aliases.h:349
Vector(T &&t, Ts &&... ts) -> Vector< std::remove_cvref_t< T >, 1+sizeof...(Ts)>

References olb::Vector< T, Size >::data(), olb::util::pow(), and olb::particles::access::providesParallelization().

+ Here is the call graph for this function:

◆ operator()()

template<typename T , typename DESCRIPTOR , typename PARTICLETYPE >
bool olb::BlockLatticeHaiderLevenspielDragForce< T, DESCRIPTOR, PARTICLETYPE >::operator() ( T output[],
const int input[] )
override

Definition at line 104 of file latticeHaiderLevenspielDragForce.hh.

105{
106 using namespace descriptors;
107 // iterate over all particles in _indicator //TODO: add periodic treatment analogous to momentum exchange
108 for (std::size_t iP=_iP0; iP!=_particleSystem.size(); iP++) {
109 auto particle = _particleSystem.get(iP);
110 evaluate(output, particle, iP);
111 }
112 return true;
113}
void evaluate(T output[], particles::Particle< T, PARTICLETYPE > &particle, int iP)

Member Data Documentation

◆ serializeForce

template<typename T , typename DESCRIPTOR , typename PARTICLETYPE >
bool olb::BlockLatticeHaiderLevenspielDragForce< T, DESCRIPTOR, PARTICLETYPE >::serializeForce = false
staticconstexpr

Definition at line 69 of file latticeHaiderLevenspielDragForce.h.


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