activity_coefficient

despasito.thermodynamics.calculation_types.activity_coefficient

activity_coefficient(Eos, **sys_dict)[source]

Calculate the activity coefficient with a variety of methods.

Obtaining the activity coefficient requires the temperature, pressure, vapor composition, and liquid composition, but if one is missing, the necessary calculation computes it.

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

  • Tlist (list, Optional, default=298.15) – [K] Temperature of the system corresponding to composition in yilist. If one set is given, this pressure will be used for all compositions.

  • xilist (list, Optional) – List of component mole fraction sets, where sum(yi)=1.0 for each set. Each set of components corresponds to a temperature in Tlist, or if one set is given, this composition will be used for all temperatures. If this value is not provided, a dew point calculation is initiated if the pressure is also absent, and a flash calculation if yilist is absent.

  • yilist (list, Optional) – List of component mole fraction sets, where sum(yi)=1.0 for each set. Each set of components corresponds to a temperature in Tlist, or if one set is given, this composition will be used for all temperatures. If this value is not provided, a bubble point calculation is initiated if the pressure is also absent, and a flash calculation if xilist is absent.

  • Plist (list, Optional) – [Pa] Pressure of the system corresponding to Tlist. If one value is given, this pressure will be used for all temperatures. If this value is not provided, a dew or bubble point calculation is initiated to find it.

  • Pguess (list/float, Optional) – [Pa] If the pressure and either xilist or yilist is not provided, guess the system pressure at the dew/bubble point respectively. If a list of length one is provided, that value is used for all temperature-composition sets given.

  • Pmin (list, Optional) – [Pa] If the pressure and either xilist or yilist is not provided, set a minimum bounds in pressure for the dew/bubble point respectively. If not defined, the default in calc_dew_pressure() is used. If a list of length one is provided, that value is used for all temperature-composition sets given.

  • Pmax (list, Optional) – [Pa] If the pressure and either xilist or yilist is not provided, set a maximum bounds in pressure for the dew/bubble point respectively. If not defined, the default in calc_dew_pressure() is used. If a list of length one is provided, that value is used for all temperature-composition sets given.

  • MultiprocessingObject (obj, Optional) – Multiprocessing object, MultiprocessingJob

  • kwargs (Optional) – Keyword arguments for calc_saturation_properties() and either calc_dew_pressure(), calc_bubble_pressure(), or calc_flash(), depending on which two of xi, yi, or P is missing.

Returns:

output_dict – Output dictionary containing given and calculated values

  • T: [K] Temperature array generated from given instructions

  • P: [Pa] Given or calculated array of pressures

  • xi: Given or calculated array of liquid compositions

  • yi: Given or calculated array of vapor compositions

  • flagv: Phase flag for vapor given temperature and calculated pressure, a

value of 0 is vapor, 1 is liquid, 2 mean a critical fluid, 3 means that neither is true, 4 means we should assume ideal gas - flagl: Phase flag for liquid given temperature and calculated pressure, a value of 0 is vapor, 1 is liquid, 2 mean a critical fluid, 3 means that neither is true, 4 means we should assume ideal gas - obj: List of objective values if a calculation was needed - Psat: [Pa] List of calculated saturation pressures - gamma: List of calculated activity coefficients

Return type:

dict