Commit f5387518 authored by Timo Koch's avatar Timo Koch
Browse files

[simpleh2o] Improve code readability

parent 53d50dfd
...@@ -157,9 +157,7 @@ public: ...@@ -157,9 +157,7 @@ public:
* \brief Specific internal energy of steam \f$\mathrm{[J/kg]}\f$. * \brief Specific internal energy of steam \f$\mathrm{[J/kg]}\f$.
* *
* Definition of enthalpy: \f$h= u + pv = u + p / \rho\f$. * Definition of enthalpy: \f$h= u + pv = u + p / \rho\f$.
*
* Rearranging for internal energy yields: \f$u = h - pv\f$. * Rearranging for internal energy yields: \f$u = h - pv\f$.
*
* Exploiting the Ideal Gas assumption (\f$pv = R_{\textnormal{specific}} T\f$)gives: \f$u = h - R / M T \f$. * Exploiting the Ideal Gas assumption (\f$pv = R_{\textnormal{specific}} T\f$)gives: \f$u = h - R / M T \f$.
* *
* The universal gas constant can only be used in the case of molar formulations. * The universal gas constant can only be used in the case of molar formulations.
...@@ -169,10 +167,10 @@ public: ...@@ -169,10 +167,10 @@ public:
static const Scalar gasInternalEnergy(Scalar temperature, static const Scalar gasInternalEnergy(Scalar temperature,
Scalar pressure) Scalar pressure)
{ {
return // 1/molarMass: conversion from [J/(mol K)] to [J/(kg K)]
gasEnthalpy(temperature, pressure) - // R*T/molarMass: pressure *spec. volume for an ideal gas
1/molarMass()* // conversion from [J/(mol K)] to [J/(kg K)] return gasEnthalpy(temperature, pressure)
IdealGas::R*temperature; // = pressure *spec. volume for an ideal gas - 1/molarMass()*IdealGas::R*temperature;
} }
/*! /*!
...@@ -183,9 +181,10 @@ public: ...@@ -183,9 +181,10 @@ public:
*/ */
static const Scalar liquidInternalEnergy(Scalar temperature, static const Scalar liquidInternalEnergy(Scalar temperature,
Scalar pressure) Scalar pressure)
{ return {
liquidEnthalpy(temperature, pressure) - return liquidEnthalpy(temperature, pressure)
pressure/liquidDensity(temperature, pressure); } - pressure/liquidDensity(temperature, pressure);
}
/*! /*!
* \brief Returns true if the gas phase is assumed to be compressible * \brief Returns true if the gas phase is assumed to be compressible
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment