42 std::string PengRobinsonEoS::className =
44 "PengRobinson", PengRobinsonEoS::create,
45 "Peng-Robinson equation of state.");
47 PengRobinsonEoS::PengRobinsonEoS(
51 pSession->LoadParameter(
"Tcrit",
m_Tc);
52 pSession->LoadParameter(
"Pcrit",
m_Pc);
53 pSession->LoadParameter(
"AcentricFactor",
m_omega);
98 deltaS +=
m_a * sqrtA *
m_fw * logTerm * (sqrtTr / T) / (
m_b *
sqrt(8));
117 2 *
m_a * alpha * rho * (1 +
m_b * rho) /
118 ((denom * rho * rho) * (denom * rho * rho));
122 -
m_a *
sqrt(alpha) * (1.0 +
m_fw) / (denom * rho * rho);
125 return dPdrho_T - dPde * dedrho_T;
177 (alpha +
sqrt(alpha) *
m_fw * sqrtTr);
202 unsigned int cnt = 0;
203 while ((fabs(residual) > tol) && cnt < maxIter)
205 f = Z * Z * Z + k1 * Z * Z + k2 * Z + k3;
206 df = 3 * Z * Z + 2 * k1 * Z + k2;
213 cout <<
"Newton-Raphson in PengRobinsonEoS::v_GetRhoFromPT did not "
215 << 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)
T GetPressureKernel(const T &rho, const T &e)
NekDouble v_GetEFromRhoP(const NekDouble &rho, const NekDouble &p) final
NekDouble GetTemperature(const NekDouble &rho, const NekDouble &e) final
Calculate the temperature.
NekDouble v_GetDPDe_rho(const NekDouble &rho, const NekDouble &e) final
NekDouble GetPressure(const NekDouble &rho, const NekDouble &e) final
Calculate the pressure.
NekDouble v_GetRhoFromPT(const NekDouble &rho, const NekDouble &p) final
NekDouble v_GetDPDrho_e(const NekDouble &rho, const NekDouble &e) final
NekDouble v_GetEntropy(const NekDouble &rho, const NekDouble &e) 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 > sqrt(scalarT< T > in)