25#ifndef ADVECTION_DIFFUSION_BOUNDARIES_H
26#define ADVECTION_DIFFUSION_BOUNDARIES_H
39template<
typename T,
typename DESCRIPTOR,
typename DYNAMICS,
typename MOMENTA,
int direction,
int orientation>
41 using MomentaF =
typename MOMENTA::template type<DESCRIPTOR>;
46 template <
typename NEW_T>
51 direction, orientation
57 std::type_index
id()
override {
62 return block.template getData<OperatorParameters<AdvectionDiffusionBoundariesDynamics>>();
65 template <
typename CELL,
typename PARAMETERS,
typename V=
typename CELL::value_t>
67 V dirichletTemperature =
MomentaF().computeRho(cell);
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");
77 for (
unsigned iPop : knownIndices) {
82 V difference = dirichletTemperature - V{1} - sum;
83 cell[unknownIndices[0]] = difference;
87 auto u = cell.template getField<descriptors::VELOCITY>();
91 for (
unsigned iPop : unknownIndices) {
97 dirichletTemperature, u));
104 for (
int iPop = 0; iPop < DESCRIPTOR::q; iPop++ ) {
110 return "AdvectionDiffusionBoundariesDynamics";
115template <
typename T,
typename DESCRIPTOR,
typename DYNAMICS,
typename MOMENTA,
int...ARGS>
124template<
typename T,
typename DESCRIPTOR,
typename DYNAMICS,
typename MOMENTA,
int plane,
int normal1,
int normal2>
127 using MomentaF =
typename MOMENTA::template type<DESCRIPTOR>;
132 template <
typename NEW_T>
137 plane, normal1, normal2
140 template <
typename M>
143 std::type_index
id()
override {
148 return block.template getData<OperatorParameters<AdvectionDiffusionEdgesDynamics>>();
151 template <
typename CELL,
typename PARAMETERS,
typename V=
typename CELL::value_t>
153 V temperature =
MomentaF().computeRho(cell);
154 auto u = cell.template getField<descriptors::VELOCITY>();
163 for (
unsigned iPop : unknownIndexes) {
176 for (
int iPop = 0; iPop < DESCRIPTOR::q; iPop++ ) {
182 return "AdvectionDiffusionEdgesDynamics";
186template <
typename T,
typename DESCRIPTOR,
typename DYNAMICS,
typename MOMENTA,
int...ARGS>
195template<
typename T,
typename DESCRIPTOR,
typename DYNAMICS,
typename MOMENTA,
int xNormal,
int yNormal>
197 using MomentaF =
typename MOMENTA::template type<DESCRIPTOR>;
202 template <
typename NEW_T>
210 template <
typename M>
213 std::type_index
id()
override {
218 return block.template getData<OperatorParameters<AdvectionDiffusionCornerDynamics2D>>();
221 template <
typename CELL,
typename PARAMETERS,
typename V=
typename CELL::value_t>
223 V temperature =
MomentaF().computeRho(cell);
224 auto u = cell.template getField<descriptors::VELOCITY>();
233 for (
unsigned iPop : unknownIndexes) {
242 return typename DYNAMICS::CollisionO().apply(cell,
parameters);
246 for (
int iPop = 0; iPop < DESCRIPTOR::q; iPop++ ) {
252 return "AdvectionDiffusionCornerDynamics2D";
257template<
typename T,
typename DESCRIPTOR,
typename DYNAMICS,
typename MOMENTA,
int... NORMAL>
266template<
typename T,
typename DESCRIPTOR,
typename DYNAMICS,
typename MOMENTA,
int xNormal,
int yNormal,
int zNormal>
268 using MomentaF =
typename MOMENTA::template type<DESCRIPTOR>;
273 template <
typename NEW_T>
278 xNormal, yNormal, zNormal
281 template <
typename M>
284 std::type_index
id()
override {
289 return block.template getData<OperatorParameters<AdvectionDiffusionCornerDynamics3D>>();
292 template <
typename CELL,
typename PARAMETERS,
typename V=
typename CELL::value_t>
294 V temperature =
MomentaF().computeRho(cell);
295 auto u = cell.template getField<descriptors::VELOCITY>();
304 for (
unsigned iPop : unknownIndexes) {
317 for (
int iPop = 0; iPop < DESCRIPTOR::q; iPop++ ) {
323 return "AdvectionDiffusionCornerDynamics3D";
328template<
typename T,
typename DESCRIPTOR,
typename DYNAMICS,
typename MOMENTA,
int... NORMAL>
A collection of dynamics classes (e.g.
std::string getName() const override
Return human-readable name.
typename DYNAMICS::template exchange_momenta< MOMENTA >::EquilibriumF EquilibriumF
typename MOMENTA::template type< DESCRIPTOR > MomentaF
AbstractParameters< T, DESCRIPTOR > & getParameters(BlockLattice< T, DESCRIPTOR > &block) override
Parameters access for legacy post processors.
CellStatistic< V > collide(CELL &cell, PARAMETERS ¶meters) 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::type_index id() override
Expose unique type-identifier for RTTI.
typename DYNAMICS::parameters parameters
Highest-level interface to read-only Cell data.
constexpr int opposite(unsigned iPop) any_platform
constexpr auto subIndexOutgoingRemaining() any_platform
constexpr auto subIndexOutgoing2DonCorners() any_platform
constexpr auto subIndexOutgoing3DonEdges() any_platform
constexpr auto subIndexOutgoing() any_platform
Compute opposites of wall-incoming population indices.
constexpr auto subIndexOutgoing3DonCorners() any_platform
Top level namespace for all of OpenLB.
Dynamic access interface for FIELD-valued parameters.
typename DYNAMICS::template exchange_momenta< MOMENTA >::EquilibriumF EquilibriumF
std::string getName() const override
Return human-readable name.
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.
CellStatistic< V > collide(CELL &cell, PARAMETERS ¶meters) any_platform
typename DYNAMICS::parameters parameters
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.
typename MOMENTA::template type< DESCRIPTOR > MomentaF
typename DYNAMICS::template exchange_momenta< MOMENTA >::EquilibriumF EquilibriumF
typename MOMENTA::template type< DESCRIPTOR > MomentaF
typename DYNAMICS::parameters parameters
CellStatistic< V > collide(CELL &cell, PARAMETERS ¶meters) any_platform
AbstractParameters< T, DESCRIPTOR > & getParameters(BlockLattice< T, DESCRIPTOR > &block) override
Parameters access for legacy post processors.
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::type_index id() override
Expose unique type-identifier for RTTI.
std::string getName() const override
Return human-readable name.
typename DYNAMICS::template exchange_momenta< MOMENTA >::EquilibriumF EquilibriumF
std::string getName() const override
Return human-readable name.
AbstractParameters< T, DESCRIPTOR > & getParameters(BlockLattice< T, DESCRIPTOR > &block) override
Parameters access for legacy post processors.
typename MOMENTA::template type< DESCRIPTOR > MomentaF
std::type_index id() override
Expose unique type-identifier for RTTI.
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.
CellStatistic< V > collide(CELL &cell, PARAMETERS ¶meters) any_platform
typename DYNAMICS::parameters parameters
Return value of any collision.
Set PARAMETER of DYNAMICS from CELL (for CustomCollision-based DYNAMICS)
static V firstOrder(int iPop, const RHO &rho, const U &u) any_platform
Computation of equilibrium distribution, first order in u.