17 const std::vector<Real> & temperature,
18 const std::vector<Real> & logk,
19 const std::string type,
24 if (temperature.size() != logk.size())
25 mooseError(
"The temperature and logk data sets must be equal in length in "
26 "EquilibriumConstantInterpolator");
29 std::vector<Real> useful_temperature, useful_logk;
30 for (
unsigned int i = 0; i < temperature.size(); ++i)
31 if (!MooseUtils::absoluteFuzzyEqual(logk[i], no_value))
33 useful_temperature.push_back(temperature[i]);
34 useful_logk.push_back(logk[i]);
40 if (type ==
"fourth-order")
42 else if (type ==
"maier-kelly")
44 else if (type ==
"piecewise-linear")
49 _linear_interp = std::make_unique<LinearInterpolation>(useful_temperature, useful_logk);
51 catch (std::domain_error & e)
53 mooseError(
"EquilibriumConstantInterpolation: ", e.what());
57 mooseError(
"Type ", type,
" is not supported in EquilibriumConstantInterpolator");
60 if (useful_temperature.size() >= 5)
72 if (MooseUtils::absoluteFuzzyEqual(useful_temperature[0], 0.0) && type ==
"maier-kelly")
73 mooseError(
"A Maier-Kelly fit cannot be used when the temperature points include 0. Use a "
74 "fourth-order fit instead");
80 const unsigned int num_rows =
_x.size();
82 _matrix.resize(num_rows * num_cols);
89 for (
unsigned int row = 0; row < num_rows; ++row)
93 _matrix[(2 * num_rows) + row] = Utility::pow<2>(
_x[row]);
94 _matrix[(3 * num_rows) + row] = Utility::pow<3>(
_x[row]);
95 _matrix[(4 * num_rows) + row] = Utility::pow<4>(
_x[row]);
102 for (
unsigned int row = 0; row < num_rows; ++row)
107 _matrix[(3 * num_rows) + row] = 1.0 /
_x[row];
108 _matrix[(4 * num_rows) + row] = 1.0 / Utility::pow<2>(
_x[row]);
118 for (
unsigned int row = 0; row < num_rows; ++row)