Microflow 3D  v1.0
BoundaryFunctions.cpp
Go to the documentation of this file.
1 // ==============================================================================================
2 // Microflow 3D, http://www.microflow.pwr.edu.pl/
3 // Created by Roman Szafran on 18.05.19.
4 // Modified by Roman Szafran, last on 07.09.19.
5 // Copyright (c) 2019 Wroclaw University of Science and Technology.
6 // Distributed under the Apache License, Version 2.0. You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0 or see accompanying file license.txt.
8 // Redistributions of source code must retain the above copyright and license notice.
9 // ==============================================================================================
10 
11 #include "BoundaryFunctions.h"
12 #define f(x) (pNode->FQ19[x])
13 #define XVelocityLB_ux (Vector4.x)
14 #define YVelocityLB_uy (Vector4.y)
15 #define ZVelocityLB_uz (Vector4.z)
16 #define DensityLB_rho (Vector4.rho)
17 #define BoundaryDensityLB_rhoB (Thread_Ptr->m_BoundaryValue_RhoLB)
18 #define BoundaryXVelocityLB_uxB (Thread_Ptr->m_BoundaryValue_ULB.x)
19 #define BoundaryYVelocityLB_uyB (Thread_Ptr->m_BoundaryValue_ULB.y)
20 #define BoundaryZVelocityLB_uzB (Thread_Ptr->m_BoundaryValue_ULB.z)
21 #define ReverseDirectionVector_Rc(x) (MF::Solver_CPU::BoundaryFunctions::m_LatticeParameters_Ptr->ReverseDirectionVector_Rc[x])
22 
23 void MF::Solver_CPU::BoundaryFunctions::SetBoundaryNodePointerToFunc(const std::shared_ptr<MF::Database::ThreadArray>& ThreadArray_Ptr) {
24  for (auto & Thread_Ptr : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
25  if (MF::Solver_CPU::BoundaryFunctions::m_CaseParameters_Ptr->FluidFlowModel_MT == MF::Solver_CPU::FlowTypeClass::QuasiCompressible) { //Quasi compressible fluid flow model
26  switch (Thread_Ptr->m_NodeType) {
27  default:
28  case 0: {break;} //solid node
29  case 1: {break;} //fluid node
30  //------------------------------------------------------------------------------------
31  //Periodic
32  //------------------------------------------------------------------------------------
33  case 4: {break;}
34  //------------------------------------------------------------------------------------
35  //Bounce Back 2
36  //------------------------------------------------------------------------------------
37  case 61: { //BB typ 2 full way standard
38  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BF_BounceBack2_61;
39  Thread_Ptr->m_DoPreCollision = false;
40  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFQC_BounceBack2_61;
41  break;
42  }
43  //------------------------------------------------------------------------------------
44  //Dirichlet Velocity
45  //------------------------------------------------------------------------------------
46  case 21: //North velocity
47  {
48  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BFQC_VelocityNorth_21;
49  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFQC_VelocityNorth_21;
50  Thread_Ptr->m_DoPreCollision = true;
51  break;
52  }
53  case 22: //South velocity
54  {
55  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BFQC_VelocitySouth_22;
56  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFQC_VelocitySouth_22;
57  Thread_Ptr->m_DoPreCollision = true;
58  break;
59  }
60  case 23: //East velocity
61  {
62  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BFQC_VelocityEast_23;
63  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFQC_VelocityEast_23;
64  Thread_Ptr->m_DoPreCollision = true;
65  break;
66  }
67  case 24: // West velocity
68  {
69  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BFQC_VelocityWest_24;
70  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFQC_VelocityWest_24;
71  Thread_Ptr->m_DoPreCollision = true;
72  break;
73  }
74  case 25: // Bottom velocity
75  {
76  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BFQC_VelocityBottom_25;
77  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFQC_VelocityBottom_25;
78  Thread_Ptr->m_DoPreCollision = true;
79  break;
80  }
81  case 26: // Top velocity
82  {
83  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BFQC_VelocityTop_26;
84  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFQC_VelocityTop_26;
85  Thread_Ptr->m_DoPreCollision = true;
86  break;
87  }
88  //------------------------------------------------------------------------------------
89  //Pressure, Neumann
90  //------------------------------------------------------------------------------------
91  case 31: //North pressure
92  {
93  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BFQC_PressureNorth_31;
94  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFQC_PressureNorth_31;
95  Thread_Ptr->m_DoPreCollision = true;
96  break;
97  }
98  case 32: //South pressure
99  {
100  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BFQC_PressureSouth_32;
101  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFQC_PressureSouth_32;
102  Thread_Ptr->m_DoPreCollision = true;
103  break;
104  }
105  case 33: //East pressure
106  {
107  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BFQC_PressureEast_33;
108  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFQC_PressureEast_33;
109  Thread_Ptr->m_DoPreCollision = true;
110  break;
111  }
112  case 34: //West pressure
113  {
114  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BFQC_PressureWest_34;
115  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFQC_PressureWest_34;
116  Thread_Ptr->m_DoPreCollision = true;
117  break;
118  }
119  case 35: // Bottom pressure
120  {
121  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BFQC_PressureBottom_35;
122  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFQC_PressureBottom_35;
123  Thread_Ptr->m_DoPreCollision = true;
124  break;
125  }
126  case 36: // Top pressure
127  {
128  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BFQC_PressureTop_36;
129  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFQC_PressureTop_36;
130  Thread_Ptr->m_DoPreCollision = true;
131  break;
132  }
133  //------------------------------------------------------------------------------------
134  //Dirichlet Velocity 0
135  //------------------------------------------------------------------------------------
136  case 41: //North velocity
137  {
138  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BF_Velocity0North_41;
139  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBF_Velocity0North_41;
140  Thread_Ptr->m_DoPreCollision = true;
141  break;
142  }
143  case 42: //South velocity
144  {
145  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BF_Velocity0South_42;
146  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBF_Velocity0South_42;
147  Thread_Ptr->m_DoPreCollision = true;
148  break;
149  }
150  case 43: //East velocity
151  {
152  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BF_Velocity0East_43;
153  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBF_Velocity0East_43;
154  Thread_Ptr->m_DoPreCollision = true;
155  break;
156  }
157  case 44: // West velocity
158  {
159  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BF_Velocity0West_44;
160  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBF_Velocity0West_44;
161  Thread_Ptr->m_DoPreCollision = true;
162  break;
163  }
164  case 45: // Bottom velocity
165  {
166  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BF_Velocity0Bottom_45;
167  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBF_Velocity0Bottom_45;
168  Thread_Ptr->m_DoPreCollision = true;
169  break;
170  }
171  case 46: // Top velocity
172  {
173  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BF_Velocity0Top_46;
174  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBF_Velocity0Top_46;
175  Thread_Ptr->m_DoPreCollision = true;
176  break;
177  }
178 
179  }
180  }
181  else if (MF::Solver_CPU::BoundaryFunctions::m_CaseParameters_Ptr->FluidFlowModel_MT == MF::Solver_CPU::FlowTypeClass::Incompressible) { //Incompressible fluid flow model
182  switch (Thread_Ptr->m_NodeType) {
183  default:
184  case 0: {break;} //solid node
185  case 1: {break;} //fluid node
186  //------------------------------------------------------------------------------------
187  //Periodic
188  //------------------------------------------------------------------------------------
189  case 4: {break;}
190  //------------------------------------------------------------------------------------
191  //Bounce Back 2
192  //------------------------------------------------------------------------------------
193  case 61: //BB typ 2 full way standard
194  {
195  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BF_BounceBack2_61;
196  Thread_Ptr->m_DoPreCollision = false;
197  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFIC_BounceBack2_61;
198  break;
199  }
200  //------------------------------------------------------------------------------------
201  //Dirichlet Velocity
202  //------------------------------------------------------------------------------------
203  case 21: //North velocity
204  {
205  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BFIC_VelocityNorth_21;
206  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFIC_VelocityNorth_21;
207  Thread_Ptr->m_DoPreCollision = true;
208  break;
209  }
210  case 22: //South velocity
211  {
212  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BFIC_VelocitySouth_22;
213  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFIC_VelocitySouth_22;
214  Thread_Ptr->m_DoPreCollision = true;
215  break;
216  }
217  case 23: //East velocity
218  {
219  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BFIC_VelocityEast_23;
220  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFIC_VelocityEast_23;
221  Thread_Ptr->m_DoPreCollision = true;
222  break;
223  }
224  case 24: // West velocity
225  {
226  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BFIC_VelocityWest_24;
227  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFIC_VelocityWest_24;
228  Thread_Ptr->m_DoPreCollision = true;
229  break;
230  }
231  case 25: // Bottom velocity
232  {
233  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BFIC_VelocityBottom_25;
234  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFIC_VelocityBottom_25;
235  Thread_Ptr->m_DoPreCollision = true;
236  break;
237  }
238  case 26: // Top velocity
239  {
240  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BFIC_VelocityTop_26;
241  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFIC_VelocityTop_26;
242  Thread_Ptr->m_DoPreCollision = true;
243  break;
244  }
245  //------------------------------------------------------------------------------------
246  //Pressure, Neumann
247  //------------------------------------------------------------------------------------
248  case 31: //North pressure
249  {
250  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BFIC_PressureNorth_31;
251  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFIC_PressureNorth_31;
252  Thread_Ptr->m_DoPreCollision = true;
253  break;
254  }
255  case 32: //South pressure
256  {
257  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BFIC_PressureSouth_32;
258  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFIC_PressureSouth_32;
259  Thread_Ptr->m_DoPreCollision = true;
260  break;
261  }
262  case 33: //East pressure
263  {
264  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BFIC_PressureEast_33;
265  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFIC_PressureEast_33;
266  Thread_Ptr->m_DoPreCollision = true;
267  break;
268  }
269  case 34: //West pressure
270  {
271  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BFIC_PressureWest_34;
272  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFIC_PressureWest_34;
273  Thread_Ptr->m_DoPreCollision = true;
274  break;
275  }
276  case 35: // Bottom pressure
277  {
278  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BFIC_PressureBottom_35;
279  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFIC_PressureBottom_35;
280  Thread_Ptr->m_DoPreCollision = true;
281  break;
282  }
283  case 36: // Top pressure
284  {
285  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BFIC_PressureTop_36;
286  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBFIC_PressureTop_36;
287  Thread_Ptr->m_DoPreCollision = true;
288  break;
289  }
290  //------------------------------------------------------------------------------------
291  //Dirichlet Velocity
292  //------------------------------------------------------------------------------------
293  case 41: //North velocity
294  {
295  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BF_Velocity0North_41;
296  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBF_Velocity0North_41;
297  Thread_Ptr->m_DoPreCollision = true;
298  break;
299  }
300  case 42: //South velocity
301  {
302  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BF_Velocity0South_42;
303  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBF_Velocity0South_42;
304  Thread_Ptr->m_DoPreCollision = true;
305  break;
306  }
307  case 43: //East velocity
308  {
309  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BF_Velocity0East_43;
310  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBF_Velocity0East_43;
311  Thread_Ptr->m_DoPreCollision = true;
312  break;
313  }
314  case 44: // West velocity
315  {
316  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BF_Velocity0West_44;
317  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBF_Velocity0West_44;
318  Thread_Ptr->m_DoPreCollision = true;
319  break;
320  }
321  case 45: // Bottom velocity
322  {
323  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BF_Velocity0Bottom_45;
324  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBF_Velocity0Bottom_45;
325  Thread_Ptr->m_DoPreCollision = true;
326  break;
327  }
328  case 46: // Top velocity
329  {
330  Thread_Ptr->m_pBoundaryFunction = MF::Solver_CPU::BoundaryFunctions::BF_Velocity0Top_46;
331  Thread_Ptr->m_pVRLBFunction = MF::Solver_CPU::BoundaryFunctions::VRBF_Velocity0Top_46;
332  Thread_Ptr->m_DoPreCollision = true;
333  break;
334  }
335  }
336  }
337  }
338 }
339 
340 inline double MF::Solver_CPU::BoundaryFunctions::MeanRHOAdjFluidNodes(const MF::Database::Node *pNode) { // Returns mean rho LB of values from adjacent nodes to pNode.
341  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
342  auto nodeNr = Thread_Ptr->getNodeNr(pNode);
343  double rho {0};
344  uint32_t nNode {0};
345 
346  for (auto f = 1; f < MFQ19; f++) {
347  if (Thread_Ptr->getLinkedNodePointer(nodeNr, f) != nullptr) { // not a solid node
348  if (Thread_Ptr->getLinkedNodePointer(nodeNr, f)-> pMyThread_Ptr->operator*().m_NodeType == 1 ) { //Linked node is fluid(1) node.
349  nNode++;
350  const MF::Database::Node * neighboringNode = Thread_Ptr->getLinkedNodePointer(nodeNr, f);
351  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr5 = *Thread_Ptr->getLinkedNodePointer(nodeNr, f)->pMyThread_Ptr;
352  const MF::Database::Vec4<double> Vector5 = (*Thread_Ptr5->m_pVRLBFunction)(neighboringNode);
353  rho += Vector5.rho;
354  }
355  }
356  }
357  if (nNode != 0)
358  return (rho/nNode);
359  else
360  return -1;
361 }
362 
363 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFQC_BounceBack2_61(const MF::Database::Node *pNode) { // Rho LB for BB 61, quasi compressible flow model
364  MF::Database::Vec4<double> Vector4 {0,0,0,0};
365  DensityLB_rho = MF::Solver_CPU::BoundaryFunctions::MeanRHOAdjFluidNodes(pNode);
366 
367  if (DensityLB_rho == -1) {
368  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
369  auto nodeNr = Thread_Ptr->getNodeNr(pNode);
370  double rho {0};
371  uint32_t nNode {0};
372  for (auto f = 1; f < MFQ19; f++) {
373  if (Thread_Ptr->getLinkedNodePointer(nodeNr, f) != nullptr) { // not a solid node
374  const MF::Database::Node *neighboringNode = Thread_Ptr->getLinkedNodePointer(nodeNr, f);
375  if (MF::Solver_CPU::BoundaryFunctions::MeanRHOAdjFluidNodes(neighboringNode) != -1) {
376  rho += MF::Solver_CPU::BoundaryFunctions::MeanRHOAdjFluidNodes(neighboringNode);
377  nNode++;
378  }
379  }
380  }
381  if (nNode != 0)
382  DensityLB_rho = rho/nNode;
383  else
384  DensityLB_rho = NAN;
385  }
386  return Vector4;
387 }
388 
389 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFIC_BounceBack2_61(const MF::Database::Node *pNode) { // Rho LB for BB 61, incompressible compressible flow model
390  return MF::Solver_CPU::BoundaryFunctions::VRBFQC_BounceBack2_61(pNode); // The same formula as for quasi compressible flow.
391 }
392 
393 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBF_Velocity0North_41(const MF::Database::Node *pNode) { // Rho LB for North Velocity0
394  MF::Database::Vec4<double> Vector4 {0,0,0,0};
395  DensityLB_rho = (f(0) + f(1) + f(11) + f(12) + f(13) + f(14) + f(3) + f(5) + f(6) + 2.0 * (f(15) + f(16) + f(2) + f(7) + f(8)));
396  return Vector4;
397 }
398 
399 // Velocity 0, Dirichlet type, own derivation
400 void MF::Solver_CPU::BoundaryFunctions::BF_Velocity0North_41(MF::Database::Node * pNode){ // North Velocity0
401  const double N_x = 0.5 * (f(1) + f(11) + f(12) - f(13) - f(14) - f(3));
402  const double N_z = 0.5 * (f(11) - f(12) - f(13) + f(14) + f(5) - f(6));
403 
404  f(4) = f(2);
405  f(9) = f(7) + N_x;
406  f(10) = f(8) - N_x;
407  f(17) = f(15) + N_z;
408  f(18) = f(16) - N_z;
409 }
410 
411 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBF_Velocity0South_42(const MF::Database::Node *pNode) { // Rho LB for South Velocity0
412  MF::Database::Vec4<double> Vector4 {0,0,0,0};
413  DensityLB_rho = f(0) + f(1) + f(11) + f(12) + f(13) + f(14) + f(3) + f(5) + f(6) + 2.0 * (f(10) + f(17) + f(18) + f(4) + f(9));
414  return Vector4;
415 }
416 
417 void MF::Solver_CPU::BoundaryFunctions::BF_Velocity0South_42(MF::Database::Node * pNode){ // South Velocity0
418  const double N_x = 0.5 * (f(1) + f(11) + f(12) - f(13) - f(14) - f(3));
419  const double N_z = 0.5 * (f(11) - f(12) - f(13) + f(14) + f(5) - f(6));
420 
421  f(2) = f(4);
422  f(7) = f(9) - N_x;
423  f(8) = f(10) + N_x;
424  f(15) = f(17) - N_z;
425  f(16) = f(18) + N_z;
426 }
427 
428 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBF_Velocity0East_43(const MF::Database::Node *pNode){ // Rho LB for East Velocity0
429  MF::Database::Vec4<double> Vector4 {0,0,0,0};
430  DensityLB_rho = f(0) + f(15) + f(16) + f(17) + f(18) + f(2) + f(4) + f(5) + f(6) + 2.0 * (f(1) + f(10) + f(11) + f(12) + f(7));
431  return Vector4;
432 }
433 
434 void MF::Solver_CPU::BoundaryFunctions::BF_Velocity0East_43(MF::Database::Node * pNode){ // East Velocity0
435  const double N_y = 0.5 * (f(15) + f(16) - f(17) - f(18) + f(2) - f(4));
436  const double N_z = 0.5 * (f(15) - f(16) - f(17) + f(18) + f(5) - f(6));
437 
438  f(3) = f(1);
439  f(13) = f(11) + N_z;
440  f(14) = f(12) - N_z;
441  f(9) = f(7) + N_y;
442  f(8) = f(10) - N_y;
443 }
444 
445 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBF_Velocity0West_44(const MF::Database::Node *pNode){ // Rho LB for West Velocity0
446  MF::Database::Vec4<double> Vector4 {0,0,0,0};
447  DensityLB_rho = f(0) + f(15) + f(16) + f(17) + f(18) + f(2) + f(4) + f(5) + f(6) + 2.0 * (f(13) + f(14) + f(3) + f(8) + f(9));
448  return Vector4;
449 }
450 
451 void MF::Solver_CPU::BoundaryFunctions::BF_Velocity0West_44(MF::Database::Node * pNode){ // West Velocity0
452  const double N_y = 0.5 * (f(15) + f(16) - f(17) - f(18) + f(2) - f(4));
453  const double N_z = 0.5 * (f(15) - f(16) - f(17) + f(18) + f(5) - f(6));
454 
455  f(1) = f(3);
456  f(11) = f(13) - N_z;
457  f(12) = f(14) + N_z;
458  f(7) = f(9) - N_y;
459  f(10) = f(8) + N_y;
460 }
461 
462 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::BoundaryFunctions::VRBF_Velocity0Bottom_45(const MF::Database::Node *pNode) { // Rho LB for Bottom Velocity0
463  MF::Database::Vec4<double> Vector4 {0,0,0,0};
464  DensityLB_rho = f(0) + f(1) + f(10) + f(2) + f(3) + f(4) + f(7) + f(8) + f(9) + 2.0 * (f(12) + f(13) + f(16) + f(17) + f(6));
465  return Vector4;
466 }
467 
468 void MF::Solver_CPU::BoundaryFunctions::BoundaryFunctions::BF_Velocity0Bottom_45(MF::Database::Node * pNode){ // Bottom Velocity0
469  const double N_x = 0.5 * (f(1) + f(10) - f(3) + f(7) - f(8) - f(9));
470  const double N_y = 0.5 * (-f(10) + f(2) - f(4) + f(7) + f(8) - f(9));
471 
472  f(5) = f(6);
473  f(11) = f(13) - N_x;
474  f(18) = f(16) + N_y;
475  f(15) = f(17) - N_y;
476  f(14) = f(12) + N_x;
477 }
478 
479 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBF_Velocity0Top_46(const MF::Database::Node *pNode){ // Rho LB for Top Velocity0
480  MF::Database::Vec4<double> Vector4 {0,0,0,0};
481  DensityLB_rho = f(0) + f(1) + f(10) + f(2) + f(3) + f(4) + f(7) + f(8) + f(9) + 2.0 * (f(11) + f(14) + f(15) + f(18) + f(5));
482  return Vector4;
483 }
484 
485 void MF::Solver_CPU::BoundaryFunctions::BF_Velocity0Top_46(MF::Database::Node * pNode){ // Top Velocity0
486  const double N_x = 0.5 * (f(1) + f(10) - f(3) + f(7) - f(8) - f(9));
487  const double N_y = 0.5 * (-f(10) + f(2) - f(4) + f(7) + f(8) - f(9));
488 
489  f(6) = f(5);
490  f(13) = f(11) + N_x;
491  f(16) = f(18) - N_y;
492  f(17) = f(15) + N_y;
493  f(12) = f(14) - N_x;
494 }
495 
496 
497 //----------------------------------------------------------------------------------------------------------------------------
498 // Quasi compressible
499 //----------------------------------------------------------------------------------------------------------------------------
500 
501 // Velocity, Dirichlet type, Hecht and Harting (2010) dla D3Q19, own derivation, (Zou,He 1997,Dirichlet boundry)
502 
503 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFQC_VelocityNorth_21(const MF::Database::Node *pNode){ // Rho LB for North Velocity
504  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
506  DensityLB_rho = (f(0) + f(1) + f(11) + f(12) + f(13) + f(14) + f(3) + f(5) + f(6) + 2.0 * (f(15) + f(16) + f(2) + f(7) + f(8))) / (1.0 + YVelocityLB_uy);
507  return Vector4;
508 }
509 
510 void MF::Solver_CPU::BoundaryFunctions::BFQC_VelocityNorth_21(MF::Database::Node * pNode){ // North Velocity
511  auto Vector4 = MF::Solver_CPU::BoundaryFunctions::VRBFQC_VelocityNorth_21(pNode);
512  const double N_x = 0.5 * (f(1) + f(11) + f(12) - f(13) - f(14) - f(3)) - 1.0 / 3.0 * XVelocityLB_ux * DensityLB_rho;
513  const double N_z = 0.5 * (f(11) - f(12) - f(13) + f(14) + f(5) - f(6)) - 1.0 / 3.0 * ZVelocityLB_uz * DensityLB_rho;
514 
515  f(4) = f(2) - 1.0 / 3.0 * YVelocityLB_uy * DensityLB_rho;
516  f(9) = f(7) + N_x - 1.0 / 6.0 * (XVelocityLB_ux + YVelocityLB_uy) * DensityLB_rho;
517  f(10) = f(8) - N_x + 1.0 / 6.0 * (XVelocityLB_ux - YVelocityLB_uy) * DensityLB_rho;
518  f(17) = f(15) + N_z - 1.0 / 6.0 * (YVelocityLB_uy + ZVelocityLB_uz) * DensityLB_rho;
519  f(18) = f(16) - N_z + 1.0 / 6.0 * (-YVelocityLB_uy + ZVelocityLB_uz) * DensityLB_rho;
520 }
521 
522 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFQC_VelocitySouth_22(const MF::Database::Node *pNode){ // Rho LB for South Velocity
523  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
525  DensityLB_rho = (f(0) + f(1) + f(11) + f(12) + f(13) + f(14) + f(3) + f(5) + f(6) + 2.0 * (f(10) + f(17) + f(18) + f(4) + f(9))) / (1.0 - YVelocityLB_uy);
526  return Vector4;
527 }
528 
529 void MF::Solver_CPU::BoundaryFunctions::BFQC_VelocitySouth_22(MF::Database::Node * pNode){ // South Velocity
530  auto Vector4 = MF::Solver_CPU::BoundaryFunctions::VRBFQC_VelocitySouth_22(pNode);
531  const double N_x = 0.5 * (f(1) + f(11) + f(12) - f(13) - f(14) - f(3)) - 1.0 / 3.0 * XVelocityLB_ux * DensityLB_rho;
532  const double N_z = 0.5 * (f(11) - f(12) - f(13) + f(14) + f(5) - f(6)) - 1.0 / 3.0 * ZVelocityLB_uz * DensityLB_rho;
533 
534  f(2) = f(4) + 1.0 / 3.0 * YVelocityLB_uy * DensityLB_rho;
535  f(7) = f(9) - N_x + 1.0 / 6.0 * (XVelocityLB_ux + YVelocityLB_uy) * DensityLB_rho;
536  f(8) = f(10) + N_x + 1.0 / 6.0 * (-XVelocityLB_ux + YVelocityLB_uy) * DensityLB_rho;
537  f(15) = f(17) - N_z + 1.0 / 6.0 * (YVelocityLB_uy + ZVelocityLB_uz) * DensityLB_rho;
538  f(16) = f(18) + N_z + 1.0 / 6.0 * (YVelocityLB_uy - ZVelocityLB_uz) * DensityLB_rho;
539 }
540 
541 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFQC_VelocityEast_23(const MF::Database::Node *pNode){ // Rho LB for East Velocity
542  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
544  DensityLB_rho = (f(0) + f(15) + f(16) + f(17) + f(18) + f(2) + f(4) + f(5) + f(6) + 2.0 * (f(1) + f(10) + f(11) + f(12) + f(7))) / (1.0 + XVelocityLB_ux);
545  return Vector4;
546 }
547 
548 void MF::Solver_CPU::BoundaryFunctions::BFQC_VelocityEast_23(MF::Database::Node * pNode){ // East Velocity
549  auto Vector4 = MF::Solver_CPU::BoundaryFunctions::VRBFQC_VelocityEast_23(pNode);
550  const double N_y = 0.5 * (f(15) + f(16) - f(17) - f(18) + f(2) - f(4)) - 1.0 / 3.0 * YVelocityLB_uy * DensityLB_rho;
551  const double N_z = 0.5 * (f(15) - f(16) - f(17) + f(18) + f(5) - f(6)) - 1.0 / 3.0 * ZVelocityLB_uz * DensityLB_rho;
552 
553  f(3) = f(1) - 1.0 / 3.0 * XVelocityLB_ux * DensityLB_rho;
554  f(13) = f(11) + N_z - 1.0 / 6.0 * (XVelocityLB_ux + ZVelocityLB_uz) * DensityLB_rho;
555  f(14) = f(12) - N_z + 1.0 / 6.0 * (-XVelocityLB_ux + ZVelocityLB_uz) * DensityLB_rho;
556  f(9) = f(7) + N_y - 1.0 / 6.0 * (XVelocityLB_ux + YVelocityLB_uy) * DensityLB_rho;
557  f(8) = f(10) - N_y + 1.0 / 6.0 * (-XVelocityLB_ux + YVelocityLB_uy) * DensityLB_rho;
558 }
559 
560 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFQC_VelocityWest_24(const MF::Database::Node *pNode){ // Rho LB for West Velocity
561  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
563  DensityLB_rho = (f(0) + f(15) + f(16) + f(17) + f(18) + f(2) + f(4) + f(5) + f(6) + 2.0 * (f(13) + f(14) + f(3) + f(8) + f(9))) / (1.0 - XVelocityLB_ux);
564  return Vector4;
565 }
566 
567 void MF::Solver_CPU::BoundaryFunctions::BFQC_VelocityWest_24(MF::Database::Node * pNode){ // West Velocity
568  auto Vector4 = MF::Solver_CPU::BoundaryFunctions::VRBFQC_VelocityWest_24(pNode);
569  const double N_y = 0.5 * (f(15) + f(16) - f(17) - f(18) + f(2) - f(4)) - 1.0 / 3.0 * YVelocityLB_uy * DensityLB_rho;
570  const double N_z = 0.5 * (f(15) - f(16) - f(17) + f(18) + f(5) - f(6)) - 1.0 / 3.0 * ZVelocityLB_uz * DensityLB_rho;
571 
572  f(1) = f(3) + 1.0 / 3.0 * XVelocityLB_ux * DensityLB_rho;
573  f(11) = f(13) - N_z + 1.0 / 6.0 * (XVelocityLB_ux + ZVelocityLB_uz) * DensityLB_rho;
574  f(12) = f(14) + N_z + 1.0 / 6.0 * (XVelocityLB_ux - ZVelocityLB_uz) * DensityLB_rho;
575  f(7) = f(9) - N_y + 1.0 / 6.0 * (XVelocityLB_ux + YVelocityLB_uy) * DensityLB_rho;
576  f(10) = f(8) + N_y + 1.0 / 6.0 * (XVelocityLB_ux - YVelocityLB_uy) * DensityLB_rho;
577 }
578 
579 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFQC_VelocityBottom_25(const MF::Database::Node *pNode){ // Rho LB for Bottom Velocity
580  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
582  DensityLB_rho = (f(0) + f(1) + f(10) + f(2) + f(3) + f(4) + f(7) + f(8) + f(9) + 2.0 * (f(12) + f(13) + f(16) + f(17) + f(6))) / (1.0 - ZVelocityLB_uz);
583  return Vector4;
584 }
585 
586 void MF::Solver_CPU::BoundaryFunctions::BFQC_VelocityBottom_25(MF::Database::Node * pNode){ // Bottom Velocity
587  auto Vector4 = MF::Solver_CPU::BoundaryFunctions::VRBFQC_VelocityBottom_25(pNode);
588  const double N_x = 0.5 * (f(1) + f(10) - f(3) + f(7) - f(8) - f(9)) - 1.0 / 3.0 * XVelocityLB_ux * DensityLB_rho;
589  const double N_y = 0.5 * (-f(10) + f(2) - f(4) + f(7) + f(8) - f(9)) - 1.0 / 3.0 * YVelocityLB_uy * DensityLB_rho;
590 
591  f(5) = f(6) + 1.0 / 3.0 * ZVelocityLB_uz * DensityLB_rho;
592  f(11) = f(13) - N_x + 1.0 / 6.0 * (XVelocityLB_ux + ZVelocityLB_uz) * DensityLB_rho;
593  f(18) = f(16) + N_y + 1.0 / 6.0 * (-YVelocityLB_uy + ZVelocityLB_uz) * DensityLB_rho;
594  f(15) = f(17) - N_y + 1.0 / 6.0 * (YVelocityLB_uy + ZVelocityLB_uz) * DensityLB_rho;
595  f(14) = f(12) + N_x + 1.0 / 6.0 * (-XVelocityLB_ux + ZVelocityLB_uz) * DensityLB_rho;
596 }
597 
598 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFQC_VelocityTop_26(const MF::Database::Node *pNode){ // Rho LB for Top Velocity
599  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
601  DensityLB_rho = (f(0) + f(1) + f(10) + f(2) + f(3) + f(4) + f(7) + f(8) + f(9) + 2.0 * (f(11) + f(14) + f(15) + f(18) + f(5))) / (1.0 + ZVelocityLB_uz);
602  return Vector4;
603 }
604 
605 void MF::Solver_CPU::BoundaryFunctions::BFQC_VelocityTop_26(MF::Database::Node * pNode){ // Top Velocity
606  auto Vector4 = MF::Solver_CPU::BoundaryFunctions::VRBFQC_VelocityTop_26(pNode);
607  const double N_x = 0.5 * (f(1) + f(10) - f(3) + f(7) - f(8) - f(9)) - 1.0 / 3.0 * XVelocityLB_ux * DensityLB_rho;
608  const double N_y = 0.5 * (-f(10) + f(2) - f(4) + f(7) + f(8) - f(9)) - 1.0 / 3.0 * YVelocityLB_uy * DensityLB_rho;
609 
610  f(6) = f(5) - 1.0 / 3.0 * ZVelocityLB_uz * DensityLB_rho;
611  f(13) = f(11) + N_x - 1.0 / 6.0 * (XVelocityLB_ux + ZVelocityLB_uz) * DensityLB_rho;
612  f(16) = f(18) - N_y + 1.0 / 6.0 * (YVelocityLB_uy - ZVelocityLB_uz) * DensityLB_rho;
613  f(17) = f(15) + N_y - 1.0 / 6.0 * (YVelocityLB_uy + ZVelocityLB_uz) * DensityLB_rho;
614  f(12) = f(14) - N_x + 1.0 / 6.0 * (XVelocityLB_ux - ZVelocityLB_uz) * DensityLB_rho;
615 }
616 
617 
618 // Pressure, Neumann type, Hecht and Harting (2010) for D3Q19, own derivation
619 
620 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFQC_PressureNorth_31(const MF::Database::Node *pNode){ // Velocity LB for North Pressure
621  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
623  YVelocityLB_uy = -1.0 + (f(0) + f(1) + f(11) + f(12) + f(13) + f(14) + f(3) + f(5) + f(6) + 2.0 * (f(15) + f(16) + f(2) + f(7) + f(8))) / DensityLB_rho;
624  return Vector4;
625 }
626 
627 void MF::Solver_CPU::BoundaryFunctions::BFQC_PressureNorth_31(MF::Database::Node * pNode){ // North Pressure
628  auto Vector4 = MF::Solver_CPU::BoundaryFunctions::VRBFQC_PressureNorth_31(pNode);
629  const double N_x = 0.5 * (f(1) + f(11) + f(12) - f(13) - f(14) - f(3)) - 1.0 / 3.0 * XVelocityLB_ux * DensityLB_rho;
630  const double N_z = 0.5 * (f(11) - f(12) - f(13) + f(14) + f(5) - f(6)) - 1.0 / 3.0 * ZVelocityLB_uz * DensityLB_rho;
631 
632  f(4) = f(2) - 1.0 / 3.0 * YVelocityLB_uy * DensityLB_rho;
633  f(9) = f(7) + N_x - 1.0 / 6.0 * (XVelocityLB_ux + YVelocityLB_uy) * DensityLB_rho;
634  f(10) = f(8) - N_x + 1.0 / 6.0 * (XVelocityLB_ux - YVelocityLB_uy) * DensityLB_rho;
635  f(17) = f(15) + N_z - 1.0 / 6.0 * (YVelocityLB_uy + ZVelocityLB_uz) * DensityLB_rho;
636  f(18) = f(16) - N_z + 1.0 / 6.0 * (-YVelocityLB_uy + ZVelocityLB_uz) * DensityLB_rho;
637 }
638 
639 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFQC_PressureSouth_32(const MF::Database::Node *pNode){ // Velocity LB for South Pressure
640  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
642  YVelocityLB_uy = 1.0 - (f(0) + f(1) + f(11) + f(12) + f(13) + f(14) + f(3) + f(5) + f(6) + 2.0 * (f(10) + f(17) + f(18) + f(4) + f(9))) / DensityLB_rho;
643  return Vector4;
644 }
645 
646 void MF::Solver_CPU::BoundaryFunctions::BFQC_PressureSouth_32(MF::Database::Node * pNode){ // South Pressure
647  MF::Database::Vec4<double> Vector4 = MF::Solver_CPU::BoundaryFunctions::VRBFQC_PressureSouth_32(pNode);
648  const double N_x = 0.5 * (f(1) + f(11) + f(12) - f(13) - f(14) - f(3)) - 1.0 / 3.0 * XVelocityLB_ux * DensityLB_rho;
649  const double N_z = 0.5 * (f(11) - f(12) - f(13) + f(14) + f(5) - f(6)) - 1.0 / 3.0 * ZVelocityLB_uz * DensityLB_rho;
650 
651  f(2) = f(4) + 1.0 / 3.0 * YVelocityLB_uy * DensityLB_rho;
652  f(7) = f(9) - N_x + 1.0 / 6.0 * (XVelocityLB_ux + YVelocityLB_uy) * DensityLB_rho;
653  f(8) = f(10) + N_x + 1.0 / 6.0 * (-XVelocityLB_ux + YVelocityLB_uy) * DensityLB_rho;
654  f(15) = f(17) - N_z + 1.0 / 6.0 * (YVelocityLB_uy + ZVelocityLB_uz) * DensityLB_rho;
655  f(16) = f(18) + N_z + 1.0 / 6.0 * (YVelocityLB_uy - ZVelocityLB_uz) * DensityLB_rho;
656 }
657 
658 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFQC_PressureEast_33(const MF::Database::Node *pNode){ // Velocity LB for East Pressure
659  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
661  XVelocityLB_ux = -1.0 + (f(0) + f(15) + f(16) + f(17) + f(18) + f(2) + f(4) + f(5) + f(6) + 2.0 * (f(1) + f(10) + f(11) + f(12) + f(7))) / DensityLB_rho;
662  return Vector4;
663 }
664 
665 void MF::Solver_CPU::BoundaryFunctions::BFQC_PressureEast_33(MF::Database::Node * pNode){ // East Pressure
666  MF::Database::Vec4<double> Vector4 = MF::Solver_CPU::BoundaryFunctions::VRBFQC_PressureEast_33(pNode);
667  const double N_y = 0.5 * (f(15) + f(16) - f(17) - f(18) + f(2) - f(4)) - 1.0 / 3.0 * YVelocityLB_uy * DensityLB_rho;
668  const double N_z = 0.5 * (f(15) - f(16) - f(17) + f(18) + f(5) - f(6)) - 1.0 / 3.0 * ZVelocityLB_uz * DensityLB_rho;
669 
670  f(3) = f(1) - 1.0 / 3.0 * XVelocityLB_ux * DensityLB_rho;
671  f(13) = f(11) + N_z - 1.0 / 6.0 * (XVelocityLB_ux + ZVelocityLB_uz) * DensityLB_rho;
672  f(14) = f(12) - N_z + 1.0 / 6.0 * (-XVelocityLB_ux + ZVelocityLB_uz) * DensityLB_rho;
673  f(9) = f(7) + N_y - 1.0 / 6.0 * (XVelocityLB_ux + YVelocityLB_uy) * DensityLB_rho;
674  f(8) = f(10) - N_y + 1.0 / 6.0 * (-XVelocityLB_ux + YVelocityLB_uy) * DensityLB_rho;
675 }
676 
677 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFQC_PressureWest_34(const MF::Database::Node *pNode){ // Velocity LB for West Pressure
678  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
680  XVelocityLB_ux = 1.0 - (f(0) + f(15) + f(16) + f(17) + f(18) + f(2) + f(4) + f(5) + f(6) + 2.0 * (f(13) + f(14) + f(3) + f(8) + f(9))) / DensityLB_rho;
681  return Vector4;
682 }
683 
684 void MF::Solver_CPU::BoundaryFunctions::BFQC_PressureWest_34(MF::Database::Node * pNode){ // West Pressure
685  MF::Database::Vec4<double> Vector4 = MF::Solver_CPU::BoundaryFunctions::VRBFQC_PressureWest_34(pNode);
686  const double N_y = 0.5 * (f(15) + f(16) - f(17) - f(18) + f(2) - f(4)) - 1.0 / 3.0 * YVelocityLB_uy * DensityLB_rho;
687  const double N_z = 0.5 * (f(15) - f(16) - f(17) + f(18) + f(5) - f(6)) - 1.0 / 3.0 * ZVelocityLB_uz * DensityLB_rho;
688 
689  f(1) = f(3) + 1.0 / 3.0 * XVelocityLB_ux * DensityLB_rho;
690  f(11) = f(13) - N_z + 1.0 / 6.0 * (XVelocityLB_ux + ZVelocityLB_uz) * DensityLB_rho;
691  f(12) = f(14) + N_z + 1.0 / 6.0 * (XVelocityLB_ux - ZVelocityLB_uz) * DensityLB_rho;
692  f(7) = f(9) - N_y + 1.0 / 6.0 * (XVelocityLB_ux + YVelocityLB_uy) * DensityLB_rho;
693  f(10) = f(8) + N_y + 1.0 / 6.0 * (XVelocityLB_ux - YVelocityLB_uy) * DensityLB_rho;
694 }
695 
696 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFQC_PressureBottom_35(const MF::Database::Node *pNode){ // Velocity LB for Bottom Pressure
697  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
699  ZVelocityLB_uz = 1.0 - (f(0) + f(1) + f(10) + f(2) + f(3) + f(4) + f(7) + f(8) + f(9) + 2.0 * (f(12) + f(13) + f(16) + f(17) + f(6))) / DensityLB_rho;
700  return Vector4;
701 }
702 
703 void MF::Solver_CPU::BoundaryFunctions::BFQC_PressureBottom_35(MF::Database::Node * pNode){ // Bottom Pressure
704  MF::Database::Vec4<double> Vector4 = MF::Solver_CPU::BoundaryFunctions::VRBFQC_PressureBottom_35(pNode);
705  const double N_x = 0.5 * (f(1) + f(10) - f(3) + f(7) - f(8) - f(9)) - 1.0 / 3.0 * XVelocityLB_ux * DensityLB_rho;
706  const double N_y = 0.5 * (-f(10) + f(2) - f(4) + f(7) + f(8) - f(9)) - 1.0 / 3.0 * YVelocityLB_uy * DensityLB_rho;
707 
708  f(5) = f(6) + 1.0 / 3.0 * ZVelocityLB_uz * DensityLB_rho;
709  f(11) = f(13) - N_x + 1.0 / 6.0 * (XVelocityLB_ux + ZVelocityLB_uz) * DensityLB_rho;
710  f(18) = f(16) + N_y + 1.0 / 6.0 * (-YVelocityLB_uy + ZVelocityLB_uz) * DensityLB_rho;
711  f(15) = f(17) - N_y + 1.0 / 6.0 * (YVelocityLB_uy + ZVelocityLB_uz) * DensityLB_rho;
712  f(14) = f(12) + N_x + 1.0 / 6.0 * (-XVelocityLB_ux + ZVelocityLB_uz) * DensityLB_rho;
713 }
714 
715 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFQC_PressureTop_36(const MF::Database::Node *pNode){ // Velocity LB for Top Pressure
716  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
718  ZVelocityLB_uz = -1.0 + (f(0) + f(1) + f(10) + f(2) + f(3) + f(4) + f(7) + f(8) + f(9) + 2.0 * (f(11) + f(14) + f(15) + f(18) + f(5))) / DensityLB_rho;
719  return Vector4;
720 }
721 
722 void MF::Solver_CPU::BoundaryFunctions::BFQC_PressureTop_36(MF::Database::Node * pNode){ // Top pressure
723  MF::Database::Vec4<double> Vector4 = MF::Solver_CPU::BoundaryFunctions::VRBFQC_PressureTop_36(pNode);
724  const double N_x = 0.5 * (f(1) + f(10) - f(3) + f(7) - f(8) - f(9)) - 1.0 / 3.0 * XVelocityLB_ux * DensityLB_rho;
725  const double N_y = 0.5 * (-f(10) + f(2) - f(4) + f(7) + f(8) - f(9)) - 1.0 / 3.0 * YVelocityLB_uy * DensityLB_rho;
726 
727  f(6) = f(5) - 1.0 / 3.0 * ZVelocityLB_uz * DensityLB_rho;
728  f(13) = f(11) + N_x - 1.0 / 6.0 * (XVelocityLB_ux + ZVelocityLB_uz) * DensityLB_rho;
729  f(16) = f(18) - N_y + 1.0 / 6.0 * (YVelocityLB_uy - ZVelocityLB_uz) * DensityLB_rho;
730  f(17) = f(15) + N_y - 1.0 / 6.0 * (YVelocityLB_uy + ZVelocityLB_uz) * DensityLB_rho;
731  f(12) = f(14) - N_x + 1.0 / 6.0 * (XVelocityLB_ux - ZVelocityLB_uz) * DensityLB_rho;
732 }
733 
734 //----------------------------------------------------------------------------------------------------------------------------
735 // Incompressible Zou et al. 1995
736 //----------------------------------------------------------------------------------------------------------------------------
737 
738 // Velocity, Dirichlet type, Hecht and Harting (2010) for D3Q19, own derivation. (Zou,He 1997,Dirichlet boundary)
739 
740 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFIC_VelocityNorth_21(const MF::Database::Node *pNode){ // Rho for North Velocity
741  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
743  DensityLB_rho = (-BoundaryYVelocityLB_uyB) + (f(0) + f(1) + f(11) + f(12) + f(13) + f(14) + f(3) + f(5) + f(6) + 2.0 * (f(15) + f(16) + f(2) + f(7) + f(8)));
744  return Vector4;
745 }
746 
747 void MF::Solver_CPU::BoundaryFunctions::BFIC_VelocityNorth_21(MF::Database::Node * pNode){ // North Velocity
748  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
749  const double N_x = 0.5 * (f(1) + f(11) + f(12) - f(13) - f(14) - f(3)) - 1.0 / 3.0 * BoundaryXVelocityLB_uxB;
750  const double N_z = 0.5 * (f(11) - f(12) - f(13) + f(14) + f(5) - f(6)) - 1.0 / 3.0 * BoundaryZVelocityLB_uzB;
751 
752  f(4) = f(2) - 1.0 / 3.0 * BoundaryYVelocityLB_uyB;
753  f(9) = f(7) + N_x - 1.0 / 6.0 * (BoundaryXVelocityLB_uxB + BoundaryYVelocityLB_uyB);
754  f(10) = f(8) - N_x + 1.0 / 6.0 * (BoundaryXVelocityLB_uxB - BoundaryYVelocityLB_uyB);
755  f(17) = f(15) + N_z - 1.0 / 6.0 * (BoundaryYVelocityLB_uyB + BoundaryZVelocityLB_uzB);
756  f(18) = f(16) - N_z + 1.0 / 6.0 * (-BoundaryYVelocityLB_uyB + BoundaryZVelocityLB_uzB);
757 }
758 
759 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFIC_VelocitySouth_22(const MF::Database::Node *pNode){ // Rho for South Velocity
760  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
762  DensityLB_rho = BoundaryYVelocityLB_uyB + (f(0) + f(1) + f(11) + f(12) + f(13) + f(14) + f(3) + f(5) + f(6) + 2.0 * (f(10) + f(17) + f(18) + f(4) + f(9)));
763  return Vector4;
764 }
765 
766 void MF::Solver_CPU::BoundaryFunctions::BFIC_VelocitySouth_22(MF::Database::Node * pNode){ // South Velocity
767  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
768  const double N_x = 0.5 * (f(1) + f(11) + f(12) - f(13) - f(14) - f(3)) - 1.0 / 3.0 * BoundaryXVelocityLB_uxB;
769  const double N_z = 0.5 * (f(11) - f(12) - f(13) + f(14) + f(5) - f(6)) - 1.0 / 3.0 * BoundaryZVelocityLB_uzB;
770 
771  f(2) = f(4) + 1.0 / 3.0 * BoundaryYVelocityLB_uyB;
772  f(7) = f(9) - N_x + 1.0 / 6.0 * (BoundaryXVelocityLB_uxB + BoundaryYVelocityLB_uyB);
773  f(8) = f(10) + N_x + 1.0 / 6.0 * (-BoundaryXVelocityLB_uxB + BoundaryYVelocityLB_uyB);
774  f(15) = f(17) - N_z + 1.0 / 6.0 * (BoundaryYVelocityLB_uyB + BoundaryZVelocityLB_uzB);
775  f(16) = f(18) + N_z + 1.0 / 6.0 * (BoundaryYVelocityLB_uyB - BoundaryZVelocityLB_uzB);
776 }
777 
778 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFIC_VelocityEast_23(const MF::Database::Node *pNode){ // Rho for East Velocity
779  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
781  DensityLB_rho = (-BoundaryXVelocityLB_uxB) + (f(0) + f(15) + f(16) + f(17) + f(18) + f(2) + f(4) + f(5) + f(6) + 2.0 * (f(1) + f(10) + f(11) + f(12) + f(7)));
782  return Vector4;
783 }
784 
785 void MF::Solver_CPU::BoundaryFunctions::BFIC_VelocityEast_23(MF::Database::Node * pNode){ // East Velocity
786  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
787  const double N_y = 0.5 * (f(15) + f(16) - f(17) - f(18) + f(2) - f(4)) - 1.0 / 3.0 * BoundaryYVelocityLB_uyB;
788  const double N_z = 0.5 * (f(15) - f(16) - f(17) + f(18) + f(5) - f(6)) - 1.0 / 3.0 * BoundaryZVelocityLB_uzB;
789 
790  f(3) = f(1) - 1.0 / 3.0 * BoundaryXVelocityLB_uxB;
791  f(13) = f(11) + N_z - 1.0 / 6.0 * (BoundaryXVelocityLB_uxB + BoundaryZVelocityLB_uzB);
792  f(14) = f(12) - N_z + 1.0 / 6.0 * (-BoundaryXVelocityLB_uxB + BoundaryZVelocityLB_uzB);
793  f(9) = f(7) + N_y - 1.0 / 6.0 * (BoundaryXVelocityLB_uxB + BoundaryYVelocityLB_uyB);
794  f(8) = f(10) - N_y + 1.0 / 6.0 * (-BoundaryXVelocityLB_uxB + BoundaryYVelocityLB_uyB);
795 }
796 
797 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFIC_VelocityWest_24(const MF::Database::Node *pNode){ // Rho for West Velocity
798  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
800  DensityLB_rho = BoundaryXVelocityLB_uxB + (f(0) + f(15) + f(16) + f(17) + f(18) + f(2) + f(4) + f(5) + f(6) + 2.0 * (f(13) + f(14) + f(3) + f(8) + f(9)));
801  return Vector4;
802 }
803 
804 void MF::Solver_CPU::BoundaryFunctions::BFIC_VelocityWest_24(MF::Database::Node * pNode){ // West Velocity
805  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
806  const double N_y = 0.5 * (f(15) + f(16) - f(17) - f(18) + f(2) - f(4)) - 1.0 / 3.0 * BoundaryYVelocityLB_uyB;
807  const double N_z = 0.5 * (f(15) - f(16) - f(17) + f(18) + f(5) - f(6)) - 1.0 / 3.0 * BoundaryZVelocityLB_uzB;
808 
809  f(1) = f(3) + 1.0 / 3.0 * BoundaryXVelocityLB_uxB;
810  f(11) = f(13) - N_z + 1.0 / 6.0 * (BoundaryXVelocityLB_uxB + BoundaryZVelocityLB_uzB);
811  f(12) = f(14) + N_z + 1.0 / 6.0 * (BoundaryXVelocityLB_uxB - BoundaryZVelocityLB_uzB);
812  f(7) = f(9) - N_y + 1.0 / 6.0 * (BoundaryXVelocityLB_uxB + BoundaryYVelocityLB_uyB);
813  f(10) = f(8) + N_y + 1.0 / 6.0 * (BoundaryXVelocityLB_uxB - BoundaryYVelocityLB_uyB);
814 }
815 
816 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFIC_VelocityBottom_25(const MF::Database::Node *pNode){ // Rho for Bottom Velocity
817  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
819  DensityLB_rho = BoundaryZVelocityLB_uzB + (f(0) + f(1) + f(10) + f(2) + f(3) + f(4) + f(7) + f(8) + f(9) + 2.0 * (f(12) + f(13) + f(16) + f(17) + f(6)));
820  return Vector4;
821 }
822 
823 void MF::Solver_CPU::BoundaryFunctions::BFIC_VelocityBottom_25(MF::Database::Node * pNode){ // Bottom Velocity
824  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
825  const double N_x = 0.5 * (f(1) + f(10) - f(3) + f(7) - f(8) - f(9)) - 1.0 / 3.0 * BoundaryXVelocityLB_uxB;
826  const double N_y = 0.5 * (-f(10) + f(2) - f(4) + f(7) + f(8) - f(9)) - 1.0 / 3.0 * BoundaryYVelocityLB_uyB;
827 
828  f(5) = f(6) + 1.0 / 3.0 * BoundaryZVelocityLB_uzB;
829  f(11) = f(13) - N_x + 1.0 / 6.0 * (BoundaryXVelocityLB_uxB + BoundaryZVelocityLB_uzB);
830  f(18) = f(16) + N_y + 1.0 / 6.0 * (-BoundaryYVelocityLB_uyB + BoundaryZVelocityLB_uzB);
831  f(15) = f(17) - N_y + 1.0 / 6.0 * (BoundaryYVelocityLB_uyB + BoundaryZVelocityLB_uzB);
832  f(14) = f(12) + N_x + 1.0 / 6.0 * (-BoundaryXVelocityLB_uxB + BoundaryZVelocityLB_uzB);
833 }
834 
835 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFIC_VelocityTop_26(const MF::Database::Node *pNode){ // Rho for Top Velocity
836  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
838  DensityLB_rho = (-BoundaryZVelocityLB_uzB) + (f(0) + f(1) + f(10) + f(2) + f(3) + f(4) + f(7) + f(8) + f(9) + 2.0 * (f(11) + f(14) + f(15) + f(18) + f(5)));
839  return Vector4;
840 }
841 
842 void MF::Solver_CPU::BoundaryFunctions::BFIC_VelocityTop_26(MF::Database::Node * pNode){ // Top Velocity
843  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
844  const double N_x = 0.5 * (f(1) + f(10) - f(3) + f(7) - f(8) - f(9)) - 1.0 / 3.0 * BoundaryXVelocityLB_uxB;
845  const double N_y = 0.5 * (-f(10) + f(2) - f(4) + f(7) + f(8) - f(9)) - 1.0 / 3.0 * BoundaryYVelocityLB_uyB;
846 
847  f(6) = f(5) - 1.0 / 3.0 * BoundaryZVelocityLB_uzB;
848  f(13) = f(11) + N_x - 1.0 / 6.0 * (BoundaryXVelocityLB_uxB + BoundaryZVelocityLB_uzB);
849  f(16) = f(18) - N_y + 1.0 / 6.0 * (BoundaryYVelocityLB_uyB - BoundaryZVelocityLB_uzB);
850  f(17) = f(15) + N_y - 1.0 / 6.0 * (BoundaryYVelocityLB_uyB + BoundaryZVelocityLB_uzB);
851  f(12) = f(14) - N_x + 1.0 / 6.0 * (BoundaryXVelocityLB_uxB - BoundaryZVelocityLB_uzB);
852 }
853 
854 
855 // Pressure, Neumann type, Hecht and Harting (2010) for D3Q19, own derivation
856 
857 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFIC_PressureNorth_31(const MF::Database::Node *pNode){ // Velocity LB for North Pressure
858  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
860  YVelocityLB_uy = (-DensityLB_rho) + (f(0) + f(1) + f(11) + f(12) + f(13) + f(14) + f(3) + f(5) + f(6) + 2.0 * (f(15) + f(16) + f(2) + f(7) + f(8)));
861  return Vector4;
862 }
863 
864 void MF::Solver_CPU::BoundaryFunctions::BFIC_PressureNorth_31(MF::Database::Node * pNode){ // North Pressure
865  MF::Database::Vec4<double> Vector4 = MF::Solver_CPU::BoundaryFunctions::VRBFIC_PressureNorth_31(pNode);
866  const double N_x = 0.5 * (f(1) + f(11) + f(12) - f(13) - f(14) - f(3)) - 1.0 / 3.0 * XVelocityLB_ux;
867  const double N_z = 0.5 * (f(11) - f(12) - f(13) + f(14) + f(5) - f(6)) - 1.0 / 3.0 * ZVelocityLB_uz;
868 
869  f(4) = f(2) - 1.0 / 3.0 * YVelocityLB_uy;
870  f(9) = f(7) + N_x - 1.0 / 6.0 * (XVelocityLB_ux + YVelocityLB_uy);
871  f(10) = f(8) - N_x + 1.0 / 6.0 * (XVelocityLB_ux - YVelocityLB_uy);
872  f(17) = f(15) + N_z - 1.0 / 6.0 * (YVelocityLB_uy + ZVelocityLB_uz);
873  f(18) = f(16) - N_z + 1.0 / 6.0 * (-YVelocityLB_uy + ZVelocityLB_uz);
874 }
875 
876 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFIC_PressureSouth_32(const MF::Database::Node *pNode){ // Velocity LB for South Pressure
877  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
879  YVelocityLB_uy = DensityLB_rho - (f(0) + f(1) + f(11) + f(12) + f(13) + f(14) + f(3) + f(5) + f(6) + 2.0 * (f(10) + f(17) + f(18) + f(4) + f(9)));
880  return Vector4;
881 }
882 
883 void MF::Solver_CPU::BoundaryFunctions::BFIC_PressureSouth_32(MF::Database::Node * pNode){ // South Pressure
884  MF::Database::Vec4<double> Vector4 = MF::Solver_CPU::BoundaryFunctions::VRBFIC_PressureSouth_32(pNode);
885  const double N_x = 0.5 * (f(1) + f(11) + f(12) - f(13) - f(14) - f(3)) - 1.0 / 3.0 * XVelocityLB_ux;
886  const double N_z = 0.5 * (f(11) - f(12) - f(13) + f(14) + f(5) - f(6)) - 1.0 / 3.0 * ZVelocityLB_uz;
887 
888  f(2) = f(4) + 1.0 / 3.0 * YVelocityLB_uy;
889  f(7) = f(9) - N_x + 1.0 / 6.0 * (XVelocityLB_ux + YVelocityLB_uy);
890  f(8) = f(10) + N_x + 1.0 / 6.0 * (-XVelocityLB_ux + YVelocityLB_uy);
891  f(15) = f(17) - N_z + 1.0 / 6.0 * (YVelocityLB_uy + ZVelocityLB_uz);
892  f(16) = f(18) + N_z + 1.0 / 6.0 * (YVelocityLB_uy - ZVelocityLB_uz);
893 }
894 
895 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFIC_PressureEast_33(const MF::Database::Node *pNode){ // Velocity LB for East Pressure
896  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
898  XVelocityLB_ux = (-DensityLB_rho) + (f(0) + f(15) + f(16) + f(17) + f(18) + f(2) + f(4) + f(5) + f(6) + 2.0 * (f(1) + f(10) + f(11) + f(12) + f(7)));
899  return Vector4;
900 }
901 
902 void MF::Solver_CPU::BoundaryFunctions::BFIC_PressureEast_33(MF::Database::Node * pNode){ // East Pressure
903  MF::Database::Vec4<double> Vector4 = MF::Solver_CPU::BoundaryFunctions::VRBFIC_PressureEast_33(pNode);
904  const double N_y = 0.5 * (f(15) + f(16) - f(17) - f(18) + f(2) - f(4)) - 1.0 / 3.0 * YVelocityLB_uy;
905  const double N_z = 0.5 * (f(15) - f(16) - f(17) + f(18) + f(5) - f(6)) - 1.0 / 3.0 * ZVelocityLB_uz;
906 
907  f(3) = f(1) - 1.0 / 3.0 * XVelocityLB_ux;
908  f(13) = f(11) + N_z - 1.0 / 6.0 * (XVelocityLB_ux + ZVelocityLB_uz);
909  f(14) = f(12) - N_z + 1.0 / 6.0 * (-XVelocityLB_ux + ZVelocityLB_uz);
910  f(9) = f(7) + N_y - 1.0 / 6.0 * (XVelocityLB_ux + YVelocityLB_uy);
911  f(8) = f(10) - N_y + 1.0 / 6.0 * (-XVelocityLB_ux + YVelocityLB_uy);
912 }
913 
914 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFIC_PressureWest_34(const MF::Database::Node *pNode){ // Velocity LB for WestPressure
915  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
917  XVelocityLB_ux = DensityLB_rho - (f(0) + f(15) + f(16) + f(17) + f(18) + f(2) + f(4) + f(5) + f(6) + 2.0 * (f(13) + f(14) + f(3) + f(8) + f(9)));
918  return Vector4;
919 }
920 
921 void MF::Solver_CPU::BoundaryFunctions::BFIC_PressureWest_34(MF::Database::Node * pNode){ // West Pressure
922  MF::Database::Vec4<double> Vector4 = MF::Solver_CPU::BoundaryFunctions::VRBFIC_PressureWest_34(pNode);
923  const double N_y = 0.5 * (f(15) + f(16) - f(17) - f(18) + f(2) - f(4)) - 1.0 / 3.0 * YVelocityLB_uy;
924  const double N_z = 0.5 * (f(15) - f(16) - f(17) + f(18) + f(5) - f(6)) - 1.0 / 3.0 * ZVelocityLB_uz;
925 
926  f(1) = f(3) + 1.0 / 3.0 * XVelocityLB_ux;
927  f(11) = f(13) - N_z + 1.0 / 6.0 * (XVelocityLB_ux + ZVelocityLB_uz);
928  f(12) = f(14) + N_z + 1.0 / 6.0 * (XVelocityLB_ux - ZVelocityLB_uz);
929  f(7) = f(9) - N_y + 1.0 / 6.0 * (XVelocityLB_ux + YVelocityLB_uy);
930  f(10) = f(8) + N_y + 1.0 / 6.0 * (XVelocityLB_ux - YVelocityLB_uy);
931 }
932 
933 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFIC_PressureBottom_35(const MF::Database::Node *pNode){ // Velocity LB for Bottom Pressure
934  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
936  ZVelocityLB_uz = DensityLB_rho - (f(0) + f(1) + f(10) + f(2) + f(3) + f(4) + f(7) + f(8) + f(9) + 2.0 * (f(12) + f(13) + f(16) + f(17) + f(6)));
937  return Vector4;
938 }
939 
940 void MF::Solver_CPU::BoundaryFunctions::BFIC_PressureBottom_35(MF::Database::Node * pNode){ // Bottom Pressure
941  MF::Database::Vec4<double> Vector4 = MF::Solver_CPU::BoundaryFunctions::VRBFIC_PressureBottom_35(pNode);
942  const double N_x = 0.5 * (f(1) + f(10) - f(3) + f(7) - f(8) - f(9)) - 1.0 / 3.0 * XVelocityLB_ux;
943  const double N_y = 0.5 * (-f(10) + f(2) - f(4) + f(7) + f(8) - f(9)) - 1.0 / 3.0 * YVelocityLB_uy;
944 
945  f(5) = f(6) + 1.0 / 3.0 * ZVelocityLB_uz;
946  f(11) = f(13) - N_x + 1.0 / 6.0 * (XVelocityLB_ux + ZVelocityLB_uz);
947  f(18) = f(16) + N_y + 1.0 / 6.0 * (-YVelocityLB_uy + ZVelocityLB_uz);
948  f(15) = f(17) - N_y + 1.0 / 6.0 * (YVelocityLB_uy + ZVelocityLB_uz);
949  f(14) = f(12) + N_x + 1.0 / 6.0 * (-XVelocityLB_ux + ZVelocityLB_uz);
950 }
951 
952 inline MF::Database::Vec4<double> MF::Solver_CPU::BoundaryFunctions::VRBFIC_PressureTop_36(const MF::Database::Node *pNode){ // Velocity LB for Top Pressure
953  const std::shared_ptr<MF::Database::Thread>& Thread_Ptr = *pNode->pMyThread_Ptr;
955  ZVelocityLB_uz = -DensityLB_rho + (f(0) + f(1) + f(10) + f(2) + f(3) + f(4) + f(7) + f(8) + f(9) + 2.0 * (f(11) + f(14) + f(15) + f(18) + f(5)));
956  return Vector4;
957 }
958 
959 void MF::Solver_CPU::BoundaryFunctions::BFIC_PressureTop_36(MF::Database::Node * pNode){ // Top pressure
960  MF::Database::Vec4<double> Vector4 = MF::Solver_CPU::BoundaryFunctions::VRBFIC_PressureTop_36(pNode);
961  const double N_x = 0.5 * (f(1) + f(10) - f(3) + f(7) - f(8) - f(9)) - 1.0 / 3.0 * XVelocityLB_ux;
962  const double N_y = 0.5 * (-f(10) + f(2) - f(4) + f(7) + f(8) - f(9)) - 1.0 / 3.0 * YVelocityLB_uy;
963 
964  f(6) = f(5) - 1.0 / 3.0 * ZVelocityLB_uz;
965  f(13) = f(11) + N_x - 1.0 / 6.0 * (XVelocityLB_ux + ZVelocityLB_uz);
966  f(16) = f(18) - N_y + 1.0 / 6.0 * (YVelocityLB_uy - ZVelocityLB_uz);
967  f(17) = f(15) + N_y - 1.0 / 6.0 * (YVelocityLB_uy + ZVelocityLB_uz);
968  f(12) = f(14) - N_x + 1.0 / 6.0 * (XVelocityLB_ux - ZVelocityLB_uz);
969 }
970 
T rho
Rho value.
Definition: Vec4.h:22
static std::shared_ptr< MF::Solver_CPU::CaseParameters > m_CaseParameters_Ptr
#define MFQ19
Number of lattice directions D3Q19.
std::shared_ptr< MF::Database::Thread > * pMyThread_Ptr
Pointer to Shared pointer to node MFThread parameters.
Definition: Node.h:27
Basic data structure for storing f(i) data for each computational grid node.
Definition: Node.h:26
#define BoundaryDensityLB_rhoB
#define ZVelocityLB_uz
#define DensityLB_rho
#define BoundaryZVelocityLB_uzB
#define f(x)
static void SetBoundaryNodePointerToFunc(const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
Sets the pointer to the function that performs calculations for the edge node (Thread.h -> its_pBoundaryFunction).
#define XVelocityLB_ux
#define BoundaryYVelocityLB_uyB
#define YVelocityLB_uy
#define BoundaryXVelocityLB_uxB