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

#include <robinBoundaryLatticePostProcessor3D.h>

+ Collaboration diagram for olb::robinBoundaryExtendedPostProcessor3DEdges< T, DESCRIPTOR, Plane, Normal1, Normal2 >:

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 Plane, int Normal1, int Normal2>
struct olb::robinBoundaryExtendedPostProcessor3DEdges< T, DESCRIPTOR, Plane, Normal1, Normal2 >

Definition at line 169 of file robinBoundaryLatticePostProcessor3D.h.

Member Typedef Documentation

◆ parameters

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

Definition at line 172 of file robinBoundaryLatticePostProcessor3D.h.

Member Function Documentation

◆ apply()

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

define variables, names match the characters in the formula

calculation of the two sums used in the MengCurvedCorr scheme

define variables, names match the characters in the formula

necessary procedure to calculate B

final calculation of the new populations

Definition at line 178 of file robinBoundaryLatticePostProcessor3D.h.

178 {
179
180 bool schemeSwitch = false; //switch between two schemes; true=MengCurvedCorr, false=Ju2020
181
182 // get external values
183 T omega = parameters.template get<descriptors::OMEGA>();
184 auto v = cell.template getField<descriptors::VELOCITY>();
185 auto a = cell.template getField<descriptors::G>();
186 T a1 = a[0];
187 T a2 = a[1];
188 T a3 = a[2];
189
190 constexpr auto unknownIndices = util::subIndexOutgoing3DonEdges<DESCRIPTOR,Plane,Normal1,Normal2>();
191 assert(unknownIndices.size() == 2);
192 auto c0=descriptors::c<DESCRIPTOR>(unknownIndices[0]);
193 auto c1=descriptors::c<DESCRIPTOR>(unknownIndices[1]);
194 Vector<int,3> n(c0[0]+c1[0], c0[1]+c1[1], c0[2]+c1[2]); //normal points into domain
195
196
197 if(schemeSwitch){
199 T w = descriptors::t<T,DESCRIPTOR>(1); //lattice weight = 1/8
200 T gamma = -descriptors::invCs2<T,DESCRIPTOR>() * omega;
201 T b1 = a1-a2*gamma*(n[0]*v[0]+n[1]*v[1]+n[2]*v[2]);
202 T b2 = a2*gamma;
203
205 T sum1 = cell.computeRho();
206 T sum2 = 0;
207 for (unsigned iPop : unknownIndices) {
208 sum1 -= (cell[iPop]+w + cell[descriptors::opposite<DESCRIPTOR>(iPop)]+w);
209 sum2 += cell[descriptors::opposite<DESCRIPTOR>(iPop)] + w;
210 }
211 T beta = (a3-b1*sum1+2*b2*sum2)/(unknownIndices.size()*w*(b1+b2));
212
213 for (unsigned iPop : unknownIndices) {
214 cell[iPop] = w * beta - (cell[descriptors::opposite<DESCRIPTOR>(iPop)] + w) - w; //set new populations
215 }
216 } else{
218 T w = descriptors::t<T,DESCRIPTOR>(1); //lattice weight = 1/8
219 T chi = (a2!=0.) ? -1/ (descriptors::invCs2<T,DESCRIPTOR>()*a2*omega) : (1/omega)/(1/omega-0.5);
220 T k = a1; //reaction rate
221 T NdotV = n[0]*v[0] + n[1]*v[1] + n[2]*v[2];
222 T A = unknownIndices.size()-1;
223 T alpha = (-chi*k+NdotV+2*w*(1-A)) / (chi*k-NdotV+2*w*(1+A)); //bounced-back part
224
226 T B = 0;
227 for (unsigned iPop : unknownIndices) {
228 B += 2*(cell[descriptors::opposite<DESCRIPTOR>(iPop)]+w);
229 }
230
232 for (unsigned iPop : unknownIndices) {
233 B -= 2*(cell[descriptors::opposite<DESCRIPTOR>(iPop)]+w); //final value of B
234 T beta = (2*w*chi*a3+2*w*B) / (chi*k-NdotV+2*w*(1+A)); //reverse reaction contribution
235 cell[iPop] = alpha * (cell[descriptors::opposite<DESCRIPTOR>(iPop)] + w) + beta - w; //set new populations
236 B += 2*(cell[descriptors::opposite<DESCRIPTOR>(iPop)]+w); //restore B
237 }
238 }
239 }

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

+ Here is the call graph for this function:

◆ getPriority()

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

Definition at line 173 of file robinBoundaryLatticePostProcessor3D.h.

173 {
174 return 2;
175 }

Member Data Documentation

◆ scope

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

Definition at line 171 of file robinBoundaryLatticePostProcessor3D.h.


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