Microflow 3D  v1.0
MF::Solver_CPU::BoundaryFunctions Class Reference

The BoundaryFunctions class stores the implementations of all boundary conditions with the distinction of the node location: N, S, W, E, NS, Top, Bottom. More...

#include <BoundaryFunctions.h>

Public Member Functions

 BoundaryFunctions ()=default
 
 ~BoundaryFunctions ()=default
 

Static Public Member Functions

static void Initialize (const std::shared_ptr< MF::Solver_CPU::CaseParameters > &CaseParameters_Ptr, const std::shared_ptr< MF::GU::LatticeParametersD3Q19 > &LatticeParameters_Ptr)
 
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). More...
 

Static Public Attributes

static std::shared_ptr< MF::Solver_CPU::CaseParametersm_CaseParameters_Ptr = nullptr
 
static std::shared_ptr< MF::GU::LatticeParametersD3Q19m_LatticeParameters_Ptr = nullptr
 

Detailed Description

The BoundaryFunctions class stores the implementations of all boundary conditions with the distinction of the node location: N, S, W, E, NS, Top, Bottom.

Definition at line 30 of file BoundaryFunctions.h.

Constructor & Destructor Documentation

◆ BoundaryFunctions()

MF::Solver_CPU::BoundaryFunctions::BoundaryFunctions ( )
default

◆ ~BoundaryFunctions()

MF::Solver_CPU::BoundaryFunctions::~BoundaryFunctions ( )
default

Member Function Documentation

◆ Initialize()

static void MF::Solver_CPU::BoundaryFunctions::Initialize ( const std::shared_ptr< MF::Solver_CPU::CaseParameters > &  CaseParameters_Ptr,
const std::shared_ptr< MF::GU::LatticeParametersD3Q19 > &  LatticeParameters_Ptr 
)
inlinestatic

Definition at line 39 of file BoundaryFunctions.h.

References SetBoundaryNodePointerToFunc().

Referenced by main().

39  {
40  m_CaseParameters_Ptr = CaseParameters_Ptr;
41  m_LatticeParameters_Ptr = LatticeParameters_Ptr;
42  };
static std::shared_ptr< MF::Solver_CPU::CaseParameters > m_CaseParameters_Ptr
static std::shared_ptr< MF::GU::LatticeParametersD3Q19 > m_LatticeParameters_Ptr

◆ SetBoundaryNodePointerToFunc()

void MF::Solver_CPU::BoundaryFunctions::SetBoundaryNodePointerToFunc ( const std::shared_ptr< MF::Database::ThreadArray > &  ThreadArray_Ptr)
static

Sets the pointer to the function that performs calculations for the edge node (Thread.h -> its_pBoundaryFunction).

Definition at line 23 of file BoundaryFunctions.cpp.

References BoundaryDensityLB_rhoB, BoundaryXVelocityLB_uxB, BoundaryYVelocityLB_uyB, BoundaryZVelocityLB_uzB, DensityLB_rho, f, MF::Solver_CPU::Incompressible, m_CaseParameters_Ptr, MFQ19, MF::Database::Node::pMyThread_Ptr, MF::Solver_CPU::QuasiCompressible, MF::Database::Vec4< T >::rho, XVelocityLB_ux, YVelocityLB_uy, and ZVelocityLB_uz.

Referenced by Initialize(), and main().

23  {
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 }
static std::shared_ptr< MF::Solver_CPU::CaseParameters > m_CaseParameters_Ptr

Field Documentation

◆ m_CaseParameters_Ptr

std::shared_ptr<MF::Solver_CPU::CaseParameters> MF::Solver_CPU::BoundaryFunctions::m_CaseParameters_Ptr = nullptr
inlinestatic

Definition at line 36 of file BoundaryFunctions.h.

Referenced by SetBoundaryNodePointerToFunc().

◆ m_LatticeParameters_Ptr

std::shared_ptr<MF::GU::LatticeParametersD3Q19> MF::Solver_CPU::BoundaryFunctions::m_LatticeParameters_Ptr = nullptr
inlinestatic

Definition at line 37 of file BoundaryFunctions.h.


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