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

VANS BGK collision step with external force. More...

#include <dynamics.h>

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

Public Types

using MomentaF = typename MOMENTA::template type<DESCRIPTOR>
 
using parameters = meta::list<descriptors::OMEGA>
 
template<typename NEW_T >
using exchange_value_type = ForcedVANSBGKdynamics<NEW_T,DESCRIPTOR,MOMENTA>
 
- Public Types inherited from olb::dynamics::CustomCollision< T, DESCRIPTOR, momenta::BulkTuple >
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.
 
void computeU (ConstCell< T, DESCRIPTOR > &cell, T u[DESCRIPTOR::d]) const override
 Compute fluid velocity.
 
void computeRhoU (ConstCell< T, DESCRIPTOR > &cell, T &rho, T u[DESCRIPTOR::d]) const override
 Compute fluid velocity and particle density.
 
template<typename CELL , typename PARAMETERS , typename V = typename CELL::value_t>
CellStatistic< V > collide (CELL &cell, PARAMETERS &parameters)
 
- Public Member Functions inherited from olb::dynamics::CustomCollision< T, DESCRIPTOR, momenta::BulkTuple >
void initialize (Cell< T, DESCRIPTOR > &cell) override
 Initialize dynamics-specific data for cell.
 
computeRho (ConstCell< T, DESCRIPTOR > &cell) const override
 Compute particle density.
 
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 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 std::string getName () const
 Return human-readable name.
 
virtual CellStatistic< T > collide (Cell< T, DESCRIPTOR > &cell)
 Perform purely-local collision step on Cell interface (legacy, to be deprecated)
 
virtual void computeEquilibrium (ConstCell< T, DESCRIPTOR > &cell, T rho, const T u[DESCRIPTOR::d], T fEq[DESCRIPTOR::q]) const =0
 Return iPop equilibrium for given first and second momenta.
 
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.
 

Detailed Description

template<typename T, typename DESCRIPTOR, typename MOMENTA = momenta::BulkTuple>
struct olb::ForcedVANSBGKdynamics< T, DESCRIPTOR, MOMENTA >

VANS BGK collision step with external force.

WIP: computeVANSRhoU doesn't exist (and should not) Forcing to be realized using standard combinations rules (Likely Guo in this case)

Definition at line 684 of file dynamics.h.

Member Typedef Documentation

◆ exchange_value_type

template<typename T , typename DESCRIPTOR , typename MOMENTA = momenta::BulkTuple>
template<typename NEW_T >
using olb::ForcedVANSBGKdynamics< T, DESCRIPTOR, MOMENTA >::exchange_value_type = ForcedVANSBGKdynamics<NEW_T,DESCRIPTOR,MOMENTA>

Definition at line 690 of file dynamics.h.

◆ MomentaF

template<typename T , typename DESCRIPTOR , typename MOMENTA = momenta::BulkTuple>
using olb::ForcedVANSBGKdynamics< T, DESCRIPTOR, MOMENTA >::MomentaF = typename MOMENTA::template type<DESCRIPTOR>

Definition at line 685 of file dynamics.h.

◆ parameters

template<typename T , typename DESCRIPTOR , typename MOMENTA = momenta::BulkTuple>
using olb::ForcedVANSBGKdynamics< T, DESCRIPTOR, MOMENTA >::parameters = meta::list<descriptors::OMEGA>

Definition at line 687 of file dynamics.h.

Member Function Documentation

◆ collide()

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

Definition at line 720 of file dynamics.h.

720 {
721 V rho, u[DESCRIPTOR::d];
722 V porosity = cell.template getField<descriptors::POROSITY>();
723 MomentaF().computeVANSRhoU(cell, rho, u, &porosity);
724 auto force = cell.template getFieldPointer<descriptors::FORCE>();
725 for (int iVel=0; iVel < DESCRIPTOR::d; ++iVel) {
726 u[iVel] += force[iVel] * V{0.5};
727 u[iVel] /= porosity;
728 }
729 rho *= porosity;
730 const auto omega = parameters.template get<descriptors::OMEGA>();
731 V uSqr = lbm<DESCRIPTOR>::bgkCollision(cell, rho, u, omega);
732 lbm<DESCRIPTOR>::addExternalForce(cell, u, omega, rho);
733 return {rho / porosity, uSqr * porosity * porosity};
734 }
typename MOMENTA::template type< DESCRIPTOR > MomentaF
Definition dynamics.h:685
meta::list< descriptors::OMEGA > parameters
Definition dynamics.h:687
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

References olb::lbm< DESCRIPTOR >::addExternalForce(), and olb::lbm< DESCRIPTOR >::bgkCollision().

+ Here is the call graph for this function:

◆ computeRhoU()

template<typename T , typename DESCRIPTOR , typename MOMENTA = momenta::BulkTuple>
void olb::ForcedVANSBGKdynamics< T, DESCRIPTOR, MOMENTA >::computeRhoU ( ConstCell< T, DESCRIPTOR > & cell,
T & rho,
T u[DESCRIPTOR::d] ) const
inlineoverridevirtual

Compute fluid velocity and particle density.

Reimplemented from olb::dynamics::CustomCollision< T, DESCRIPTOR, momenta::BulkTuple >.

Definition at line 710 of file dynamics.h.

710 {
711 T porosity = cell.template getField<descriptors::POROSITY>();
712 MomentaF().computeVANSRhoU(cell, rho, u, &porosity);
713 auto force = cell.template getFieldPointer<descriptors::FORCE>();
714 for (int iVel=0; iVel<DESCRIPTOR::d; ++iVel) {
715 u[iVel] += force[iVel] * T{0.5};
716 }
717 }

◆ computeU()

template<typename T , typename DESCRIPTOR , typename MOMENTA = momenta::BulkTuple>
void olb::ForcedVANSBGKdynamics< T, DESCRIPTOR, MOMENTA >::computeU ( ConstCell< T, DESCRIPTOR > & cell,
T u[DESCRIPTOR::d] ) const
inlineoverridevirtual

Compute fluid velocity.

Reimplemented from olb::dynamics::CustomCollision< T, DESCRIPTOR, momenta::BulkTuple >.

Definition at line 700 of file dynamics.h.

700 {
701 T rho;
702 T porosity = cell.template getField<descriptors::POROSITY>();
703 MomentaF().computeVANSRhoU(cell, rho, u, &porosity);
704 auto force = cell.template getFieldPointer<descriptors::FORCE>();
705 for (int iVel=0; iVel < DESCRIPTOR::d; ++iVel) {
706 u[iVel] += force[iVel] * T{0.5};
707 }
708 }

◆ getParameters()

template<typename T , typename DESCRIPTOR , typename MOMENTA = momenta::BulkTuple>
AbstractParameters< T, DESCRIPTOR > & olb::ForcedVANSBGKdynamics< T, DESCRIPTOR, MOMENTA >::getParameters ( BlockLattice< T, DESCRIPTOR > & block)
inlineoverridevirtual

Parameters access for legacy post processors.

Implements olb::Dynamics< T, DESCRIPTOR >.

Definition at line 696 of file dynamics.h.

696 {
697 return block.template getData<OperatorParameters<ForcedVANSBGKdynamics>>();
698 }

◆ id()

template<typename T , typename DESCRIPTOR , typename MOMENTA = momenta::BulkTuple>
std::type_index olb::ForcedVANSBGKdynamics< T, DESCRIPTOR, MOMENTA >::id ( )
inlineoverridevirtual

Expose unique type-identifier for RTTI.

Implements olb::Dynamics< T, DESCRIPTOR >.

Definition at line 692 of file dynamics.h.

692 {
693 return typeid(ForcedVANSBGKdynamics);
694 }

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