DewPoint#

class 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).

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

  • thermo=None (Thermo, optional)

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=92008, IDs=('Water', 'Ethanol'), z=[0.5 0.5], x=[0.849 0.151])
>>> # 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, 92008, ('Water', 'Ethanol'), array([0.5, 0.5]), array([0.849, 0.151]))
>>> # Solve for dew point at constant pressure
>>> DP(z=molar_composition, P=2*101324)
DewPointValues(T=376.25, P=202648, IDs=('Water', 'Ethanol'), z=[0.5 0.5], x=[0.83 0.17])
__call__(z, *, T=None, P=None, gas_conversion=None)[source]#

Call self as a function.

solve_Tx(z, P, gas_conversion=None)[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)
>>> tmo.docround(DP.solve_Tx(z=np.array([0.5, 0.5]), P=101325))
(357.4419, array([0.847, 0.153]))
solve_Px(z, T, gas_conversion=None)[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)
>>> tmo.docround(DP.solve_Px(z=np.array([0.5, 0.5]), T=352.28))
(82480.7311, array([0.851, 0.149]))