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

#include <robinBoundaryLatticePostProcessor3D.h>

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

Definition at line 245 of file robinBoundaryLatticePostProcessor3D.h.

Member Typedef Documentation

◆ parameters

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

Definition at line 248 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::robinBoundaryExtendedPostProcessor3DCorners< T, DESCRIPTOR, Normal1, Normal2, Normal3 >::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 254 of file robinBoundaryLatticePostProcessor3D.h.

254 {
255 bool schemeSwitch = false; //switch between two schemes; true=MengCurvedCorr, false=Ju2020
256
257 // get external values
258 T omega = parameters.template get<descriptors::OMEGA>();
259 auto v = cell.template getField<descriptors::VELOCITY>(); //velocity field
260 auto a = cell.template getField<descriptors::G>(); //field containing coefficients for the robin boundary condition
261 T a1 = a[0]; T a2 = a[1]; T a3 = a[2];
262 std::vector<int> n(3);
263 n[0] = -Normal1; n[1] = -Normal2; n[2] = -Normal3; //change normal to point into domain
264
265 constexpr auto unknownIndices = util::subIndexOutgoing3DonCorners<DESCRIPTOR,Normal1,Normal2,Normal3>(); //function returns the indices of missing populations
266 assert(unknownIndices.size() == 3);
267
268 if(schemeSwitch){
269 //--- MengCurvedCorr ---//
271 T w = descriptors::t<T,DESCRIPTOR>(1); //lattice weight = 1/8
272 T gamma = -descriptors::invCs2<T,DESCRIPTOR>() * omega;
273 T b1 = a1-a2*gamma*(n[0]*v[0]+n[1]*v[1]+n[2]*v[2]);
274 T b2 = a2*gamma;
275
277 T sum1 = cell.computeRho();
278 T sum2 = 0;
279 for (unsigned iPop : unknownIndices) {
280 sum1 -= (cell[iPop]+w + cell[descriptors::opposite<DESCRIPTOR>(iPop)]+w);
281 sum2 += cell[descriptors::opposite<DESCRIPTOR>(iPop)] + w;
282 }
283 T beta = (a3-b1*sum1+2*b2*sum2)/(unknownIndices.size()*w*(b1+b2));
284
285 for (unsigned iPop : unknownIndices) {
286 cell[iPop] = w * beta - (cell[descriptors::opposite<DESCRIPTOR>(iPop)] + w) - w; //set new populations
287 }
288 } else{
289 //--- Ju2020 ---//
291 T w = descriptors::t<T,DESCRIPTOR>(1); //lattice weight = 1/8
292 T chi = (a2!=0.) ? -1/ (descriptors::invCs2<T,DESCRIPTOR>()*a2*omega) : (1/omega)/(1/omega-0.5);
293 T k = a1; //reaction rate
294 T NdotV = n[0]*v[0] + n[1]*v[1] + n[2]*v[2];
295 T A = unknownIndices.size()-1;
296 T alpha = (-chi*k+NdotV+2*w*(1-A)) / (chi*k-NdotV+2*w*(1+A)); //bounced-back part
297
299 T B = 0;
300 for (unsigned iPop : unknownIndices) {
301 B += 2*(cell[descriptors::opposite<DESCRIPTOR>(iPop)]+w);
302 }
303
305 for (unsigned iPop : unknownIndices) {
306 B -= 2*(cell[descriptors::opposite<DESCRIPTOR>(iPop)]+w); //final value of B
307 T beta = (2*w*chi*a3+2*w*B) / (chi*k-NdotV+2*w*(1+A)); //reverse reaction part
308 cell[iPop] = alpha * (cell[descriptors::opposite<DESCRIPTOR>(iPop)] + w) + beta - w; //set new populations
309 B += 2*(cell[descriptors::opposite<DESCRIPTOR>(iPop)]+w); //restore B for next iteration
310 }
311 }
312 }

◆ getPriority()

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

Definition at line 249 of file robinBoundaryLatticePostProcessor3D.h.

249 {
250 return 1;
251 }

Member Data Documentation

◆ scope

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

Definition at line 247 of file robinBoundaryLatticePostProcessor3D.h.


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