Skip to content

Commit

Permalink
[oneD] added default PMAC values to maintain backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
wandadars committed Oct 22, 2024
1 parent a9bf1e5 commit 336a341
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions src/oneD/Flow1D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,23 @@ Flow1D::Flow1D(ThermoPhase* ph, size_t nsp, size_t points) :
}
}
}

// Polynomial coefficients for CO2 and H2O (backwards compatibility)
// Check if "CO2" is already in the map, if not, add the polynomial fit data
if (!m_PMAC.hasKey("CO2")) {
const std::vector<double> c_CO2 = {18.741, -121.310, 273.500, -194.050, 56.310,
-5.8169};
m_PMAC["CO2"]["fit-type"] = "polynomial";
m_PMAC["CO2"]["coefficients"] = c_CO2;
}

// Check if "H2O" is already in the map, if not, add the polynomial fit data
if (!m_PMAC.hasKey("H2O")) {
const std::vector<double> c_H2O = {-0.23093, -1.12390, 9.41530, -2.99880,
0.51382, -1.86840e-5};
m_PMAC["H2O"]["fit-type"] = "polynomial";
m_PMAC["H2O"]["coefficients"] = c_H2O;
}
}

Flow1D::Flow1D(shared_ptr<ThermoPhase> th, size_t nsp, size_t points)
Expand Down Expand Up @@ -512,12 +529,6 @@ void Flow1D::computeRadiation(double* x, size_t jmin, size_t jmax)
// radiation calculation:
double k_P_ref = 1.0*OneAtm;

// Polynomial coefficients:
const double c_H2O[6] = {-0.23093, -1.12390, 9.41530, -2.99880,
0.51382, -1.86840e-5};
const double c_CO2[6] = {18.741, -121.310, 273.500, -194.050,
56.310, -5.8169};

// Calculation of the two boundary values
double boundary_Rad_left = m_epsilon_left * StefanBoltz * pow(T(x, 0), 4);
double boundary_Rad_right = m_epsilon_right * StefanBoltz * pow(T(x, m_points - 1), 4);
Expand Down

0 comments on commit 336a341

Please sign in to comment.