OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::ForcedPSMBGKdynamics< T, DESCRIPTOR > Struct Template Referencefinal

Implementation of the Partially Saturated Method (PSM), see Krüger, Timm, et al. More...

#include <porousBGKdynamics.h>

+ Inheritance diagram for olb::ForcedPSMBGKdynamics< T, DESCRIPTOR >:
+ Collaboration diagram for olb::ForcedPSMBGKdynamics< T, DESCRIPTOR >:

Public Types

using MomentaF = typename momenta::ForcedPSMBulkTuple::template type<DESCRIPTOR>
 
using EquilibriumF = typename equilibria::SecondOrder::template type<DESCRIPTOR,momenta::ForcedPSMBulkTuple>
 
using parameters = meta::list<descriptors::OMEGA>
 
template<typename NEW_T >
using exchange_value_type = ForcedPSMBGKdynamics<NEW_T,DESCRIPTOR>
 
- Public Types inherited from olb::dynamics::CustomCollision< T, DESCRIPTOR, momenta::ForcedPSMBulkTuple >
using value_t
 
using descriptor_t
 
using MomentaF
 
- Public Types inherited from olb::Dynamics< T, DESCRIPTOR >
using value_t = T
 
using descriptor_t = DESCRIPTOR
 

Public Member Functions

std::type_index id () override
 Expose unique type-identifier for RTTI.
 
AbstractParameters< T, DESCRIPTOR > & getParameters (BlockLattice< T, DESCRIPTOR > &block) override
 Parameters access for legacy post processors.
 
template<typename CELL , typename PARAMETERS , typename V = typename CELL::value_t>
CellStatistic< V > collide (CELL &cell, PARAMETERS &parameters) any_platform
 
void computeEquilibrium (ConstCell< T, DESCRIPTOR > &cell, T rho, const T u[DESCRIPTOR::d], T fEq[DESCRIPTOR::q]) const override
 Return iPop equilibrium for given first and second momenta.
 
std::string getName () const override
 Return human-readable name.
 
- Public Member Functions inherited from olb::dynamics::CustomCollision< T, DESCRIPTOR, momenta::ForcedPSMBulkTuple >
void initialize (Cell< T, DESCRIPTOR > &cell) override
 Initialize dynamics-specific data for cell.
 
computeRho (ConstCell< T, DESCRIPTOR > &cell) const override
 Compute particle density.
 
void computeU (ConstCell< T, DESCRIPTOR > &cell, T u[DESCRIPTOR::d]) const override
 Compute fluid velocity.
 
void computeJ (ConstCell< T, DESCRIPTOR > &cell, T j[DESCRIPTOR::d]) const override
 Compute fluid momentum.
 
void computeStress (ConstCell< T, DESCRIPTOR > &cell, T rho, const T u[DESCRIPTOR::d], T pi[util::TensorVal< DESCRIPTOR >::n]) const override
 Compute stress tensor.
 
void computeRhoU (ConstCell< T, DESCRIPTOR > &cell, T &rho, T u[DESCRIPTOR::d]) const override
 Compute fluid velocity and particle density.
 
void computeAllMomenta (ConstCell< T, DESCRIPTOR > &cell, T &rho, T u[DESCRIPTOR::d], T pi[util::TensorVal< DESCRIPTOR >::n]) const override
 Compute all momenta up to second order.
 
void defineRho (Cell< T, DESCRIPTOR > &cell, T rho) override
 Set particle density.
 
void defineU (Cell< T, DESCRIPTOR > &cell, const T u[DESCRIPTOR::d]) override
 Set fluid velocity.
 
void defineRhoU (Cell< T, DESCRIPTOR > &cell, T rho, const T u[DESCRIPTOR::d]) override
 Define fluid velocity and particle density.
 
void defineAllMomenta (Cell< T, DESCRIPTOR > &cell, T rho, const T u[DESCRIPTOR::d], const T pi[util::TensorVal< DESCRIPTOR >::n]) override
 Define all momenta up to second order.
 
void inverseShiftRhoU (ConstCell< T, DESCRIPTOR > &cell, T &rho, T u[DESCRIPTOR::d]) const override
 Calculate population momenta s.t. the physical momenta are reproduced by the computeRhoU.
 
- Public Member Functions inherited from olb::Dynamics< T, DESCRIPTOR >
virtual ~Dynamics () any_platform
 
virtual CellStatistic< T > collide (Cell< T, DESCRIPTOR > &cell)
 Perform purely-local collision step on Cell interface (legacy, to be deprecated)
 
void iniEquilibrium (Cell< T, DESCRIPTOR > &cell, T rho, const T u[DESCRIPTOR::d])
 Initialize to equilibrium distribution.
 
void iniRegularized (Cell< T, DESCRIPTOR > &cell, T rho, const T u[DESCRIPTOR::d], const T pi[util::TensorVal< DESCRIPTOR >::n])
 Initialize cell to equilibrium and non-equilibrum part.
 

Static Public Attributes

static constexpr bool is_vectorizable = false
 

Detailed Description

template<typename T, typename DESCRIPTOR>
struct olb::ForcedPSMBGKdynamics< T, DESCRIPTOR >

Implementation of the Partially Saturated Method (PSM), see Krüger, Timm, et al.

The Lattice Boltzmann Method. Springer, 2017. (p.447-451)

Definition at line 598 of file porousBGKdynamics.h.

Member Typedef Documentation

◆ EquilibriumF

template<typename T , typename DESCRIPTOR >
using olb::ForcedPSMBGKdynamics< T, DESCRIPTOR >::EquilibriumF = typename equilibria::SecondOrder::template type<DESCRIPTOR,momenta::ForcedPSMBulkTuple>

Definition at line 601 of file porousBGKdynamics.h.

◆ exchange_value_type

template<typename T , typename DESCRIPTOR >
template<typename NEW_T >
using olb::ForcedPSMBGKdynamics< T, DESCRIPTOR >::exchange_value_type = ForcedPSMBGKdynamics<NEW_T,DESCRIPTOR>

Definition at line 608 of file porousBGKdynamics.h.

◆ MomentaF

template<typename T , typename DESCRIPTOR >
using olb::ForcedPSMBGKdynamics< T, DESCRIPTOR >::MomentaF = typename momenta::ForcedPSMBulkTuple::template type<DESCRIPTOR>

Definition at line 600 of file porousBGKdynamics.h.

◆ parameters

template<typename T , typename DESCRIPTOR >
using olb::ForcedPSMBGKdynamics< T, DESCRIPTOR >::parameters = meta::list<descriptors::OMEGA>

Definition at line 603 of file porousBGKdynamics.h.

Member Function Documentation

◆ collide()

template<typename T , typename DESCRIPTOR >
template<typename CELL , typename PARAMETERS , typename V = typename CELL::value_t>
CellStatistic< V > olb::ForcedPSMBGKdynamics< T, DESCRIPTOR >::collide ( CELL & cell,
PARAMETERS & parameters )
inline

Definition at line 619 of file porousBGKdynamics.h.

620 {
621 V omega = parameters.template get<descriptors::OMEGA>();
622 V rho, u[DESCRIPTOR::d], uSqr;
623 lbm<DESCRIPTOR>::computeRhoU(cell, rho, u);
624 auto force = cell.template getField<descriptors::FORCE>();
625 for (int iVel=0; iVel < DESCRIPTOR::d; ++iVel) {
626 u[iVel] += force[iVel] * V{0.5};
627 }
628 auto u_s = cell.template getField<descriptors::VELOCITY_SOLID>();
629
630 V epsilon = V{1} - cell.template getField<descriptors::POROSITY>();
631 if (epsilon < 1e-5) {
632 uSqr = lbm<DESCRIPTOR>::bgkCollision(cell, rho, u, omega);
633 lbm<DESCRIPTOR>::addExternalForce(cell, rho, u, omega, force);
634 }
635 else {
636 V paramA = V{1} / omega - V{0.5};
637 V paramB = (epsilon * paramA) / ((V{1} - epsilon) + paramA);
638 V paramC = (V{1} - paramB);
639
640 V omega_s[DESCRIPTOR::q];
641 V cell_tmp[DESCRIPTOR::q];
642
643 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
644 cell_tmp[iPop] = cell[iPop];
645 omega_s[iPop] = (equilibrium<DESCRIPTOR>::secondOrder(iPop, rho, u_s) - cell[iPop])
646 + (V{1} - omega) * (cell[iPop] - equilibrium<DESCRIPTOR>::secondOrder(iPop, rho, u));
647 }
648
649 uSqr = lbm<DESCRIPTOR>::bgkCollision(cell, rho, u, omega);
650 lbm<DESCRIPTOR>::addExternalForce(cell, rho, u, omega, force);
651
652 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
653 cell[iPop] = cell_tmp[iPop] + paramC * (cell[iPop] - cell_tmp[iPop]);
654 cell[iPop] += paramB * omega_s[iPop];
655 }
656 for (int iVel=0; iVel < DESCRIPTOR::d; ++iVel) {
657 u[iVel] = paramC * u[iVel] + paramB * u_s[iVel];
658 }
660 }
661 return {rho, uSqr};
662 }
auto normSqr(const ARRAY_LIKE &u) any_platform
Compute norm square of a d-dimensional vector.
Definition util.h:145
meta::list< descriptors::OMEGA > parameters
static V secondOrder(int iPop, const RHO &rho, const U &u, const USQR &uSqr) any_platform
Computation of equilibrium distribution, second order in u.
Definition lbm.h:51
static void addExternalForce(CELL &cell, const RHO &rho, const U &u, const OMEGA &omega, const FORCE &force) any_platform
Add a force term after BGK collision.
Definition lbm.h:545
static V bgkCollision(CELL &cell, const RHO &rho, const VELOCITY &u, const OMEGA &omega) any_platform
BGK collision step.
Definition lbm.h:372
static void computeRhoU(CELL &cell, RHO &rho, U &u) any_platform
Computation of hydrodynamic variables.
Definition lbm.h:301

References olb::lbm< DESCRIPTOR >::addExternalForce(), olb::lbm< DESCRIPTOR >::bgkCollision(), olb::lbm< DESCRIPTOR >::computeRhoU(), olb::util::normSqr(), and olb::equilibrium< DESCRIPTOR >::secondOrder().

+ Here is the call graph for this function:

◆ computeEquilibrium()

template<typename T , typename DESCRIPTOR >
void olb::ForcedPSMBGKdynamics< T, DESCRIPTOR >::computeEquilibrium ( ConstCell< T, DESCRIPTOR > & cell,
T rho,
const T u[DESCRIPTOR::d],
T fEq[DESCRIPTOR::q] ) const
inlineoverridevirtual

Return iPop equilibrium for given first and second momenta.

Implements olb::Dynamics< T, DESCRIPTOR >.

Definition at line 664 of file porousBGKdynamics.h.

664 {
665 EquilibriumF().compute(cell, rho, u, fEq);
666 };
typename equilibria::SecondOrder::template type< DESCRIPTOR, momenta::ForcedPSMBulkTuple > EquilibriumF

◆ getName()

template<typename T , typename DESCRIPTOR >
std::string olb::ForcedPSMBGKdynamics< T, DESCRIPTOR >::getName ( ) const
inlineoverridevirtual

Return human-readable name.

Reimplemented from olb::Dynamics< T, DESCRIPTOR >.

Definition at line 668 of file porousBGKdynamics.h.

668 {
669 return "ForcedPSMBGKdynamics<" + MomentaF().getName() + ">";
670 };
typename momenta::ForcedPSMBulkTuple::template type< DESCRIPTOR > MomentaF

◆ getParameters()

template<typename T , typename DESCRIPTOR >
AbstractParameters< T, DESCRIPTOR > & olb::ForcedPSMBGKdynamics< T, DESCRIPTOR >::getParameters ( BlockLattice< T, DESCRIPTOR > & block)
inlineoverridevirtual

Parameters access for legacy post processors.

Implements olb::Dynamics< T, DESCRIPTOR >.

Definition at line 614 of file porousBGKdynamics.h.

614 {
615 return block.template getData<OperatorParameters<ForcedPSMBGKdynamics>>();
616 }

◆ id()

template<typename T , typename DESCRIPTOR >
std::type_index olb::ForcedPSMBGKdynamics< T, DESCRIPTOR >::id ( )
inlineoverridevirtual

Expose unique type-identifier for RTTI.

Implements olb::Dynamics< T, DESCRIPTOR >.

Definition at line 610 of file porousBGKdynamics.h.

610 {
611 return typeid(ForcedPSMBGKdynamics);
612 }

Member Data Documentation

◆ is_vectorizable

template<typename T , typename DESCRIPTOR >
bool olb::ForcedPSMBGKdynamics< T, DESCRIPTOR >::is_vectorizable = false
staticconstexpr

Definition at line 605 of file porousBGKdynamics.h.


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