29#ifndef ADVECTION_DIFFUSION_DYNAMICS_H
30#define ADVECTION_DIFFUSION_DYNAMICS_H
39namespace TotalEnthalpy {
53 template <
unsigned D,
unsigned Q,
unsigned...>
54 static constexpr unsigned size() {
58 template <
typename DESCRIPTOR>
59 static constexpr unsigned size() {
60 return DESCRIPTOR::q * DESCRIPTOR::q;
63 template <
typename T,
typename DESCRIPTOR>
68 template <
typename T,
typename DESCRIPTOR,
typename FIELD>
78 return "AdvectionDifffusionExternalVelocityCollision";
81 template <
typename DESCRIPTOR,
typename MOMENTA>
84 template <
typename DESCRIPTOR,
typename MOMENTA,
typename EQUILIBRIUM>
87 template <
typename DESCRIPTOR,
typename MOMENTA,
typename EQUILIBRIUM,
typename COLLISION>
91 typename MOMENTA::density,
93 typename MOMENTA::stress,
94 typename MOMENTA::definition
99 template <
typename DESCRIPTOR,
typename MOMENTA,
typename EQUILIBRIUM,
typename COLLISION>
103template<
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::AdvectionDiffusionBulkTuple>
112template <
typename T,
typename DESCRIPTOR,
typename DYNAMICS,
typename MOMENTA=momenta::AdvectionDiffusionBulkTuple>
115 using MomentaF =
typename MOMENTA::template type<DESCRIPTOR>;
120 template <
typename NEW_T>
127 template <
typename M>
130 std::type_index
id()
override {
135 return block.template getData<OperatorParameters<CombinedAdvectionDiffusionRLBdynamics>>();
138 template <
typename CELL,
typename PARAMETERS,
typename V=
typename CELL::value_t>
140 V jNeq[DESCRIPTOR::d] { };
142 const V rho =
MomentaF().computeRho(cell);
143 const auto u = cell.template getField<descriptors::VELOCITY>();
146 for (
int iD = 0; iD < DESCRIPTOR::d; ++iD) {
147 jNeq[iD] -= u[iD] * rho;
150 V fEq[DESCRIPTOR::q] { };
152 for (
int iPop = 0; iPop < DESCRIPTOR::q; ++iPop) {
156 return typename DYNAMICS::CollisionO().apply(cell,
parameters);
160 for (
int iPop = 0; iPop < DESCRIPTOR::q; iPop++ ) {
166 return "CombinedAdvectionDiffusionRLBdynamics<" +
MomentaF().getName() +
">";
173template<
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::AdvectionDiffusionBulkTuple>
185template<
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::AdvectionDiffusionBulkTuple>
199template<
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::AdvectionDiffusionBulkTuple>
203 momenta::SourcedDensity<typename MOMENTA::density>,
204 typename MOMENTA::momentum,
205 typename MOMENTA::stress,
206 typename MOMENTA::definition
211 typename MOMENTA::momentum,
212 typename MOMENTA::stress,
213 typename MOMENTA::definition
214 >::template type<DESCRIPTOR>;
215 using EquilibriumF =
typename equilibria::FirstOrder::template type<DESCRIPTOR,MOMENTA>;
219 template <
typename NEW_T>
228 std::type_index
id()
override {
233 return block.template getData<OperatorParameters<SourcedAdvectionDiffusionBGKdynamics>>();
236 template <
typename CELL,
typename PARAMETERS,
typename V=
typename CELL::value_t>
238 const auto u = cell.template getField<descriptors::VELOCITY>();
239 const V temperature =
MomentaF().computeRho(cell);
240 const V omega =
parameters.template get<descriptors::OMEGA>();
243 const V sourceMod = cell.template getField<descriptors::SOURCE>() * (V{1} - V{0.5} * omega);
245 for (
int iPop = 0; iPop < DESCRIPTOR::q; iPop++ ) {
249 return {temperature, uSqr};
253 for (
int iPop = 0; iPop < DESCRIPTOR::q; iPop++ ) {
259 return "SourcedAdvectionDiffusionBGKdynamics<" +
MomentaF().getName() +
">";
268template<
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::AdvectionDiffusionBulkTuple>
272 momenta::SourcedDensity<typename MOMENTA::density>,
273 typename MOMENTA::momentum,
274 typename MOMENTA::stress,
275 typename MOMENTA::definition
280 typename MOMENTA::momentum,
281 typename MOMENTA::stress,
282 typename MOMENTA::definition
283 >::template type<DESCRIPTOR>;
284 using EquilibriumF =
typename equilibria::FirstOrder::template type<DESCRIPTOR,MOMENTA>;
290 template <
typename NEW_T>
296 std::type_index
id()
override {
301 return block.template getData<OperatorParameters<SourcedLimitedAdvectionDiffusionBGKdynamics>>();
304 template <
typename CELL,
typename PARAMETERS,
typename V=
typename CELL::value_t>
306 const auto u = cell.template getField<descriptors::VELOCITY>();
307 V temperature =
MomentaF().computeRho(cell);
308 if (temperature < V{1.e-8}) temperature = V{1.e-8};
309 const V omega = cell.template getField<descriptors::OMEGA>();
312 const V sourceMod = cell.template getField<descriptors::SOURCE>() * (V{1} - V{0.5} * omega);
314 for (
int iPop = 0; iPop < DESCRIPTOR::q; iPop++ ) {
318 return {temperature, uSqr};
322 for (
int iPop = 0; iPop < DESCRIPTOR::q; iPop++ ) {
328 return "SourcedLimitedAdvectionDiffusionBGKdynamics<" +
MomentaF().getName() +
">";
336template<
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::AdvectionDiffusionBulkTuple>
340 using MomentaF =
typename MOMENTA::template type<DESCRIPTOR>;
341 using EquilibriumF =
typename equilibria::FirstOrder::template type<DESCRIPTOR,MOMENTA>;
354 template <
typename NEW_T>
360 std::type_index
id()
override {
365 return block.template getData<OperatorParameters<TotalEnthalpyAdvectionDiffusionBGKdynamics>>();
368 template<
typename V,
typename PARAMETERS,
typename ENTHALPY>
371 using namespace TotalEnthalpy;
373 const V cp_s =
parameters.template get<CP_S>();
374 const V cp_l =
parameters.template get<CP_L>();
378 const V H_s = cp_s * T_s;
379 const V H_l = cp_l * T_l + l;
382 if (enthalpy <= H_s) {
383 temperature = T_s - (H_s - enthalpy) / cp_s;
385 else if (enthalpy >= H_l) {
386 temperature = T_l + (enthalpy - H_l) / cp_l;
389 temperature = (H_l - enthalpy) / (H_l - H_s) * T_s + (enthalpy - H_s) / (H_l - H_s) * T_l;
394 template<
typename V,
typename PARAMETERS,
typename ENTHALPY>
397 using namespace TotalEnthalpy;
399 const V cp_s =
parameters.template get<CP_S>();
400 const V cp_l =
parameters.template get<CP_L>();
404 const V H_s = cp_s * T_s;
405 const V H_l = cp_l * T_l + l;
408 if (enthalpy <= H_s) {
409 liquid_fraction = 0.;
411 else if (enthalpy >= H_l) {
412 liquid_fraction = 1.;
415 liquid_fraction = (enthalpy - H_s) / l;
417 return liquid_fraction;
421 for (
int iPop = 0; iPop < DESCRIPTOR::q; iPop++ ) {
426 template <
typename CELL,
typename PARAMETERS,
typename V=
typename CELL::value_t>
428 using namespace TotalEnthalpy;
430 const V lambda_s =
parameters.template get<LAMBDA_S>();
431 const V lambda_l =
parameters.template get<LAMBDA_L>();
432 const V cp_s =
parameters.template get<CP_S>();
433 const V cp_l =
parameters.template get<CP_L>();
434 const V cp_ref = V{2} * cp_s * cp_l / (cp_s + cp_l);
436 const V enthalpy =
MomentaF().computeRho( cell );
439 const V lambda = (V{1} - liquid_fraction) * lambda_s + liquid_fraction * lambda_l;
440 const V cp = (V{1} - liquid_fraction) * cp_s + liquid_fraction * cp_l;
443 const auto u = cell.template getFieldPointer<descriptors::VELOCITY>();
447 const V f_eq = enthalpy - cp_ref * temperature
451 cell[0] *= V{1} - omega;
452 cell[0] += omega * f_eq;
453 for (
int iPop=1; iPop < DESCRIPTOR::q; ++iPop) {
455 for (
int iD=0; iD < DESCRIPTOR::d; ++iD) {
462 cell[iPop] *= V{1} - omega;
463 cell[iPop] += omega * f_eq;
465 return {enthalpy, uSqr};
469 return "TotalEnthalpyAdvectionDiffusionBGKdynamics<" +
MomentaF().getName() +
">";
477template<
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::AdvectionDiffusionBulkTuple>
481 using MomentaF =
typename MOMENTA::template type<DESCRIPTOR>;
482 using EquilibriumF =
typename equilibria::FirstOrder::template type<DESCRIPTOR,MOMENTA>;
496 template <
typename NEW_T>
502 std::type_index
id()
override {
507 return block.template getData<OperatorParameters<TotalEnthalpyAdvectionDiffusionTRTdynamics>>();
510 template<
typename V,
typename PARAMETERS,
typename ENTHALPY>
513 using namespace TotalEnthalpy;
515 const V cp_s =
parameters.template get<CP_S>();
516 const V cp_l =
parameters.template get<CP_L>();
520 const V H_s = cp_s * T_s;
521 const V H_l = cp_l * T_l + l;
524 if (enthalpy <= H_s) {
525 temperature = T_s - (H_s - enthalpy) / cp_s;
527 else if (enthalpy >= H_l) {
528 temperature = T_l + (enthalpy - H_l) / cp_l;
531 temperature = (H_l - enthalpy) / (H_l - H_s) * T_s + (enthalpy - H_s) / (H_l - H_s) * T_l;
536 template<
typename V,
typename PARAMETERS,
typename ENTHALPY>
539 using namespace TotalEnthalpy;
541 const V cp_s =
parameters.template get<CP_S>();
542 const V cp_l =
parameters.template get<CP_L>();
546 const V H_s = cp_s * T_s;
547 const V H_l = cp_l * T_l + l;
550 if (enthalpy <= H_s) {
551 liquid_fraction = 0.;
553 else if (enthalpy >= H_l) {
554 liquid_fraction = 1.;
557 liquid_fraction = (enthalpy - H_s) / l;
559 return liquid_fraction;
562 template<
typename V,
typename PARAMETERS,
typename RHO,
typename U>
565 using namespace TotalEnthalpy;
571 const V cp_s =
parameters.template get<CP_S>();
572 const V cp_l =
parameters.template get<CP_L>();
573 const V cp = (V{1} - liquid_fraction) * cp_s + liquid_fraction * cp_l;
574 const V cp_ref = V{2} * cp_s * cp_l / (cp_s + cp_l);
577 for (
int iD=0; iD < DESCRIPTOR::d; ++iD) {
583 f_eq = rho - cp_ref * temperature
598 template <
typename CELL,
typename PARAMETERS,
typename V=
typename CELL::value_t>
600 using namespace TotalEnthalpy;
602 const V lambda_s =
parameters.template get<LAMBDA_S>();
603 const V lambda_l =
parameters.template get<LAMBDA_L>();
604 const V cp_s =
parameters.template get<CP_S>();
605 const V cp_l =
parameters.template get<CP_L>();
606 const V cp_ref = V{2} * cp_s * cp_l / (cp_s + cp_l);
608 const V enthalpy =
MomentaF().computeRho( cell );
610 const V lambda = (V{1} - liquid_fraction) * lambda_s + liquid_fraction * lambda_l;
612 const V magic_parameter =
parameters.template get<collision::TRT::MAGIC>();
613 const V omega2 = V{1} / (magic_parameter/(V{1}/omega-V{0.5})+V{0.5});
615 const auto u = cell.template getField<descriptors::VELOCITY>();
619 V fPlus[DESCRIPTOR::q], fMinus[DESCRIPTOR::q] { };
620 V fEq[DESCRIPTOR::q], fEqPlus[DESCRIPTOR::q], fEqMinus[DESCRIPTOR::q] { };
622 for (
int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
628 for (
int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
633 for (
int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
634 cell[iPop] -= omega2 * (fPlus[iPop] - fEqPlus[iPop]) + omega * (fMinus[iPop] - fEqMinus[iPop]);
637 return {enthalpy, uSqr};
641 for (
int iPop = 0; iPop < DESCRIPTOR::q; iPop++ ) {
647 return "TotalEnthalpyAdvectionDiffusionTRTdynamics<" +
MomentaF().getName() +
">";
651namespace descriptors {
661template<
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::AdvectionDiffusionBulkTuple>
663 using MomentaF =
typename MOMENTA::template type<DESCRIPTOR>;
664 using EquilibriumF =
typename equilibria::FirstOrder::template type<DESCRIPTOR,momenta::BulkTuple>;
668 template <
typename NEW_T>
674 std::type_index
id()
override {
679 return block.template getData<OperatorParameters<PhaseFieldAdvectionDiffusionBGKdynamics>>();
682 template <
typename CELL,
typename PARAMETERS,
typename V=
typename CELL::value_t>
684 const V omega =
parameters.template get<descriptors::OMEGA>();
685 const V interface_thickness =
parameters.template get<descriptors::INTERFACE_THICKNESS>();
687 const V phi =
MomentaF().computeRho( cell );
688 const auto u = cell.template getField<descriptors::VELOCITY>();
692 const auto n = cell.template getFieldPointer<descriptors::INTERPHASE_NORMAL>();
693 for (
int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
696 for (
int iD=0; iD < DESCRIPTOR::d; ++iD) {
702 * (V{4} * phi * (V{1} - phi) / interface_thickness) * c_n;
704 cell[iPop] *= V{1} - omega;
705 cell[iPop] += omega * f_eq;
712 for (
int iPop = 0; iPop < DESCRIPTOR::q; iPop++ ) {
718 return "PhaseFieldAdvectionDiffusionBGKdynamics<" +
MomentaF().getName() +
">";
724template<
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::AdvectionDiffusionBulkTuple>
728 typename MOMENTA::density,
730 typename MOMENTA::stress,
731 typename MOMENTA::definition
732 >::template type<DESCRIPTOR>;
733 using EquilibriumF =
typename equilibria::FirstOrder::template type<DESCRIPTOR,MOMENTA>;
737 template <
typename NEW_T>
740 template <
typename M>
743 std::type_index
id()
override {
748 return block.template getData<OperatorParameters<ParticleAdvectionDiffusionBGKdynamics>>();
751 template <
typename CELL,
typename PARAMETERS,
typename V=
typename CELL::value_t>
753 const V omega =
parameters.template get<descriptors::OMEGA>();
754 const auto time =
parameters.template get<descriptors::LATTICE_TIME>();
755 const auto u = (time % 2 == 0) ? cell.template getField<descriptors::VELOCITY>()
756 : cell.template getField<descriptors::VELOCITY2>();
757 V rho =
MomentaF().computeRho(cell);
763 for (
int iPop = 0; iPop < DESCRIPTOR::q; iPop++ ) {
769 return "ParticleAdvectionDiffusionBGKdynamics<" +
MomentaF().getName() +
">";
777template<
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::AdvectionDiffusionBulkTuple>
778struct RTLBMdynamicsMcHardy final :
public dynamics::CustomCollision<T,DESCRIPTOR,MOMENTA>
780 using MomentaF =
typename MOMENTA::template type<DESCRIPTOR>;
781 using EquilibriumF =
typename equilibria::ZerothOrder::template type<DESCRIPTOR,MOMENTA>;
784 template <
typename NEW_T>
790 std::type_index
id()
override {
795 return block.template getData<OperatorParameters<RTLBMdynamicsMcHardy>>();
798 template <
typename CELL,
typename PARAMETERS,
typename V=
typename CELL::value_t>
800 const V absorption =
parameters.template get<Light::ABSORPTION>();
801 const V scattering =
parameters.template get<Light::SCATTERING>();
802 auto anisoMatrix =
parameters.template get<Light::ANISOMATRIX>();
803 V irradiance =
MomentaF().computeRho(cell);
805 for (
int iPop = 0; iPop < DESCRIPTOR::q; ++iPop ) {
806 for (
int jPop = 0; jPop < DESCRIPTOR::q; ++jPop ) {
808 feq[iPop] += fFull * anisoMatrix[jPop+iPop];
813 for (
int iPop = 0; iPop < DESCRIPTOR::q; ++iPop) {
817 - normC * (absorption + scattering) * ( fFull- feq[iPop] )
818 - absorption * normC * fFull
822 return {irradiance, V(0)};
830 return "RTLBMdynamicsMcHardy<" +
MomentaF().getName() +
">";
839template<
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::AdvectionDiffusionBulkTuple>
840struct RTLBMdynamicsMcHardyRK final :
public dynamics::CustomCollision<T,DESCRIPTOR,MOMENTA>
842 using MomentaF =
typename MOMENTA::template type<DESCRIPTOR>;
843 using EquilibriumF =
typename equilibria::ZerothOrder::template type<DESCRIPTOR,MOMENTA>;
846 template <
typename NEW_T>
852 std::type_index
id()
override {
857 return block.template getData<OperatorParameters<RTLBMdynamicsMcHardyRK>>();
860 template <
typename CELL,
typename PARAMETERS,
typename V=
typename CELL::value_t>
862 const V absorption =
parameters.template get<Light::ABSORPTION>();
863 const V scattering =
parameters.template get<Light::SCATTERING>();
864 auto anisoMatrix =
parameters.template get<Light::ANISOMATRIX>();
865 V irradiance =
MomentaF().computeRho(cell);
870 for (
int iPop = 0; iPop < DESCRIPTOR::q; ++iPop) {
875 for (
int iPop = 0; iPop < DESCRIPTOR::q; ++iPop) {
881 auto k1 =
doCollision(cell, feq, absorption, scattering);
883 for (
int iPop = 0; iPop < DESCRIPTOR::q; ++iPop) {
884 cell[iPop] = f_pre_collision[iPop] + 0.5 * k1[iPop];
888 auto k2 =
doCollision(cell, feq, absorption, scattering);
890 for (
int iPop = 0; iPop < DESCRIPTOR::q; ++iPop) {
891 cell[iPop] = f_pre_collision[iPop] + 0.5 * k2[iPop];
895 auto k3 =
doCollision(cell, feq, absorption, scattering);
897 for (
int iPop = 0; iPop < DESCRIPTOR::q; ++iPop) {
898 cell[iPop] = f_pre_collision[iPop] + k3[iPop];
902 auto k4 =
doCollision(cell, feq, absorption, scattering);
904 for (
int iPop = 0; iPop < DESCRIPTOR::q; ++iPop) {
905 cell[iPop] = f_pre_collision[iPop] + (1.0 / 6.0) * (k1[iPop] + 2 * k2[iPop] + 2 * k3[iPop] + k4[iPop])
909 return {irradiance, V(0)};
912 template <
typename CELL,
typename MATRIX,
typename V=
typename CELL::value_t>
915 for (
int i = 0; i < DESCRIPTOR::q; ++i) {
918 for (
int iPop = 0; iPop < DESCRIPTOR::q; ++iPop) {
919 for (
int jPop = 0; jPop < DESCRIPTOR::q; ++jPop) {
920 feq[iPop] += cell[jPop] * anisoMatrix[jPop+iPop];
926 template <
typename CELL,
typename VECTOR,
typename V=
typename CELL::value_t>
927 VECTOR
doCollision(CELL& cell, VECTOR& feq, V absorption, V scattering)
const {
929 for (
int iPop = 0; iPop < DESCRIPTOR::q; ++iPop) {
931 V fFull = cell[iPop];
932 k[iPop] = -normC * (absorption + scattering) * fFull
933 + normC * scattering * feq[iPop];
943 return "RTLBMdynamicsMcHardyRK<" +
MomentaF().getName() +
">";
953template<
typename T,
typename DESCRIPTOR,
typename MOMENTA=momenta::AdvectionDiffusionBulkTuple>
962template <
typename T,
typename DESCRIPTOR>
std::type_index id() override
Expose unique type-identifier for RTTI.
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.
typename DYNAMICS::EquilibriumF EquilibriumF
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.
Highest-level interface to read-only Cell data.
constexpr T invCs2() any_platform
constexpr T t(unsigned iPop, tag::CUM) any_platform
constexpr int c(unsigned iPop, unsigned iDim) any_platform
constexpr int opposite(unsigned iPop) any_platform
Tuple< BulkDensity, BulkMomentum, BulkStress, DefineToNEq > BulkTuple
Standard computation of momenta from the populations in the bulk.
auto normSqr(const ARRAY_LIKE &u) any_platform
Compute norm square of a d-dimensional vector.
T norm(const std::vector< T > &a)
l2 norm of a vector of arbitrary length
Top level namespace for all of OpenLB.
Dynamic access interface for FIELD-valued parameters.
typename COLLISION::parameters combined_parameters
typename MOMENTA::template type< DESCRIPTOR > combined_momenta
typename COLLISION::template type< DESCRIPTOR, momenta::Tuple< typename MOMENTA::density, momenta::FixedVelocityMomentum, typename MOMENTA::stress, typename MOMENTA::definition >, EQUILIBRIUM > combined_collision
typename EQUILIBRIUM::template type< DESCRIPTOR, MOMENTA > combined_equilibrium
static std::string getName()
Return value of any collision.
static constexpr unsigned size()
static constexpr auto isValid(FieldD< T, DESCRIPTOR, FIELD > value)
static constexpr auto getInitialValue()
static constexpr unsigned size()
This approach contains a slight error in the diffusion term.
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.
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 momenta::Tuple< typename MOMENTA::density, momenta::FixedVelocityMomentum, typename MOMENTA::stress, typename MOMENTA::definition >::template type< DESCRIPTOR > MomentaF
typename equilibria::FirstOrder::template type< DESCRIPTOR, MOMENTA > EquilibriumF
std::string getName() const override
Return human-readable name.
typename MOMENTA::template type< DESCRIPTOR > MomentaF
typename equilibria::FirstOrder::template type< DESCRIPTOR, momenta::BulkTuple > EquilibriumF
CellStatistic< V > collide(CELL &cell, PARAMETERS ¶meters)
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.
std::string getName() const override
Return human-readable name.
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
std::type_index id() override
Expose unique type-identifier for RTTI.
void computeEquilibriumAniso(CELL &cell, Vector< V, DESCRIPTOR::q > &feq, MATRIX &anisoMatrix) const
void computeEquilibrium(ConstCell< T, DESCRIPTOR > &cell, T irradiance, const T u[DESCRIPTOR::d], T fEq[DESCRIPTOR::q]) const override
Return iPop equilibrium for given first and second momenta.
VECTOR doCollision(CELL &cell, VECTOR &feq, V absorption, V scattering) const
typename equilibria::ZerothOrder::template type< DESCRIPTOR, MOMENTA > EquilibriumF
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.
RTLBMdynamicsMcHardyRK(T latticeAbsorption, T latticeScattering, std::array< std::array< T, DESCRIPTOR::q >, DESCRIPTOR::q > &anisoMatrix)
Constructor.
Solves RTE according Christopher McHardy et al 2016.
AbstractParameters< T, DESCRIPTOR > & getParameters(BlockLattice< T, DESCRIPTOR > &block) override
Parameters access for legacy post processors.
RTLBMdynamicsMcHardy(T latticeAbsorption, T latticeScattering, std::array< std::array< T, DESCRIPTOR::q >, DESCRIPTOR::q > &anisoMatrix)
Constructor.
std::type_index id() override
Expose unique type-identifier for RTTI.
typename MOMENTA::template type< DESCRIPTOR > MomentaF
void computeEquilibrium(ConstCell< T, DESCRIPTOR > &cell, T irradiance, const T u[DESCRIPTOR::d], T fEq[DESCRIPTOR::q]) const override
Return iPop equilibrium for given first and second momenta.
typename equilibria::ZerothOrder::template type< DESCRIPTOR, MOMENTA > EquilibriumF
std::string getName() const override
Return human-readable name.
CellStatistic< V > collide(CELL &cell, PARAMETERS ¶meters) any_platform
typename equilibria::FirstOrder::template type< DESCRIPTOR, MOMENTA > EquilibriumF
CellStatistic< V > collide(CELL &cell, PARAMETERS ¶meters) any_platform
typename momenta::Tuple< momenta::SourcedDensity< typename MOMENTA::density >, typename MOMENTA::momentum, typename MOMENTA::stress, typename MOMENTA::definition >::template type< DESCRIPTOR > MomentaF
AbstractParameters< T, DESCRIPTOR > & getParameters(BlockLattice< T, DESCRIPTOR > &block) override
Parameters access for legacy post processors.
std::string getName() const override
Return human-readable name.
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.
static constexpr bool is_vectorizable
typename equilibria::FirstOrder::template type< DESCRIPTOR, MOMENTA > EquilibriumF
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.
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::Tuple< momenta::SourcedDensity< typename MOMENTA::density >, typename MOMENTA::momentum, typename MOMENTA::stress, typename MOMENTA::definition >::template type< DESCRIPTOR > MomentaF
CellStatistic< V > collide(CELL &cell, PARAMETERS ¶meters) any_platform
V computeLiquidFraction(const PARAMETERS ¶meters, const ENTHALPY &enthalpy) const any_platform
typename MOMENTA::template type< DESCRIPTOR > MomentaF
std::string getName() const override
Return human-readable name.
V computeTemperature(const PARAMETERS ¶meters, const ENTHALPY &enthalpy) const any_platform
static constexpr bool is_vectorizable
typename equilibria::FirstOrder::template type< DESCRIPTOR, MOMENTA > EquilibriumF
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.
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.
typename equilibria::FirstOrder::template type< DESCRIPTOR, MOMENTA > EquilibriumF
V computeEquilibrium(int iPop, const PARAMETERS ¶meters, RHO &rho, U &u) const 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.
V computeLiquidFraction(const PARAMETERS ¶meters, const ENTHALPY &enthalpy) const any_platform
typename MOMENTA::template type< DESCRIPTOR > MomentaF
static constexpr bool is_vectorizable
std::string getName() const override
Return human-readable name.
CellStatistic< V > collide(CELL &cell, PARAMETERS ¶meters) any_platform
V computeTemperature(const PARAMETERS ¶meters, const ENTHALPY &enthalpy) const any_platform
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.
Base of a field whose size is defined by [C_0,C_1,C_2]^T * [1,D,Q].
Dynamics constructed as a tuple of momenta, equilibrium and collision.
static V firstOrder(int iPop, const RHO &rho, const U &u) any_platform
Computation of equilibrium distribution, first order in u.
static V adeBgkCollision(CELL &cell, const RHO &rho, const VELOCITY &u, const OMEGA &omega) any_platform
Advection diffusion BGK collision step.
static V bgkCollision(CELL &cell, const RHO &rho, const VELOCITY &u, const OMEGA &omega) any_platform
BGK collision step.
The velocity is stored in the external field descriptors::VELOCITY.
Unit conversion handling – header file.