OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::opti::BlockLatticeDphysDissipationDf< T, DESCRIPTOR > Class Template Reference

functor to get the pointwise dual dissipation density on local lattices, if globIC is not on the local processor, the returned vector is empty More...

#include <dualFunctors3D.h>

+ Inheritance diagram for olb::opti::BlockLatticeDphysDissipationDf< T, DESCRIPTOR >:
+ Collaboration diagram for olb::opti::BlockLatticeDphysDissipationDf< T, DESCRIPTOR >:

Public Member Functions

 BlockLatticeDphysDissipationDf (BlockLattice< T, DESCRIPTOR > &blockLattice, int overlap, const UnitConverter< T, DESCRIPTOR > &converter)
 
bool operator() (T output[], const int input[])
 

Protected Attributes

const int _overlap
 
const UnitConverter< T, DESCRIPTOR > & _converter
 

Detailed Description

template<typename T, typename DESCRIPTOR>
class olb::opti::BlockLatticeDphysDissipationDf< T, DESCRIPTOR >

functor to get the pointwise dual dissipation density on local lattices, if globIC is not on the local processor, the returned vector is empty

Definition at line 39 of file dualFunctors3D.h.

Constructor & Destructor Documentation

◆ BlockLatticeDphysDissipationDf()

template<typename T , typename DESCRIPTOR >
olb::opti::BlockLatticeDphysDissipationDf< T, DESCRIPTOR >::BlockLatticeDphysDissipationDf ( BlockLattice< T, DESCRIPTOR > & blockLattice,
int overlap,
const UnitConverter< T, DESCRIPTOR > & converter )

Definition at line 40 of file dualFunctors3D.hh.

44 : BlockLatticeF<T,DESCRIPTOR>(blockLattice,DESCRIPTOR::q),
45 _overlap(overlap),
46 _converter(converter)
47{
48 this->getName() = "dPhysDissipationDf";
49}
const UnitConverter< T, DESCRIPTOR > & _converter
std::conditional_t< DESCRIPTOR::d==2, BlockLatticeF2D< T, DESCRIPTOR >, BlockLatticeF3D< T, DESCRIPTOR > > BlockLatticeF
Definition aliases.h:147
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

◆ operator()()

template<typename T , typename DESCRIPTOR >
bool olb::opti::BlockLatticeDphysDissipationDf< T, DESCRIPTOR >::operator() ( T output[],
const int input[] )

Definition at line 52 of file dualFunctors3D.hh.

53{
54 const T omega = _converter.getLatticeRelaxationFrequency();
55 const T dt = _converter.getConversionFactorTime();
56
57 T rho, u[DESCRIPTOR::d], pi[util::TensorVal<DESCRIPTOR >::n];
58 auto cell = this->_blockLattice.get(latticeR);
59 cell.computeAllMomenta(rho, u, pi);
60
61 for (int jPop=0; jPop < DESCRIPTOR::q; ++jPop) {
62 dDdf[jPop] = T();
65 for (int iAlpha=0; iAlpha < DESCRIPTOR::d; ++iAlpha) {
66 for (int iBeta=0; iBeta < DESCRIPTOR::d; ++iBeta) {
67 const int iPi = util::serialSymmetricTensorIndex<DESCRIPTOR::d>(iAlpha, iBeta);
68 dDdf[jPop] += pi[iPi] * dpidf[iPi] - pi[iPi] * pi[iPi] / rho;
69 }
70 }
71 dDdf[jPop] *= T(2)*util::pow(omega*descriptors::invCs2<T,DESCRIPTOR>()/rho,2)/2.*_converter.getPhysViscosity()/dt/dt;
72 }
73 return true;
74}
constexpr T invCs2() any_platform
Definition functions.h:107
Expr pow(Expr base, Expr exp)
Definition expr.cpp:235
unsigned serialSymmetricTensorIndex(unsigned i, unsigned j) any_platform
Compute serial index of symmetric tensor.
static void dPiDf(CELL &cell, DPIDF &dpidf, int jPop) any_platform
derive stress pi by population component
static constexpr int n
result stored in n
Definition util.h:217

References olb::opti::dualLbMomentaHelpers< DESCRIPTOR >::dPiDf(), olb::descriptors::invCs2(), olb::util::pow(), and olb::util::serialSymmetricTensorIndex().

+ Here is the call graph for this function:

Member Data Documentation

◆ _converter

template<typename T , typename DESCRIPTOR >
const UnitConverter<T,DESCRIPTOR>& olb::opti::BlockLatticeDphysDissipationDf< T, DESCRIPTOR >::_converter
protected

Definition at line 42 of file dualFunctors3D.h.

◆ _overlap

template<typename T , typename DESCRIPTOR >
const int olb::opti::BlockLatticeDphysDissipationDf< T, DESCRIPTOR >::_overlap
protected

Definition at line 41 of file dualFunctors3D.h.


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