Microflow 3D  v1.0
Collision.h
Go to the documentation of this file.
1 // ==============================================================================================
2 // Microflow 3D, http://www.microflow.pwr.edu.pl/
3 // Created by Roman Szafran on 29.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 # pragma once
12 
13 #include <memory>
14 #include <utility>
17 #include "MFDatabase/ThreadArray.h"
18 #include "MFDatabase/Vec4.h"
19 
20 namespace MF::Solver_CPU {
21 
23  class Collision {
24  public:
25  Collision() = default;
26  ~Collision() = default;
27 
28  inline static std::shared_ptr<MF::Solver_CPU::CaseParameters> m_CaseParameters_Ptr = nullptr;
29  inline static std::shared_ptr<MF::GU::LatticeParametersD3Q19> m_LatticeParameters_Ptr = nullptr;
30 
31  static void Initialize (const std::shared_ptr<MF::Solver_CPU::CaseParameters>& CaseParameters_Ptr, const std::shared_ptr<MF::GU::LatticeParametersD3Q19>& LatticeParameters_Ptr) {
32  m_CaseParameters_Ptr = CaseParameters_Ptr;
33  m_LatticeParameters_Ptr = LatticeParameters_Ptr;
34  };
35 
36  static void SetCollisionPointerToFunc(const std::shared_ptr<MF::Database::ThreadArray>& ThreadArray_Ptr);
37 
38  // FEQ BGK getters used during initialization of computations ----------------------------------
39  static double GetBGKFeq_Qcompr(const MF::Database::Vec4<double>& Vector4, const unsigned char& k);
40  static double GetBGKFeq_Incompr(const MF::Database::Vec4<double>& Vector4, const unsigned char& k);
41 
42  private:
43  // BGK -------------------------------------------------------------------------------
44  static double Feq_Qcompr(const MF::Database::Vec4<double>& Vector4, const unsigned char& k);
45  static double Feq_Incompr(const MF::Database::Vec4<double>& Vector4, const unsigned char& k);
46  static void Coll_BGK_Qcompr(MF::Database::Node * pNode);
47  static void Coll_BGK_Incompr(MF::Database::Node * pNode);
48 
49  // FBGK with external force F ---------------------------------------------------------
50  static void Coll_FBGK_Qcompr(MF::Database::Node * pNode);
51  static void Coll_FBGK_Incompr(MF::Database::Node * pNode);
52  static double Feq_Qcompr_F(const MF::Database::Vec4<double>& Vector4, const unsigned char& k, const MF::Database::Vec3<double> & XYZForce_LB);
53  static double Feq_Incompr_F(const MF::Database::Vec4<double>& Vector4, const unsigned char& k, const MF::Database::Vec3<double> & XYZForce_LB);
54 
55  // MRT and MRT2 -------------------------------------------------------------------------------
56  static void Coll_MRT_Qcompr(MF::Database::Node * pNode);
57  static void Coll_MRT_Incompr(MF::Database::Node * pNode);
58  static void Coll_MRT2_Qcompr(MF::Database::Node * pNode);
59  static void Coll_MRT2_Incompr(MF::Database::Node * pNode);
60  static double Meq_Qcompr(const MF::Database::Vec4<double>& Vector4, const unsigned char& k);
61  static double Meq_Incompr(const MF::Database::Vec4<double>& Vector4, const unsigned char& k);
62 
63  // Bounce-back 61. Do nothing since propagation function includes swap f(i) procedure -----------------------------------------
64  static void Coll_BounceBackForNode61( MF::Database::Node * pNode) {};
65  };
66  } /* namespace MF */
67 
static std::shared_ptr< MF::Solver_CPU::CaseParameters > m_CaseParameters_Ptr
Definition: Collision.h:28
static double GetBGKFeq_Incompr(const MF::Database::Vec4< double > &Vector4, const unsigned char &k)
Gets FEQ from quasi incompressible BGK model.
Definition: Collision.cpp:634
Basic data structure for storing f(i) data for each computational grid node.
Definition: Node.h:26
static std::shared_ptr< MF::GU::LatticeParametersD3Q19 > m_LatticeParameters_Ptr
Definition: Collision.h:29
The Collision class collects collision algorithms.
Definition: Collision.h:23
static double GetBGKFeq_Qcompr(const MF::Database::Vec4< double > &Vector4, const unsigned char &k)
Gets FEQ from quasi compressible BGK model.
Definition: Collision.cpp:630
static void SetCollisionPointerToFunc(const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
Sets pointers to proper collision functions in MFThreads.
Definition: Collision.cpp:23
static void Initialize(const std::shared_ptr< MF::Solver_CPU::CaseParameters > &CaseParameters_Ptr, const std::shared_ptr< MF::GU::LatticeParametersD3Q19 > &LatticeParameters_Ptr)
Definition: Collision.h:31