OpenLB 1.8.1
Loading...
Searching...
No Matches
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 1816 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 1818 of file elements.h.

1819 {
1820 V uNew[DESCRIPTOR::d] { };
1821 const auto force = cell.template getFieldPointer<descriptors::FORCE>();
1822 for (unsigned iD=0; iD < DESCRIPTOR::d; ++iD) {
1823 uNew[iD] = u[iD] - V{0.5} * force[iD];
1824 }
1825 STRESS().template compute<TYPE>(cell, rho, uNew, pi);
1826 V forceTensor[util::TensorVal<DESCRIPTOR>::n];
1827 // Creation of body force tensor (rho/2.)*(G_alpha*U_beta + U_alpha*G_Beta)
1828 int iPi = 0;
1829 for (int iAlpha=0; iAlpha < DESCRIPTOR::d; ++iAlpha) {
1830 for (int iBeta=iAlpha; iBeta < DESCRIPTOR::d; ++iBeta) {
1831 forceTensor[iPi] = V{0.5} * rho * (force[iAlpha]*uNew[iBeta] + uNew[iAlpha]*force[iBeta]);
1832 ++iPi;
1833 }
1834 }
1835 // Creation of second-order moment off-equilibrium tensor
1836 for (int iPi=0; iPi < util::TensorVal<DESCRIPTOR>::n; ++iPi) {
1837 pi[iPi] += forceTensor[iPi];
1838 }
1839 }
void compute(CELL &cell, const RHO &rho, const U &u, PI &pi) any_platform
Definition elements.h:1818
static constexpr int n
result stored in n
Definition util.h:217

References olb::momenta::ForcedStress< 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::ForcedStress< STRESS >::getName ( )
inlinestatic

Definition at line 1841 of file elements.h.

1841 {
1842 return "ForcedStress<" + STRESS().getName() + ">";
1843 }

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