OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
olb::momenta::ForcedStress< STRESS > Struct Template Reference

#include <elements.h>

+ Collaboration diagram for olb::momenta::ForcedStress< 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::ForcedStress< STRESS >

Definition at line 1370 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::ForcedStress< STRESS >::compute ( CELL & cell,
const RHO & rho,
const U & u,
PI & pi )
inline

Definition at line 1372 of file elements.h.

1373 {
1374 V uNew[DESCRIPTOR::d] { };
1375 const auto force = cell.template getFieldPointer<descriptors::FORCE>();
1376 for (unsigned iD=0; iD < DESCRIPTOR::d; ++iD) {
1377 uNew[iD] = u[iD] - V{0.5} * force[iD];
1378 }
1379 STRESS().template compute<TYPE>(cell, rho, uNew, pi);
1380 V forceTensor[util::TensorVal<DESCRIPTOR>::n];
1381 // Creation of body force tensor (rho/2.)*(G_alpha*U_beta + U_alpha*G_Beta)
1382 int iPi = 0;
1383 for (int iAlpha=0; iAlpha < DESCRIPTOR::d; ++iAlpha) {
1384 for (int iBeta=iAlpha; iBeta < DESCRIPTOR::d; ++iBeta) {
1385 forceTensor[iPi] = V{0.5} * rho * (force[iAlpha]*uNew[iBeta] + uNew[iAlpha]*force[iBeta]);
1386 ++iPi;
1387 }
1388 }
1389 // Creation of second-order moment off-equilibrium tensor
1390 for (int iPi=0; iPi < util::TensorVal<DESCRIPTOR>::n; ++iPi) {
1391 pi[iPi] += forceTensor[iPi];
1392 }
1393 }
static constexpr int n
result stored in n
Definition util.h:211

◆ getName()

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

Definition at line 1395 of file elements.h.

1395 {
1396 return "ForcedStress<" + STRESS().getName() + ">";
1397 }

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