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>;
48 std::type_index
id()
override {
53 return block.template getData<OperatorParameters<AdvectionDiffusionBoundariesDynamics>>();
56 template <
typename CELL,
typename PARAMETERS,
typename V=
typename CELL::value_t>
58 V dirichletTemperature =
MomentaF().computeRho(cell);
61 constexpr auto unknownIndices = util::subIndexOutgoing<DESCRIPTOR, direction, orientation>();
62 constexpr auto knownIndices = util::subIndexOutgoingRemaining<DESCRIPTOR, direction, orientation>();
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");
68 for (
unsigned iPop : knownIndices) {
73 V difference = dirichletTemperature - V{1} - sum;
74 cell[unknownIndices[0]] = difference;
78 auto u = cell.template getField<descriptors::VELOCITY>();
82 for (
unsigned iPop : unknownIndices) {
85 - (cell[descriptors::opposite<DESCRIPTOR>(iPop)]
87 descriptors::opposite<DESCRIPTOR>(iPop),
88 dirichletTemperature, u));
99 return "AdvectionDiffusionBoundariesDynamics";
104template <
typename T,
typename DESCRIPTOR,
typename DYNAMICS,
typename MOMENTA,
int...ARGS>
113template<
typename T,
typename DESCRIPTOR,
typename DYNAMICS,
typename MOMENTA,
int plane,
int normal1,
int normal2>
116 using MomentaF =
typename MOMENTA::template type<DESCRIPTOR>;
120 template <
typename M>
123 std::type_index
id()
override {
128 return block.template getData<OperatorParameters<AdvectionDiffusionEdgesDynamics>>();
131 template <
typename CELL,
typename PARAMETERS,
typename V=
typename CELL::value_t>
133 V temperature =
MomentaF().computeRho(cell);
134 auto u = cell.template getField<descriptors::VELOCITY>();
136 constexpr auto unknownIndexes = util::subIndexOutgoing3DonEdges<DESCRIPTOR,plane,normal1,normal2>();
143 for (
unsigned iPop : unknownIndexes) {
145 - ( cell[descriptors::opposite<DESCRIPTOR>(iPop)]
160 return "AdvectionDiffusionEdgesDynamics";
164template <
typename T,
typename DESCRIPTOR,
typename DYNAMICS,
typename MOMENTA,
int...ARGS>
173template<
typename T,
typename DESCRIPTOR,
typename DYNAMICS,
typename MOMENTA,
int xNormal,
int yNormal>
175 using MomentaF =
typename MOMENTA::template type<DESCRIPTOR>;
179 template <
typename M>
182 std::type_index
id()
override {
187 return block.template getData<OperatorParameters<AdvectionDiffusionCornerDynamics2D>>();
190 template <
typename CELL,
typename PARAMETERS,
typename V=
typename CELL::value_t>
192 V temperature =
MomentaF().computeRho(cell);
193 auto u = cell.template getField<descriptors::VELOCITY>();
195 constexpr auto unknownIndexes = util::subIndexOutgoing2DonCorners<DESCRIPTOR,xNormal,yNormal>();
202 for (
unsigned iPop : unknownIndexes) {
204 - ( cell[descriptors::opposite<DESCRIPTOR>(iPop)]
211 return typename DYNAMICS::CollisionO().apply(cell,
parameters);
219 return "AdvectionDiffusionCornerDynamics2D";
224template<
typename T,
typename DESCRIPTOR,
typename DYNAMICS,
typename MOMENTA,
int... NORMAL>
233template<
typename T,
typename DESCRIPTOR,
typename DYNAMICS,
typename MOMENTA,
int xNormal,
int yNormal,
int zNormal>
235 using MomentaF =
typename MOMENTA::template type<DESCRIPTOR>;
239 template <
typename M>
242 std::type_index
id()
override {
247 return block.template getData<OperatorParameters<AdvectionDiffusionCornerDynamics3D>>();
250 template <
typename CELL,
typename PARAMETERS,
typename V=
typename CELL::value_t>
252 V temperature =
MomentaF().computeRho(cell);
253 auto u = cell.template getField<descriptors::VELOCITY>();
255 constexpr auto unknownIndexes = util::subIndexOutgoing3DonCorners<DESCRIPTOR,xNormal,yNormal,zNormal>();
262 for (
unsigned iPop : unknownIndexes) {
264 - ( cell[descriptors::opposite<DESCRIPTOR>(iPop)]
279 return "AdvectionDiffusionCornerDynamics3D";
284template<
typename T,
typename DESCRIPTOR,
typename DYNAMICS,
typename MOMENTA,
int... NORMAL>
A collection of dynamics classes (e.g.
T 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.
typename MOMENTA::template type< DESCRIPTOR > MomentaF
AbstractParameters< T, DESCRIPTOR > & getParameters(BlockLattice< T, DESCRIPTOR > &block) override
Parameters access for legacy post processors.
std::type_index id() override
Expose unique type-identifier for RTTI.
CellStatistic< V > apply(CELL &cell, PARAMETERS ¶meters) any_platform
typename DYNAMICS::parameters parameters
Platform-abstracted block lattice for external access and inter-block interaction.
Descriptor for all types of 2D and 3D lattices.
Top level namespace for all of OpenLB.
Dynamic access interface for FIELD-valued parameters.
std::string getName() const override
Return human-readable name.
CellStatistic< V > apply(CELL &cell, PARAMETERS ¶meters) any_platform
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.
typename DYNAMICS::parameters parameters
typename MOMENTA::template type< DESCRIPTOR > MomentaF
T computeEquilibrium(int iPop, T rho, const T u[DESCRIPTOR::d]) const override any_platform
Return iPop equilibrium for given first and second momenta.
typename MOMENTA::template type< DESCRIPTOR > MomentaF
typename DYNAMICS::parameters parameters
CellStatistic< V > apply(CELL &cell, PARAMETERS ¶meters) any_platform
AbstractParameters< T, DESCRIPTOR > & getParameters(BlockLattice< T, DESCRIPTOR > &block) override
Parameters access for legacy post processors.
T computeEquilibrium(int iPop, T rho, const T u[DESCRIPTOR::d]) const override any_platform
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.
std::string getName() const override
Return human-readable name.
CellStatistic< V > apply(CELL &cell, PARAMETERS ¶meters) any_platform
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.
T computeEquilibrium(int iPop, T rho, const T u[DESCRIPTOR::d]) const override any_platform
Return iPop equilibrium for given first and second momenta.
typename DYNAMICS::parameters parameters
Return value of any collision.
Set PARAMETER of DYNAMICS from CELL (for CustomCollision-based DYNAMICS)