OpenLB 1.7
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
olb::ShanChenForcedSingleComponentPostProcessor< T, DESCRIPTOR, POTENTIAL > Struct Template Reference

#include <shanChenForcedSingleComponentCoupling.h>

+ Collaboration diagram for olb::ShanChenForcedSingleComponentPostProcessor< T, DESCRIPTOR, POTENTIAL >:

Classes

struct  G
 
struct  OMEGA
 
struct  RHO0
 

Public Types

using parameters = typename POTENTIAL::parameters::template include<G,RHO0,OMEGA>
 

Public Member Functions

int getPriority () const
 
template<typename CELL , typename PARAMETERS >
void apply (CELL &cell, PARAMETERS &parameters) any_platform
 

Static Public Attributes

static constexpr OperatorScope scope = OperatorScope::PerCellWithParameters
 

Detailed Description

template<typename T, typename DESCRIPTOR, typename POTENTIAL>
struct olb::ShanChenForcedSingleComponentPostProcessor< T, DESCRIPTOR, POTENTIAL >

Definition at line 33 of file shanChenForcedSingleComponentCoupling.h.

Member Typedef Documentation

◆ parameters

template<typename T , typename DESCRIPTOR , typename POTENTIAL >
using olb::ShanChenForcedSingleComponentPostProcessor< T, DESCRIPTOR, POTENTIAL >::parameters = typename POTENTIAL::parameters::template include<G,RHO0,OMEGA>

Definition at line 40 of file shanChenForcedSingleComponentCoupling.h.

Member Function Documentation

◆ apply()

template<typename T , typename DESCRIPTOR , typename POTENTIAL >
template<typename CELL , typename PARAMETERS >
void olb::ShanChenForcedSingleComponentPostProcessor< T, DESCRIPTOR, POTENTIAL >::apply ( CELL & cell,
PARAMETERS & parameters )
inline

Definition at line 47 of file shanChenForcedSingleComponentCoupling.h.

48 {
49 using V = typename CELL::value_t;
50 //using DESCRIPTOR = typename CELL::descriptor_t;
51
52 auto j = cell.template getField<descriptors::VELOCITY>();
54 cell.template setField<descriptors::VELOCITY>(j);
55
56 const V g = parameters.template get<G>();
57 const V rho0 = parameters.template get<RHO0>();
58 const V omega = parameters.template get<OMEGA>();
59
60 const V rho = cell.template getFieldComponent<descriptors::STATISTIC>(0) * rho0;
61 // Computation of the common velocity, shared among the two populations
62 const V rhoTot = rho * omega;
63
64 Vector<V,DESCRIPTOR::d> uTot{};
65 auto u = cell.template getField<descriptors::VELOCITY>();
66 uTot = (u*rho0*omega) / rhoTot;
67
68 // Computation of the interaction potential
69 Vector<V,DESCRIPTOR::d> rhoContribution;
70 const V psi = POTENTIAL().compute(rho, parameters);
71
72 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
73 const V rho_ = cell.neighbor(descriptors::c<DESCRIPTOR>(iPop))
74 .template getFieldComponent<descriptors::STATISTIC>(0)
75 * rho0;
76 const V psi_ = POTENTIAL().compute(rho_, parameters);
77 rhoContribution += psi * psi_
78 * descriptors::c<DESCRIPTOR>(iPop)
79 * descriptors::t<V,DESCRIPTOR>(iPop);
80 }
81
82 // Computation and storage of the final velocity, consisting
83 // of u and the momentum difference due to interaction
84 // potential plus external force
85 auto force = cell.template getField<descriptors::EXTERNAL_FORCE>();
86 cell.template setField<descriptors::VELOCITY>(uTot);
87 cell.template setField<descriptors::FORCE>(force - g*rhoContribution/rho);
88 }
typename POTENTIAL::parameters::template include< G, RHO0, OMEGA > parameters
static void computeJ(CELL &cell, J &j) any_platform
Computation of momentum.
Definition lbm.h:197

References olb::lbm< DESCRIPTOR >::computeJ().

+ Here is the call graph for this function:

◆ getPriority()

template<typename T , typename DESCRIPTOR , typename POTENTIAL >
int olb::ShanChenForcedSingleComponentPostProcessor< T, DESCRIPTOR, POTENTIAL >::getPriority ( ) const
inline

Definition at line 42 of file shanChenForcedSingleComponentCoupling.h.

42 {
43 return 0;
44 }

Member Data Documentation

◆ scope

template<typename T , typename DESCRIPTOR , typename POTENTIAL >
constexpr OperatorScope olb::ShanChenForcedSingleComponentPostProcessor< T, DESCRIPTOR, POTENTIAL >::scope = OperatorScope::PerCellWithParameters
staticconstexpr

Definition at line 34 of file shanChenForcedSingleComponentCoupling.h.


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