void NaClFluidProperties::e_dpT(Real pressure, Real temperature, Real & e, Real & de_dp, Real & de_dT) const { Real h, dh_dp, dh_dT; h_dpT(pressure, temperature, h, dh_dp, dh_dT); Real rho, drho_dp, drho_dT; rho_dpT(pressure, temperature, rho, drho_dp, drho_dT); e = h - pressure / rho; de_dp = dh_dp + pressure * drho_dp / rho / rho - 1.0 / rho; de_dT = dh_dT + pressure * drho_dT / rho / rho; }
void NaClFluidProperties::rho_e_dpT(Real pressure, Real temperature, Real & rho, Real & drho_dp, Real & drho_dT, Real & e, Real & de_dp, Real & de_dT) const { rho_dpT(pressure, temperature, rho, drho_dp, drho_dT); e_dpT(pressure, temperature, e, de_dp, de_dT); }
Real StiffenedGasFluidProperties::beta(Real pressure, Real temperature) const { // The volumetric thermal expansion coefficient is defined as // 1/v dv/dT)_p // It is the fractional change rate of volume with respect to temperature change // at constant pressure. Here it is coded as // - 1/rho drho/dT)_p // using chain rule with v = v(rho) Real rho, drho_dp, drho_dT; rho_dpT(pressure, temperature, rho, drho_dp, drho_dT); return -drho_dT / rho; }
void StiffenedGasFluidProperties::rho_e_dps(Real pressure, Real entropy, Real & rho, Real & drho_dp, Real & drho_ds, Real & e, Real & de_dp, Real & de_ds) const { // compute rho(p, T(p,s)) and e(p, rho(p, T(p,s))) this->rho_e_ps(pressure, entropy, rho, e); // compute temperature const Real aux = (entropy - _q_prime + _cv * std::log(std::pow(pressure + _p_inf, _gamma - 1))) / _cv; const Real T = std::pow(std::exp(aux), 1 / _gamma); // dT/dp const Real dT_dp = 1.0 / _gamma * std::pow(std::exp(aux), 1.0 / _gamma - 1.0) * std::exp(aux) / std::pow(pressure + _p_inf, _gamma - 1.0) * (_gamma - 1.0) * std::pow(pressure + _p_inf, _gamma - 2.0); // dT/ds const Real dT_ds = 1.0 / _gamma * std::pow(std::exp(aux), 1.0 / _gamma - 1.0) * std::exp(aux) / _cv; // Drho/Dp = d/dp[rho(p, T(p,s))] = drho/dp + drho/dT * dT/dp Real drho_dp_partial, drho_dT; rho_dpT(pressure, T, rho, drho_dp_partial, drho_dT); drho_dp = drho_dp_partial + drho_dT * dT_dp; // Drho/Ds = d/ds[rho(p, T(p,s))] = drho/dT * dT/ds drho_ds = drho_dT * dT_ds; // De/Dp = d/dp[e(p, rho(p, T(p,s)))] = de/dp + de/drho * Drho/Dp const Real de_dp_partial = 1.0 / ((_gamma - 1.0) * rho); const Real de_drho = -(pressure + _gamma * _p_inf) / ((_gamma - 1.0) * rho * rho); de_dp = de_dp_partial + de_drho * drho_dp; // De/Ds = d/ds[e(p, rho(p, T(p,s)))] = de/drho * Drho/Ds de_ds = de_drho * drho_ds; }
void IdealGasFluidPropertiesPT::rho_e_dpT(Real pressure, Real temperature, Real & rho, Real & drho_dp, Real & drho_dT, Real & e, Real & de_dp, Real & de_dT) const { Real density, ddensity_dp, ddensity_dT; rho_dpT(pressure, temperature, density, ddensity_dp, ddensity_dT); rho = density; drho_dp = ddensity_dp; drho_dT = ddensity_dT; Real energy, denergy_dp, denergy_dT; e_dpT(pressure, temperature, energy, denergy_dp, denergy_dT); e = energy; de_dp = denergy_dp; de_dT = denergy_dT; }