BubblePoint#

class BubblePoint(chemicals=(), thermo=None)[source]#

Create a BubblePoint object that returns bubble point values when called with a composition and either a temperture (T) or pressure (P).

Parameters:
  • chemicals=() (Iterable[Chemical], optional)

  • thermo=None (Thermo, optional)

Examples

>>> import thermosteam as tmo
>>> chemicals = tmo.Chemicals(['Water', 'Ethanol'], cache=True)
>>> tmo.settings.set_thermo(chemicals)
>>> BP = tmo.equilibrium.BubblePoint(chemicals)
>>> molar_composition = (0.5, 0.5)
>>> # Solve bubble point at constant temperature
>>> bp = BP(z=molar_composition, T=355)
>>> bp
BubblePointValues(T=355.00, P=109407, IDs=('Water', 'Ethanol'), z=[0.5 0.5], y=[0.344 0.656])
>>> # Note that the result is a BubblePointValues object which contain all results as attibutes
>>> (bp.T, round(bp.P), bp.IDs, bp.z, bp.y)
(355, 109407, ('Water', 'Ethanol'), array([0.5, 0.5]), array([0.344, 0.656]))
>>> # Solve bubble point at constant pressure
>>> BP(z=molar_composition, P=101325)
BubblePointValues(T=353.03, P=101325, IDs=('Water', 'Ethanol'), z=[0.5 0.5], y=[0.343 0.657])
__call__(z, *, T=None, P=None)[source]#

Call self as a function.

solve_Ty(z, P)[source]#

Bubble point at given composition and pressure.

Parameters:
  • z (ndarray) – Molar composition.

  • P (float) – Pressure [Pa].

Returns:

  • T (float) – Bubble point temperature [K].

  • y (ndarray) – Vapor phase molar composition.

Examples

>>> import thermosteam as tmo
>>> import numpy as np
>>> chemicals = tmo.Chemicals(['Water', 'Ethanol'], cache=True)
>>> tmo.settings.set_thermo(chemicals)
>>> BP = tmo.equilibrium.BubblePoint(chemicals)
>>> tmo.docround(BP.solve_Ty(z=np.array([0.6, 0.4]), P=101325))
(353.8284, array([0.383, 0.617]))
solve_Py(z, T)[source]#

Bubble point at given composition and temperature.

Parameters:
  • z (ndarray) – Molar composition.

  • T (float) – Temperature [K].

Returns:

  • P (float) – Bubble point pressure [Pa].

  • y (ndarray) – Vapor phase molar composition.

Examples

>>> import thermosteam as tmo
>>> import numpy as np
>>> chemicals = tmo.Chemicals(['Water', 'Ethanol'], cache=True)
>>> tmo.settings.set_thermo(chemicals)
>>> BP = tmo.equilibrium.BubblePoint(chemicals)
>>> tmo.docround(BP.solve_Py(z=np.array([0.703, 0.297]), T=352.28))
(91592.781, array([0.42, 0.58]))