14 double VelocitySum = 0.0;
17 for (
auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
18 if (Thread_it->m_NodeType == 1)
19 for (
auto & Node_it : *Thread_it->m_NodeArray_Ptr) {
20 Vector4 = (*Thread_it->m_pVRLBFunction)(&Node_it);
21 VelocitySum += sqrt(Vector4.
x * Vector4.
x + Vector4.
y * Vector4.
y + Vector4.
z * Vector4.
z);
28 double VelocitySum = 0;
32 for (
auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
33 if (Thread_it->m_NodeType >= 21 && Thread_it->m_NodeType <= 26) {
34 for (
auto & Node_it : *Thread_it->m_NodeArray_Ptr) {
35 Vector4 = (*Thread_it->m_pVRLBFunction)(&Node_it);
36 VelocitySum += sqrt(Vector4.
x * Vector4.
x + Vector4.
y * Vector4.
y + Vector4.
z * Vector4.
z);
41 return(VelocitySum/n);
45 double VelocitySum = 0;
49 for (
auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
50 if (Thread_it->m_NodeType >= 21 && Thread_it->m_NodeType <= 26) {
51 for (
auto & Node_it : *Thread_it->m_NodeArray_Ptr) {
52 Vector4 = (*Thread_it->m_pVRLBFunction)(&Node_it);
53 VelocitySum += sqrt(Vector4.
x * Vector4.
x + Vector4.
y * Vector4.
y + Vector4.
z * Vector4.
z);
63 double VelocitySum = 0;
67 for (
auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
68 if (Thread_it->m_NodeType >= 31 && Thread_it->m_NodeType <= 36) {
69 for (
auto & Node_it : *Thread_it->m_NodeArray_Ptr) {
70 Vector4 = (*Thread_it->m_pVRLBFunction)(&Node_it);
71 VelocitySum += sqrt(Vector4.
x * Vector4.
x + Vector4.
y * Vector4.
y + Vector4.
z * Vector4.
z);
76 return(VelocitySum/n);
80 const std::shared_ptr<MF::Database::ThreadArray> &ThreadArray_Ptr) {
81 double VelocitySum = 0;
85 for (
auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
86 if (Thread_it->m_NodeType >= 31 && Thread_it->m_NodeType <= 36) {
87 for (
auto & Node_it : *Thread_it->m_NodeArray_Ptr) {
88 Vector4 = (*Thread_it->m_pVRLBFunction)(&Node_it);
89 VelocitySum += sqrt(Vector4.
x * Vector4.
x + Vector4.
y * Vector4.
y + Vector4.
z * Vector4.
z);
98 double VelocitySum = 0;
102 for (
auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
103 if (Thread_it->m_ThreadName == ThreadName && Thread_it->m_NodeType != 61) {
104 for (
auto & Node_it : *Thread_it->m_NodeArray_Ptr) {
105 Vector4 = (*Thread_it->m_pVRLBFunction)(&Node_it);
106 VelocitySum += sqrt(Vector4.
x * Vector4.
x + Vector4.
y * Vector4.
y + Vector4.
z * Vector4.
z);
111 return(VelocitySum/n);
115 double VelocitySum = 0;
119 for (
auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
120 if (Thread_it->m_IsInletBalanceSurface && Thread_it->m_NodeType != 61) {
121 for (
auto & Node_it : *Thread_it->m_NodeArray_Ptr) {
122 Vector4 = (*Thread_it->m_pVRLBFunction)(&Node_it);
123 VelocitySum += sqrt(Vector4.
x * Vector4.
x + Vector4.
y * Vector4.
y + Vector4.
z * Vector4.
z);
127 else if (Thread_it->m_IsInletBalanceSurface) {
128 n = n+(Thread_it->getNumberOfNodes()/2);
135 const std::shared_ptr<MF::Database::ThreadArray>& ThreadArray_Ptr) {
136 double VelocitySum = 0;
140 for (
auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
141 if (Thread_it->m_IsOutletBalanceSurface && Thread_it->m_NodeType != 61) {
142 for (
auto & Node_it : *Thread_it->m_NodeArray_Ptr) {
143 Vector4 = (*Thread_it->m_pVRLBFunction)(&Node_it);
144 VelocitySum += sqrt(Vector4.
x * Vector4.
x + Vector4.
y * Vector4.
y + Vector4.
z * Vector4.
z);
148 else if (Thread_it->m_IsOutletBalanceSurface) {
149 n = n+(Thread_it->getNumberOfNodes()/2);
157 double sum1 = 0.0, sum2 = 0.0, Velocity;
160 for (
auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
161 if (Thread_it->m_NodeType >= 21 && Thread_it->m_NodeType <= 26) {
162 for (
auto & Node_it : *Thread_it->m_NodeArray_Ptr) {
163 Vector4 = (*Thread_it->m_pVRLBFunction)(&Node_it);
164 Velocity = sqrt(Vector4.
x * Vector4.
x + Vector4.
y * Vector4.
y + Vector4.
z * Vector4.
z);
166 sum1 += (Velocity * CaseParameters_Ptr->ReferenceDensityLB_Rho0_LB);
168 sum1 += (Velocity * Vector4.
rho);
171 else if (Thread_it->m_NodeType >= 31 && Thread_it->m_NodeType <= 36) {
172 for (
auto & Node_it : *Thread_it->m_NodeArray_Ptr) {
173 Vector4 = (*Thread_it->m_pVRLBFunction)(&Node_it);
174 Velocity = sqrt(Vector4.
x * Vector4.
x + Vector4.
y * Vector4.
y + Vector4.
z * Vector4.
z);
176 sum2 += (Velocity * CaseParameters_Ptr->ReferenceDensityLB_Rho0_LB);
178 sum2 += (Velocity * Vector4.
rho);
184 return(sum1-sum2)/sum1*100;
189 double sum1 = 0.0, sum2 = 0.0, Velocity;
192 for (
auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
193 if (Thread_it->m_NodeType >= 21 && Thread_it->m_NodeType <= 26) {
194 for (
auto & Node_it : *Thread_it->m_NodeArray_Ptr) {
195 Vector4 = (*Thread_it->m_pVRLBFunction)(&Node_it);
200 else if (Thread_it->m_NodeType >= 31 && Thread_it->m_NodeType <= 36) {
201 for (
auto & Node_it : *Thread_it->m_NodeArray_Ptr) {
202 Vector4 = (*Thread_it->m_pVRLBFunction)(&Node_it);
211 return((sum1-sum2)/sum1*100);
215 const std::shared_ptr<MF::Solver_CPU::CaseParameters>& CaseParameters_Ptr) {
216 double sum1 = 0.0, sum2 = 0.0, Velocity;
220 for (
auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
221 if (Thread_it->m_IsInletBalanceSurface && Thread_it->m_NodeType != 61) {
222 for (
auto & Node_it : *Thread_it->m_NodeArray_Ptr) {
223 Vector4 = (*Thread_it->m_pVRLBFunction)(&Node_it);
224 Velocity = sqrt(Vector4.
x * Vector4.
x + Vector4.
y * Vector4.
y + Vector4.
z * Vector4.
z);
226 sum1 += (Velocity * CaseParameters_Ptr->ReferenceDensityLB_Rho0_LB);
230 sum1 += (Velocity * Vector4.
rho);
235 else if (Thread_it->m_IsOutletBalanceSurface && Thread_it->m_NodeType != 61) {
236 for (
auto & Node_it : *Thread_it->m_NodeArray_Ptr) {
237 Vector4 = (*Thread_it->m_pVRLBFunction)(&Node_it);
238 Velocity = sqrt(Vector4.
x * Vector4.
x + Vector4.
y * Vector4.
y + Vector4.
z * Vector4.
z);
240 sum2 += (Velocity * CaseParameters_Ptr->ReferenceDensityLB_Rho0_LB);
244 sum2 += (Velocity * Vector4.
rho);
250 return(sum1-sum2)/sum1*100;
254 const std::shared_ptr<MF::Solver_CPU::CaseParameters>& CaseParameters_Ptr) {
255 double sum1 = 0.0, sum2 = 0.0, Velocity;
259 for (
auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
260 if (Thread_it->m_IsInletBalanceSurface && Thread_it->m_NodeType != 61) {
261 for (
auto & Node_it : *Thread_it->m_NodeArray_Ptr) {
262 Vector4 = (*Thread_it->m_pVRLBFunction)(&Node_it);
268 else if (Thread_it->m_IsOutletBalanceSurface && Thread_it->m_NodeType != 61) {
269 for (
auto & Node_it : *Thread_it->m_NodeArray_Ptr) {
270 Vector4 = (*Thread_it->m_pVRLBFunction)(&Node_it);
277 return((sum1-sum2)/sum1*100);
282 double uLB_maks = 0.0;
285 for (
auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
286 if (Thread_it->m_NodeType == 1) {
287 for (
auto & Node_it : *Thread_it->m_NodeArray_Ptr) {
288 Vector4 = (*Thread_it->m_pVRLBFunction)(&Node_it);
289 if (fabs(Vector4.
x) > fabs(uLB_maks)) {
290 uLB_maks = Vector4.
x;
292 if (fabs(Vector4.
y) > fabs(uLB_maks)) {
293 uLB_maks = Vector4.
y;
295 if (fabs(Vector4.
z) > fabs(uLB_maks)) {
296 uLB_maks = Vector4.
z;
305 unsigned int sum = 0;
306 for (
auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
307 if (Thread_it->m_NodeType == 1) {
308 sum += Thread_it->m_NodeArray_Ptr->size();
315 unsigned int sum = 0;
316 for (
auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
317 if (Thread_it->m_NodeType == 0) {
318 sum += Thread_it->m_NodeArray_Ptr->size();
325 unsigned int sum = 0;
326 for (
auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
327 if (Thread_it->m_NodeType == 61) {
328 sum += Thread_it->m_NodeArray_Ptr->size();
335 unsigned int sum = 0;
336 for (
auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
337 if (Thread_it->m_NodeType >= 21 && Thread_it->m_NodeType <= 26) {
338 sum += Thread_it->m_NodeArray_Ptr->size();
345 unsigned int sum = 0;
346 for (
auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
347 if (Thread_it->m_NodeType >= 31 && Thread_it->m_NodeType <= 36) {
348 sum += Thread_it->m_NodeArray_Ptr->size();
355 unsigned int sum = 0;
356 for (
auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
357 if (Thread_it->m_NodeType >= 41 && Thread_it->m_NodeType <= 46) {
358 sum += Thread_it->m_NodeArray_Ptr->size();
365 unsigned int sum = 0;
366 for (
auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
367 if (Thread_it->m_NodeType == 4 || Thread_it->m_NodeType == 5) {
368 sum += Thread_it->m_NodeArray_Ptr->size();
375 unsigned int sum = 0;
376 for (
auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
377 sum += Thread_it->m_NodeArray_Ptr->size();
static double VelocityLBMeanForPNodes(const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
Mean LB velocity for all nodes type 30.
static double VelocityFizMeanForOutlet(const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
Scaled (surface weighted) fiz velocity for all outlet threads.
static double VelocityFizMeanForPNodes(const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
Scaled (surface weighted) fiz velocity for all nodes type 30.
static double VelocityFizMeanForVNodes(const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
Mean Fiz velocity for all nodes type 20.
static double DeltaMassFlowThread_LB(const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr, const std::shared_ptr< MF::Solver_CPU::CaseParameters > &CaseParameters_Ptr)
Returns the difference in mass flow rate in LB units (inlet-outlet)/inlet*100. Surfaces are defined i...
static double VelocityLBMeanForVNodes(const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
Mean LB velocity for all nodes type 20.
static double DeltaMassFlow_fiz(const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr, const std::shared_ptr< MF::Solver_CPU::CaseParameters > &CaseParameters_Ptr)
Returns the difference in mass flow rate (inlet-outlet)/inlet*100. Surfaces are automatically detecte...
static double VelocityFizMeanForInlet(const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
Mean Fiz velocity for all inlet threads.
static double DeltaMassFlowLB(const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr, const std::shared_ptr< MF::Solver_CPU::CaseParameters > &CaseParameters_Ptr)
Returns the difference in mass flow rate in LB units (inlet-outlet)/inlet*100. Surfaces are automatic...
static double RhoLB_toRhoPhys(double rho_LB)
Converts rho LB to physical density.
static uint64_t getSolidNodeNumber_1(const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
Returns number of solid nodes.
static uint64_t getVelocityNodeNumber_20(const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
Returns number of boundary velocity nodes.
static uint64_t getTotalNodeNumber(const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
Returns total number of computational nodes (non-solid).
static uint64_t getPeriodicNodeNumber_4(const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
Returns number of boundary periodic nodes.
static double getULBmaks(const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
Returns the maximal value of LB velocity noticed in lattice node.
static double VelocityLBMeanForThread(const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr, std::string &ThreadName)
Mean LB velocity for all nodes in thread of name ThreadName excluding nodes type BB 61...
static uint64_t getBBNodeNumber_61(const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
Returns number of bounce-back nodes.
static double DeltaMassFlowThread_fiz(const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr, const std::shared_ptr< MF::Solver_CPU::CaseParameters > &CaseParameters_Ptr)
Returns the difference in mass flow rate (inlet-outlet)/inlet*100. Surfaces are defined in thread_par...
static uint64_t getVelocity0NodeNumber_40(const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
Returns number of boundary velocity 0 nodes.
static double ULB_toPhys(double u_LB)
Converts LB velocity to physical velocity.
static uint64_t getPressureNodeNumber_30(const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
Returns number of boundary pressure nodes.
static uint64_t getFluidNodeNumber_1(const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
Returns number of fluid nodes.
static double VelocityLBVolumeSum(const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
Mean LB velocity for all fluid nodes type 1.