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).
Examples
>>> import thermosteam as tmo >>> chemicals = tmo.Chemicals(['Water', 'Ethanol']) >>> 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, P=109755.45319869411, 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, bp.P, bp.IDs, bp.z, bp.y) (355, 109755.45319869411, ('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.950302699425, P=101325, IDs=('Water', 'Ethanol'), z=[0.5 0.5], y=[0.342 0.658])
-
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']) >>> tmo.settings.set_thermo(chemicals) >>> BP = tmo.equilibrium.BubblePoint(chemicals) >>> BP.solve_Ty(z=np.array([0.6, 0.4]), P=101325) (353.75434459553634, 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']) >>> tmo.settings.set_thermo(chemicals) >>> BP = tmo.equilibrium.BubblePoint(chemicals) >>> BP.solve_Py(z=np.array([0.703, 0.297]), T=352.28) (91830.97988957872, array([0.419, 0.581]))
-