objective_find_yi
despasito.thermodynamics.calc.objective_find_yi
- objective_find_yi(yi, P, T, phil, xi, Eos, density_opts={}, return_flag=False)[source]
Objective function for solving for stable vapor mole fraction.
- Parameters:
yi (numpy.ndarray) – Vapor mole fraction of each component, sum(yi) should equal 1.0
P (float) – [Pa] Pressure of the system
T (float) – [K] Temperature of the system
phil (float) – Fugacity coefficient of liquid at system pressure
xi (numpy.ndarray) – Liquid mole fraction of each component, sum(xi) 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 flagv is returned, otherwise, just the objective value is returned
- Returns:
obj (numpy.ndarray) – Objective function for solving for vapor 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