35 #include <boost/core/ignore_unused.hpp>
44 std::string VanDerWaalsEoS::className =
46 "VanDerWaals", VanDerWaalsEoS::create,
47 "Van der Waals equation of state.");
49 VanDerWaalsEoS::VanDerWaalsEoS(
54 pSession->LoadParameter(
"Tcrit", Tcrit);
55 pSession->LoadParameter(
"Pcrit", Pcrit);
98 result = result / ((1 -
m_b * rho) * (1 -
m_b * rho));
99 result = result - 2 *
m_a * rho;
107 boost::ignore_unused(e);
114 return (
p +
m_a * rho * rho) * (1.0 / rho -
m_b) / (
m_gamma - 1) -
139 unsigned int cnt = 0;
140 while (
abs(residual) > tol && cnt < maxIter)
142 f = Z * Z * Z + k1 * Z * Z + k2 * Z + k3;
143 df = 3 * Z * Z + 2 * k1 * Z + k2;
150 cout <<
"Newton-Raphson in VanDerWaalsEoS::v_GetRhoFromPT did not "
152 << 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.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
virtual NekDouble v_GetDPDrho_e(const NekDouble &rho, const NekDouble &e) override final
T GetTemperatureKernel(const T &rho, const T &e)
virtual NekDouble v_GetTemperature(const NekDouble &rho, const NekDouble &e) override final
virtual NekDouble v_GetEntropy(const NekDouble &rho, const NekDouble &e) override final
T GetPressureKernel(const T &rho, const T &e)
virtual NekDouble v_GetRhoFromPT(const NekDouble &rho, const NekDouble &p) override final
virtual NekDouble v_GetEFromRhoP(const NekDouble &rho, const NekDouble &p) override final
virtual NekDouble v_GetDPDe_rho(const NekDouble &rho, const NekDouble &e) override final
virtual NekDouble v_GetPressure(const NekDouble &rho, const NekDouble &e) override 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)