OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::momenta::BulkPressure< MOMENTUM > Struct Template Reference

Computation of hydrodynamic pressure as zeroth moment of the population. More...

#include <elements.h>

+ Collaboration diagram for olb::momenta::BulkPressure< MOMENTUM >:

Public Member Functions

template<typename TYPE , typename CELL , typename PRESSURE , typename DESCRIPTOR = typename CELL::descriptor_t, typename V = typename CELL::value_t>
void compute (CELL &cell, PRESSURE &p) any_platform
 
template<typename TYPE , typename CELL , typename RHO >
void define (CELL &cell, const RHO &rho) any_platform
 
template<typename TYPE , typename CELL >
void initialize (CELL &cell) any_platform
 
template<typename TYPE , typename CELL , typename RHO >
void inverseShift (CELL &cell, RHO &rho) any_platform
 

Static Public Member Functions

static std::string getName ()
 

Detailed Description

template<typename MOMENTUM>
struct olb::momenta::BulkPressure< MOMENTUM >

Computation of hydrodynamic pressure as zeroth moment of the population.

Definition at line 173 of file elements.h.

Member Function Documentation

◆ compute()

template<typename MOMENTUM >
template<typename TYPE , typename CELL , typename PRESSURE , typename DESCRIPTOR = typename CELL::descriptor_t, typename V = typename CELL::value_t>
void olb::momenta::BulkPressure< MOMENTUM >::compute ( CELL & cell,
PRESSURE & p )
inline

Definition at line 175 of file elements.h.

176 {
177 V sum = 0;
178 for (int iPop=1; iPop < DESCRIPTOR::q; ++iPop) {
179 sum += cell[iPop];
180 }
181 auto rho = cell.template getField<descriptors::RHO>();
182 auto gradRho = cell.template getField<descriptors::NABLARHO>();
184 V uGradRho = 0;
185 MOMENTUM().template computeU<TYPE>(cell, u);
186 for (unsigned iD=0; iD < DESCRIPTOR::d; ++iD) {
187 uGradRho += u[iD] * gradRho[iD];
188 }
191 p = 1/ descriptors::invCs2<V,DESCRIPTOR>() / (1-descriptors::t<V,DESCRIPTOR>(0)) * (sum + 0.5*uGradRho + rho*s0);
192 }
constexpr T invCs2() any_platform
Definition functions.h:107
constexpr T t(unsigned iPop, tag::CUM) any_platform
Definition cum.h:108
auto normSqr(const ARRAY_LIKE &u) any_platform
Compute norm square of a d-dimensional vector.
Definition util.h:145
Vector(T &&t, Ts &&... ts) -> Vector< std::remove_cvref_t< T >, 1+sizeof...(Ts)>

References olb::descriptors::invCs2(), olb::util::normSqr(), and olb::descriptors::t().

+ Here is the call graph for this function:

◆ define()

template<typename MOMENTUM >
template<typename TYPE , typename CELL , typename RHO >
void olb::momenta::BulkPressure< MOMENTUM >::define ( CELL & cell,
const RHO & rho )
inline

Definition at line 195 of file elements.h.

195{};

◆ getName()

template<typename MOMENTUM >
static std::string olb::momenta::BulkPressure< MOMENTUM >::getName ( )
inlinestatic

Definition at line 203 of file elements.h.

203 {
204 return "BulkPressure";
205 }

◆ initialize()

template<typename MOMENTUM >
template<typename TYPE , typename CELL >
void olb::momenta::BulkPressure< MOMENTUM >::initialize ( CELL & cell)
inline

Definition at line 198 of file elements.h.

198{};

◆ inverseShift()

template<typename MOMENTUM >
template<typename TYPE , typename CELL , typename RHO >
void olb::momenta::BulkPressure< MOMENTUM >::inverseShift ( CELL & cell,
RHO & rho )
inline

Definition at line 201 of file elements.h.

201{};

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