OpenLB 1.7
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
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 parameters = typename DYNAMICS::parameters
 
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 > apply (CELL &cell, PARAMETERS &parameters) any_platform
 
computeEquilibrium (int iPop, T rho, const T u[DESCRIPTOR::d]) const override any_platform
 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

◆ 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 46 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 43 of file advectionDiffusionBoundaries.h.

Member Function Documentation

◆ apply()

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

Definition at line 57 of file advectionDiffusionBoundaries.h.

57 {
58 V dirichletTemperature = MomentaF().computeRho(cell);
59
60 // Placeholder - the index calculation of this section can and should be done at compile time
61 constexpr auto unknownIndices = util::subIndexOutgoing<DESCRIPTOR, direction, orientation>();
62 constexpr auto knownIndices = util::subIndexOutgoingRemaining<DESCRIPTOR, direction, orientation>();
63
64 if constexpr ((DESCRIPTOR::d == 3 && DESCRIPTOR::q == 7)||(DESCRIPTOR::d == 2 && DESCRIPTOR::q == 5)) {
65 static_assert(unknownIndices.size() == 1 && knownIndices.size() == DESCRIPTOR::q - 1,
66 "More than one population missing");
67 V sum = V{0};
68 for (unsigned iPop : knownIndices) {
69 sum += cell[iPop];
70 }
71
72 // on cell there are non-shifted values -> temperature has to be changed
73 V difference = dirichletTemperature - V{1} - sum;
74 cell[unknownIndices[0]] = difference;
75 return typename DYNAMICS::template exchange_momenta<MOMENTA>::CollisionO().apply(cell, parameters);
76 }
77 else {
78 auto u = cell.template getField<descriptors::VELOCITY>();
79 // part for q=19 copied from AdvectionDiffusionEdgesDynamics.collide()
80 // but here just all missing directions, even at border of inlet area
81 // has to be checked!
82 for (unsigned iPop : unknownIndices) {
83 cell[iPop] =
84 equilibrium<DESCRIPTOR>::template firstOrder(iPop, dirichletTemperature, u)
85 - (cell[descriptors::opposite<DESCRIPTOR>(iPop)]
86 - equilibrium<DESCRIPTOR>::template firstOrder(
87 descriptors::opposite<DESCRIPTOR>(iPop),
88 dirichletTemperature, u));
89 }
90 return {-1,-1};
91 }
92 };
typename MOMENTA::template type< DESCRIPTOR > MomentaF

References olb::AdvectionDiffusionBoundariesDynamics< T, DESCRIPTOR, DYNAMICS, MOMENTA, direction, orientation >::apply().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ computeEquilibrium()

template<typename T , typename DESCRIPTOR , typename DYNAMICS , typename MOMENTA , int direction, int orientation>
T olb::AdvectionDiffusionBoundariesDynamics< T, DESCRIPTOR, DYNAMICS, MOMENTA, direction, orientation >::computeEquilibrium ( int iPop,
T rho,
const T u[DESCRIPTOR::d] ) const
inlineoverridevirtual

Return iPop equilibrium for given first and second momenta.

Implements olb::Dynamics< T, DESCRIPTOR >.

Definition at line 94 of file advectionDiffusionBoundaries.h.

94 {
95 return equilibrium<DESCRIPTOR>::template firstOrder(iPop, rho, u);
96 };

◆ 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 98 of file advectionDiffusionBoundaries.h.

98 {
99 return "AdvectionDiffusionBoundariesDynamics";
100 };

◆ 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 52 of file advectionDiffusionBoundaries.h.

52 {
53 return block.template getData<OperatorParameters<AdvectionDiffusionBoundariesDynamics>>();
54 }

◆ 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 48 of file advectionDiffusionBoundaries.h.

48 {
49 return typeid(AdvectionDiffusionBoundariesDynamics);
50 };

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