OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::momenta::MovingPorousStress< STRESS > Struct Template Reference

#include <elements.h>

+ Collaboration diagram for olb::momenta::MovingPorousStress< STRESS >:

Public Member Functions

template<typename TYPE , typename CELL , typename RHO , typename U , typename PI , typename V = typename CELL::value_t, typename DESCRIPTOR = typename CELL::descriptor_t>
void compute (CELL &cell, const RHO &rho, const U &u, PI &pi) any_platform
 

Static Public Member Functions

static std::string getName ()
 

Detailed Description

template<typename STRESS>
struct olb::momenta::MovingPorousStress< STRESS >

Definition at line 1331 of file elements.h.

Member Function Documentation

◆ compute()

template<typename STRESS >
template<typename TYPE , typename CELL , typename RHO , typename U , typename PI , typename V = typename CELL::value_t, typename DESCRIPTOR = typename CELL::descriptor_t>
void olb::momenta::MovingPorousStress< STRESS >::compute ( CELL & cell,
const RHO & rho,
const U & u,
PI & pi )
inline

Definition at line 1333 of file elements.h.

1334 {
1335 V uNew[DESCRIPTOR::d] { };
1336 const V porosity = cell.template getField<descriptors::POROSITY>();
1337 for (int iD=0; iD < DESCRIPTOR::d; ++iD) {
1338 uNew[iD] = u[iD] + V{0.5} * rho
1339 * (V{1} - porosity)
1340 * (cell.template getFieldComponent<descriptors::VELOCITY>(iD) - u[iD]);
1341 }
1342
1343 STRESS().template compute<TYPE>(cell, rho, uNew, pi);
1344 V forceTensor[util::TensorVal<DESCRIPTOR>::n];
1345 // Creation of body force tensor (rho/2.)*(G_alpha*U_beta + U_alpha*G_Beta)
1346 int iPi = 0;
1347 for (int iAlpha=0; iAlpha < DESCRIPTOR::d; ++iAlpha) {
1348 for (int iBeta=iAlpha; iBeta < DESCRIPTOR::d; ++iBeta) {
1349 forceTensor[iPi] = V{0.5} * rho * (uNew[iBeta] + uNew[iAlpha]);
1350 ++iPi;
1351 }
1352 }
1353 // Creation of second-order moment off-equilibrium tensor
1354 for (int iPi=0; iPi < util::TensorVal<DESCRIPTOR>::n; ++iPi) {
1355 pi[iPi] += forceTensor[iPi];
1356 }
1357 }
void compute(CELL &cell, const RHO &rho, const U &u, PI &pi) any_platform
Definition elements.h:1333
static constexpr int n
result stored in n
Definition util.h:217

References olb::momenta::MovingPorousStress< STRESS >::compute().

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

◆ getName()

template<typename STRESS >
static std::string olb::momenta::MovingPorousStress< STRESS >::getName ( )
inlinestatic

Definition at line 1359 of file elements.h.

1359 {
1360 return "MovingPorousStress<" + STRESS().getName() + ">";
1361 }

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