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);
81 while (abs(residual) > tol && cnt < maxIter)
83 f = sqrtT * sqrtT * sqrtT + A * sqrtT + B;
84 df = 3 * sqrtT * sqrtT + A;
91 cout <<
"Newton-Raphson in RedlichKwongEoS::v_GetTemperature did not " 93 << maxIter <<
" iterations (residual = " << residual <<
")" 122 deltaS -=
m_a *
Alpha(T) * logTerm / (2 *
m_b * T);
137 m_a * alpha * rho * (
m_b * rho + 2) /
138 ((1 +
m_b * rho) * (1 +
m_b * rho));
144 return dPdrho_T - dPde * dedrho_T;
160 3 *
m_a * alpha * logTerm / (4 *
m_b * T);
189 unsigned int cnt = 0;
190 while (abs(residual) > tol && cnt < maxIter)
192 f = sqrtT * sqrtT * sqrtT + A * sqrtT + B;
193 df = 3 * sqrtT * sqrtT + A;
200 cout <<
"Newton-Raphson in RedlichKwongEoS::v_GetEFromRhoP did not " 202 << maxIter <<
" iterations (residual = " << residual <<
")" 236 unsigned int cnt = 0;
237 while (abs(residual) > tol && cnt < maxIter)
239 f = Z * Z * Z + k1 * Z * Z + k2 * Z + k3;
240 df = 3 * Z * Z + 2 * k1 * Z + k2;
247 cout <<
"Newton-Raphson in RedlichKwongEoS::v_GetRhoFromPT did not " 249 << maxIter <<
" iterations (residual = " << residual <<
")" 259 return 1.0 / sqrt(T /
m_Tc);
264 return log(1 +
m_b * rho);
virtual NekDouble v_GetTemperature(const NekDouble &rho, const NekDouble &e)
virtual NekDouble v_GetDPDrho_e(const NekDouble &rho, const NekDouble &e)
virtual NekDouble v_GetEFromRhoP(const NekDouble &rho, const NekDouble &p)
NekDouble GetDPDe_rho(const NekDouble &rho, const NekDouble &e)
Calculate the partial derivative of P(rho,e) with respect to e.
Encapsulates equations of state allowing us to obtain thermodynamic properties: most relations are in...
NekDouble Alpha(const NekDouble &T)
EquationOfStateFactory & GetEquationOfStateFactory()
Declaration of the equation of state factory singleton.
virtual NekDouble v_GetRhoFromPT(const NekDouble &rho, const NekDouble &p)
NekDouble GetTemperature(const NekDouble &rho, const NekDouble &e)
Calculate the temperature.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
virtual NekDouble v_GetDPDe_rho(const NekDouble &rho, const NekDouble &e)
NekDouble LogTerm(const NekDouble &rho)
std::shared_ptr< SessionReader > SessionReaderSharedPtr
virtual NekDouble v_GetEntropy(const NekDouble &rho, const NekDouble &e)
virtual NekDouble v_GetPressure(const NekDouble &rho, const NekDouble &e)