calc_flash

despasito.thermodynamics.calc.calc_flash

calc_flash(P, T, Eos, density_opts={}, maxiter=200, tol=1e-09, max_mole_fraction0=1.0, min_mole_fraction0=0.0, Psat_set=10000000.0, **kwargs)[source]

Binary flash calculation of vapor and liquid mole fractions.

Parameters:
  • P (numpy.ndarray) – Pressure of the system [Pa]

  • T (float) – Temperature of the system [K]

  • Eos (obj) – An instance of the defined EOS class to be used in thermodynamic computations.

  • density_opts (dict, Optional, default={}) – Dictionary of options used in calculating pressure vs. specific volume in pressure_vs_volume_arrays()

  • maxiter (int, Optional, default=200) – Maximum number of iterations in updating Ki values

  • tol (float, Optional, tol: 1e-9) – Tolerance to break loop. The error is defined as the absolute value of the summed difference in Ki values between iterations.

  • min_mole_fraction0 (float, Optional, default=0) – Set the vapor and liquid mole fraction of component one to be greater than this number. Useful for diagrams with multiple solutions, such as those with an azeotrope.

  • max_mole_fraction0 (float, Optional, default=1) – Set the vapor and liquid mole fraction of component one to be less than this number. Useful for diagrams with multiple solutions, such as those with an azeotrope.

  • Psat_set (float, Optional, default=1e+7) – [Pa] Set the saturation pressure if the pure component is above the critical point in these conditions

  • kwargs – Keyword arguments for calc_saturation_properties()

Returns:

  • xi (numpy.ndarray) – Liquid mole fraction of each component, sum(xi) should equal 1.0

  • flagl (int) – Flag identifying the fluid type for the liquid mole fractions, expected is liquid, 1. A value of 0 is vapor, 1 is liquid, 2 mean a critical fluid, 3 means that neither is true

  • yi (numpy.ndarray) – Vapor mole fraction of each component, sum(yi) should equal 1.0

  • flagv (int) – Flag identifying the fluid type for the vapor mole fractions, expected is vapor or 0. A value of 0 is vapor, 1 is liquid, 2 mean a critical fluid, 3 means that neither is true, 4 means ideal gas is assumed

  • obj (float) – Objective function value