35#ifndef NEKTAR_SOLVERS_COMPRESSIBLEFLOWSOLVER_MISC_REDLICHKWONGEOS
36#define NEKTAR_SOLVERS_COMPRESSIBLEFLOWSOLVER_MISC_REDLICHKWONGEOS
100 template <
class T,
typename =
typename std::enable_if<
101 std::is_floating_point<T>::value ||
109 template <
class T,
typename =
typename std::enable_if<
110 std::is_floating_point<T>::value ||
114 return log(1.0 +
m_b * rho);
117 template <
class T,
typename =
typename std::enable_if<
118 std::is_floating_point<T>::value ||
137 unsigned int maxIter = 100;
138 unsigned int cnt = 0;
139 while (
abs(residual) > tol && cnt < maxIter)
141 T f = sqrtT * sqrtT * sqrtT +
A * sqrtT + B;
142 T df = 3 * sqrtT * sqrtT +
A;
149 std::cout <<
"Newton-Raphson in RedlichKwongEoS::v_GetTemperature "
152 << maxIter <<
" iterations (residual = " << residual
157 return sqrtT * sqrtT;
160 template <
class T,
typename =
typename std::enable_if<
161 std::is_floating_point<T>::value ||
166 T oneOrho = 1.0 / rho;
Encapsulates equations of state allowing us to obtain thermodynamic properties: most relations are in...
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
Redlich-Kwong equation of state: p = RT/(1/rho - b) - a/( sqrt(T / Tc) * (1/rho^2 + b/rho) with a = 0...
~RedlichKwongEoS(void) override
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
std::shared_ptr< EquationOfState > EquationOfStateSharedPtr
A shared pointer to an equation of state object.
tinysimd::simd< NekDouble > vec_t
scalarT< T > abs(scalarT< T > in)
scalarT< T > log(scalarT< T > in)
scalarT< T > sqrt(scalarT< T > in)