10template <MInt nDim, MInt nDist,
class SysEqnLb,
class SysEqnFv>
14 CouplingLB<nDim, nDist, SysEqnLb>(couplingId, lb) {
23 std::cerr <<
"CFL number calculated and set to: " << newCFL << std::endl;
24 m_log <<
"CFL number calculated and set to: " << newCFL << std::endl;
30template <MInt nDim, MInt nDist,
class SysEqnLb,
class SysEqnFv>
32 const MFloat lbL2FvL = fvSolver().m_referenceLength / fvSolver().c_cellLengthAtLevel(fvSolver().maxLevel());
33 conversionLbFv.length = lbL2FvL;
34 conversionFvLb.length = 1.0 / lbL2FvL;
36 const MFloat lbU2FvU = sqrt(3.0 / (1.0 + (fvSolver().m_gamma - 1.0) / 2.0 * fvSolver().a_Ma() * fvSolver().a_Ma()));
37 conversionLbFv.velocity = lbU2FvU;
38 conversionFvLb.velocity = 1.0 / lbU2FvU;
40 MFloat lbP2FvP = pow(fvSolver().m_TInfinity, fvSolver().m_gamma / (fvSolver().m_gamma - 1.0));
41 if(std::isnan(lbP2FvP)) {
42 const MFloat TInf = fvSolver().m_initialCondition == 465 || fvSolver().m_initialCondition == 9465
44 : 1.0 / (1.0 + 0.5 * (fvSolver().m_gamma - 1.0) *
POW2(fvSolver().m_Ma));
45 lbP2FvP = pow(TInf, fvSolver().m_gamma / (fvSolver().m_gamma - 1.0));
47 conversionLbFv.pressure = lbP2FvP;
48 conversionFvLb.pressure = 1.0 / lbP2FvP;
50 MFloat lbNu2FvNu = fvSolver().c_cellLengthAtLevel(fvSolver().maxLevel()) * sqrt(fvSolver().m_TInfinity * 3.0)
51 * fvSolver().sysEqn().m_Re0;
52 if(std::isnan(lbNu2FvNu)) {
53 const MFloat TInf = fvSolver().m_initialCondition == 465 || fvSolver().m_initialCondition == 9465
55 : 1.0 / (1.0 + 0.5 * (fvSolver().m_gamma - 1.0) *
POW2(fvSolver().m_Ma));
56 lbNu2FvNu = fvSolver().c_cellLengthAtLevel(fvSolver().maxLevel()) * sqrt(TInf * 3.0) * fvSolver().sysEqn().m_Re0;
58 conversionLbFv.viscosity = lbNu2FvNu;
59 conversionFvLb.viscosity = 1.0 / lbNu2FvNu;
62template <MInt nDim, MInt nDist,
class SysEqnLb,
class SysEqnFv>
64 m_fvSolverId = fvSolver().solverId();
65 m_lbSolverId = lbSolver().solverId();
68template <MInt nDim, MInt nDist,
class SysEqnLb,
class SysEqnFv>
71template <MInt nDim, MInt nDist,
class SysEqnLb,
class SysEqnFv>
virtual void initConversionFactors()
virtual void checkProperties()
CouplerLbFv(const MInt couplingId, LbSolver *lb, FvCartesianSolver *fv)
virtual void readProperties()
solverType & fvSolver(const MInt solverId=0) const
This class represents all LB models.
constexpr Real POW2(const Real x)