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

The Calculations class collects functions for post-processing calculations. More...

#include <Calculations.h>

Public Member Functions

 Calculations ()=default
 
 ~Calculations ()=default
 

Static Public Member Functions

static double VelocityLBVolumeSum (const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
 Mean LB velocity for all fluid nodes type 1. More...
 
static double VelocityLBMeanForVNodes (const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
 Mean LB velocity for all nodes type 20. More...
 
static double VelocityFizMeanForVNodes (const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
 Mean Fiz velocity for all nodes type 20. More...
 
static double VelocityLBMeanForPNodes (const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
 Mean LB velocity for all nodes type 30. More...
 
static double VelocityFizMeanForPNodes (const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
 Scaled (surface weighted) fiz velocity for all nodes type 30. More...
 
static double VelocityFizMeanForInlet (const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
 Mean Fiz velocity for all inlet threads. More...
 
static double VelocityFizMeanForOutlet (const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
 Scaled (surface weighted) fiz velocity for all outlet threads. More...
 
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. More...
 
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 automatically detected. More...
 
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 detected. More...
 
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 in thread_params.cfg file. More...
 
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_params.cfg file. More...
 
static double getULBmaks (const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
 Returns the maximal value of LB velocity noticed in lattice node. More...
 
static uint64_t getTotalNodeNumber (const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
 Returns total number of computational nodes (non-solid). More...
 
static uint64_t getFluidNodeNumber_1 (const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
 Returns number of fluid nodes. More...
 
static uint64_t getSolidNodeNumber_1 (const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
 Returns number of solid nodes. More...
 
static uint64_t getBBNodeNumber_61 (const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
 Returns number of bounce-back nodes. More...
 
static uint64_t getVelocityNodeNumber_20 (const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
 Returns number of boundary velocity nodes. More...
 
static uint64_t getPressureNodeNumber_30 (const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
 Returns number of boundary pressure nodes. More...
 
static uint64_t getVelocity0NodeNumber_40 (const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
 Returns number of boundary velocity 0 nodes. More...
 
static uint64_t getPeriodicNodeNumber_4 (const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
 Returns number of boundary periodic nodes. More...
 

Detailed Description

The Calculations class collects functions for post-processing calculations.

Definition at line 23 of file Calculations.h.

Constructor & Destructor Documentation

◆ Calculations()

MF::Solver_CPU::Calculations::Calculations ( )
default

◆ ~Calculations()

MF::Solver_CPU::Calculations::~Calculations ( )
default

Member Function Documentation

◆ DeltaMassFlow_fiz()

double MF::Solver_CPU::Calculations::DeltaMassFlow_fiz ( const std::shared_ptr< MF::Database::ThreadArray > &  ThreadArray_Ptr,
const std::shared_ptr< MF::Solver_CPU::CaseParameters > &  CaseParameters_Ptr 
)
static

Returns the difference in mass flow rate (inlet-outlet)/inlet*100. Surfaces are automatically detected.

Definition at line 187 of file Calculations.cpp.

References MF::Database::Vec4< T >::rho, MF::LBPC::ParametersConversion::RhoLB_toRhoPhys(), MF::LBPC::ParametersConversion::ULB_toPhys(), MF::Database::Vec4< T >::x, MF::Database::Vec4< T >::y, and MF::Database::Vec4< T >::z.

Referenced by MF::Solver_CPU::ConsoleWriter::PrintTimeStepStatistics().

188 {
189  double sum1 = 0.0, sum2 = 0.0, Velocity;
191 
192  for (auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
193  if (Thread_it->m_NodeType >= 21 && Thread_it->m_NodeType <= 26) { // velocity nodes type 20
194  for (auto & Node_it : *Thread_it->m_NodeArray_Ptr) {
195  Vector4 = (*Thread_it->m_pVRLBFunction)(&Node_it);
196  Velocity = MF::LBPC::ParametersConversion::ULB_toPhys(sqrt(Vector4.x * Vector4.x + Vector4.y * Vector4.y + Vector4.z * Vector4.z));
197  sum1 += (Velocity * MF::LBPC::ParametersConversion::RhoLB_toRhoPhys(Vector4.rho));
198  }
199  }
200  else if (Thread_it->m_NodeType >= 31 && Thread_it->m_NodeType <= 36) { // pressure nodes type 30
201  for (auto & Node_it : *Thread_it->m_NodeArray_Ptr) {
202  Vector4 = (*Thread_it->m_pVRLBFunction)(&Node_it);
203  Velocity = MF::LBPC::ParametersConversion::ULB_toPhys(sqrt(Vector4.x * Vector4.x + Vector4.y * Vector4.y + Vector4.z * Vector4.z));
204  sum2 += (Velocity * MF::LBPC::ParametersConversion::RhoLB_toRhoPhys(Vector4.rho));
205  }
206  }
207  }
208  //auto NumberOfVelocity20Nodes = MF::Solver_CPU::Calculations::getVelocityNodeNumber_20(ThreadArray_Ptr);
209  //auto NumberOfPressure30Nodes = MF::Solver_CPU::Calculations::getPressureNodeNumber_30(ThreadArray_Ptr);
210  //double unitA = CaseParameters_Ptr->its_DXPhysical_Dx_Phys*CaseParameters_Ptr->its_DXPhysical_Dx_Phys;
211  return((sum1-sum2)/sum1*100);
212 }
T rho
Rho value.
Definition: Vec4.h:22
T z
Z direction value.
Definition: Vec4.h:21
static double RhoLB_toRhoPhys(double rho_LB)
Converts rho LB to physical density.
static double ULB_toPhys(double u_LB)
Converts LB velocity to physical velocity.
T x
X direction value.
Definition: Vec4.h:19
T y
Y direction value.
Definition: Vec4.h:20

◆ DeltaMassFlowLB()

double MF::Solver_CPU::Calculations::DeltaMassFlowLB ( const std::shared_ptr< MF::Database::ThreadArray > &  ThreadArray_Ptr,
const std::shared_ptr< MF::Solver_CPU::CaseParameters > &  CaseParameters_Ptr 
)
static

Returns the difference in mass flow rate in LB units (inlet-outlet)/inlet*100. Surfaces are automatically detected.

Definition at line 155 of file Calculations.cpp.

References MF::Solver_CPU::Incompressible, MF::Database::Vec4< T >::rho, MF::Database::Vec4< T >::x, MF::Database::Vec4< T >::y, and MF::Database::Vec4< T >::z.

Referenced by MF::Solver_CPU::ConsoleWriter::PrintTimeStepStatistics().

156 {
157  double sum1 = 0.0, sum2 = 0.0, Velocity;
159 
160  for (auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
161  if (Thread_it->m_NodeType >= 21 && Thread_it->m_NodeType <= 26) { // velocity nodes type 20
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);
165  if (CaseParameters_Ptr->FluidFlowModel_MT == MF::Solver_CPU::FlowTypeClass::Incompressible)
166  sum1 += (Velocity * CaseParameters_Ptr->ReferenceDensityLB_Rho0_LB);
167  else //quasi compressible
168  sum1 += (Velocity * Vector4.rho);
169  }
170  }
171  else if (Thread_it->m_NodeType >= 31 && Thread_it->m_NodeType <= 36) { // pressure nodes type 30
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);
175  if (CaseParameters_Ptr->FluidFlowModel_MT == MF::Solver_CPU::FlowTypeClass::Incompressible)
176  sum2 += (Velocity * CaseParameters_Ptr->ReferenceDensityLB_Rho0_LB);
177  else //quasi compressible
178  sum2 += (Velocity * Vector4.rho);
179  }
180  }
181  }
182  //auto NumberOfVelocity20Nodes = MF::Solver_CPU::Calculations::getVelocityNodeNumber_20(ThreadArray_Ptr);
183  //auto NumberOfPressure30Nodes = MF::Solver_CPU::Calculations::getPressureNodeNumber_30(ThreadArray_Ptr);
184  return(sum1-sum2)/sum1*100;
185 }
T rho
Rho value.
Definition: Vec4.h:22
T z
Z direction value.
Definition: Vec4.h:21
T x
X direction value.
Definition: Vec4.h:19
T y
Y direction value.
Definition: Vec4.h:20

◆ DeltaMassFlowThread_fiz()

double MF::Solver_CPU::Calculations::DeltaMassFlowThread_fiz ( const std::shared_ptr< MF::Database::ThreadArray > &  ThreadArray_Ptr,
const std::shared_ptr< MF::Solver_CPU::CaseParameters > &  CaseParameters_Ptr 
)
static

Returns the difference in mass flow rate (inlet-outlet)/inlet*100. Surfaces are defined in thread_params.cfg file.

Definition at line 253 of file Calculations.cpp.

References MF::Database::Vec4< T >::rho, MF::LBPC::ParametersConversion::RhoLB_toRhoPhys(), MF::LBPC::ParametersConversion::ULB_toPhys(), MF::Database::Vec4< T >::x, MF::Database::Vec4< T >::y, and MF::Database::Vec4< T >::z.

Referenced by MF::Solver_CPU::ConsoleWriter::PrintTimeStepStatistics().

254  {
255  double sum1 = 0.0, sum2 = 0.0, Velocity;
257  //uint64_t NrSum1 = 0 , NrSum2 = 0;
258 
259  for (auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
260  if (Thread_it->m_IsInletBalanceSurface && Thread_it->m_NodeType != 61) { // inlet thread except BB 61 nodes
261  for (auto & Node_it : *Thread_it->m_NodeArray_Ptr) {
262  Vector4 = (*Thread_it->m_pVRLBFunction)(&Node_it);
263  Velocity = MF::LBPC::ParametersConversion::ULB_toPhys(sqrt(Vector4.x * Vector4.x + Vector4.y * Vector4.y + Vector4.z * Vector4.z));
264  sum1 += (Velocity * MF::LBPC::ParametersConversion::RhoLB_toRhoPhys(Vector4.rho));
265  //NrSum1++;
266  }
267  }
268  else if (Thread_it->m_IsOutletBalanceSurface && Thread_it->m_NodeType != 61) { // outled thread except BB 61 nodes
269  for (auto & Node_it : *Thread_it->m_NodeArray_Ptr) {
270  Vector4 = (*Thread_it->m_pVRLBFunction)(&Node_it);
271  Velocity = MF::LBPC::ParametersConversion::ULB_toPhys(sqrt(Vector4.x * Vector4.x + Vector4.y * Vector4.y + Vector4.z * Vector4.z));
272  sum2 += (Velocity * MF::LBPC::ParametersConversion::RhoLB_toRhoPhys(Vector4.rho));
273  //NrSum2++;
274  }
275  }
276  }
277  return((sum1-sum2)/sum1*100);
278 }
T rho
Rho value.
Definition: Vec4.h:22
T z
Z direction value.
Definition: Vec4.h:21
static double RhoLB_toRhoPhys(double rho_LB)
Converts rho LB to physical density.
static double ULB_toPhys(double u_LB)
Converts LB velocity to physical velocity.
T x
X direction value.
Definition: Vec4.h:19
T y
Y direction value.
Definition: Vec4.h:20

◆ DeltaMassFlowThread_LB()

double MF::Solver_CPU::Calculations::DeltaMassFlowThread_LB ( const std::shared_ptr< MF::Database::ThreadArray > &  ThreadArray_Ptr,
const std::shared_ptr< MF::Solver_CPU::CaseParameters > &  CaseParameters_Ptr 
)
static

Returns the difference in mass flow rate in LB units (inlet-outlet)/inlet*100. Surfaces are defined in thread_params.cfg file.

Definition at line 214 of file Calculations.cpp.

References MF::Solver_CPU::Incompressible, MF::Database::Vec4< T >::rho, MF::Database::Vec4< T >::x, MF::Database::Vec4< T >::y, and MF::Database::Vec4< T >::z.

Referenced by MF::Solver_CPU::ConsoleWriter::PrintTimeStepStatistics().

215  {
216  double sum1 = 0.0, sum2 = 0.0, Velocity;
218  //uint64_t NrSum1 = 0 , NrSum2 = 0;
219 
220  for (auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
221  if (Thread_it->m_IsInletBalanceSurface && Thread_it->m_NodeType != 61) { // inlet thread except BB 61 nodes
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);
225  if (CaseParameters_Ptr->FluidFlowModel_MT == MF::Solver_CPU::FlowTypeClass::Incompressible) {
226  sum1 += (Velocity * CaseParameters_Ptr->ReferenceDensityLB_Rho0_LB);
227  //NrSum1++;
228  }
229  else {//quasi compressible
230  sum1 += (Velocity * Vector4.rho);
231  //NrSum1++;
232  }
233  }
234  }
235  else if (Thread_it->m_IsOutletBalanceSurface && Thread_it->m_NodeType != 61) { // outled thread except BB 61 nodes
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);
239  if (CaseParameters_Ptr->FluidFlowModel_MT == MF::Solver_CPU::FlowTypeClass::Incompressible) {
240  sum2 += (Velocity * CaseParameters_Ptr->ReferenceDensityLB_Rho0_LB);
241  //NrSum2++;
242  }
243  else {//quasi compressible
244  sum2 += (Velocity * Vector4.rho);
245  //NrSum2++;
246  }
247  }
248  }
249  }
250  return(sum1-sum2)/sum1*100;
251 }
T rho
Rho value.
Definition: Vec4.h:22
T z
Z direction value.
Definition: Vec4.h:21
T x
X direction value.
Definition: Vec4.h:19
T y
Y direction value.
Definition: Vec4.h:20

◆ getBBNodeNumber_61()

uint64_t MF::Solver_CPU::Calculations::getBBNodeNumber_61 ( const std::shared_ptr< MF::Database::ThreadArray > &  ThreadArray_Ptr)
static

Returns number of bounce-back nodes.

Definition at line 324 of file Calculations.cpp.

Referenced by MF::Solver_CPU::ConsoleWriter::PrintGridStatistics().

324  {
325  unsigned int sum = 0;
326  for (auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
327  if (Thread_it->m_NodeType == 61) { // only fluid nodes
328  sum += Thread_it->m_NodeArray_Ptr->size();
329  }
330  }
331  return sum;
332 }

◆ getFluidNodeNumber_1()

uint64_t MF::Solver_CPU::Calculations::getFluidNodeNumber_1 ( const std::shared_ptr< MF::Database::ThreadArray > &  ThreadArray_Ptr)
static

Returns number of fluid nodes.

Definition at line 304 of file Calculations.cpp.

Referenced by MF::Solver_CPU::ConsoleWriter::PrintGridStatistics().

304  {
305  unsigned int sum = 0;
306  for (auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
307  if (Thread_it->m_NodeType == 1) { // only fluid nodes
308  sum += Thread_it->m_NodeArray_Ptr->size();
309  }
310  }
311  return sum;
312 }

◆ getPeriodicNodeNumber_4()

uint64_t MF::Solver_CPU::Calculations::getPeriodicNodeNumber_4 ( const std::shared_ptr< MF::Database::ThreadArray > &  ThreadArray_Ptr)
static

Returns number of boundary periodic nodes.

Definition at line 364 of file Calculations.cpp.

Referenced by MF::Solver_CPU::ConsoleWriter::PrintGridStatistics().

364  {
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) { // only nodes of type 4 and 5
368  sum += Thread_it->m_NodeArray_Ptr->size();
369  }
370  }
371  return sum;
372 }

◆ getPressureNodeNumber_30()

uint64_t MF::Solver_CPU::Calculations::getPressureNodeNumber_30 ( const std::shared_ptr< MF::Database::ThreadArray > &  ThreadArray_Ptr)
static

Returns number of boundary pressure nodes.

Definition at line 344 of file Calculations.cpp.

Referenced by MF::Solver_CPU::ConsoleWriter::PrintGridStatistics().

344  {
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) { // only nodes of type 30
348  sum += Thread_it->m_NodeArray_Ptr->size();
349  }
350  }
351  return sum;
352 }

◆ getSolidNodeNumber_1()

uint64_t MF::Solver_CPU::Calculations::getSolidNodeNumber_1 ( const std::shared_ptr< MF::Database::ThreadArray > &  ThreadArray_Ptr)
static

Returns number of solid nodes.

Definition at line 314 of file Calculations.cpp.

Referenced by MF::Solver_CPU::ConsoleWriter::PrintGridStatistics().

314  {
315  unsigned int sum = 0;
316  for (auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
317  if (Thread_it->m_NodeType == 0) { // only fluid nodes
318  sum += Thread_it->m_NodeArray_Ptr->size();
319  }
320  }
321  return sum;
322 }

◆ getTotalNodeNumber()

uint64_t MF::Solver_CPU::Calculations::getTotalNodeNumber ( const std::shared_ptr< MF::Database::ThreadArray > &  ThreadArray_Ptr)
static

Returns total number of computational nodes (non-solid).

Definition at line 374 of file Calculations.cpp.

Referenced by MF::Solver_CPU::ConsoleWriter::PrintComputationStatistics(), MF::Solver_CPU::ConsoleWriter::PrintGridStatistics(), and MF::Solver_CPU::ConsoleWriter::PrintTimeStepStatistics().

374  {
375  unsigned int sum = 0;
376  for (auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
377  sum += Thread_it->m_NodeArray_Ptr->size();
378  }
379  return sum;
380 }

◆ getULBmaks()

double MF::Solver_CPU::Calculations::getULBmaks ( const std::shared_ptr< MF::Database::ThreadArray > &  ThreadArray_Ptr)
static

Returns the maximal value of LB velocity noticed in lattice node.

Definition at line 280 of file Calculations.cpp.

References MF::Database::Vec4< T >::x, MF::Database::Vec4< T >::y, and MF::Database::Vec4< T >::z.

Referenced by MF::Solver_CPU::ConsoleWriter::PrintTimeStepStatistics().

281 {
282  double uLB_maks = 0.0;
284 
285  for (auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
286  if (Thread_it->m_NodeType == 1) { // only fluid nodes
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;
291  }
292  if (fabs(Vector4.y) > fabs(uLB_maks)) {
293  uLB_maks = Vector4.y;
294  }
295  if (fabs(Vector4.z) > fabs(uLB_maks)) {
296  uLB_maks = Vector4.z;
297  }
298  }
299  }
300  }
301  return(uLB_maks);
302 }
T z
Z direction value.
Definition: Vec4.h:21
T x
X direction value.
Definition: Vec4.h:19
T y
Y direction value.
Definition: Vec4.h:20

◆ getVelocity0NodeNumber_40()

uint64_t MF::Solver_CPU::Calculations::getVelocity0NodeNumber_40 ( const std::shared_ptr< MF::Database::ThreadArray > &  ThreadArray_Ptr)
static

Returns number of boundary velocity 0 nodes.

Definition at line 354 of file Calculations.cpp.

Referenced by MF::Solver_CPU::ConsoleWriter::PrintGridStatistics().

354  {
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) { // only nodes of type 40
358  sum += Thread_it->m_NodeArray_Ptr->size();
359  }
360  }
361  return sum;
362 }

◆ getVelocityNodeNumber_20()

uint64_t MF::Solver_CPU::Calculations::getVelocityNodeNumber_20 ( const std::shared_ptr< MF::Database::ThreadArray > &  ThreadArray_Ptr)
static

Returns number of boundary velocity nodes.

Definition at line 334 of file Calculations.cpp.

Referenced by MF::Solver_CPU::ConsoleWriter::PrintGridStatistics().

334  {
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) { // only nodes of type 20
338  sum += Thread_it->m_NodeArray_Ptr->size();
339  }
340  }
341  return sum;
342 }

◆ VelocityFizMeanForInlet()

double MF::Solver_CPU::Calculations::VelocityFizMeanForInlet ( const std::shared_ptr< MF::Database::ThreadArray > &  ThreadArray_Ptr)
static

Mean Fiz velocity for all inlet threads.

Definition at line 114 of file Calculations.cpp.

References MF::LBPC::ParametersConversion::ULB_toPhys(), MF::Database::Vec4< T >::x, MF::Database::Vec4< T >::y, and MF::Database::Vec4< T >::z.

Referenced by MF::Solver_CPU::ConsoleWriter::PrintTimeStepStatistics().

114  {
115  double VelocitySum = 0;
116  unsigned int n = 0;
118 
119  for (auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
120  if (Thread_it->m_IsInletBalanceSurface && Thread_it->m_NodeType != 61) { // Excluding BB 61 nodes
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);
124  n++;
125  }
126  }
127  else if (Thread_it->m_IsInletBalanceSurface) {
128  n = n+(Thread_it->getNumberOfNodes()/2); // Half of number of BB nodes because we need cell mean velocity
129  }
130  }
131  return(MF::LBPC::ParametersConversion::ULB_toPhys(VelocitySum/n));
132 }
T z
Z direction value.
Definition: Vec4.h:21
static double ULB_toPhys(double u_LB)
Converts LB velocity to physical velocity.
T x
X direction value.
Definition: Vec4.h:19
T y
Y direction value.
Definition: Vec4.h:20

◆ VelocityFizMeanForOutlet()

double MF::Solver_CPU::Calculations::VelocityFizMeanForOutlet ( const std::shared_ptr< MF::Database::ThreadArray > &  ThreadArray_Ptr)
static

Scaled (surface weighted) fiz velocity for all outlet threads.

Definition at line 134 of file Calculations.cpp.

References MF::LBPC::ParametersConversion::ULB_toPhys(), MF::Database::Vec4< T >::x, MF::Database::Vec4< T >::y, and MF::Database::Vec4< T >::z.

Referenced by MF::Solver_CPU::ConsoleWriter::PrintTimeStepStatistics().

135  {
136  double VelocitySum = 0;
137  uint64_t n = 0;
139 
140  for (auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
141  if (Thread_it->m_IsOutletBalanceSurface && Thread_it->m_NodeType != 61) { // Excluding BB 61 nodes
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);
145  n++;
146  }
147  }
148  else if (Thread_it->m_IsOutletBalanceSurface) {
149  n = n+(Thread_it->getNumberOfNodes()/2); // Half of number of BB nodes because we need cell mean velocity
150  }
151  }
152  return(MF::LBPC::ParametersConversion::ULB_toPhys(VelocitySum/n));
153 }
T z
Z direction value.
Definition: Vec4.h:21
static double ULB_toPhys(double u_LB)
Converts LB velocity to physical velocity.
T x
X direction value.
Definition: Vec4.h:19
T y
Y direction value.
Definition: Vec4.h:20

◆ VelocityFizMeanForPNodes()

double MF::Solver_CPU::Calculations::VelocityFizMeanForPNodes ( const std::shared_ptr< MF::Database::ThreadArray > &  ThreadArray_Ptr)
static

Scaled (surface weighted) fiz velocity for all nodes type 30.

Definition at line 79 of file Calculations.cpp.

References MF::LBPC::ParametersConversion::ULB_toPhys(), MF::Database::Vec4< T >::x, MF::Database::Vec4< T >::y, and MF::Database::Vec4< T >::z.

Referenced by MF::Solver_CPU::ConsoleWriter::PrintTimeStepStatistics().

80  {
81  double VelocitySum = 0;
82  unsigned int n = 0;
84 
85  for (auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
86  if (Thread_it->m_NodeType >= 31 && Thread_it->m_NodeType <= 36) { // velocity nodes
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);
90  n++;
91  }
92  }
93  }
94  return(MF::LBPC::ParametersConversion::ULB_toPhys(VelocitySum/n));
95 }
T z
Z direction value.
Definition: Vec4.h:21
static double ULB_toPhys(double u_LB)
Converts LB velocity to physical velocity.
T x
X direction value.
Definition: Vec4.h:19
T y
Y direction value.
Definition: Vec4.h:20

◆ VelocityFizMeanForVNodes()

double MF::Solver_CPU::Calculations::VelocityFizMeanForVNodes ( const std::shared_ptr< MF::Database::ThreadArray > &  ThreadArray_Ptr)
static

Mean Fiz velocity for all nodes type 20.

Definition at line 44 of file Calculations.cpp.

References MF::LBPC::ParametersConversion::ULB_toPhys(), MF::Database::Vec4< T >::x, MF::Database::Vec4< T >::y, and MF::Database::Vec4< T >::z.

Referenced by MF::Solver_CPU::ConsoleWriter::PrintTimeStepStatistics().

44  {
45  double VelocitySum = 0;
46  unsigned int n = 0;
48 
49  for (auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
50  if (Thread_it->m_NodeType >= 21 && Thread_it->m_NodeType <= 26) { // velocity nodes
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);
54  n++;
55  }
56  }
57  }
58  return(MF::LBPC::ParametersConversion::ULB_toPhys(VelocitySum/n));
59 }
T z
Z direction value.
Definition: Vec4.h:21
static double ULB_toPhys(double u_LB)
Converts LB velocity to physical velocity.
T x
X direction value.
Definition: Vec4.h:19
T y
Y direction value.
Definition: Vec4.h:20

◆ VelocityLBMeanForPNodes()

double MF::Solver_CPU::Calculations::VelocityLBMeanForPNodes ( const std::shared_ptr< MF::Database::ThreadArray > &  ThreadArray_Ptr)
static

Mean LB velocity for all nodes type 30.

Definition at line 61 of file Calculations.cpp.

References MF::Database::Vec4< T >::x, MF::Database::Vec4< T >::y, and MF::Database::Vec4< T >::z.

62 {
63  double VelocitySum = 0;
64  unsigned int n = 0;
66 
67  for (auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
68  if (Thread_it->m_NodeType >= 31 && Thread_it->m_NodeType <= 36) { // velocity nodes
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);
72  n++;
73  }
74  }
75  }
76  return(VelocitySum/n);
77 }
T z
Z direction value.
Definition: Vec4.h:21
T x
X direction value.
Definition: Vec4.h:19
T y
Y direction value.
Definition: Vec4.h:20

◆ VelocityLBMeanForThread()

double MF::Solver_CPU::Calculations::VelocityLBMeanForThread ( const std::shared_ptr< MF::Database::ThreadArray > &  ThreadArray_Ptr,
std::string &  ThreadName 
)
static

Mean LB velocity for all nodes in thread of name ThreadName excluding nodes type BB 61.

Definition at line 97 of file Calculations.cpp.

References MF::Database::Vec4< T >::x, MF::Database::Vec4< T >::y, and MF::Database::Vec4< T >::z.

97  {
98  double VelocitySum = 0;
99  unsigned int n = 0;
101 
102  for (auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
103  if (Thread_it->m_ThreadName == ThreadName && Thread_it->m_NodeType != 61) { // Excluding BB 61 nodes
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);
107  n++;
108  }
109  }
110  }
111  return(VelocitySum/n);
112 }
T z
Z direction value.
Definition: Vec4.h:21
T x
X direction value.
Definition: Vec4.h:19
T y
Y direction value.
Definition: Vec4.h:20

◆ VelocityLBMeanForVNodes()

double MF::Solver_CPU::Calculations::VelocityLBMeanForVNodes ( const std::shared_ptr< MF::Database::ThreadArray > &  ThreadArray_Ptr)
static

Mean LB velocity for all nodes type 20.

Definition at line 27 of file Calculations.cpp.

References MF::Database::Vec4< T >::x, MF::Database::Vec4< T >::y, and MF::Database::Vec4< T >::z.

27  {
28  double VelocitySum = 0;
29  unsigned int n = 0;
31 
32  for (auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
33  if (Thread_it->m_NodeType >= 21 && Thread_it->m_NodeType <= 26) { // velocity nodes
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);
37  n++;
38  }
39  }
40  }
41  return(VelocitySum/n);
42 }
T z
Z direction value.
Definition: Vec4.h:21
T x
X direction value.
Definition: Vec4.h:19
T y
Y direction value.
Definition: Vec4.h:20

◆ VelocityLBVolumeSum()

double MF::Solver_CPU::Calculations::VelocityLBVolumeSum ( const std::shared_ptr< MF::Database::ThreadArray > &  ThreadArray_Ptr)
static

Mean LB velocity for all fluid nodes type 1.

Definition at line 12 of file Calculations.cpp.

References MF::Database::Vec4< T >::x, MF::Database::Vec4< T >::y, and MF::Database::Vec4< T >::z.

Referenced by MF::Solver_CPU::ConsoleWriter::PrintTimeStepStatistics().

12  {
13 
14  double VelocitySum = 0.0;
16 
17  for (auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
18  if (Thread_it->m_NodeType == 1) // fluid nodes only
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);
22  }
23  }
24  return (VelocitySum);
25 }
T z
Z direction value.
Definition: Vec4.h:21
T x
X direction value.
Definition: Vec4.h:19
T y
Y direction value.
Definition: Vec4.h:20

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