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

#include <latticeTranCongDragForce.h>

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

Public Member Functions

 BlockLatticeTranCongDragForce (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::BlockLatticeTranCongDragForce< T, DESCRIPTOR, PARTICLETYPE >

Definition at line 47 of file latticeTranCongDragForce.h.

Constructor & Destructor Documentation

◆ BlockLatticeTranCongDragForce()

template<typename T , typename DESCRIPTOR , typename PARTICLETYPE >
olb::BlockLatticeTranCongDragForce< T, DESCRIPTOR, PARTICLETYPE >::BlockLatticeTranCongDragForce ( 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 31 of file latticeTranCongDragForce.hh.

39 : BlockLatticePhysF<T,DESCRIPTOR>(blockLattice, converter,
40 (DESCRIPTOR::d)*(particleSystem.size()-iP0)),
41 _blockGeometry(blockGeometry), _blockLattice(blockLattice),
42 _particleSystem(particleSystem),
43 _cellMin(cellMin), _cellMax(cellMax),_periodic(periodic), _iP0(iP0)
44{
45 this->getName() = "physTranCongDragForce";
46}
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::BlockLatticeTranCongDragForce< T, DESCRIPTOR, PARTICLETYPE >::evaluate ( T output[],
particles::Particle< T, PARTICLETYPE > & particle,
int iP )

Definition at line 49 of file latticeTranCongDragForce.hh.

50{
51 constexpr unsigned Dd = DESCRIPTOR::d;
52 const int serialSize = Dd;
53 using namespace descriptors;
54 static_assert(PARTICLETYPE::template providesNested<MOBILITY, FLUIDVEL>(), "Field MOBILITY:FLUIDVEL has to be provided");
55
56 //Retrieve particle quantities
57 Vector<T,Dd> position = particle.template getField<GENERAL,POSITION>();
58 Vector<T,Dd> velocity = particle.template getField<MOBILITY,VELOCITY>();
59 T radius = particle.template getField<PHYSPROPERTIES,RADIUS>();
60 T mass = particle.template getField<PHYSPROPERTIES,MASS>();
61 T* positionArray = position.data();
62
63 //TODO: check, whether creation can be avoided by using a second _blockF list
64 const auto& cuboid = _blockGeometry.getCuboid();
66 _blockLattice, this->_converter, cuboid);
67
68 //Calculate general constants
69 T part_density = particle.template getField<PHYSPROPERTIES,DENSITY>();;
70
71 T fluidVelArray[Dd] = {0.};
72
73 //Check whether inside cuboid (when not parallelized)
74 bool inside = true;
76 inside = cuboid.isInside(position);
77 }
78 if (inside){
79
80 //Retrieve interpolated velocity at position
81 blockInterpPhysVelF(fluidVelArray, positionArray);
82 particle.template setField<MOBILITY, FLUIDVEL>(fluidVelArray);
83 T relVel = util::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]));
84
85 Vector<T,Dd> direction ((velocity[0]-fluidVelArray[0])/relVel,(velocity[1]-fluidVelArray[1])/relVel,(velocity[2]-fluidVelArray[2])/relVel);
86 T Re_p = relVel*2*radius/this->_converter.getPhysViscosity();//needed
87 T C_d;
88 if (Re_p < 0.000001)
89 C_d = 0.;
90 else
91 C_d = 24./Re_p*particle.template getField<NUMERICPROPERTIES, DA_DN>()*(1.+0.15/util::sqrt(particle.template getField<NUMERICPROPERTIES,CIRCULARITY>())*util::pow(particle.template getField<NUMERICPROPERTIES, DA_DN>()*Re_p,0.687))+
92 (0.42*particle.template getField<NUMERICPROPERTIES, DA_DN>()*particle.template getField<NUMERICPROPERTIES, DA_DN>())/(util::sqrt(particle.template getField<NUMERICPROPERTIES, CIRCULARITY>())*(1+4.25*10000*util::pow(particle.template getField<NUMERICPROPERTIES,DA_DN>()*Re_p,-1.16)));
93
94
95 //Calculate TranCong force
96 T tmpForce[Dd] = {0.};
97 for (int iDim = 0; iDim < PARTICLETYPE::d; ++iDim) {
98 tmpForce[iDim] =-C_d*particle.template getField<NUMERICPROPERTIES, PROJECTED_SURFACE>()*this->_converter.getPhysDensity()*relVel*relVel*direction[iDim];
99
100 }
101 particle.template setField<FORCING,FORCE> (tmpForce);
102 }
103}
Cuboid< T, D > & getCuboid()
constexpr bool providesParallelization()
Provides group PARALLELIZATION.
Expr sqrt(Expr x)
Definition expr.cpp:225
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(), olb::particles::access::providesParallelization(), and olb::util::sqrt().

+ Here is the call graph for this function:

◆ operator()()

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

Definition at line 108 of file latticeTranCongDragForce.hh.

109{
110 using namespace descriptors;
111 using namespace particles;
112 // iterate over all particles in _indicator //TODO: add periodic treatment analogous to momentum exchange
113
114 forParticlesInParticleSystem<T,PARTICLETYPE,conditions::valid_particles>( _particleSystem,
115 [&](Particle<T,PARTICLETYPE>& particle){
116
117 evaluate(output, particle, particle.getId());
118
119
120 });
121 return true;
122}
void evaluate(T output[], particles::Particle< T, PARTICLETYPE > &particle, int iP)

Member Data Documentation

◆ serializeForce

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

Definition at line 67 of file latticeTranCongDragForce.h.


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