26#ifndef ROBIN_BOUNDARY_LATTICE_POST_PROCESSOR_3D_H
27#define ROBIN_BOUNDARY_LATTICE_POST_PROCESSOR_3D_H
59template<
typename T,
typename DESCRIPTOR,
int Normal1,
int Normal2,
int Normal3>
68 template <
typename CELL,
typename PARAMETERS>
71 T omega =
parameters.template get<descriptors::OMEGA>();
72 auto v = cell.template getField<descriptors::VELOCITY>();
73 auto a = cell.template getField<descriptors::G>();
78 const int direction =
abs(Normal1*0 + Normal2*1 + Normal3*2);
79 const int orientation = -(Normal1 + Normal2 + Normal3);
81 T NdotV = n[0]*v[0] + n[1]*v[1] + n[2]*v[2];
86 for(
int iPop = 0; iPop<DESCRIPTOR::q; iPop++){
88 unknownIndices[0] = iPop;
93 T b1 = a1-a2*gamma*NdotV;
97 T sum1 = cell.computeRho();
99 for (
unsigned iPop : unknownIndices) {
103 T beta = (a3-b1*sum1+2*b2*sum2)/(unknownIndices.
size()*w*(b1+b2));
105 for (
unsigned iPop : unknownIndices) {
112template<
typename T,
typename DESCRIPTOR,
int Normal1,
int Normal2,
int Normal3>
121 template <
typename CELL,
typename PARAMETERS>
124 T omega =
parameters.template get<descriptors::OMEGA>();
125 auto v = cell.template getField<descriptors::VELOCITY>();
126 auto a = cell.template getField<descriptors::G>();
131 const int direction =
abs(Normal1*0 + Normal2*1 + Normal3*2);
132 const int orientation = -(Normal1 + Normal2 + Normal3);
134 T NdotV = n[0]*v[0] + n[1]*v[1] + n[2]*v[2];
139 for(
int iPop = 0; iPop<DESCRIPTOR::q; iPop++){
141 unknownIndices[0] = iPop;
146 T chi = (a2!=0.) ? 1/ (gamma*a2) : (1/omega)/(1/omega-0.5);
148 T A = unknownIndices.
size()-1;
149 T alpha = (-chi*k+NdotV+2*w*(1-A)) / (chi*k-NdotV+2*w*(1+A));
153 for (
unsigned iPop : unknownIndices) {
158 for (
unsigned iPop : unknownIndices) {
160 T beta = (2*w*chi*a3+2*w*B) / (chi*k-NdotV+2*w*(1+A));
168template<
typename T,
typename DESCRIPTOR,
int Plane,
int Normal1,
int Normal2>
177 template <
typename CELL,
typename PARAMETERS>
180 bool schemeSwitch =
false;
183 T omega =
parameters.template get<descriptors::OMEGA>();
184 auto v = cell.template getField<descriptors::VELOCITY>();
185 auto a = cell.template getField<descriptors::G>();
191 assert(unknownIndices.size() == 2);
201 T b1 = a1-a2*gamma*(n[0]*v[0]+n[1]*v[1]+n[2]*v[2]);
205 T sum1 = cell.computeRho();
207 for (
unsigned iPop : unknownIndices) {
211 T beta = (a3-b1*sum1+2*b2*sum2)/(unknownIndices.size()*w*(b1+b2));
213 for (
unsigned iPop : unknownIndices) {
221 T NdotV = n[0]*v[0] + n[1]*v[1] + n[2]*v[2];
222 T A = unknownIndices.
size()-1;
223 T alpha = (-chi*k+NdotV+2*w*(1-A)) / (chi*k-NdotV+2*w*(1+A));
227 for (
unsigned iPop : unknownIndices) {
232 for (
unsigned iPop : unknownIndices) {
234 T beta = (2*w*chi*a3+2*w*B) / (chi*k-NdotV+2*w*(1+A));
244template<
typename T,
typename DESCRIPTOR,
int Normal1,
int Normal2,
int Normal3>
253 template <
typename CELL,
typename PARAMETERS>
255 bool schemeSwitch =
false;
258 T omega =
parameters.template get<descriptors::OMEGA>();
259 auto v = cell.template getField<descriptors::VELOCITY>();
260 auto a = cell.template getField<descriptors::G>();
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;
266 assert(unknownIndices.size() == 3);
273 T b1 = a1-a2*gamma*(n[0]*v[0]+n[1]*v[1]+n[2]*v[2]);
277 T sum1 = cell.computeRho();
279 for (
unsigned iPop : unknownIndices) {
283 T beta = (a3-b1*sum1+2*b2*sum2)/(unknownIndices.size()*w*(b1+b2));
285 for (
unsigned iPop : unknownIndices) {
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));
300 for (
unsigned iPop : unknownIndices) {
305 for (
unsigned iPop : unknownIndices) {
307 T beta = (2*w*chi*a3+2*w*B) / (chi*k-NdotV+2*w*(1+A));
constexpr T invCs2() any_platform
constexpr T t(unsigned iPop, tag::CUM) any_platform
constexpr int c(unsigned iPop, unsigned iDim) any_platform
constexpr int opposite(unsigned iPop) any_platform
constexpr auto subIndexOutgoing3DonEdges() any_platform
constexpr auto subIndexOutgoing3DonCorners() any_platform
Top level namespace for all of OpenLB.
std::enable_if_t< std::is_arithmetic< T >::type::value, T > abs(T x) any_platform
OperatorScope
Block-wide operator application scopes.
@ PerCellWithParameters
Per-cell application with parameters, i.e. OPERATOR::apply is passed a CELL concept implementation an...
Interface for post-processing steps – header file.
static constexpr unsigned size()
static constexpr OperatorScope scope
void apply(CELL &cell, PARAMETERS ¶meters) any_platform
void apply(CELL &cell, PARAMETERS ¶meters) any_platform
static constexpr OperatorScope scope
First scheme adapted from Xuhui Meng and Zhaoli Guo.
static constexpr OperatorScope scope
void apply(CELL &cell, PARAMETERS ¶meters) any_platform
static constexpr OperatorScope scope
void apply(CELL &cell, PARAMETERS ¶meters) any_platform
Set of functions commonly used in LB computations – header file.