OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::forcing::WellBalancedCahnHilliard::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION > Struct Template Reference

#include <forcing.h>

+ Collaboration diagram for olb::forcing::WellBalancedCahnHilliard::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >:

Public Types

using MomentaF = typename MOMENTA::template type<DESCRIPTOR>
 
using CollisionO = typename COLLISION::template type<DESCRIPTOR,MOMENTA,EQUILIBRIUM>
 

Public Member Functions

template<typename CELL , typename PARAMETERS , typename V = typename CELL::value_t>
CellStatistic< V > apply (CELL &cell, PARAMETERS &parameters) any_platform
 

Detailed Description

template<typename DESCRIPTOR, typename MOMENTA, typename EQUILIBRIUM, typename COLLISION>
struct olb::forcing::WellBalancedCahnHilliard::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >

Definition at line 314 of file forcing.h.

Member Typedef Documentation

◆ CollisionO

template<typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM , typename COLLISION >
using olb::forcing::WellBalancedCahnHilliard::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >::CollisionO = typename COLLISION::template type<DESCRIPTOR,MOMENTA,EQUILIBRIUM>

Definition at line 316 of file forcing.h.

◆ MomentaF

template<typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM , typename COLLISION >
using olb::forcing::WellBalancedCahnHilliard::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >::MomentaF = typename MOMENTA::template type<DESCRIPTOR>

Definition at line 315 of file forcing.h.

Member Function Documentation

◆ apply()

template<typename DESCRIPTOR , typename MOMENTA , typename EQUILIBRIUM , typename COLLISION >
template<typename CELL , typename PARAMETERS , typename V = typename CELL::value_t>
CellStatistic< V > olb::forcing::WellBalancedCahnHilliard::combined_collision< DESCRIPTOR, MOMENTA, EQUILIBRIUM, COLLISION >::apply ( CELL & cell,
PARAMETERS & parameters )
inline

Definition at line 322 of file forcing.h.

322 {
323 V phi = MomentaF().computeRho(cell);
324 CollisionO().apply(cell, parameters);
325 const auto source = cell.template getField<descriptors::SOURCE>();
326 const auto u = cell.template getField<descriptors::VELOCITY>();
327 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
328 V c_c{};
329 for (int iD=0; iD < DESCRIPTOR::d; ++iD) {
331 }
332 V sourceTerm{};
333 sourceTerm += -V{2} + 0.5*descriptors::invCs2<V,DESCRIPTOR>()*c_c;
334 sourceTerm *= descriptors::t<V,DESCRIPTOR>(iPop)*source;
335 cell[iPop] += sourceTerm;
336 }
337 return {phi, util::normSqr<V,DESCRIPTOR::d>(u)};
338 };
constexpr T invCs2() any_platform
Definition functions.h:107
constexpr T t(unsigned iPop, tag::CUM) any_platform
Definition cum.h:108
constexpr int c(unsigned iPop, unsigned iDim) any_platform
Definition functions.h:83
auto normSqr(const ARRAY_LIKE &u) any_platform
Compute norm square of a d-dimensional vector.
Definition util.h:145
typename COLLISION::template type< DESCRIPTOR, MOMENTA, EQUILIBRIUM > CollisionO
Definition forcing.h:316
typename MOMENTA::template type< DESCRIPTOR > MomentaF
Definition forcing.h:315

References olb::descriptors::c(), olb::descriptors::invCs2(), olb::util::normSqr(), and olb::descriptors::t().

+ Here is the call graph for this function:

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