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

The Collision class collects collision algorithms. More...

#include <Collision.h>

Public Member Functions

 Collision ()=default
 
 ~Collision ()=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 SetCollisionPointerToFunc (const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr)
 Sets pointers to proper collision functions in MFThreads. More...
 
static double GetBGKFeq_Qcompr (const MF::Database::Vec4< double > &Vector4, const unsigned char &k)
 Gets FEQ from quasi compressible BGK model. More...
 
static double GetBGKFeq_Incompr (const MF::Database::Vec4< double > &Vector4, const unsigned char &k)
 Gets FEQ from quasi incompressible BGK model. 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 Collision class collects collision algorithms.

Definition at line 23 of file Collision.h.

Constructor & Destructor Documentation

◆ Collision()

MF::Solver_CPU::Collision::Collision ( )
default

◆ ~Collision()

MF::Solver_CPU::Collision::~Collision ( )
default

Member Function Documentation

◆ GetBGKFeq_Incompr()

double MF::Solver_CPU::Collision::GetBGKFeq_Incompr ( const MF::Database::Vec4< double > &  Vector4,
const unsigned char &  k 
)
static

Gets FEQ from quasi incompressible BGK model.

Definition at line 634 of file Collision.cpp.

Referenced by Initialize(), and MF::Solver_CPU::Initialization::ThreadDataInitialize().

634  {
635  return Feq_Incompr(Vector4,k);
636 }

◆ GetBGKFeq_Qcompr()

double MF::Solver_CPU::Collision::GetBGKFeq_Qcompr ( const MF::Database::Vec4< double > &  Vector4,
const unsigned char &  k 
)
static

Gets FEQ from quasi compressible BGK model.

Definition at line 630 of file Collision.cpp.

Referenced by Initialize(), and MF::Solver_CPU::Initialization::ThreadDataInitialize().

630  {
631  return Feq_Qcompr(Vector4,k);
632 }

◆ Initialize()

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

Definition at line 31 of file Collision.h.

References GetBGKFeq_Incompr(), GetBGKFeq_Qcompr(), and SetCollisionPointerToFunc().

Referenced by main().

31  {
32  m_CaseParameters_Ptr = CaseParameters_Ptr;
33  m_LatticeParameters_Ptr = LatticeParameters_Ptr;
34  };
static std::shared_ptr< MF::Solver_CPU::CaseParameters > m_CaseParameters_Ptr
Definition: Collision.h:28
static std::shared_ptr< MF::GU::LatticeParametersD3Q19 > m_LatticeParameters_Ptr
Definition: Collision.h:29

◆ SetCollisionPointerToFunc()

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

Sets pointers to proper collision functions in MFThreads.

Definition at line 23 of file Collision.cpp.

References DirectionVectorComponent_Cx, DirectionVectorComponent_Cy, DirectionVectorComponent_Cz, DirectionWeight_W, f, MF::Solver_CPU::FBGK, MF::Solver_CPU::Incompressible, m_CaseParameters_Ptr, m_LatticeParameters_Ptr, MFQ19, MF::Solver_CPU::MRT, MF::Solver_CPU::MRT2, MF::Database::Node::pMyThread_Ptr, RHO, MF::GU::LatticeParametersD3Q19::SwapDirections, U, V, W, MF::Database::Vec3< T >::x, MF::Database::Vec3< T >::y, and MF::Database::Vec3< T >::z.

Referenced by Initialize(), and main().

23  {
24  for (auto & Thread_Ptr : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
25  switch (Thread_Ptr->m_NodeType) {
26  case 0: {break;} // for solid node
27  case 61: { // for BB2 61 node
28  Thread_Ptr->m_pColideFunc = MF::Solver_CPU::Collision::Coll_BounceBackForNode61;
29  Thread_Ptr.get()->m_DoCollision = false;
30  break;
31  }
32 
33  default:
34  case 1: { //All other nodes except BB2 61
35  if (m_CaseParameters_Ptr->CollisionModel_KT == MF::Solver_CPU::ModelTypeClass::MRT) { //MRT collision model
37  Thread_Ptr.get()->m_pColideFunc = MF::Solver_CPU::Collision::Coll_MRT_Incompr; //Incompressible MRT collision model
38  Thread_Ptr.get()->m_DoCollision = true;
39  }
40  else {//QuasiCompressible MRT
41  Thread_Ptr.get()->m_pColideFunc = MF::Solver_CPU::Collision::Coll_MRT_Qcompr;
42  Thread_Ptr.get()->m_DoCollision = true;
43  }
44  }
45  else if (m_CaseParameters_Ptr->CollisionModel_KT == MF::Solver_CPU::ModelTypeClass::MRT2) { //MRT collision model
47  Thread_Ptr.get()->m_pColideFunc = MF::Solver_CPU::Collision::Coll_MRT2_Incompr; //Incompressible MRT collision model
48  Thread_Ptr.get()->m_DoCollision = true;
49  }
50  else {//QuasiCompressible MRT
51  Thread_Ptr.get()->m_pColideFunc = MF::Solver_CPU::Collision::Coll_MRT2_Qcompr;
52  Thread_Ptr.get()->m_DoCollision = true;
53  }
54  }
55  else if (m_CaseParameters_Ptr->CollisionModel_KT == MF::Solver_CPU::ModelTypeClass::FBGK) //FBGK
56  {
58  Thread_Ptr.get()->m_pColideFunc = MF::Solver_CPU::Collision::Coll_FBGK_Incompr; //Incompressible FBGK
59  Thread_Ptr.get()->m_DoCollision = true;
60  }
61  else {//QuasiCompressible FBGK
62  Thread_Ptr.get()->m_pColideFunc = MF::Solver_CPU::Collision::Coll_FBGK_Qcompr;
63  Thread_Ptr.get()->m_DoCollision = true;
64  }
65  }
66  else //BGK
67  {
68  if (m_CaseParameters_Ptr->FluidFlowModel_MT == MF::Solver_CPU::FlowTypeClass::Incompressible) {//Incompressible BGK
69  Thread_Ptr.get()->m_pColideFunc = MF::Solver_CPU::Collision::Coll_BGK_Incompr;
70  Thread_Ptr.get()->m_DoCollision = true;
71  }
72  else {//QuasiCompressible BGK
73  Thread_Ptr.get()->m_pColideFunc = MF::Solver_CPU::Collision::Coll_BGK_Qcompr;
74  Thread_Ptr.get()->m_DoCollision = true;
75  }
76  }
77  break;
78  }
79  }
80  }
81 }
static std::shared_ptr< MF::Solver_CPU::CaseParameters > m_CaseParameters_Ptr
Definition: Collision.h:28

Field Documentation

◆ m_CaseParameters_Ptr

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

Definition at line 28 of file Collision.h.

Referenced by SetCollisionPointerToFunc().

◆ m_LatticeParameters_Ptr

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

Definition at line 29 of file Collision.h.

Referenced by SetCollisionPointerToFunc().


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