DewPoint
- class thermosteam.equilibrium.DewPoint(chemicals=(), thermo=None)[source]
Create a DewPoint object that returns dew 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'], cache=True) >>> tmo.settings.set_thermo(chemicals) >>> DP = tmo.equilibrium.DewPoint(chemicals) >>> # Solve for dew point at constant temperautre >>> molar_composition = (0.5, 0.5) >>> dp = DP(z=molar_composition, T=355) >>> dp DewPointValues(T=355.00, P=91970, IDs=('Water', 'Ethanol'), z=[0.5 0.5], x=[0.851 0.149]) >>> # Note that the result is a DewPointValues object which contain all results as attibutes >>> (dp.T, round(dp.P), dp.IDs, dp.z, dp.x) (355, 91970, ('Water', 'Ethanol'), array([0.5, 0.5]), array([0.851, 0.149])) >>> # Solve for dew point at constant pressure >>> DP(z=molar_composition, P=2*101324) DewPointValues(T=376.26, P=202648, IDs=('Water', 'Ethanol'), z=[0.5 0.5], x=[0.832 0.168])
- solve_Tx(z, P)[source]
Dew point given composition and pressure.
- Parameters
z (ndarray) – Molar composition.
P (float) – Pressure [Pa].
- Returns
T (float) – Dew point temperature [K].
x (numpy.ndarray) – Liquid phase molar composition.
Examples
>>> import thermosteam as tmo >>> import numpy as np >>> chemicals = tmo.Chemicals(['Water', 'Ethanol'], cache=True) >>> tmo.settings.set_thermo(chemicals) >>> DP = tmo.equilibrium.DewPoint(chemicals) >>> DP.solve_Tx(z=np.array([0.5, 0.5]), P=101325) (357.451847, array([0.849, 0.151]))
- solve_Px(z, T)[source]
Dew point given composition and temperature.
- Parameters
z (ndarray) – Molar composition.
T (float) – Temperature (K).
- Returns
P (float) – Dew point pressure (Pa).
x (ndarray) – Liquid phase molar composition.
Examples
>>> import thermosteam as tmo >>> import numpy as np >>> chemicals = tmo.Chemicals(['Water', 'Ethanol'], cache=True) >>> tmo.settings.set_thermo(chemicals) >>> DP = tmo.equilibrium.DewPoint(chemicals) >>> DP.solve_Px(z=np.array([0.5, 0.5]), T=352.28) (82444.29876, array([0.853, 0.147]))