void StiffenedGasFluidProperties::T_from_v_e(Real v, Real e, Real & T, Real & dT_dv, Real & dT_de) const { T = T_from_v_e(v, e); dT_dv = -_p_inf / _cv; dT_de = 1.0 / _cv; }
Real SinglePhaseFluidProperties::T_from_p_h(Real p, Real h) const { const Real s = s_from_h_p(h, p); const Real rho = rho_from_p_s(p, s); const Real v = 1. / rho; const Real e = e_from_v_h(v, h); return T_from_v_e(v, e); }
Real StiffenedGasFluidProperties::s_from_v_e(Real v, Real e) const { Real T = T_from_v_e(v, e); Real p = p_from_v_e(v, e); Real n = std::pow(T, _gamma) / std::pow(p + _p_inf, _gamma - 1.0); if (n <= 0.0) throw MooseException(name() + ": Negative argument in the ln() function."); return _cv * std::log(n) + _q_prime; }
Real StiffenedGasFluidProperties::g_from_v_e(Real v, Real e) const { // g(p,T) for SGEOS is given by Equation (37) in the following reference: // // Ray A. Berry, Richard Saurel, Olivier LeMetayer // The discrete equation method (DEM) for fully compressible, two-phase flows in // ducts of spatially varying cross-section // Nuclear Engineering and Design 240 (2010) p. 3797-3818 // const Real p = p_from_v_e(v, e); const Real T = T_from_v_e(v, e); return (_gamma * _cv - _q_prime) * T - _cv * T * std::log(std::pow(T, _gamma) / std::pow(p + _p_inf, _gamma - 1.0)) + _q; }
void StiffenedGasFluidProperties::s_from_v_e(Real v, Real e, Real & s, Real & ds_dv, Real & ds_de) const { Real T, dT_dv, dT_de; T_from_v_e(v, e, T, dT_dv, dT_de); Real p, dp_dv, dp_de; p_from_v_e(v, e, p, dp_dv, dp_de); const Real n = std::pow(T, _gamma) / std::pow(p + _p_inf, _gamma - 1.0); if (n <= 0.0) throw MooseException(name() + ": Negative argument in the ln() function."); s = _cv * std::log(n) + _q_prime; const Real dn_dT = _gamma * std::pow(T, _gamma - 1.0) / std::pow(p + _p_inf, _gamma - 1.0); const Real dn_dp = std::pow(T, _gamma) * (1.0 - _gamma) * std::pow(p + _p_inf, -_gamma); const Real dn_dv = dn_dT * dT_dv + dn_dp * dp_dv; const Real dn_de = dn_dT * dT_de + dn_dp * dp_de; ds_dv = _cv / n * dn_dv; ds_de = _cv / n * dn_de; }