45 "Redlich-Kwong equation of state.");
51 pSession->LoadParameter(
"Tcrit",
m_Tc);
52 pSession->LoadParameter(
"Pcrit",
m_Pc);
105 m_a * alpha * rho * (
m_b * rho + 2) /
106 ((1 +
m_b * rho) * (1 +
m_b * rho));
112 return dPdrho_T - dPde * dedrho_T;
128 3 *
m_a * alpha * logTerm / (4 *
m_b * T);
157 unsigned int cnt = 0;
158 while (
abs(residual) > tol && cnt < maxIter)
160 f = sqrtT * sqrtT * sqrtT +
A * sqrtT + B;
161 df = 3 * sqrtT * sqrtT +
A;
168 cout <<
"Newton-Raphson in RedlichKwongEoS::v_GetEFromRhoP did not "
170 << maxIter <<
" iterations (residual = " << residual <<
")"
204 unsigned int cnt = 0;
205 while (
abs(residual) > tol && cnt < maxIter)
207 f = Z * Z * Z + k1 * Z * Z + k2 * Z + k3;
208 df = 3 * Z * Z + 2 * k1 * Z + k2;
215 cout <<
"Newton-Raphson in RedlichKwongEoS::v_GetRhoFromPT did not "
217 << maxIter <<
" iterations (residual = " << residual <<
")"
Encapsulates equations of state allowing us to obtain thermodynamic properties: most relations are in...
NekDouble GetTemperature(const NekDouble &rho, const NekDouble &e)
Calculate the temperature.
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)
static std::string className
Name of the class.
NekDouble v_GetDPDrho_e(const NekDouble &rho, const NekDouble &e) final
RedlichKwongEoS(const LibUtilities::SessionReaderSharedPtr &pSession)
static EquationOfStateSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession)
Creates an instance of this class.
NekDouble v_GetRhoFromPT(const NekDouble &rho, const NekDouble &p) final
NekDouble v_GetDPDe_rho(const NekDouble &rho, const NekDouble &e) final
NekDouble v_GetTemperature(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_GetPressure(const NekDouble &rho, const NekDouble &e) final
NekDouble v_GetEFromRhoP(const NekDouble &rho, const NekDouble &p) final
std::shared_ptr< SessionReader > SessionReaderSharedPtr
EquationOfStateFactory & GetEquationOfStateFactory()
Declaration of the equation of state factory singleton.
tinysimd::simd< NekDouble > vec_t
scalarT< T > abs(scalarT< T > in)
scalarT< T > log(scalarT< T > in)
scalarT< T > sqrt(scalarT< T > in)