OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
olb::BouzidiAdeDirichletPostProcessor Class Reference

#include <setBouzidiBoundary.h>

+ Collaboration diagram for olb::BouzidiAdeDirichletPostProcessor:

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

Definition at line 101 of file setBouzidiBoundary.h.

Member Function Documentation

◆ apply()

template<typename CELL , typename V = typename CELL::value_t>
void olb::BouzidiAdeDirichletPostProcessor::apply ( CELL & x_b)
inline

Definition at line 110 of file setBouzidiBoundary.h.

110 {
111 using DESCRIPTOR = typename CELL::descriptor_t;
112 const auto q = x_b.template getFieldPointer<descriptors::BOUZIDI_DISTANCE>();
113 const auto phi_d = x_b.template getFieldPointer<descriptors::BOUZIDI_ADE_DIRICHLET>();
114 V f = V{1/3}; // D2Q5
115 if (descriptors::q<DESCRIPTOR>() == 7) {
116 f = V{0.25}; // D3Q7
117 }
118 for (int iPop = 1; iPop < descriptors::q<DESCRIPTOR>(); ++iPop) {
119 // update missing population if valid bouzidi distance
120 if (q[iPop] > V{0}) {
121 const auto c = descriptors::c<DESCRIPTOR>(iPop);
122 const int iPop_opposite = descriptors::opposite<DESCRIPTOR>(iPop);
123 auto x_s = x_b.neighbor(c); // solid side neighbor
124 auto x_f = x_b.neighbor(descriptors::c<DESCRIPTOR>(iPop_opposite)); // fluid side neighbor opposite to the missing population
125 auto source_d = phi_d[iPop] * f; // source term set by the dirichlet condition
126 auto t_i = descriptors::t<V,DESCRIPTOR>(iPop);
127 auto t_iopp = descriptors::t<V,DESCRIPTOR>(iPop_opposite);
128
129 x_b[iPop_opposite] = (q[iPop] <= V{0.5}) // cut is closer to the fluid cell
130 * (V{-2} * q[iPop] * (x_s[iPop] + t_i) + (V{2} * q[iPop] - V{1}) * (x_b[iPop] + t_i) + source_d)
131 + (q[iPop] > V{0.5}) // cut is closer to the solid cell
132 * (V{-1} / (V{2} * q[iPop]) * (x_s[iPop] + t_i) + (V{1} - V{1} / (V{2} * q[iPop])) * (x_f[iPop_opposite] + t_iopp) + (V{1} / (V{2} * q[iPop])) * source_d)
133 - t_iopp;
134 }
135 // if intersection point is on the cell then fall back to full-way bounce back
136 else if (q[iPop] == V{0}) {
137 const int iPop_opposite = descriptors::opposite<DESCRIPTOR>(iPop);
138 auto source_d = phi_d[iPop] * f;
139 auto t_i = descriptors::t<V,DESCRIPTOR>(iPop);
140 auto t_iopp = descriptors::t<V,DESCRIPTOR>(iPop_opposite);
141 x_b[iPop_opposite] = -(x_b[iPop] + t_i) + source_d - t_iopp;
142 }
143 }
144 }
platform_constant int c[Q][D]
constexpr int q() any_platform

◆ getPriority()

int olb::BouzidiAdeDirichletPostProcessor::getPriority ( ) const
inline

Definition at line 105 of file setBouzidiBoundary.h.

105 {
106 return -1;
107 }

Member Data Documentation

◆ scope

constexpr OperatorScope olb::BouzidiAdeDirichletPostProcessor::scope = OperatorScope::PerCell
staticconstexpr

Definition at line 103 of file setBouzidiBoundary.h.


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