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

#include <setSlipBoundary2D.hh>

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

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>
struct olb::FullSlipBoundaryPostProcessor2D< typename, typename, NX, NY >

Definition at line 35 of file setSlipBoundary2D.hh.

Member Function Documentation

◆ apply()

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

Definition at line 44 of file setSlipBoundary2D.hh.

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

◆ getPriority()

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

Definition at line 38 of file setSlipBoundary2D.hh.

38 {
39 return -1;
40 }

Member Data Documentation

◆ scope

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

Definition at line 36 of file setSlipBoundary2D.hh.


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