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

First scheme adapted from Xuhui Meng and Zhaoli Guo. More...

#include <robinBoundaryLatticePostProcessor3D.h>

+ Collaboration diagram for olb::robinBoundaryLatticePostProcessor3D< T, DESCRIPTOR, Normal1, Normal2, Normal3 >:

Public Types

using parameters = meta::list<descriptors::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, int Normal1, int Normal2, int Normal3>
struct olb::robinBoundaryLatticePostProcessor3D< T, DESCRIPTOR, Normal1, Normal2, Normal3 >

First scheme adapted from Xuhui Meng and Zhaoli Guo.

“Boundary scheme for linear heterogeneous surface reactions in the lattice Boltzmann method”. In: Physical Review E 94.5 (2016), doi.org/10.1103/PhysRevE.94.053307 Eq.(20)

Second scheme from Long Ju, Chunhua Zhang, and Zhaoli Guo. “Local reactive boundary scheme for irregular geometries in lattice Boltzmann method”. In: International Journal of Heat and Mass Transfer 150 (2020), p. 119314. doi: 10.1016/j.ijheatmasstransfer.2020.119314

Definition at line 60 of file robinBoundaryLatticePostProcessor3D.h.

Member Typedef Documentation

◆ parameters

template<typename T , typename DESCRIPTOR , int Normal1, int Normal2, int Normal3>
using olb::robinBoundaryLatticePostProcessor3D< T, DESCRIPTOR, Normal1, Normal2, Normal3 >::parameters = meta::list<descriptors::OMEGA>

Definition at line 63 of file robinBoundaryLatticePostProcessor3D.h.

Member Function Documentation

◆ apply()

template<typename T , typename DESCRIPTOR , int Normal1, int Normal2, int Normal3>
template<typename CELL , typename PARAMETERS >
void olb::robinBoundaryLatticePostProcessor3D< T, DESCRIPTOR, Normal1, Normal2, Normal3 >::apply ( CELL & cell,
PARAMETERS & parameters )
inline

define variables, names match the characters in the formula in thesis

calculation of the two sums used in the MengCurvedCorr scheme

Definition at line 69 of file robinBoundaryLatticePostProcessor3D.h.

69 {
70
71 T omega = parameters.template get<descriptors::OMEGA>();
72 auto v = cell.template getField<descriptors::VELOCITY>();
73 auto a = cell.template getField<descriptors::G>(); //get robin boundary coefficients
74 T a1 = a[0];
75 T a2 = a[1];
76 T a3 = a[2];
77
78 const int direction = abs(Normal1*0 + Normal2*1 + Normal3*2); // ==0,1,2
79 const int orientation = -(Normal1 + Normal2 + Normal3); // ==+-1
80 Vector<int,3> n(-Normal1, -Normal2, -Normal3); //normal points into domain
81 T NdotV = n[0]*v[0] + n[1]*v[1] + n[2]*v[2];
82 T w = descriptors::t<T,DESCRIPTOR>(1); //lattice weight = 1/8
83 T gamma = -descriptors::invCs2<T,DESCRIPTOR>() * omega; //a factor used in scheme
84
85 Vector<T,1> unknownIndices;
86 for(int iPop = 0; iPop<DESCRIPTOR::q; iPop++){
87 if(descriptors::c<DESCRIPTOR>(iPop)[direction] == orientation){
88 unknownIndices[0] = iPop;
89 }
90 }
91
93 T b1 = a1-a2*gamma*NdotV;
94 T b2 = a2*gamma;
95
97 T sum1 = cell.computeRho();
98 T sum2 = 0;
99 for (unsigned iPop : unknownIndices) {
100 sum1 -= (cell[iPop]+w + cell[descriptors::opposite<DESCRIPTOR>(iPop)]+w);
101 sum2 += cell[descriptors::opposite<DESCRIPTOR>(iPop)] + w;
102 }
103 T beta = (a3-b1*sum1+2*b2*sum2)/(unknownIndices.size()*w*(b1+b2));
104
105 for (unsigned iPop : unknownIndices) {
106 cell[iPop] = w * beta - (cell[descriptors::opposite<DESCRIPTOR>(iPop)] + w) - w; //set new populations
107 }
108 }
std::enable_if_t< std::is_arithmetic< T >::type::value, T > abs(T x)
Definition util.h:396

References olb::abs(), and olb::GenericVector< T, D, IMPL >::size().

+ Here is the call graph for this function:

◆ getPriority()

template<typename T , typename DESCRIPTOR , int Normal1, int Normal2, int Normal3>
int olb::robinBoundaryLatticePostProcessor3D< T, DESCRIPTOR, Normal1, Normal2, Normal3 >::getPriority ( ) const
inline

Definition at line 64 of file robinBoundaryLatticePostProcessor3D.h.

64 {
65 return 0;
66 }

Member Data Documentation

◆ scope

template<typename T , typename DESCRIPTOR , int Normal1, int Normal2, int Normal3>
constexpr OperatorScope olb::robinBoundaryLatticePostProcessor3D< T, DESCRIPTOR, Normal1, Normal2, Normal3 >::scope = OperatorScope::PerCellWithParameters
staticconstexpr

Definition at line 62 of file robinBoundaryLatticePostProcessor3D.h.


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