objective_find_xi

despasito.thermodynamics.calc.objective_find_xi

objective_find_xi(xi, P, T, phiv, yi, Eos, density_opts={}, return_flag=False)[source]

Objective function for solving for stable vapor mole fraction.

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

  • P (float) – [Pa] Pressure of the system

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

  • phiv (float) – Fugacity coefficient of vapor at system pressure

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

  • 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()

  • return_flag (bool, Optional, default=False) – If True, the objective value and flagl is returned, otherwise, just the objective value is returned

Returns:

  • obj (numpy.ndarray) – Objective function for solving for liquid mole fractions

  • flag (int, Optional) – Flag identifying the fluid type. 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. Only outputted when return_flag is True