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

#include <robinBoundaryLatticePostProcessor3D.h>

+ Collaboration diagram for olb::robinBoundaryLatticePostProcessor3Dother< 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::robinBoundaryLatticePostProcessor3Dother< T, DESCRIPTOR, Normal1, Normal2, Normal3 >

Definition at line 113 of file robinBoundaryLatticePostProcessor3D.h.

Member Typedef Documentation

◆ parameters

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

Definition at line 116 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::robinBoundaryLatticePostProcessor3Dother< T, DESCRIPTOR, Normal1, Normal2, Normal3 >::apply ( CELL & cell,
PARAMETERS & parameters )
inline

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

necessary procedure to calculate B

final calculation of the new populations

Definition at line 122 of file robinBoundaryLatticePostProcessor3D.h.

122 {
123
124 T omega = parameters.template get<descriptors::OMEGA>();
125 auto v = cell.template getField<descriptors::VELOCITY>();
126 auto a = cell.template getField<descriptors::G>(); //get robin boundary coefficients
127 T a1 = a[0];
128 T a2 = a[1];
129 T a3 = a[2];
130
131 const int direction = abs(Normal1*0 + Normal2*1 + Normal3*2); // ==0,1,2
132 const int orientation = -(Normal1 + Normal2 + Normal3); // ==+-1
133 Vector<int,3> n(-Normal1, -Normal2, -Normal3); //normal points into domain
134 T NdotV = n[0]*v[0] + n[1]*v[1] + n[2]*v[2];
135 T w = descriptors::t<T,DESCRIPTOR>(1); //lattice weight = 1/8
136 T gamma = -descriptors::invCs2<T,DESCRIPTOR>() * omega; //a factor used in scheme
137
138 Vector<T,1> unknownIndices;
139 for(int iPop = 0; iPop<DESCRIPTOR::q; iPop++){
140 if(descriptors::c<DESCRIPTOR>(iPop)[direction] == orientation){
141 unknownIndices[0] = iPop;
142 }
143 }
144
146 T chi = (a2!=0.) ? 1/ (gamma*a2) : (1/omega)/(1/omega-0.5);
147 T k = a1; //reaction rate
148 T A = unknownIndices.size()-1;
149 T alpha = (-chi*k+NdotV+2*w*(1-A)) / (chi*k-NdotV+2*w*(1+A)); //bounced-back part
150
152 T B = 0;
153 for (unsigned iPop : unknownIndices) {
154 B += 2*(cell[descriptors::opposite<DESCRIPTOR>(iPop)]+w);
155 }
156
158 for (unsigned iPop : unknownIndices) {
159 B -= 2*(cell[descriptors::opposite<DESCRIPTOR>(iPop)]+w); //final value of B
160 T beta = (2*w*chi*a3+2*w*B) / (chi*k-NdotV+2*w*(1+A)); //reverse reaction contribution
161 cell[iPop] = alpha * (cell[descriptors::opposite<DESCRIPTOR>(iPop)] + w) + beta - w; //set new populations
162 B += 2*(cell[descriptors::opposite<DESCRIPTOR>(iPop)]+w); //restore B
163 }
164 }
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::robinBoundaryLatticePostProcessor3Dother< T, DESCRIPTOR, Normal1, Normal2, Normal3 >::getPriority ( ) const
inline

Definition at line 117 of file robinBoundaryLatticePostProcessor3D.h.

117 {
118 return 0;
119 }

Member Data Documentation

◆ scope

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

Definition at line 115 of file robinBoundaryLatticePostProcessor3D.h.


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