OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::AdvectionDiffusionBoundariesDynamics< T, DESCRIPTOR, DYNAMICS, MOMENTA, direction, orientation > Struct Template Referencefinal

#include <advectionDiffusionBoundaries.h>

+ Inheritance diagram for olb::AdvectionDiffusionBoundariesDynamics< T, DESCRIPTOR, DYNAMICS, MOMENTA, direction, orientation >:
+ Collaboration diagram for olb::AdvectionDiffusionBoundariesDynamics< T, DESCRIPTOR, DYNAMICS, MOMENTA, direction, orientation >:

Public Types

using MomentaF = typename MOMENTA::template type<DESCRIPTOR>
 
using EquilibriumF = typename DYNAMICS::template exchange_momenta<MOMENTA>::EquilibriumF
 
using parameters = typename DYNAMICS::parameters
 
template<typename NEW_T >
using exchange_value_type
 
template<typename M >
using exchange_momenta = AdvectionDiffusionBoundariesDynamics<T,DESCRIPTOR,DYNAMICS,M,direction,orientation>
 
- 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.
 
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 >
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.
 

Detailed Description

template<typename T, typename DESCRIPTOR, typename DYNAMICS, typename MOMENTA, int direction, int orientation>
struct olb::AdvectionDiffusionBoundariesDynamics< T, DESCRIPTOR, DYNAMICS, MOMENTA, direction, orientation >

Definition at line 40 of file advectionDiffusionBoundaries.h.

Member Typedef Documentation

◆ EquilibriumF

template<typename T , typename DESCRIPTOR , typename DYNAMICS , typename MOMENTA , int direction, int orientation>
using olb::AdvectionDiffusionBoundariesDynamics< T, DESCRIPTOR, DYNAMICS, MOMENTA, direction, orientation >::EquilibriumF = typename DYNAMICS::template exchange_momenta<MOMENTA>::EquilibriumF

Definition at line 42 of file advectionDiffusionBoundaries.h.

◆ exchange_momenta

template<typename T , typename DESCRIPTOR , typename DYNAMICS , typename MOMENTA , int direction, int orientation>
template<typename M >
using olb::AdvectionDiffusionBoundariesDynamics< T, DESCRIPTOR, DYNAMICS, MOMENTA, direction, orientation >::exchange_momenta = AdvectionDiffusionBoundariesDynamics<T,DESCRIPTOR,DYNAMICS,M,direction,orientation>

Definition at line 55 of file advectionDiffusionBoundaries.h.

◆ exchange_value_type

template<typename T , typename DESCRIPTOR , typename DYNAMICS , typename MOMENTA , int direction, int orientation>
template<typename NEW_T >
using olb::AdvectionDiffusionBoundariesDynamics< T, DESCRIPTOR, DYNAMICS, MOMENTA, direction, orientation >::exchange_value_type
Initial value:
AdvectionDiffusionBoundariesDynamics<
NEW_T, DESCRIPTOR,
typename DYNAMICS::template exchange_value_type<NEW_T>,
MOMENTA,
direction, orientation
>
AdvectionDiffusionBoundariesDynamics< NEW_T, DESCRIPTOR, typename DYNAMICS::template exchange_value_type< NEW_T >, MOMENTA, direction, orientation > exchange_value_type

Definition at line 47 of file advectionDiffusionBoundaries.h.

◆ MomentaF

template<typename T , typename DESCRIPTOR , typename DYNAMICS , typename MOMENTA , int direction, int orientation>
using olb::AdvectionDiffusionBoundariesDynamics< T, DESCRIPTOR, DYNAMICS, MOMENTA, direction, orientation >::MomentaF = typename MOMENTA::template type<DESCRIPTOR>

Definition at line 41 of file advectionDiffusionBoundaries.h.

◆ parameters

template<typename T , typename DESCRIPTOR , typename DYNAMICS , typename MOMENTA , int direction, int orientation>
using olb::AdvectionDiffusionBoundariesDynamics< T, DESCRIPTOR, DYNAMICS, MOMENTA, direction, orientation >::parameters = typename DYNAMICS::parameters

Definition at line 44 of file advectionDiffusionBoundaries.h.

Member Function Documentation

◆ collide()

template<typename T , typename DESCRIPTOR , typename DYNAMICS , typename MOMENTA , int direction, int orientation>
template<typename CELL , typename PARAMETERS , typename V = typename CELL::value_t>
CellStatistic< V > olb::AdvectionDiffusionBoundariesDynamics< T, DESCRIPTOR, DYNAMICS, MOMENTA, direction, orientation >::collide ( CELL & cell,
PARAMETERS & parameters )
inline

Definition at line 66 of file advectionDiffusionBoundaries.h.

66 {
67 V dirichletTemperature = MomentaF().computeRho(cell);
68
69 // Placeholder - the index calculation of this section can and should be done at compile time
70 constexpr auto unknownIndices = util::subIndexOutgoing<DESCRIPTOR, direction, orientation>();
72
73 if constexpr ((DESCRIPTOR::d == 3 && DESCRIPTOR::q == 7)||(DESCRIPTOR::d == 2 && DESCRIPTOR::q == 5)) {
74 static_assert(unknownIndices.size() == 1 && knownIndices.size() == DESCRIPTOR::q - 1,
75 "More than one population missing");
76 V sum = V{0};
77 for (unsigned iPop : knownIndices) {
78 sum += cell[iPop];
79 }
80
81 // on cell there are non-shifted values -> temperature has to be changed
82 V difference = dirichletTemperature - V{1} - sum;
83 cell[unknownIndices[0]] = difference;
84 return typename DYNAMICS::template exchange_momenta<MOMENTA>::CollisionO().apply(cell, parameters);
85 }
86 else {
87 auto u = cell.template getField<descriptors::VELOCITY>();
88 // part for q=19 copied from AdvectionDiffusionEdgesDynamics.collide()
89 // but here just all missing directions, even at border of inlet area
90 // has to be checked!
91 for (unsigned iPop : unknownIndices) {
92 cell[iPop] =
93 equilibrium<DESCRIPTOR>::firstOrder(iPop, dirichletTemperature, u)
97 dirichletTemperature, u));
98 }
99 return {-1,-1};
100 }
101 };
constexpr int opposite(unsigned iPop) any_platform
Definition functions.h:95
constexpr auto subIndexOutgoingRemaining() any_platform
Definition util.h:278
constexpr auto subIndexOutgoing() any_platform
Compute opposites of wall-incoming population indices.
Definition util.h:262
typename MOMENTA::template type< DESCRIPTOR > MomentaF
static V firstOrder(int iPop, const RHO &rho, const U &u) any_platform
Computation of equilibrium distribution, first order in u.
Definition lbm.h:37

References olb::equilibrium< DESCRIPTOR >::firstOrder(), olb::descriptors::opposite(), olb::util::subIndexOutgoing(), and olb::util::subIndexOutgoingRemaining().

+ Here is the call graph for this function:

◆ computeEquilibrium()

template<typename T , typename DESCRIPTOR , typename DYNAMICS , typename MOMENTA , int direction, int orientation>
void olb::AdvectionDiffusionBoundariesDynamics< T, DESCRIPTOR, DYNAMICS, MOMENTA, direction, orientation >::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 103 of file advectionDiffusionBoundaries.h.

103 {
104 for ( int iPop = 0; iPop < DESCRIPTOR::q; iPop++ ) {
105 fEq[iPop] = equilibrium<DESCRIPTOR>::firstOrder(iPop, rho, u);
106 }
107 };

References olb::equilibrium< DESCRIPTOR >::firstOrder().

+ Here is the call graph for this function:

◆ getName()

template<typename T , typename DESCRIPTOR , typename DYNAMICS , typename MOMENTA , int direction, int orientation>
std::string olb::AdvectionDiffusionBoundariesDynamics< T, DESCRIPTOR, DYNAMICS, MOMENTA, direction, orientation >::getName ( ) const
inlineoverridevirtual

Return human-readable name.

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

Definition at line 109 of file advectionDiffusionBoundaries.h.

109 {
110 return "AdvectionDiffusionBoundariesDynamics";
111 };

◆ getParameters()

template<typename T , typename DESCRIPTOR , typename DYNAMICS , typename MOMENTA , int direction, int orientation>
AbstractParameters< T, DESCRIPTOR > & olb::AdvectionDiffusionBoundariesDynamics< T, DESCRIPTOR, DYNAMICS, MOMENTA, direction, orientation >::getParameters ( BlockLattice< T, DESCRIPTOR > & block)
inlineoverridevirtual

Parameters access for legacy post processors.

Implements olb::Dynamics< T, DESCRIPTOR >.

Definition at line 61 of file advectionDiffusionBoundaries.h.

61 {
62 return block.template getData<OperatorParameters<AdvectionDiffusionBoundariesDynamics>>();
63 }

◆ id()

template<typename T , typename DESCRIPTOR , typename DYNAMICS , typename MOMENTA , int direction, int orientation>
std::type_index olb::AdvectionDiffusionBoundariesDynamics< T, DESCRIPTOR, DYNAMICS, MOMENTA, direction, orientation >::id ( )
inlineoverridevirtual

Expose unique type-identifier for RTTI.

Implements olb::Dynamics< T, DESCRIPTOR >.

Definition at line 57 of file advectionDiffusionBoundaries.h.

57 {
58 return typeid(AdvectionDiffusionBoundariesDynamics);
59 };

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