OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::PhaseFieldInletDynamics< T, DESCRIPTOR, DYNAMICS, MOMENTA, direction, orientation > Class Template Reference

Implementation of Dirichlet boundary condition for the order parameter. More...

#include <phaseFieldBoundaryDynamics.h>

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

Public Types

using MomentaF = typename MOMENTA::template type<DESCRIPTOR>
 
using EquilibriumF = typename CORRECTED_DYNAMICS::EquilibriumF
 
using parameters = typename CORRECTED_DYNAMICS::parameters
 
template<typename M >
using exchange_momenta = PhaseFieldInletDynamics<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>
class olb::PhaseFieldInletDynamics< T, DESCRIPTOR, DYNAMICS, MOMENTA, direction, orientation >

Implementation of Dirichlet boundary condition for the order parameter.

Definition at line 35 of file phaseFieldBoundaryDynamics.h.

Member Typedef Documentation

◆ EquilibriumF

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

Definition at line 42 of file phaseFieldBoundaryDynamics.h.

◆ exchange_momenta

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

Definition at line 47 of file phaseFieldBoundaryDynamics.h.

◆ MomentaF

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

Definition at line 41 of file phaseFieldBoundaryDynamics.h.

◆ parameters

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

Definition at line 44 of file phaseFieldBoundaryDynamics.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::PhaseFieldInletDynamics< T, DESCRIPTOR, DYNAMICS, MOMENTA, direction, orientation >::collide ( CELL & cell,
PARAMETERS & parameters )
inline

Definition at line 58 of file phaseFieldBoundaryDynamics.h.

58 {
59 // Along all the commented parts of this code there will be an example based
60 // on the situation where the wall's normal vector if (0,1) and the
61 // numerotation of the velocites are done according to the D2Q9
62 // lattice of the OpenLB library.
63
64 // Find all the missing populations
65 // (directions 3,4,5)
66 constexpr auto missingIndices = util::subIndexOutgoing<DESCRIPTOR,direction,orientation>();
67
68 V phi = MomentaF().computeRho(cell);
69 V missingPhi = phi - 1.;
70 V missingWeightSum = 0;
71 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
72
73 bool contains = false;
74 for(unsigned i=0; i < missingIndices.size(); i++){
75 if(missingIndices[i] == (unsigned)iPop){
76 contains = true;
77 }
78 }
79
80 if(contains){
81 missingWeightSum += descriptors::t<V,DESCRIPTOR>(iPop);
82 } else {
83 missingPhi -= cell[iPop];
84 }
85 }
86
87 for (unsigned iPop=0; iPop < missingIndices.size(); ++iPop) {
88 cell[missingIndices[iPop]] = missingPhi * descriptors::t<V,DESCRIPTOR>(missingIndices[iPop]) / missingWeightSum;
89 }
90
91 return typename CORRECTED_DYNAMICS::CollisionO().apply(cell, parameters);
92 }
typename MOMENTA::template type< DESCRIPTOR > MomentaF
typename CORRECTED_DYNAMICS::parameters parameters
constexpr T t(unsigned iPop, tag::CUM) any_platform
Definition cum.h:108
constexpr bool contains()
Returns true iff a given type list contains WANTED.
Definition meta.h:125
constexpr auto subIndexOutgoing() any_platform
Compute opposites of wall-incoming population indices.
Definition util.h:262

References olb::util::subIndexOutgoing(), and olb::descriptors::t().

+ Here is the call graph for this function:

◆ computeEquilibrium()

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

94 {
95 EquilibriumF().compute(cell, rho, u, fEq);
96 };
typename CORRECTED_DYNAMICS::EquilibriumF EquilibriumF

◆ getName()

template<typename T , typename DESCRIPTOR , typename DYNAMICS , typename MOMENTA , int direction, int orientation>
std::string olb::PhaseFieldInletDynamics< 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 phaseFieldBoundaryDynamics.h.

98 {
99 return "PhaseFieldInletDynamics<" + CORRECTED_DYNAMICS().getName() + ">";
100 };

◆ getParameters()

template<typename T , typename DESCRIPTOR , typename DYNAMICS , typename MOMENTA , int direction, int orientation>
AbstractParameters< T, DESCRIPTOR > & olb::PhaseFieldInletDynamics< 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 53 of file phaseFieldBoundaryDynamics.h.

53 {
54 return block.template getData<OperatorParameters<PhaseFieldInletDynamics>>();
55 }

◆ id()

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

Expose unique type-identifier for RTTI.

Implements olb::Dynamics< T, DESCRIPTOR >.

Definition at line 49 of file phaseFieldBoundaryDynamics.h.

49 {
50 return typeid(PhaseFieldInletDynamics);
51 }

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