OpenLB 1.7
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
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>
 
- Public Types inherited from olb::dynamics::CustomCollision< T, DESCRIPTOR, MOMENTA >
using value_t = T
 
using descriptor_t = DESCRIPTOR
 
using MomentaF = typename MOMENTA::template type<DESCRIPTOR>
 
- 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 > apply (CELL &cell, PARAMETERS &parameters)
 
- Public Member Functions inherited from olb::dynamics::CustomCollision< T, DESCRIPTOR, MOMENTA >
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 T computeEquilibrium (int iPop, T rho, const T u[DESCRIPTOR::d]) const any_platform=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 419 of file dynamics.h.

Member Typedef Documentation

◆ 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 420 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 422 of file dynamics.h.

Member Function Documentation

◆ apply()

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 >::apply ( CELL & cell,
PARAMETERS & parameters )
inline

Definition at line 452 of file dynamics.h.

452 {
453 V rho, u[DESCRIPTOR::d];
454 V porosity = cell.template getField<descriptors::POROSITY>();
455 MomentaF().computeVANSRhoU(cell, rho, u, &porosity);
456 auto force = cell.template getFieldPointer<descriptors::FORCE>();
457 for (int iVel=0; iVel < DESCRIPTOR::d; ++iVel) {
458 u[iVel] += force[iVel] * V{0.5};
459 u[iVel] /= porosity;
460 }
461 rho *= porosity;
462 const auto omega = parameters.template get<descriptors::OMEGA>();
463 V uSqr = lbm<DESCRIPTOR>::bgkCollision(cell, rho, u, omega);
464 lbm<DESCRIPTOR>::addExternalForce(cell, u, omega, rho);
465 return {rho / porosity, uSqr * porosity * porosity};
466 }
typename MOMENTA::template type< DESCRIPTOR > MomentaF
Definition dynamics.h:420
meta::list< descriptors::OMEGA > parameters
Definition dynamics.h:422
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:463
static V bgkCollision(CELL &cell, const RHO &rho, const VELOCITY &u, const OMEGA &omega) any_platform
BGK collision step.
Definition lbm.h:290

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 >.

Definition at line 442 of file dynamics.h.

442 {
443 T porosity = cell.template getField<descriptors::POROSITY>();
444 MomentaF().computeVANSRhoU(cell, rho, u, &porosity);
445 auto force = cell.template getFieldPointer<descriptors::FORCE>();
446 for (int iVel=0; iVel<DESCRIPTOR::d; ++iVel) {
447 u[iVel] += force[iVel] * T{0.5};
448 }
449 }

◆ 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 >.

Definition at line 432 of file dynamics.h.

432 {
433 T rho;
434 T porosity = cell.template getField<descriptors::POROSITY>();
435 MomentaF().computeVANSRhoU(cell, rho, u, &porosity);
436 auto force = cell.template getFieldPointer<descriptors::FORCE>();
437 for (int iVel=0; iVel < DESCRIPTOR::d; ++iVel) {
438 u[iVel] += force[iVel] * T{0.5};
439 }
440 }

◆ 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 428 of file dynamics.h.

428 {
429 return block.template getData<OperatorParameters<ForcedVANSBGKdynamics>>();
430 }

◆ 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 424 of file dynamics.h.

424 {
425 return typeid(ForcedVANSBGKdynamics);
426 }

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