OpenLB 1.7
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | List of all members
olb::TotalEnthalpyAdvectionDiffusionBGKdynamics< T, DESCRIPTOR, MOMENTA > Struct Template Referencefinal

#include <advectionDiffusionDynamics.h>

+ Inheritance diagram for olb::TotalEnthalpyAdvectionDiffusionBGKdynamics< T, DESCRIPTOR, MOMENTA >:
+ Collaboration diagram for olb::TotalEnthalpyAdvectionDiffusionBGKdynamics< T, DESCRIPTOR, MOMENTA >:

Public Types

using MomentaF = typename MOMENTA::template type<DESCRIPTOR>
 
using parameters
 
template<typename M >
using exchange_momenta = TotalEnthalpyAdvectionDiffusionBGKdynamics<T,DESCRIPTOR,M>
 
- 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 V , typename PARAMETERS , typename ENTHALPY >
computeTemperature (const PARAMETERS &parameters, const ENTHALPY &enthalpy) const any_platform
 
template<typename V , typename PARAMETERS , typename ENTHALPY >
computeLiquidFraction (const PARAMETERS &parameters, const ENTHALPY &enthalpy) const 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.
 
template<typename CELL , typename PARAMETERS , typename V = typename CELL::value_t>
CellStatistic< V > apply (CELL &cell, PARAMETERS &parameters) any_platform
 
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.
 

Static Public Attributes

static constexpr bool is_vectorizable = false
 

Detailed Description

template<typename T, typename DESCRIPTOR, typename MOMENTA = momenta::AdvectionDiffusionBulkTuple>
struct olb::TotalEnthalpyAdvectionDiffusionBGKdynamics< T, DESCRIPTOR, MOMENTA >

Definition at line 282 of file advectionDiffusionDynamics.h.

Member Typedef Documentation

◆ exchange_momenta

template<typename T , typename DESCRIPTOR , typename MOMENTA = momenta::AdvectionDiffusionBulkTuple>
template<typename M >
using olb::TotalEnthalpyAdvectionDiffusionBGKdynamics< T, DESCRIPTOR, MOMENTA >::exchange_momenta = TotalEnthalpyAdvectionDiffusionBGKdynamics<T,DESCRIPTOR,M>

Definition at line 299 of file advectionDiffusionDynamics.h.

◆ MomentaF

template<typename T , typename DESCRIPTOR , typename MOMENTA = momenta::AdvectionDiffusionBulkTuple>
using olb::TotalEnthalpyAdvectionDiffusionBGKdynamics< T, DESCRIPTOR, MOMENTA >::MomentaF = typename MOMENTA::template type<DESCRIPTOR>

Definition at line 285 of file advectionDiffusionDynamics.h.

◆ parameters

template<typename T , typename DESCRIPTOR , typename MOMENTA = momenta::AdvectionDiffusionBulkTuple>
using olb::TotalEnthalpyAdvectionDiffusionBGKdynamics< T, DESCRIPTOR, MOMENTA >::parameters
Initial value:
meta::list<
descriptors::OMEGA,
TotalEnthalpy::T_S,
TotalEnthalpy::T_L,
TotalEnthalpy::CP_S,
TotalEnthalpy::CP_L,
TotalEnthalpy::LAMBDA_S,
TotalEnthalpy::LAMBDA_L,
TotalEnthalpy::L
>

Definition at line 287 of file advectionDiffusionDynamics.h.

Member Function Documentation

◆ apply()

template<typename T , typename DESCRIPTOR , typename MOMENTA = momenta::AdvectionDiffusionBulkTuple>
template<typename CELL , typename PARAMETERS , typename V = typename CELL::value_t>
CellStatistic< V > olb::TotalEnthalpyAdvectionDiffusionBGKdynamics< T, DESCRIPTOR, MOMENTA >::apply ( CELL & cell,
PARAMETERS & parameters )
inline

Definition at line 367 of file advectionDiffusionDynamics.h.

367 {
368 using namespace TotalEnthalpy;
369
370 const V lambda_s = parameters.template get<LAMBDA_S>();
371 const V lambda_l = parameters.template get<LAMBDA_L>();
372 const V cp_s = parameters.template get<CP_S>();
373 const V cp_l = parameters.template get<CP_L>();
374 const V cp_ref = V{2} * cp_s * cp_l / (cp_s + cp_l);
375
376 const V enthalpy = MomentaF().computeRho( cell );
377 const V temperature = computeTemperature<V>( parameters, enthalpy );
378 const V liquid_fraction = computeLiquidFraction<V>( parameters, enthalpy );
379 const V lambda = (V{1} - liquid_fraction) * lambda_s + liquid_fraction * lambda_l;
380 const V cp = (V{1} - liquid_fraction) * cp_s + liquid_fraction * cp_l;
381 const V omega = V{1} / ( lambda / cp_ref * descriptors::invCs2<T,DESCRIPTOR>() + V{0.5} );
382
383 const auto u = cell.template getFieldPointer<descriptors::VELOCITY>();
384
385 const V uSqr = util::normSqr<V,DESCRIPTOR::d>(u);
386
387 const V f_eq = enthalpy - cp_ref * temperature
388 + cp * temperature * descriptors::t<T,DESCRIPTOR>(0) * ( cp_ref / cp
389 - descriptors::invCs2<T,DESCRIPTOR>() * V{0.5} * uSqr )
390 - descriptors::t<T,DESCRIPTOR>(0);
391 cell[0] *= V{1} - omega;
392 cell[0] += omega * f_eq;
393 for (int iPop=1; iPop < DESCRIPTOR::q; ++iPop) {
394 V c_u{};
395 for (int iD=0; iD < DESCRIPTOR::d; ++iD) {
396 c_u += descriptors::c<DESCRIPTOR>(iPop,iD)*u[iD];
397 }
398 const V f_eq = cp * temperature * descriptors::t<T,DESCRIPTOR>(iPop) * ( cp_ref / cp + descriptors::invCs2<T,DESCRIPTOR>() * c_u
399 + descriptors::invCs2<T,DESCRIPTOR>() * descriptors::invCs2<T,DESCRIPTOR>() * V{0.5} * c_u *c_u
400 - descriptors::invCs2<T,DESCRIPTOR>() * V{0.5} * uSqr )
401 - descriptors::t<T,DESCRIPTOR>(iPop);
402 cell[iPop] *= V{1} - omega;
403 cell[iPop] += omega * f_eq;
404 }
405 return {enthalpy, uSqr};
406 };
meta::list< descriptors::OMEGA, TotalEnthalpy::T_S, TotalEnthalpy::T_L, TotalEnthalpy::CP_S, TotalEnthalpy::CP_L, TotalEnthalpy::LAMBDA_S, TotalEnthalpy::LAMBDA_L, TotalEnthalpy::L > parameters
typename MOMENTA::template type< DESCRIPTOR > MomentaF

◆ computeEquilibrium()

template<typename T , typename DESCRIPTOR , typename MOMENTA = momenta::AdvectionDiffusionBulkTuple>
T olb::TotalEnthalpyAdvectionDiffusionBGKdynamics< T, DESCRIPTOR, MOMENTA >::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 361 of file advectionDiffusionDynamics.h.

362 {
363 return equilibrium<DESCRIPTOR>::template firstOrder(iPop, rho, u);
364 }

◆ computeLiquidFraction()

template<typename T , typename DESCRIPTOR , typename MOMENTA = momenta::AdvectionDiffusionBulkTuple>
template<typename V , typename PARAMETERS , typename ENTHALPY >
V olb::TotalEnthalpyAdvectionDiffusionBGKdynamics< T, DESCRIPTOR, MOMENTA >::computeLiquidFraction ( const PARAMETERS & parameters,
const ENTHALPY & enthalpy ) const
inline

Definition at line 336 of file advectionDiffusionDynamics.h.

337 {
338 using namespace TotalEnthalpy;
339
340 const V cp_s = parameters.template get<CP_S>();
341 const V cp_l = parameters.template get<CP_L>();
342 const V T_s = parameters.template get<T_S>();
343 const V T_l = parameters.template get<T_L>();
344 const V l = parameters.template get<L>();
345 const V H_s = cp_s * T_s;
346 const V H_l = cp_l * T_l + l;
347 V liquid_fraction{};
348
349 if (enthalpy <= H_s) {
350 liquid_fraction = 0.;
351 }
352 else if (enthalpy >= H_l) {
353 liquid_fraction = 1.;
354 }
355 else {
356 liquid_fraction = (enthalpy - H_s) / l;
357 }
358 return liquid_fraction;
359 }

◆ computeTemperature()

template<typename T , typename DESCRIPTOR , typename MOMENTA = momenta::AdvectionDiffusionBulkTuple>
template<typename V , typename PARAMETERS , typename ENTHALPY >
V olb::TotalEnthalpyAdvectionDiffusionBGKdynamics< T, DESCRIPTOR, MOMENTA >::computeTemperature ( const PARAMETERS & parameters,
const ENTHALPY & enthalpy ) const
inline

Definition at line 310 of file advectionDiffusionDynamics.h.

311 {
312 using namespace TotalEnthalpy;
313
314 const V cp_s = parameters.template get<CP_S>();
315 const V cp_l = parameters.template get<CP_L>();
316 const V T_s = parameters.template get<T_S>();
317 const V T_l = parameters.template get<T_L>();
318 const V l = parameters.template get<L>();
319 const V H_s = cp_s * T_s;
320 const V H_l = cp_l * T_l + l;
321 V temperature{};
322
323 if (enthalpy <= H_s) {
324 temperature = T_s - (H_s - enthalpy) / cp_s;
325 }
326 else if (enthalpy >= H_l) {
327 temperature = T_l + (enthalpy - H_l) / cp_l;
328 }
329 else {
330 temperature = (H_l - enthalpy) / (H_l - H_s) * T_s + (enthalpy - H_s) / (H_l - H_s) * T_l;
331 }
332 return temperature;
333 }

◆ getName()

template<typename T , typename DESCRIPTOR , typename MOMENTA = momenta::AdvectionDiffusionBulkTuple>
std::string olb::TotalEnthalpyAdvectionDiffusionBGKdynamics< T, DESCRIPTOR, MOMENTA >::getName ( ) const
inlineoverridevirtual

Return human-readable name.

Reimplemented from olb::Dynamics< T, DESCRIPTOR >.

Definition at line 408 of file advectionDiffusionDynamics.h.

408 {
409 return "TotalEnthalpyAdvectionDiffusionBGKdynamics<" + MomentaF().getName() + ">";
410 };

◆ getParameters()

template<typename T , typename DESCRIPTOR , typename MOMENTA = momenta::AdvectionDiffusionBulkTuple>
AbstractParameters< T, DESCRIPTOR > & olb::TotalEnthalpyAdvectionDiffusionBGKdynamics< T, DESCRIPTOR, MOMENTA >::getParameters ( BlockLattice< T, DESCRIPTOR > & block)
inlineoverridevirtual

Parameters access for legacy post processors.

Implements olb::Dynamics< T, DESCRIPTOR >.

Definition at line 305 of file advectionDiffusionDynamics.h.

305 {
306 return block.template getData<OperatorParameters<TotalEnthalpyAdvectionDiffusionBGKdynamics>>();
307 }

◆ id()

template<typename T , typename DESCRIPTOR , typename MOMENTA = momenta::AdvectionDiffusionBulkTuple>
std::type_index olb::TotalEnthalpyAdvectionDiffusionBGKdynamics< T, DESCRIPTOR, MOMENTA >::id ( )
inlineoverridevirtual

Expose unique type-identifier for RTTI.

Implements olb::Dynamics< T, DESCRIPTOR >.

Definition at line 301 of file advectionDiffusionDynamics.h.

301 {
302 return typeid(TotalEnthalpyAdvectionDiffusionBGKdynamics);
303 };

Member Data Documentation

◆ is_vectorizable

template<typename T , typename DESCRIPTOR , typename MOMENTA = momenta::AdvectionDiffusionBulkTuple>
constexpr bool olb::TotalEnthalpyAdvectionDiffusionBGKdynamics< T, DESCRIPTOR, MOMENTA >::is_vectorizable = false
staticconstexpr

Definition at line 283 of file advectionDiffusionDynamics.h.


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