42 std::string RedlichKwongEoS::className =
44 "RedlichKwong", RedlichKwongEoS::create,
45 "Redlich-Kwong equation of state.");
47 RedlichKwongEoS::RedlichKwongEoS(
51 pSession->LoadParameter(
"Tcrit",
m_Tc);
52 pSession->LoadParameter(
"Pcrit",
m_Pc);
107 m_a * alpha * rho * (
m_b * rho + 2) /
108 ((1 +
m_b * rho) * (1 +
m_b * rho));
114 return dPdrho_T - dPde * dedrho_T;
130 3 *
m_a * alpha * logTerm / (4 *
m_b * T);
159 unsigned int cnt = 0;
160 while (
abs(residual) > tol && cnt < maxIter)
162 f = sqrtT * sqrtT * sqrtT +
A * sqrtT + B;
163 df = 3 * sqrtT * sqrtT +
A;
170 cout <<
"Newton-Raphson in RedlichKwongEoS::v_GetEFromRhoP did not "
172 << maxIter <<
" iterations (residual = " << residual <<
")"
206 unsigned int cnt = 0;
207 while (
abs(residual) > tol && cnt < maxIter)
209 f = Z * Z * Z + k1 * Z * Z + k2 * Z + k3;
210 df = 3 * Z * Z + 2 * k1 * Z + k2;
217 cout <<
"Newton-Raphson in RedlichKwongEoS::v_GetRhoFromPT did not "
219 << maxIter <<
" iterations (residual = " << residual <<
")"
Encapsulates equations of state allowing us to obtain thermodynamic properties: most relations are in...
NekDouble GetDPDe_rho(const NekDouble &rho, const NekDouble &e)
Calculate the partial derivative of P(rho,e) with respect to e.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
T GetTemperatureKernel(const T &rho, const T &e)
NekDouble v_GetDPDrho_e(const NekDouble &rho, const NekDouble &e) final
NekDouble GetPressure(const NekDouble &rho, const NekDouble &e) final
Calculate the pressure.
NekDouble GetTemperature(const NekDouble &rho, const NekDouble &e) final
Calculate the temperature.
NekDouble v_GetRhoFromPT(const NekDouble &rho, const NekDouble &p) final
NekDouble v_GetDPDe_rho(const NekDouble &rho, const NekDouble &e) final
NekDouble v_GetEntropy(const NekDouble &rho, const NekDouble &e) final
T GetPressureKernel(const T &rho, const T &e)
NekDouble v_GetEFromRhoP(const NekDouble &rho, const NekDouble &p) final
std::shared_ptr< SessionReader > SessionReaderSharedPtr
The above copyright notice and this permission notice shall be included.
EquationOfStateFactory & GetEquationOfStateFactory()
Declaration of the equation of state factory singleton.
tinysimd::simd< NekDouble > vec_t
scalarT< T > log(scalarT< T > in)
scalarT< T > abs(scalarT< T > in)
scalarT< T > sqrt(scalarT< T > in)