Function solve_temperature_from_entropy

Source
pub fn solve_temperature_from_entropy(
    entropy_value: f64,
    pressure: f64,
    x_nacl: f64,
) -> Result<f64, String>
Expand description

Calculate temperature, given composition, pressure and entropy

This calculation underlies the pressure-enthalpy flash

Within the validity of this equation, entropy is a monotonic function of temperature; a simple bracketing and bisection approach is used where the amount that is bisected is estimated from a limited Newton step, with the derivative estimated from the bracket; a step size limiter of 95% if the bracketed domain is imposed.

§Arguments:

  • entropy_value - entropy, J/mol/K
  • pressure - pressure, Pa
  • x_nacl - NaCl mole fraction, mol/mol

§Returns

Temperature, K, or an error