OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
olb::FullSlipBoundaryPostProcessor3D< typename, typename, NX, NY, NZ > Struct Template Reference

#include <setSlipBoundary3D.hh>

+ Collaboration diagram for olb::FullSlipBoundaryPostProcessor3D< typename, typename, NX, NY, NZ >:

Public Member Functions

int getPriority () const
 
template<typename CELL , typename V = typename CELL::value_t>
void apply (CELL &x_b) any_platform
 

Static Public Attributes

static constexpr OperatorScope scope = OperatorScope::PerCell
 

Detailed Description

template<typename, typename, int NX, int NY, int NZ>
struct olb::FullSlipBoundaryPostProcessor3D< typename, typename, NX, NY, NZ >

Definition at line 36 of file setSlipBoundary3D.hh.

Member Function Documentation

◆ apply()

template<typename , typename , int NX, int NY, int NZ>
template<typename CELL , typename V = typename CELL::value_t>
void olb::FullSlipBoundaryPostProcessor3D< typename, typename, NX, NY, NZ >::apply ( CELL & x_b)
inline

Definition at line 45 of file setSlipBoundary3D.hh.

45 {
46 using DESCRIPTOR = typename CELL::descriptor_t;
47 int reflectionPop[DESCRIPTOR::q];
48 int mirrorDirection0;
49 int mirrorDirection1;
50 int mirrorDirection2;
51 int mult = 2 / (NX*NX + NY*NY + NZ*NZ);
52 reflectionPop[0] =0;
53 for (int iPop = 1; iPop < DESCRIPTOR::q; iPop++) {
54 reflectionPop[iPop] = 0;
55 // iPop are the directions which pointing into the fluid, discreteNormal is pointing outwarts
56 int scalarProduct = descriptors::c<DESCRIPTOR>(iPop,0)*NX + descriptors::c<DESCRIPTOR>(iPop,1)*NY + descriptors::c<DESCRIPTOR>(iPop,2)*NZ;
57 if ( scalarProduct < 0) {
58 // bounce back for the case discreteNormalX = discreteNormalY = discreteNormalZ = 1, that is mult=0
59 if (mult == 0) {
60 mirrorDirection0 = -descriptors::c<DESCRIPTOR>(iPop,0);
61 mirrorDirection1 = -descriptors::c<DESCRIPTOR>(iPop,1);
62 mirrorDirection2 = -descriptors::c<DESCRIPTOR>(iPop,2);
63 }
64 else {
65 mirrorDirection0 = descriptors::c<DESCRIPTOR>(iPop,0) - mult*scalarProduct*NX;
66 mirrorDirection1 = descriptors::c<DESCRIPTOR>(iPop,1) - mult*scalarProduct*NY;
67 mirrorDirection2 = descriptors::c<DESCRIPTOR>(iPop,2) - mult*scalarProduct*NZ;
68 }
69
70 // run through all lattice directions and look for match of direction
71 for (int i = 1; i < DESCRIPTOR::q; i++) {
72 if (descriptors::c<DESCRIPTOR>(i,0)==mirrorDirection0
73 && descriptors::c<DESCRIPTOR>(i,1)==mirrorDirection1
74 && descriptors::c<DESCRIPTOR>(i,2)==mirrorDirection2) {
75 reflectionPop[iPop] = i;
76 break;
77 }
78 }
79 }
80 }
81 for (int iPop = 1; iPop < DESCRIPTOR::q ; ++iPop) {
82 if (reflectionPop[iPop]!=0) {
83 //do reflection
84 x_b[iPop] = x_b[reflectionPop[iPop]];
85 }
86 }
87 }
T scalarProduct(const T u1[d], const T u2[d])
Definition util.h:187

◆ getPriority()

template<typename , typename , int NX, int NY, int NZ>
int olb::FullSlipBoundaryPostProcessor3D< typename, typename, NX, NY, NZ >::getPriority ( ) const
inline

Definition at line 39 of file setSlipBoundary3D.hh.

39 {
40 return -1;
41 }

Member Data Documentation

◆ scope

template<typename , typename , int NX, int NY, int NZ>
constexpr OperatorScope olb::FullSlipBoundaryPostProcessor3D< typename, typename, NX, NY, NZ >::scope = OperatorScope::PerCell
staticconstexpr

Definition at line 37 of file setSlipBoundary3D.hh.


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