OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
olb::SlipBoundaryPostProcessor3D< T, DESCRIPTOR, discreteNormalX, discreteNormalY, discreteNormalZ > Struct Template Reference

#include <setNewSlipBoundary3D.hh>

+ Collaboration diagram for olb::SlipBoundaryPostProcessor3D< T, DESCRIPTOR, discreteNormalX, discreteNormalY, discreteNormalZ >:

Public Member Functions

int getPriority () const
 
template<typename CELL >
void apply (CELL &cell) any_platform
 

Static Public Attributes

static constexpr OperatorScope scope = OperatorScope::PerCell
 

Detailed Description

template<typename T, typename DESCRIPTOR, int discreteNormalX, int discreteNormalY, int discreteNormalZ>
struct olb::SlipBoundaryPostProcessor3D< T, DESCRIPTOR, discreteNormalX, discreteNormalY, discreteNormalZ >

Definition at line 32 of file setNewSlipBoundary3D.hh.

Member Function Documentation

◆ apply()

template<typename T , typename DESCRIPTOR , int discreteNormalX, int discreteNormalY, int discreteNormalZ>
template<typename CELL >
void olb::SlipBoundaryPostProcessor3D< T, DESCRIPTOR, discreteNormalX, discreteNormalY, discreteNormalZ >::apply ( CELL & cell)
inline

Definition at line 41 of file setNewSlipBoundary3D.hh.

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

◆ getPriority()

template<typename T , typename DESCRIPTOR , int discreteNormalX, int discreteNormalY, int discreteNormalZ>
int olb::SlipBoundaryPostProcessor3D< T, DESCRIPTOR, discreteNormalX, discreteNormalY, discreteNormalZ >::getPriority ( ) const
inline

Definition at line 36 of file setNewSlipBoundary3D.hh.

36 {
37 return 0;
38 }

Member Data Documentation

◆ scope

template<typename T , typename DESCRIPTOR , int discreteNormalX, int discreteNormalY, int discreteNormalZ>
constexpr OperatorScope olb::SlipBoundaryPostProcessor3D< T, DESCRIPTOR, discreteNormalX, discreteNormalY, discreteNormalZ >::scope = OperatorScope::PerCell
staticconstexpr

Definition at line 34 of file setNewSlipBoundary3D.hh.


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