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);
100 result = result / ((1 -
m_b * rho) * (1 -
m_b * rho));
101 result = result - 2 *
m_a * rho;
109 boost::ignore_unused(e);
116 return (
p +
m_a * rho * rho) * (1.0 / rho -
m_b) / (
m_gamma - 1) -
141 unsigned int cnt = 0;
142 while (
abs(residual) > tol && cnt < maxIter)
144 f = Z * Z * Z + k1 * Z * Z + k2 * Z + k3;
145 df = 3 * Z * Z + 2 * k1 * Z + k2;
152 cout <<
"Newton-Raphson in VanDerWaalsEoS::v_GetRhoFromPT did not "
154 << maxIter <<
" iterations (residual = " << residual <<
")"
Encapsulates equations of state allowing us to obtain thermodynamic properties: most relations are in...
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_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
NekDouble GetTemperature(const NekDouble &rho, const NekDouble &e) final
Calculate the temperature.
NekDouble v_GetDPDe_rho(const NekDouble &rho, const NekDouble &e) final
NekDouble v_GetRhoFromPT(const NekDouble &rho, const NekDouble &p) final
NekDouble v_GetDPDrho_e(const NekDouble &rho, const NekDouble &e) final
NekDouble GetPressure(const NekDouble &rho, const NekDouble &e) final
Calculate the pressure.
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)