OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::opti::dualLbMomentaHelpers< DESCRIPTOR > Struct Template Reference

#include <dualLbHelpers.h>

+ Collaboration diagram for olb::opti::dualLbMomentaHelpers< DESCRIPTOR >:

Static Public Member Functions

template<concepts::MinimalCell CELL, typename V = typename CELL::value_t>
static V dRhoDf (CELL &cell, int jPop) any_platform
 derive rho by population component
 
template<concepts::MinimalCell CELL, typename DJDF , typename V = typename CELL::value_t>
static void dJDf (CELL &cell, DJDF &djdf, int jPop) any_platform
 derive momentum j by population component
 
template<concepts::MinimalCell CELL, typename DUDF , typename V = typename CELL::value_t>
static void dUDf (CELL &cell, DUDF &dudf, int jPop) any_platform
 derive velocity u by population component
 
template<concepts::MinimalCell CELL, typename DPIDF , typename V = typename CELL::value_t>
static void dPiDf (CELL &cell, DPIDF &dpidf, int jPop) any_platform
 derive stress pi by population component
 

Detailed Description

template<typename DESCRIPTOR>
struct olb::opti::dualLbMomentaHelpers< DESCRIPTOR >

Definition at line 98 of file dualLbHelpers.h.

Member Function Documentation

◆ dJDf()

template<typename DESCRIPTOR >
template<concepts::MinimalCell CELL, typename DJDF , typename V = typename CELL::value_t>
static void olb::opti::dualLbMomentaHelpers< DESCRIPTOR >::dJDf ( CELL & cell,
DJDF & djdf,
int jPop )
inlinestatic

derive momentum j by population component

Definition at line 109 of file dualLbHelpers.h.

110 {
111 for (int iD=0; iD < DESCRIPTOR::d; ++iD) {
112 djdf[iD] = descriptors::c<DESCRIPTOR>(jPop,iD);
113 }
114 }
constexpr int c(unsigned iPop, unsigned iDim) any_platform
Definition functions.h:83

References olb::descriptors::c().

+ Here is the call graph for this function:

◆ dPiDf()

template<typename DESCRIPTOR >
template<concepts::MinimalCell CELL, typename DPIDF , typename V = typename CELL::value_t>
static void olb::opti::dualLbMomentaHelpers< DESCRIPTOR >::dPiDf ( CELL & cell,
DPIDF & dpidf,
int jPop )
inlinestatic

derive stress pi by population component

Definition at line 129 of file dualLbHelpers.h.

130 {
131 V rho, u[DESCRIPTOR::d];
132 lbm<DESCRIPTOR>::computeRhoU(cell, rho, u);
133
134 int iPi = 0;
135 for (int iAlpha=0; iAlpha < DESCRIPTOR::d; ++iAlpha) {
136 for (int iBeta=iAlpha; iBeta < DESCRIPTOR::d; ++iBeta) {
137 dpidf[iPi] = descriptors::c<DESCRIPTOR>(jPop,iAlpha) * descriptors::c<DESCRIPTOR>(jPop,iBeta)
138 - descriptors::c<DESCRIPTOR>(jPop,iAlpha) * u[iBeta]
139 - u[iAlpha] * (descriptors::c<DESCRIPTOR>(jPop,iBeta) - u[iBeta]);
140 if (iAlpha==iBeta) {
141 dpidf[iPi] -= V{1} / descriptors::invCs2<V,DESCRIPTOR>();
142 }
143 ++iPi;
144 }
145 }
146 }
constexpr T invCs2() any_platform
Definition functions.h:107
static void computeRhoU(CELL &cell, RHO &rho, U &u) any_platform
Computation of hydrodynamic variables.
Definition lbm.h:301

References olb::descriptors::c(), olb::lbm< DESCRIPTOR >::computeRhoU(), and olb::descriptors::invCs2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dRhoDf()

template<typename DESCRIPTOR >
template<concepts::MinimalCell CELL, typename V = typename CELL::value_t>
static V olb::opti::dualLbMomentaHelpers< DESCRIPTOR >::dRhoDf ( CELL & cell,
int jPop )
inlinestatic

derive rho by population component

Definition at line 102 of file dualLbHelpers.h.

103 {
104 return V{1};
105 }

◆ dUDf()

template<typename DESCRIPTOR >
template<concepts::MinimalCell CELL, typename DUDF , typename V = typename CELL::value_t>
static void olb::opti::dualLbMomentaHelpers< DESCRIPTOR >::dUDf ( CELL & cell,
DUDF & dudf,
int jPop )
inlinestatic

derive velocity u by population component

Definition at line 118 of file dualLbHelpers.h.

119 {
120 V rho, u[DESCRIPTOR::d];
121 lbm<DESCRIPTOR>::computeRhoU(cell, rho, u);
122 for (int iD=0; iD < DESCRIPTOR::d; ++iD) {
123 dudf[iD] = (descriptors::c<DESCRIPTOR>(jPop,iD) - u[iD]) / rho;
124 }
125 }

References olb::descriptors::c(), and olb::lbm< DESCRIPTOR >::computeRhoU().

+ Here is the call graph for this function:

The documentation for this struct was generated from the following file: