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

The Initialization class is responsible for initialization of values of particle distribution function for each node (equilibrium model). More...

#include <Initialization.h>

Public Member Functions

 Initialization ()=default
 
 ~Initialization ()=default
 

Static Public Member Functions

static void ThreadDataInitialize (const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr, const std::shared_ptr< MF::Database::ConfigData > &ConfigData_Ptr)
 Initialization of MFThread boundary/initial values from thread.cfg file. More...
 
static void ThreadDefaultDataInitialize (const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr, const std::shared_ptr< MF::Solver_CPU::CaseParameters > &CaseParameters_Ptr)
 Initialization of MFThread boundary/initial values from thread.cfg file. More...
 
static void EquilibriumInitialization (const std::shared_ptr< MF::Database::ThreadArray > &ThreadArray_Ptr, const std::shared_ptr< MF::Solver_CPU::CaseParameters > &CaseParameters_Ptr)
 Initialization of FEQ pre and post collision tables (equilibrium model). More...
 

Detailed Description

The Initialization class is responsible for initialization of values of particle distribution function for each node (equilibrium model).

It also sets boundary values of threads from thread.cfg file.

Definition at line 32 of file Initialization.h.

Constructor & Destructor Documentation

◆ Initialization()

MF::Solver_CPU::Initialization::Initialization ( )
default

◆ ~Initialization()

MF::Solver_CPU::Initialization::~Initialization ( )
default

Member Function Documentation

◆ EquilibriumInitialization()

static void MF::Solver_CPU::Initialization::EquilibriumInitialization ( const std::shared_ptr< MF::Database::ThreadArray > &  ThreadArray_Ptr,
const std::shared_ptr< MF::Solver_CPU::CaseParameters > &  CaseParameters_Ptr 
)
inlinestatic

Initialization of FEQ pre and post collision tables (equilibrium model).

Definition at line 44 of file Initialization.h.

References MF::Solver_CPU::Incompressible, and MF::Solver_CPU::QuasiCompressible.

Referenced by main().

44  {
45  if (CaseParameters_Ptr->FluidFlowModel_MT == MF::Solver_CPU::FlowTypeClass::QuasiCompressible)
46  EquilibriumQcompr(ThreadArray_Ptr, CaseParameters_Ptr);
47  else if (CaseParameters_Ptr->FluidFlowModel_MT == MF::Solver_CPU::FlowTypeClass::Incompressible)
48  EquilibriumIncompr(ThreadArray_Ptr, CaseParameters_Ptr);
49  else {
50  std::cout << "Error in Initialization.h -> Unknown fluid flow model " << std::endl;
51  exit(EXIT_FAILURE);
52  }
53  };

◆ ThreadDataInitialize()

void MF::Solver_CPU::Initialization::ThreadDataInitialize ( const std::shared_ptr< MF::Database::ThreadArray > &  ThreadArray_Ptr,
const std::shared_ptr< MF::Database::ConfigData > &  ConfigData_Ptr 
)
static

Initialization of MFThread boundary/initial values from thread.cfg file.

Definition at line 13 of file Initialization.cpp.

References MF::LBPC::ParametersConversion::FPhys_toFLB(), MF::Solver_CPU::Collision::GetBGKFeq_Incompr(), MF::Solver_CPU::Collision::GetBGKFeq_Qcompr(), MFQ19, MF::LBPC::ParametersConversion::PressurePhys_toRhoLB(), MF::Database::Vec4< T >::rho, MF::LBPC::ParametersConversion::UPhys_toLB(), MF::Database::Vec4< T >::x, MF::Database::Vec3< T >::x, MF::Database::Vec4< T >::y, MF::Database::Vec3< T >::y, MF::Database::Vec3< T >::z, and MF::Database::Vec4< T >::z.

Referenced by main().

13  {
14 
15  double pressure_fiz;
16  MF::Database::Vec3<double> velocity_fiz;
17  MF::Database::Vec3<double> XYZForce_fiz;
18 
19  for (auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
20  if (Thread_it->m_uidThreadNr > 0) {
21  int32_t uidThread = Thread_it->m_uidThreadNr - 1;
22  if (ConfigData_Ptr->getThreadParamLength(uidThread, "Pressure_fiz") > 0) {
23  pressure_fiz = ConfigData_Ptr->getThreadFloatParam(uidThread, "Pressure_fiz");
24  Thread_it->m_BoundaryValue_RhoLB = MF::LBPC::ParametersConversion::PressurePhys_toRhoLB(pressure_fiz);
25  }
26  if (ConfigData_Ptr->getThreadParamLength(uidThread, "IsInletBalanceSurface") > 0) {
27  Thread_it->m_IsInletBalanceSurface = ConfigData_Ptr->getThreadBooleanParam(uidThread, "IsInletBalanceSurface");
28  }
29  if (ConfigData_Ptr->getThreadParamLength(uidThread, "IsOutletBalanceSurface") > 0) {
30  Thread_it->m_IsOutletBalanceSurface = ConfigData_Ptr->getThreadBooleanParam(uidThread, "IsOutletBalanceSurface");
31  }
32  if (ConfigData_Ptr->getThreadParamLength(uidThread, "Velocity_fiz") > 0) {
33  velocity_fiz.x = ConfigData_Ptr->getThreadFloatVectorParam(0, uidThread, "Velocity_fiz");
34  velocity_fiz.y = ConfigData_Ptr->getThreadFloatVectorParam(1, uidThread, "Velocity_fiz");
35  velocity_fiz.z = ConfigData_Ptr->getThreadFloatVectorParam(2, uidThread, "Velocity_fiz");
36  Thread_it->m_BoundaryValue_ULB = MF::LBPC::ParametersConversion::UPhys_toLB(velocity_fiz);
37  }
38  if (ConfigData_Ptr->getThreadParamLength(uidThread, "XYZForce_fiz") > 0) {
39  XYZForce_fiz.x = ConfigData_Ptr->getThreadFloatVectorParam(0, uidThread, "XYZForce_fiz");
40  XYZForce_fiz.y = ConfigData_Ptr->getThreadFloatVectorParam(1, uidThread, "XYZForce_fiz");
41  XYZForce_fiz.z = ConfigData_Ptr->getThreadFloatVectorParam(2, uidThread, "XYZForce_fiz");
42  Thread_it->m_XYZForce_LB = MF::LBPC::ParametersConversion::FPhys_toFLB(XYZForce_fiz);
43  }
44  if (ConfigData_Ptr->getThreadParamLength(uidThread, "ThreadName") > 0){
45  Thread_it->m_ThreadName = ConfigData_Ptr->getThreadStringParam(uidThread, "ThreadName");
46  }
47  }
48  }
49 }
T y
Y direction value.
Definition: Vec3.h:20
T z
Z direction value.
Definition: Vec3.h:21
T x
X direction value.
Definition: Vec3.h:19
static double PressurePhys_toRhoLB(double p_phys)
Converts physical pressure to rho LB.
static double FPhys_toFLB(double F_phys)
Physical force to LB force.
static double UPhys_toLB(double u_phys)
Converts physical velocity to LB velocity.

◆ ThreadDefaultDataInitialize()

void MF::Solver_CPU::Initialization::ThreadDefaultDataInitialize ( const std::shared_ptr< MF::Database::ThreadArray > &  ThreadArray_Ptr,
const std::shared_ptr< MF::Solver_CPU::CaseParameters > &  CaseParameters_Ptr 
)
static

Initialization of MFThread boundary/initial values from thread.cfg file.

Definition at line 142 of file Initialization.cpp.

Referenced by main().

142  {
143 
144  for (auto & Thread_it : *ThreadArray_Ptr->m_ThreadsTable_Ptr) {
145 
146  // Force initialization from default values.
147  Thread_it->m_XYZForce_LB.x = CaseParameters_Ptr->ForceX_LB;
148  Thread_it->m_XYZForce_LB.y = CaseParameters_Ptr->ForceY_LB;
149  Thread_it->m_XYZForce_LB.z = CaseParameters_Ptr->ForceZ_LB;
150  }
151 }

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