BubblePoint

class thermosteam.equilibrium.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=109755, IDs=('Water', 'Ethanol'), z=[0.5 0.5], y=[0.343 0.657])
>>> # 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, 109755, ('Water', 'Ethanol'), array([0.5, 0.5]), array([0.343, 0.657]))
>>> # Solve bubble point at constant pressure
>>> BP(z=molar_composition, P=101325)
BubblePointValues(T=352.95, P=101325, IDs=('Water', 'Ethanol'), z=[0.5 0.5], y=[0.342 0.658])
__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 composotion.

  • 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)
>>> BP.solve_Ty(z=np.array([0.6, 0.4]), P=101325)
(353.7543, array([0.381, 0.619]))
solve_Py(z, T)[source]

Bubble point at given composition and temperature.

Parameters
  • z (ndarray) – Molar composotion.

  • 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)
>>> BP.solve_Py(z=np.array([0.703, 0.297]), T=352.28)
(91830.9798, array([0.419, 0.581]))