13 #include <openvdb/openvdb.h> 30 static void Initialize (
const std::shared_ptr<MF::Database::ConfigData>& ConfigData_Ptr,
const std::shared_ptr<MF::GU::LatticeParametersD3Q19>& LatticeParameters_Ptr) {
32 u_ch_phys = ConfigData_Ptr->getCaseFloatParam(
"CharactersticParams.CharactVelocityPhysical_U_CH_Phys");
33 l_ch_phys = ConfigData_Ptr->getCaseFloatParam(
"CharactersticParams.CharactLengthPhysical_L_CH_Phys");
34 nu_phys = ConfigData_Ptr->getCaseFloatParam(
"PhysicalParams.FluidPhysicalViscosity_Nu_Phys");
35 dx_phys = ConfigData_Ptr->getCaseFloatParam(
"GeometryParams.PhysicalVoxelSize");
36 TAU = ConfigData_Ptr->getCaseFloatParam(
"PhysicalParams.Tau");
37 csq = LatticeParameters_Ptr->LatticeConstant_CSQ;
38 rho0_LB = ConfigData_Ptr->getCaseFloatParam(
"InitialCondition.ReferenceDensityLB_Rho0_LB");
39 rho0_phys = ConfigData_Ptr->getCaseFloatParam(
"PhysicalParams.FluidPhysicalReferenceDensity_Rho0_Phys");
40 FluidFlowModel_MT = ConfigData_Ptr->getFlowType();
45 static double l_ch_LB;
46 static double u_ch_LB;
47 static double dt_phys;
50 static double TAU, csq, rho0_LB, rho0_phys, u_ch_phys, l_ch_phys, nu_phys, dx_phys;
51 static int FluidFlowModel_MT;
55 static void ComputeBasicParameters(
const std::shared_ptr<MF::Solver_CPU::CaseParameters>& CaseParameters_Ptr,
const openvdb::Int64Grid::Ptr& VDBGrid_Ptr);
60 return ((u_LB * l_ch_LB * nu_phys) / (nu_LB * l_ch_phys));
66 u_phys.
x = (u_LB.
x * l_ch_LB * nu_phys) / (nu_LB * l_ch_phys);
67 u_phys.
y = (u_LB.
y * l_ch_LB * nu_phys) / (nu_LB * l_ch_phys);
68 u_phys.
z = (u_LB.
z * l_ch_LB * nu_phys) / (nu_LB * l_ch_phys);
75 return ((u_phys * l_ch_phys * nu_LB) / (nu_phys * l_ch_LB));
81 u_LB.
x = (u_phys.
x * l_ch_phys * nu_LB) / (nu_phys * l_ch_LB);
82 u_LB.
y = (u_phys.
y * l_ch_phys * nu_LB) / (nu_phys * l_ch_LB);
83 u_LB.
z = (u_phys.
z * l_ch_phys * nu_LB) / (nu_phys * l_ch_LB);
90 return (csq * (rho_LB - rho0_LB) * rho0_phys / rho0_LB * ((dx_phys * dx_phys) / (dt_phys * dt_phys)));
96 return (rho0_LB + ((p_phys * rho0_LB) / (rho0_phys * csq)) * ((dt_phys * dt_phys) / (dx_phys * dx_phys)));
103 if(FluidFlowModel_MT == 1)
106 RhoPhys = rho0_phys / rho0_LB * rho_LB;
113 return (rho_phys * rho0_LB / rho0_phys);
119 return (F_phys / (rho0_phys / rho0_LB * dx_phys / (dt_phys * dt_phys)));
126 FLB.
x = F_phys.
x / (rho0_phys / rho0_LB * dx_phys / (dt_phys * dt_phys));
127 FLB.
y = F_phys.
y / (rho0_phys / rho0_LB * dx_phys / (dt_phys * dt_phys));
128 FLB.
z = F_phys.
z / (rho0_phys / rho0_LB * dx_phys / (dt_phys * dt_phys));
135 return (F_LB * rho0_phys / rho0_LB * dx_phys / (dt_phys * dt_phys));
~ParametersConversion()=default
The class of methods converting between LB and physical values and vice versa.
static double RhoLB_toRhoPhys(double rho_LB)
Converts rho LB to physical density.
static void Initialize(const std::shared_ptr< MF::Database::ConfigData > &ConfigData_Ptr, const std::shared_ptr< MF::GU::LatticeParametersD3Q19 > &LatticeParameters_Ptr)
static void ComputeBasicParameters(const std::shared_ptr< MF::Solver_CPU::CaseParameters > &CaseParameters_Ptr, const openvdb::Int64Grid::Ptr &VDBGrid_Ptr)
Compute: Re, l_ch_LB, Cu, u_ch_LB, dt_phys, nu_LB.
static MF::Database::Vec3< double > ULB_toPhys(MF::Database::Vec3< double > u_LB)
Converts vector data: LB velocity to physical velocity.
static double PressurePhys_toRhoLB(double p_phys)
Converts physical pressure to rho LB.
ParametersConversion()=default
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.
static double FLB_toFPhys(double F_LB)
LB force to physical force.
static double RhoPhys_toRhoLB(double rho_phys)
Converts physical density to rho LB.
static MF::Database::Vec3< double > FPhys_toFLB(MF::Database::Vec3< double > F_phys)
Physical force to LB force.
static double RhoLB_toPressurePhys(double rho_LB)
Converts rho LB to physical pressure.
static double ULB_toPhys(double u_LB)
Converts LB velocity to physical velocity.
static MF::Database::Vec3< double > UPhys_toLB(MF::Database::Vec3< double > u_phys)
Converts vector data: physical velocity to LB velocity.