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

#include <elements.h>

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

Public Member Functions

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

Static Public Member Functions

static std::string getName ()
 

Detailed Description

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

Definition at line 1847 of file elements.h.

Member Function Documentation

◆ compute()

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

Definition at line 1849 of file elements.h.

1850 {
1851 V uNew[DESCRIPTOR::d] { };
1852 const auto force = cell.template getFieldPointer<descriptors::FORCE>();
1853 const auto partialRho = cell.template getFieldPointer<descriptors::NABLARHO>();
1854 for (unsigned iD=0; iD < DESCRIPTOR::d; ++iD) {
1855 uNew[iD] = u[iD] - V{0.5} * force[iD];
1856 }
1857 STRESS().template compute<TYPE>(cell, p, uNew, pi);
1858 V forceTensor[util::TensorVal<DESCRIPTOR>::n];
1859 int iPi = 0;
1860 for (int iAlpha=0; iAlpha < DESCRIPTOR::d; ++iAlpha) {
1861 for (int iBeta=iAlpha; iBeta < DESCRIPTOR::d; ++iBeta) {
1862 forceTensor[iPi] = V{0.5} /descriptors::invCs2<V,DESCRIPTOR>() * (partialRho[iAlpha]*uNew[iBeta] + uNew[iAlpha]*partialRho[iBeta]);
1863 if (iAlpha == iBeta) forceTensor[iPi] += V{0.5} /descriptors::invCs2<V,DESCRIPTOR>() * partialRho[iAlpha]*uNew[iAlpha];
1864 ++iPi;
1865 }
1866 }
1867 // Creation of second-order moment off-equilibrium tensor
1868 for (int iPi=0; iPi < util::TensorVal<DESCRIPTOR>::n; ++iPi) {
1869 pi[iPi] += forceTensor[iPi];
1870 }
1871 }
constexpr T invCs2() any_platform
Definition functions.h:107
void compute(CELL &cell, const P &p, const U &u, PI &pi) any_platform
Definition elements.h:1849
static constexpr int n
result stored in n
Definition util.h:217

References olb::momenta::ForcedIncompressibleStress< STRESS >::compute(), and olb::descriptors::invCs2().

+ 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::ForcedIncompressibleStress< STRESS >::getName ( )
inlinestatic

Definition at line 1873 of file elements.h.

1873 {
1874 return "ForcedIncompressibleStress<" + STRESS().getName() + ">";
1875 }

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