Microflow 3D  v1.0
Calculations.h
Go to the documentation of this file.
1 // ==============================================================================================
2 // Microflow 3D, http://www.microflow.pwr.edu.pl/
3 // Created by Roman Szafran on 05.06.19.
4 // Copyright (c) 2019 Wroclaw University of Science and Technology.
5 // Distributed under the Apache License, Version 2.0. You may obtain a copy of the License at
6 // http://www.apache.org/licenses/LICENSE-2.0 or see accompanying file license.txt.
7 // Redistributions of source code must retain the above copyright and license notice.
8 // ==============================================================================================
9 
10 # pragma once
11 
12 #include <math.h>
13 
14 #include "MFDatabase/Vec4.h"
15 #include "MFDatabase/ThreadArray.h"
18 
19 namespace MF {
20  namespace Solver_CPU {
21 
23  class Calculations {
24  public:
25  Calculations()= default;
26  ~Calculations() = default;
27 
28  // Functions for post-processing calculations
29  static double VelocityLBVolumeSum(const std::shared_ptr<MF::Database::ThreadArray>& ThreadArray_Ptr);
30  static double VelocityLBMeanForVNodes(const std::shared_ptr<MF::Database::ThreadArray>& ThreadArray_Ptr);
31  static double VelocityFizMeanForVNodes(const std::shared_ptr<MF::Database::ThreadArray>& ThreadArray_Ptr);
32  static double VelocityLBMeanForPNodes(const std::shared_ptr<MF::Database::ThreadArray>& ThreadArray_Ptr);
33  static double VelocityFizMeanForPNodes(const std::shared_ptr<MF::Database::ThreadArray> &ThreadArray_Ptr);
34  static double VelocityFizMeanForInlet(const std::shared_ptr<MF::Database::ThreadArray>& ThreadArray_Ptr);
35  static double VelocityFizMeanForOutlet(const std::shared_ptr<MF::Database::ThreadArray> &ThreadArray_Ptr);
36  static double VelocityLBMeanForThread(const std::shared_ptr<MF::Database::ThreadArray>& ThreadArray_Ptr, std::string &ThreadName);
37  static double DeltaMassFlowLB(const std::shared_ptr<MF::Database::ThreadArray>& ThreadArray_Ptr, const std::shared_ptr<MF::Solver_CPU::CaseParameters>& CaseParameters_Ptr);
38  static double DeltaMassFlow_fiz(const std::shared_ptr<MF::Database::ThreadArray>& ThreadArray_Ptr, const std::shared_ptr<MF::Solver_CPU::CaseParameters>& CaseParameters_Ptr);
39  static double DeltaMassFlowThread_LB(const std::shared_ptr<MF::Database::ThreadArray>& ThreadArray_Ptr, const std::shared_ptr<MF::Solver_CPU::CaseParameters>& CaseParameters_Ptr);
40  static double DeltaMassFlowThread_fiz(const std::shared_ptr<MF::Database::ThreadArray>& ThreadArray_Ptr, const std::shared_ptr<MF::Solver_CPU::CaseParameters>& CaseParameters_Ptr);
41 
42  static double getULBmaks(const std::shared_ptr<MF::Database::ThreadArray>& ThreadArray_Ptr);
43  static uint64_t getTotalNodeNumber(const std::shared_ptr<MF::Database::ThreadArray>& ThreadArray_Ptr);
44  static uint64_t getFluidNodeNumber_1(const std::shared_ptr<MF::Database::ThreadArray>& ThreadArray_Ptr);
45  static uint64_t getSolidNodeNumber_1(const std::shared_ptr<MF::Database::ThreadArray>& ThreadArray_Ptr);
46  static uint64_t getBBNodeNumber_61(const std::shared_ptr<MF::Database::ThreadArray>& ThreadArray_Ptr);
47  static uint64_t getVelocityNodeNumber_20(const std::shared_ptr<MF::Database::ThreadArray>& ThreadArray_Ptr);
48  static uint64_t getPressureNodeNumber_30(const std::shared_ptr<MF::Database::ThreadArray>& ThreadArray_Ptr);
49  static uint64_t getVelocity0NodeNumber_40(const std::shared_ptr<MF::Database::ThreadArray>& ThreadArray_Ptr);
50  static uint64_t getPeriodicNodeNumber_4(const std::shared_ptr<MF::Database::ThreadArray>& ThreadArray_Ptr);
51  };
52 
53  } /* namespace Solver_CPU */
54 } /* namespace MF */
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 uint64_t getSolidNodeNumber_1(const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
Returns number of solid nodes.
The Calculations class collects functions for post-processing calculations.
Definition: Calculations.h:23
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 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.