tespy.tools.fluid_properties package¶
tespy.tools.fluid_properties.functions module¶
Module for fluid property functions.
This file is part of project TESPy (github.com/oemof/tespy). It’s copyrighted by the contributors recorded in the version control history of the file, available from its original location tespy/tools/fluid_properties/functions.py
SPDX-License-Identifier: MIT
- tespy.tools.fluid_properties.functions.Q_mix_ph(p, h, fluid_data, mixing_rule=None)[source]¶
Calculate vapour quality from pressure and specific enthalpy.
Valid for single-component
fluid_data, including mixture-backend wrappers handled entirely inside theFluidPropertyWrapper. RaisesValueErrorfor multi-componentfluid_data.- Parameters:
p (float) – Pressure in Pa.
h (float) – Specific enthalpy in J/kg.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Ignored.
- Returns:
float – Vapour quality (0 = saturated liquid, 1 = saturated vapour).
- Raises:
ValueError – If
fluid_datacontains more than one fluid.
- tespy.tools.fluid_properties.functions.T_bubble_p(p, fluid_data, mixing_rule=None)[source]¶
Calculate bubble point temperature from pressure.
Valid for single-component
fluid_data, including mixture-backend wrappers handled entirely inside theFluidPropertyWrapper. RaisesValueErrorfor multi-componentfluid_data.- Parameters:
p (float) – Pressure in Pa.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Ignored.
- Returns:
float – Bubble point temperature in K.
- Raises:
ValueError – If
fluid_datacontains more than one fluid.
- tespy.tools.fluid_properties.functions.T_dew_p(p, fluid_data, mixing_rule=None)[source]¶
Calculate dew point temperature from pressure.
Valid for single-component
fluid_data, including mixture-backend wrappers handled entirely inside theFluidPropertyWrapper. RaisesValueErrorfor multi-componentfluid_data.- Parameters:
p (float) – Pressure in Pa.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Ignored.
- Returns:
float – Dew point temperature in K.
- Raises:
ValueError – If
fluid_datacontains more than one fluid.
- tespy.tools.fluid_properties.functions.T_mix_ph(p, h, fluid_data, mixing_rule=None, T0=None)[source]¶
Calculate temperature from pressure and specific enthalpy.
For a pure fluid delegates to the fluid wrapper. For humid air uses
CoolProp.CoolProp.HAPropsSI(). For other mixtures invertsh_mix_pT()iteratively viahelpers.inverse_temperature_mixture().- Parameters:
p (float) – Pressure in Pa.
h (float) – Specific enthalpy in J/kg.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Mixing rule identifier; ignored for pure fluids.
T0 (float, optional) – Temperature starting value in K for the iterative inversion.
- Returns:
float – Temperature in K.
- tespy.tools.fluid_properties.functions.T_mix_ps(p, s, fluid_data, mixing_rule=None, T0=None)[source]¶
Calculate temperature from pressure and specific entropy.
For a pure fluid delegates to the fluid wrapper. For humid air uses
CoolProp.CoolProp.HAPropsSI(). For other mixtures invertss_mix_pT()iteratively viahelpers.inverse_temperature_mixture().- Parameters:
p (float) – Pressure in Pa.
s (float) – Specific entropy in J/(kg K).
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Mixing rule identifier; ignored for pure fluids.
T0 (float, optional) – Temperature starting value in K for the iterative inversion.
- Returns:
float – Temperature in K.
- tespy.tools.fluid_properties.functions.T_sat_p(p, fluid_data, mixing_rule=None)[source]¶
Calculate saturation temperature from pressure.
Valid for single-component
fluid_data, including mixture-backend wrappers handled entirely inside theFluidPropertyWrapper. RaisesValueErrorfor multi-componentfluid_data.- Parameters:
p (float) – Pressure in Pa.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Ignored.
- Returns:
float – Saturation temperature in K.
- Raises:
ValueError – If
fluid_datacontains more than one fluid.
- tespy.tools.fluid_properties.functions.calc_physical_exergy(h, s, p, pamb, Tamb, fluid_data, mixing_rule=None, T0=None)[source]¶
Calculate specific physical exergy.
Physical exergy is allocated to a thermal and a mechanical share according to [43].
- Parameters:
h (float) – Specific enthalpy in J/kg.
s (float) – Specific entropy in J/(kg K).
p (float) – Pressure in Pa.
pamb (float) – Ambient pressure in Pa.
Tamb (float) – Ambient temperature in K.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Mixing rule identifier; ignored for pure fluids.
T0 (float, optional) – Temperature starting value in K for iterative property inversions.
- Returns:
tuple – Specific thermal and mechanical exergy (\(e^\text{T}\), \(e^\text{M}\)) in J/kg.
Notes
\[ \begin{align}\begin{aligned}e^\text{T} = \left( h - h \left( p, T_0 \right) \right) - T_0 \cdot \left(s - s\left(p, T_0\right)\right)\\e^\text{M}=\left(h\left(p,T_0\right)-h\left(p_0,T_0\right)\right) -T_0\cdot\left(s\left(p, T_0\right)-s\left(p_0,T_0\right)\right)\\e^\text{PH} = e^\text{T} + e^\text{M}\end{aligned}\end{align} \]
- tespy.tools.fluid_properties.functions.conductivity_mix_ph(p, h, fluid_data, mixing_rule=None, T0=None)[source]¶
Calculate thermal conductivity from pressure and specific enthalpy.
Only implemented for single-component
fluid_data. RaisesNotImplementedErrorfor multi-componentfluid_data.- Parameters:
p (float) – Pressure in Pa.
h (float) – Specific enthalpy in J/kg.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Ignored.
T0 (float, optional) – Ignored.
- Returns:
float – Thermal conductivity in W/(m K).
- Raises:
NotImplementedError – If
fluid_datacontains more than one fluid.
- tespy.tools.fluid_properties.functions.dT_mix_dph(p, h, fluid_data, mixing_rule=None, T0=None)[source]¶
Calculate the partial derivative of temperature with respect to pressure at constant enthalpy.
Uses a central finite difference with step \(d = 0.1\) Pa.
- Parameters:
p (float) – Pressure in Pa.
h (float) – Specific enthalpy in J/kg.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Mixing rule identifier; ignored for pure fluids.
T0 (float, optional) – Temperature starting value in K for the iterative inversion.
- Returns:
float – \(\partial T / \partial p \big|_h\) in K/Pa.
Notes
\[\frac{\partial T}{\partial p}\bigg|_h \approx \frac{T(p+d,\,h) - T(p-d,\,h)}{2\,d}, \quad d = 0.1 \text{ Pa}\]
- tespy.tools.fluid_properties.functions.dT_mix_pdh(p, h, fluid_data, mixing_rule=None, T0=None)[source]¶
Calculate the partial derivative of temperature with respect to enthalpy at constant pressure.
Uses a central finite difference with step \(d = 0.1\) J/kg.
- Parameters:
p (float) – Pressure in Pa.
h (float) – Specific enthalpy in J/kg.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Mixing rule identifier; ignored for pure fluids.
T0 (float, optional) – Temperature starting value in K for the iterative inversion.
- Returns:
float – \(\partial T / \partial h \big|_p\) in K kg/J.
Notes
\[\frac{\partial T}{\partial h}\bigg|_p \approx \frac{T(p,\,h+d) - T(p,\,h-d)}{2\,d}, \quad d = 0.1 \text{ J/kg}\]
- tespy.tools.fluid_properties.functions.dT_mix_ph_dfluid(p, h, fluid, fluid_data, mixing_rule=None, T0=None)[source]¶
Calculate the partial derivative of temperature with respect to a fluid mass fraction.
Perturbs the mass fraction of fluid by \(d = 10^{-5}\) in each direction and applies a central finite difference.
- Parameters:
p (float) – Pressure in Pa.
h (float) – Specific enthalpy in J/kg.
fluid (str) – Name of the fluid whose mass fraction is perturbed.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Mixing rule identifier; ignored for pure fluids.
T0 (float, optional) – Temperature starting value in K for the iterative inversion.
- Returns:
float – \(\partial T / \partial x_i \big|_{p,h}\) in K.
Notes
\[\frac{\partial T}{\partial x_i}\bigg|_{p,h} \approx \frac{T(p,h,x_i+d) - T(p,h,x_i-d)}{2\,d}, \quad d = 10^{-5}\]
- tespy.tools.fluid_properties.functions.dT_sat_dp(p, fluid_data, mixing_rule=None)[source]¶
Calculate the derivative of saturation temperature with respect to pressure.
Uses a central finite difference with step \(d = 0.01\) Pa.
- Parameters:
p (float) – Pressure in Pa.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Ignored.
- Returns:
float – \(dT_\text{sat} / dp\) in K/Pa.
Notes
\[\frac{dT_\text{sat}}{dp} \approx \frac{T_\text{sat}(p+d) - T_\text{sat}(p-d)}{2\,d}, \quad d = 0.01 \text{ Pa}\]
- tespy.tools.fluid_properties.functions.dh_mix_dpQ(p, Q, fluid_data, mixing_rule=None)[source]¶
Calculate the partial derivative of saturation enthalpy with respect to pressure.
Uses a central finite difference with step \(d = 0.1\) Pa.
- Parameters:
p (float) – Pressure in Pa.
Q (float) – Vapour quality (0 = saturated liquid, 1 = saturated vapour).
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Ignored.
- Returns:
float – \(\partial h / \partial p \big|_Q\) in J/(kg Pa).
Notes
\[\frac{\partial h}{\partial p}\bigg|_Q \approx \frac{h(p+d,\,Q) - h(p-d,\,Q)}{2\,d}, \quad d = 0.1 \text{ Pa}\]
- tespy.tools.fluid_properties.functions.dv_mix_dph(p, h, fluid_data, mixing_rule=None, T0=None)[source]¶
Calculate the partial derivative of specific volume with respect to pressure at constant enthalpy.
Uses a central finite difference with step \(d = 0.1\) Pa.
- Parameters:
p (float) – Pressure in Pa.
h (float) – Specific enthalpy in J/kg.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Mixing rule identifier; ignored for pure fluids.
T0 (float, optional) – Temperature starting value in K for the iterative inversion.
- Returns:
float – \(\partial v / \partial p \big|_h\) in m³/(kg Pa).
Notes
\[\frac{\partial v}{\partial p}\bigg|_h \approx \frac{v(p+d,\,h) - v(p-d,\,h)}{2\,d}, \quad d = 0.1 \text{ Pa}\]
- tespy.tools.fluid_properties.functions.dv_mix_pdh(p, h, fluid_data, mixing_rule=None, T0=None)[source]¶
Calculate the partial derivative of specific volume with respect to enthalpy at constant pressure.
Uses a central finite difference with step \(d = 0.1\) J/kg.
- Parameters:
p (float) – Pressure in Pa.
h (float) – Specific enthalpy in J/kg.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Mixing rule identifier; ignored for pure fluids.
T0 (float, optional) – Temperature starting value in K for the iterative inversion.
- Returns:
float – \(\partial v / \partial h \big|_p\) in m³ kg/J.
Notes
\[\frac{\partial v}{\partial h}\bigg|_p \approx \frac{v(p,\,h+d) - v(p,\,h-d)}{2\,d}, \quad d = 0.1 \text{ J/kg}\]
- tespy.tools.fluid_properties.functions.h_mix_pQ(p, Q, fluid_data, mixing_rule=None)[source]¶
Calculate specific enthalpy from pressure and vapour quality.
Valid for single-component
fluid_data, including mixture-backend wrappers handled entirely inside theFluidPropertyWrapper. RaisesValueErrorfor multi-componentfluid_data.- Parameters:
p (float) – Pressure in Pa.
Q (float) – Vapour quality (0 = saturated liquid, 1 = saturated vapour).
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Ignored.
- Returns:
float – Specific enthalpy in J/kg.
- Raises:
ValueError – If
fluid_datacontains more than one fluid.
- tespy.tools.fluid_properties.functions.h_mix_pT(p, T, fluid_data, mixing_rule=None)[source]¶
Calculate specific enthalpy from pressure and temperature.
For a pure fluid delegates to the fluid wrapper. For mixtures dispatches to the mixing rule registered under mixing_rule.
- Parameters:
p (float) – Pressure in Pa.
T (float) – Temperature in K.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Mixing rule identifier; ignored for pure fluids.
- Returns:
float – Specific enthalpy in J/kg.
- tespy.tools.fluid_properties.functions.isentropic(p_1, h_1, p_2, fluid_data, mixing_rule=None, T0=None, T0_out=None)[source]¶
Calculate specific enthalpy at isentropic outlet conditions.
For a pure fluid delegates directly to the fluid wrapper. For mixtures the isentropic enthalpy is obtained by computing the inlet entropy, then inverting
T_mix_ps()at the outlet pressure, and finally evaluatingh_mix_pT().- Parameters:
p_1 (float) – Inlet pressure in Pa.
h_1 (float) – Inlet specific enthalpy in J/kg.
p_2 (float) – Outlet pressure in Pa.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Mixing rule identifier; ignored for pure fluids.
T0 (float, optional) – Temperature starting value in K for the inlet entropy inversion.
T0_out (float, optional) – Temperature starting value in K for the outlet enthalpy inversion.
- Returns:
float – Isentropic specific enthalpy at the outlet in J/kg.
Notes
For mixtures:
\[h_2^\text{is} = h\!\left(p_2,\; T\!\left(p_2,\; s(p_1, h_1)\right)\right)\]
- tespy.tools.fluid_properties.functions.p_bubble_T(T, fluid_data, mixing_rule=None)[source]¶
Calculate bubble point pressure from temperature.
Valid for single-component
fluid_data, including mixture-backend wrappers handled entirely inside theFluidPropertyWrapper. RaisesValueErrorfor multi-componentfluid_data.- Parameters:
T (float) – Temperature in K.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Ignored.
- Returns:
float – Bubble point pressure in Pa.
- Raises:
ValueError – If
fluid_datacontains more than one fluid.
- tespy.tools.fluid_properties.functions.p_dew_T(T, fluid_data, mixing_rule=None)[source]¶
Calculate dew point pressure from temperature.
Valid for single-component
fluid_data, including mixture-backend wrappers handled entirely inside theFluidPropertyWrapper. RaisesValueErrorfor multi-componentfluid_data.- Parameters:
T (float) – Temperature in K.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Ignored.
- Returns:
float – Dew point pressure in Pa.
- Raises:
ValueError – If
fluid_datacontains more than one fluid.
- tespy.tools.fluid_properties.functions.p_sat_T(T, fluid_data, mixing_rule=None)[source]¶
Calculate saturation pressure from temperature.
Valid for single-component
fluid_data, including mixture-backend wrappers handled entirely inside theFluidPropertyWrapper. RaisesValueErrorfor multi-componentfluid_data.- Parameters:
T (float) – Temperature in K.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Ignored.
- Returns:
float – Saturation pressure in Pa.
- Raises:
ValueError – If
fluid_datacontains more than one fluid.
- tespy.tools.fluid_properties.functions.phase_mix_ph(p, h, fluid_data, mixing_rule=None)[source]¶
Return the thermodynamic phase state from pressure and specific enthalpy.
Valid for single-component
fluid_data, including mixture-backend wrappers handled entirely inside theFluidPropertyWrapper. RaisesValueErrorfor multi-componentfluid_data.- Parameters:
p (float) – Pressure in Pa.
h (float) – Specific enthalpy in J/kg.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Ignored.
- Returns:
str – Phase identifier (e.g.
"tp"for two-phase,"g"for gas,"l"for liquid).- Raises:
ValueError – If
fluid_datacontains more than one fluid.
- tespy.tools.fluid_properties.functions.s_mix_pT(p, T, fluid_data, mixing_rule=None)[source]¶
Calculate specific entropy from pressure and temperature.
For a pure fluid delegates to the fluid wrapper. For mixtures dispatches to the mixing rule registered under mixing_rule.
- Parameters:
p (float) – Pressure in Pa.
T (float) – Temperature in K.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Mixing rule identifier; ignored for pure fluids.
- Returns:
float – Specific entropy in J/(kg K).
- tespy.tools.fluid_properties.functions.s_mix_ph(p, h, fluid_data, mixing_rule=None, T0=None)[source]¶
Calculate specific entropy from pressure and specific enthalpy.
For a pure fluid delegates to the fluid wrapper. For mixtures first determines the temperature via
T_mix_ph(), then evaluatess_mix_pT().- Parameters:
p (float) – Pressure in Pa.
h (float) – Specific enthalpy in J/kg.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Mixing rule identifier; ignored for pure fluids.
T0 (float, optional) – Temperature starting value in K for the iterative inversion.
- Returns:
float – Specific entropy in J/(kg K).
- tespy.tools.fluid_properties.functions.v_mix_pT(p, T, fluid_data, mixing_rule=None)[source]¶
Calculate specific volume from pressure and temperature.
For a pure fluid returns the reciprocal of the wrapper density. For mixtures dispatches to the mixing rule registered under mixing_rule.
- Parameters:
p (float) – Pressure in Pa.
T (float) – Temperature in K.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Mixing rule identifier; ignored for pure fluids.
- Returns:
float – Specific volume in m³/kg.
- tespy.tools.fluid_properties.functions.v_mix_ph(p, h, fluid_data, mixing_rule=None, T0=None)[source]¶
Calculate specific volume from pressure and specific enthalpy.
For a pure fluid returns the reciprocal of the wrapper density. For humid air uses
CoolProp.CoolProp.HAPropsSI(). For other mixtures first determines the temperature viaT_mix_ph(), then evaluatesv_mix_pT().- Parameters:
p (float) – Pressure in Pa.
h (float) – Specific enthalpy in J/kg.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Mixing rule identifier; ignored for pure fluids.
T0 (float, optional) – Temperature starting value in K for the iterative inversion.
- Returns:
float – Specific volume in m³/kg.
- tespy.tools.fluid_properties.functions.viscosity_mix_pT(p, T, fluid_data, mixing_rule=None)[source]¶
Calculate dynamic viscosity from pressure and temperature.
For a pure fluid delegates to the fluid wrapper. For mixtures dispatches to the mixing rule registered under mixing_rule.
- Parameters:
p (float) – Pressure in Pa.
T (float) – Temperature in K.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Mixing rule identifier; ignored for pure fluids.
- Returns:
float – Dynamic viscosity in Pa s.
- tespy.tools.fluid_properties.functions.viscosity_mix_ph(p, h, fluid_data, mixing_rule=None, T0=None)[source]¶
Calculate dynamic viscosity from pressure and specific enthalpy.
For a pure fluid delegates to the fluid wrapper. For humid air uses
CoolProp.CoolProp.HAPropsSI(). For other mixtures first determines the temperature viaT_mix_ph(), then evaluatesviscosity_mix_pT().- Parameters:
p (float) – Pressure in Pa.
h (float) – Specific enthalpy in J/kg.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.mixing_rule (str, optional) – Mixing rule identifier; ignored for pure fluids.
T0 (float, optional) – Temperature starting value in K for the iterative inversion.
- Returns:
float – Dynamic viscosity in Pa s.
tespy.tools.fluid_properties.helpers module¶
Module for fluid property helper functions.
This file is part of project TESPy (github.com/oemof/tespy). It’s copyrighted by the contributors recorded in the version control history of the file, available from its original location tespy/tools/fluid_properties/helpers.py
SPDX-License-Identifier: MIT
- tespy.tools.fluid_properties.helpers.blasius(re)[source]¶
Calculate friction coefficient according to Blasius.
- Parameters:
re (float) – Reynolds number.
- Returns:
darcy_friction_factor (float) – Darcy friction factor.
- tespy.tools.fluid_properties.helpers.colebrook(reynolds, ks, diameter, darcy_friction_factor, **kwargs)[source]¶
Calculate friction coefficient according to Colebrook-White equation.
Applied in transition zone and rough conditions.
- Parameters:
re (float) – Reynolds number.
ks (float) – Equivalent sand roughness.
d (float) – Pipe’s diameter.
darcy_friction_factor (float) – Darcy friction factor.
- Returns:
darcy_friction_factor (float) – Darcy friction factor.
- tespy.tools.fluid_properties.helpers.darcy_friction_factor(re, ks, d)[source]¶
Calculate the Darcy friction factor.
- Parameters:
re (float) – Reynolds number re / 1.
ks (float) – Pipe roughness ks / m.
d (float) – Pipe diameter/characteristic length d / m.
- Returns:
darcy_friction_factor (float) – Darcy friction factor \(\lambda\) / 1
Note
Laminar flow (\(re \leq 2320\))
\[\lambda = \frac{64}{re}\]turbulent flow (\(re > 2320\))
hydraulically smooth: \(\frac{re \cdot k_{s}}{d} < 65\)
\[\begin{split}\lambda = \begin{cases} 0.03164 \cdot re^{-0.25} & re \leq 10^4\\ \left(1.8 \cdot \log \left(re\right) -1.5 \right)^{-2} & 10^4 < re < 10^6\\ solve \left(0 = 2 \cdot \log\left(re \cdot \sqrt{\lambda} \right) -0.8 - \frac{1}{\sqrt{\lambda}}\right) & re \geq 10^6\\ \end{cases}\end{split}\]transition zone and hydraulically rough:
\[\lambda = solve \left( 0 = 2 \cdot \log \left( \frac{2.51}{re \cdot \sqrt{\lambda}} + \frac{k_{s}}{d \cdot 3.71} \right) - \frac{1}{\sqrt{\lambda}} \right)\]Reference: [44].
Example
Calculate the Darcy friction factor at different hydraulic states.
>>> from tespy.tools.fluid_properties.helpers import darcy_friction_factor >>> ks = 5e-5 >>> d = 0.05 >>> re_laminar = 2000 >>> re_turb_smooth = 5000 >>> re_turb_trans = 70000 >>> re_high = 1000000 >>> d_high = 0.8 >>> re_very_high = 6000000 >>> d_very_high = 1 >>> ks_low = 1e-5 >>> ks_rough = 1e-3 >>> darcy_friction_factor(re_laminar, ks, d) 0.032 >>> round(darcy_friction_factor(re_turb_smooth, ks, d), 3) 0.038 >>> round(darcy_friction_factor(re_turb_trans, ks, d), 3) 0.023 >>> round(darcy_friction_factor(re_turb_trans, ks_rough, d), 3) 0.049 >>> round(darcy_friction_factor(re_high, ks, d_high), 3) 0.012 >>> round(darcy_friction_factor(re_very_high, ks_low, d_very_high), 3) 0.009
- tespy.tools.fluid_properties.helpers.fit_incompressible_linear(temperature: ndarray, y: ndarray) tuple[source]¶
- tespy.tools.fluid_properties.helpers.fit_incompressible_viscosity(temperature: ndarray, viscosity: ndarray) tuple[source]¶
- tespy.tools.fluid_properties.helpers.fluid_structure(fluid)[source]¶
Return the checmical formula of fluid.
- Parameters:
fluid (str) – Name of the fluid.
- Returns:
parts (dict) – Dictionary of the chemical base elements as keys and the number of atoms in a molecule as values.
Example
Get the chemical formula of methane.
>>> from tespy.tools.fluid_properties.helpers import fluid_structure >>> elements = fluid_structure('methane') >>> elements['C'], elements['H'] (1, 4)
- tespy.tools.fluid_properties.helpers.hanakov(re)[source]¶
Calculate friction coefficient according to Hanakov.
- Parameters:
re (float) – Reynolds number.
- Returns:
darcy_friction_factor (float) – Darcy friction factor.
- tespy.tools.fluid_properties.helpers.inverse_temperature_mixture(p=None, target_value=None, fluid_data=None, T0=None, f=None)[source]¶
- tespy.tools.fluid_properties.helpers.prandtl_karman(reynolds, darcy_friction_factor, **kwargs)[source]¶
Calculate friction coefficient according to Prandtl and v. Kármán.
Applied in smooth conditions.
- Parameters:
re (float) – Reynolds number.
darcy_friction_factor (float) – Darcy friction factor.
- Returns:
darcy_friction_factor (float) – Darcy friction factor.
tespy.tools.fluid_properties.mixtures module¶
Module for fluid property mixture routines.
This file is part of project TESPy (github.com/oemof/tespy). It’s copyrighted by the contributors recorded in the version control history of the file, available from its original location tespy/tools/fluid_properties/mixtures.py
SPDX-License-Identifier: MIT
- class tespy.tools.fluid_properties.mixtures.MixingRuleRegistry[source]¶
Bases:
objectRegistry of mixing rule functions for multi-component fluid properties.
Use
register()to add custom mixing rules at runtime.Example
Register a custom enthalpy mixing rule:
>>> def my_h_pT(p, T, fluid_data, **kwargs): ... >>> MIXING_RULES.register("my-rule", h_pT=my_h_pT)
- register(name, *, h_pT=None, s_pT=None, v_pT=None, viscosity_pT=None, T_ph_inversion=True, T_ps_inversion=True)[source]¶
Register a mixing rule.
- Parameters:
name (str) – Mixing rule identifier used as the mixing_rule argument.
h_pT (callable, optional) –
h(p, T, fluid_data, **kwargs) -> floats_pT (callable, optional) –
s(p, T, fluid_data, **kwargs) -> floatv_pT (callable, optional) –
v(p, T, fluid_data, **kwargs) -> floatviscosity_pT (callable, optional) –
visc(p, T, fluid_data, **kwargs) -> floatT_ph_inversion (bool) – When True (default), h_pT is also registered as the Newton residual for
T(p, h)inversion. Set to False when the function is not monotonic in T (e.g."forced-gas").T_ps_inversion (bool) – Analogous flag for
T(p, s)inversion via s_pT.
- tespy.tools.fluid_properties.mixtures.cond_check(p, T, fluid_data, water_alias)[source]¶
Check if water is partially condensing in gaseous mixture.
- Parameters:
p (float) – pressure of mixture
T (float) – temperature of mixture
fluid_data (dict) – Dictionary of fluid data:
{fluid_name: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}water_alias (str) – label of the water in the fluid_data dictionary
- Returns:
tuple – Tuple containing gas phase mass specific and molar specific compositions and overall liquid water mass fraction, as well as saturation pressure of water and partial pressure of water in gas phase
- tespy.tools.fluid_properties.mixtures.h_mix_pT_forced_gas(p, T, fluid_data, **kwargs)[source]¶
Calculate specific enthalpy treating all H2O as gas phase.
Like
h_mix_pT_ideal(), but forces the water component to be evaluated as saturated vapour whenever the temperature is at or below the saturation point at the water partial pressure.- Parameters:
p (float) – Pressure in Pa.
T (float) – Temperature in K.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.**kwargs – Ignored; present for interface compatibility.
- Returns:
float – Specific enthalpy in J/kg.
Notes
For all components other than H2O the partial-pressure enthalpy is used:
\[h_i = h_i(p_i, T), \quad p_i = p \cdot y_i\]For H2O, when \(T \le T_\text{sat}(p_\text{H2O})\), the saturated vapour enthalpy is substituted:
\[h_\text{H2O} = h_\text{H2O}(Q{=}1,\,T)\]The mixture enthalpy is:
\[h_\text{mix}(p, T) = \sum_i x_i \cdot h_i\]
- tespy.tools.fluid_properties.mixtures.h_mix_pT_humidair(p, T, fluid_data, **kwargs)[source]¶
Calculate specific enthalpy of a humid-air mixture.
Delegates to
CoolProp.CoolProp.HAPropsSI()using the humidity ratio obtained fromw_mix_pT_humidair().- Parameters:
p (float) – Pressure in Pa.
T (float) – Temperature in K.
fluid_data (dict) – Fluid property data containing H2O and air components.
**kwargs – Forwarded to
w_mix_pT_humidair().
- Returns:
float – Specific enthalpy in J/kg.
- tespy.tools.fluid_properties.mixtures.h_mix_pT_ideal(p=None, T=None, fluid_data=None, **kwargs)[source]¶
Calculate specific enthalpy of an ideal gas mixture.
Applies Dalton’s law to assign partial pressures and sums the mass-fraction-weighted component enthalpies.
- Parameters:
p (float) – Pressure in Pa.
T (float) – Temperature in K.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.**kwargs – Ignored; present for interface compatibility.
- Returns:
float – Specific enthalpy in J/kg.
Notes
Molar fractions are derived from mass fractions:
\[y_i = \frac{x_i / M_i}{\sum_j x_j / M_j}\]Each component is evaluated at its partial pressure \(p_i = p \cdot y_i\). The mixture enthalpy is:
\[h_\text{mix}(p, T) = \sum_i x_i \cdot h_i(p_i, T)\]
- tespy.tools.fluid_properties.mixtures.h_mix_pT_ideal_cond(p=None, T=None, fluid_data=None, **kwargs)[source]¶
Calculate specific enthalpy of an ideal gas mixture with water condensation.
Extends
h_mix_pT_ideal()by checking whether the water vapour partial pressure exceeds the saturation pressure at T. If condensation occurs the water content is split between a saturated gas phase and a liquid phase, and the enthalpy is computed accordingly.- Parameters:
p (float) – Pressure in Pa.
T (float) – Temperature in K.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.**kwargs – Ignored; present for interface compatibility.
- Returns:
float – Specific enthalpy in J/kg.
Notes
If no H2O is present, or the water partial pressure is below saturation, the result equals
h_mix_pT_ideal().When \(p_\text{sat}(T) < p \cdot y_\text{H2O}\), the liquid water mass fraction \(x_\text{liq}\) is determined by
cond_check(). The enthalpy is then:\[h_\text{mix} = x_\text{liq} \cdot h_\text{H2O}(Q{=}0,\,T) + (1 - x_\text{liq}) \left[ x_\text{H2O}^\text{gas} \cdot h_\text{H2O}(Q{=}1,\,T) + \sum_{i \neq \text{H2O}} x_i^\text{gas} \cdot h_i\!\left(p_i^\text{gas},\,T\right) \right]\]where \(x_i^\text{gas}\) and \(p_i^\text{gas}\) are the gas-phase mass fractions and partial pressures after condensate removal.
- tespy.tools.fluid_properties.mixtures.h_mix_pT_incompressible(p, T, fluid_data, **kwargs)[source]¶
Calculate specific enthalpy of an incompressible mixture.
Each component is evaluated at the full mixture pressure (no partial pressure splitting) and contributions are summed by mass fraction.
- Parameters:
p (float) – Pressure in Pa.
T (float) – Temperature in K.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.**kwargs – Ignored; present for interface compatibility.
- Returns:
float – Specific enthalpy in J/kg.
Notes
\[h_\text{mix}(p, T) = \sum_i x_i \cdot h_i(p, T)\]
- tespy.tools.fluid_properties.mixtures.s_mix_pT_humidair(p, T, fluid_data, **kwargs)[source]¶
Calculate specific entropy of a humid-air mixture.
Delegates to
CoolProp.CoolProp.HAPropsSI()using the humidity ratio obtained fromw_mix_fluid_data().- Parameters:
p (float) – Pressure in Pa.
T (float) – Temperature in K.
fluid_data (dict) – Fluid property data containing H2O and air components.
**kwargs – Ignored; present for interface compatibility.
- Returns:
float – Specific entropy in J/(kg K).
- tespy.tools.fluid_properties.mixtures.s_mix_pT_ideal(p=None, T=None, fluid_data=None, **kwargs)[source]¶
Calculate specific entropy of an ideal gas mixture.
Applies Dalton’s law to assign partial pressures and sums the mass-fraction-weighted component entropies.
- Parameters:
p (float) – Pressure in Pa.
T (float) – Temperature in K.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.**kwargs – Ignored; present for interface compatibility.
- Returns:
float – Specific entropy in J/(kg K).
Notes
Molar fractions are derived from mass fractions:
\[y_i = \frac{x_i / M_i}{\sum_j x_j / M_j}\]Each component is evaluated at its partial pressure \(p_i = p \cdot y_i\). The mixture entropy is:
\[s_\text{mix}(p, T) = \sum_i x_i \cdot s_i(p_i, T)\]
- tespy.tools.fluid_properties.mixtures.s_mix_pT_ideal_cond(p=None, T=None, fluid_data=None, **kwargs)[source]¶
Calculate specific entropy of an ideal gas mixture with water condensation.
Extends
s_mix_pT_ideal()by checking whether the water vapour partial pressure exceeds the saturation pressure at T. If condensation occurs the water content is split between a saturated gas phase and a liquid phase, and the entropy is computed accordingly.- Parameters:
p (float) – Pressure in Pa.
T (float) – Temperature in K.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.**kwargs – Ignored; present for interface compatibility.
- Returns:
float – Specific entropy in J/(kg K).
Notes
If no H2O is present, or the water partial pressure is below saturation, the result equals
s_mix_pT_ideal().When \(p_\text{sat}(T) < p \cdot y_\text{H2O}\), the liquid water mass fraction \(x_\text{liq}\) is determined by
cond_check(). The entropy is then:\[s_\text{mix} = x_\text{liq} \cdot s_\text{H2O}(Q{=}0,\,T) + (1 - x_\text{liq}) \left[ x_\text{H2O}^\text{gas} \cdot s_\text{H2O}(Q{=}1,\,T) + \sum_{i \neq \text{H2O}} x_i^\text{gas} \cdot s_i\!\left(p_i^\text{gas},\,T\right) \right]\]where \(x_i^\text{gas}\) and \(p_i^\text{gas}\) are the gas-phase mass fractions and partial pressures after condensate removal.
- tespy.tools.fluid_properties.mixtures.s_mix_pT_incompressible(p=None, T=None, fluid_data=None, **kwargs)[source]¶
Calculate specific entropy of an incompressible mixture.
Each component is evaluated at the full mixture pressure (no partial pressure splitting) and contributions are summed by mass fraction.
- Parameters:
p (float) – Pressure in Pa.
T (float) – Temperature in K.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.**kwargs – Ignored; present for interface compatibility.
- Returns:
float – Specific entropy in J/(kg K).
Notes
\[s_\text{mix}(p, T) = \sum_i x_i \cdot s_i(p, T)\]
- tespy.tools.fluid_properties.mixtures.v_mix_pT_humidair(p, T, fluid_data, **kwargs)[source]¶
Calculate specific volume of a humid-air mixture.
Delegates to
CoolProp.CoolProp.HAPropsSI()using the humidity ratio obtained fromw_mix_fluid_data().- Parameters:
p (float) – Pressure in Pa.
T (float) – Temperature in K.
fluid_data (dict) – Fluid property data containing H2O and air components.
**kwargs – Ignored; present for interface compatibility.
- Returns:
float – Specific volume in m³/kg.
- tespy.tools.fluid_properties.mixtures.v_mix_pT_ideal(p=None, T=None, fluid_data=None, **kwargs)[source]¶
Calculate specific volume of an ideal gas mixture.
Sums the partial densities evaluated at each component’s partial pressure and returns the reciprocal.
- Parameters:
p (float) – Pressure in Pa.
T (float) – Temperature in K.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.**kwargs – Ignored; present for interface compatibility.
- Returns:
float – Specific volume in m³/kg.
Notes
Using Dalton’s law, each component contributes its density at its partial pressure \(p_i = p \cdot y_i\):
\[ \begin{align}\begin{aligned}\rho_\text{mix}(p, T) = \sum_i \rho_i(p_i, T)\\v_\text{mix} = \frac{1}{\rho_\text{mix}}\end{aligned}\end{align} \]
- tespy.tools.fluid_properties.mixtures.v_mix_pT_ideal_cond(p=None, T=None, fluid_data=None, **kwargs)[source]¶
Calculate specific volume of an ideal gas mixture with water condensation.
Extends
v_mix_pT_ideal()by checking whether the water vapour partial pressure exceeds the saturation pressure at T. If condensation occurs the water content is split between a saturated gas phase and a liquid phase, and the specific volume is computed accordingly.- Parameters:
p (float) – Pressure in Pa.
T (float) – Temperature in K.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.**kwargs – Ignored; present for interface compatibility.
- Returns:
float – Specific volume in m³/kg.
Notes
If no H2O is present, or the water partial pressure is below saturation, the result equals
v_mix_pT_ideal().When \(p_\text{sat}(T) < p \cdot y_\text{H2O}\), the liquid water mass fraction \(x_\text{liq}\) is determined by
cond_check(). The mixture density is then:\[ \begin{align}\begin{aligned}\rho_\text{mix} = x_\text{liq} \cdot \rho_\text{H2O}(Q{=}0,\,T) + (1 - x_\text{liq}) \left[ \rho_\text{H2O}(Q{=}1,\,T) + \sum_{i \neq \text{H2O}} \rho_i\!\left(p_i^\text{gas},\,T\right) \right]\\v_\text{mix} = \frac{1}{\rho_\text{mix}}\end{aligned}\end{align} \]
- tespy.tools.fluid_properties.mixtures.v_mix_pT_incompressible(p=None, T=None, fluid_data=None, **kwargs)[source]¶
Calculate specific volume of an incompressible mixture.
Applies volume additivity: each component’s specific volume is weighted by its mass fraction and contributions are summed.
- Parameters:
p (float) – Pressure in Pa.
T (float) – Temperature in K.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.**kwargs – Ignored; present for interface compatibility.
- Returns:
float – Specific volume in m³/kg.
Notes
\[v_\text{mix}(p, T) = \sum_i x_i \cdot v_i(p, T)\]
- tespy.tools.fluid_properties.mixtures.viscosity_mix_pT_humidair(p, T, fluid_data, **kwargs)[source]¶
Calculate dynamic viscosity of a humid-air mixture.
Delegates to
CoolProp.CoolProp.HAPropsSI()using the humidity ratio obtained fromw_mix_fluid_data().- Parameters:
p (float) – Pressure in Pa.
T (float) – Temperature in K.
fluid_data (dict) – Fluid property data containing H2O and air components.
**kwargs – Ignored; present for interface compatibility.
- Returns:
float – Dynamic viscosity in Pa s.
- tespy.tools.fluid_properties.mixtures.viscosity_mix_pT_ideal(p=None, T=None, fluid_data=None, **kwargs)[source]¶
Calculate dynamic viscosity from pressure and temperature.
- Parameters:
flow (list) – Fluid property vector containing mass flow, pressure, enthalpy and fluid composition.
T (float) – Temperature T / K.
- Returns:
visc (float) – Dynamic viscosity visc / Pa s.
Note
Calculation for fluid mixtures.
\[\begin{split}\eta_{mix}(p,T)=\frac{\sum_{i} \left( \eta(p,T,fluid_{i}) \cdot y_{i} \cdot \sqrt{M_{i}} \right)} {\sum_{i} \left(y_{i} \cdot \sqrt{M_{i}} \right)}\; \forall i \in \text{fluid components}\\ y: \text{volume fraction}\\ M: \text{molar mass}\end{split}\]Reference: [45].
- tespy.tools.fluid_properties.mixtures.viscosity_mix_pT_incompressible(p=None, T=None, fluid_data=None, **kwargs)[source]¶
Calculate dynamic viscosity of an incompressible mixture.
Applies a simple mass-fraction-weighted average of the component viscosities at the full mixture pressure.
- Parameters:
p (float) – Pressure in Pa.
T (float) – Temperature in K.
fluid_data (dict) – Fluid property data:
{fluid: {"mass_fraction": float, "wrapper": FluidPropertyWrapper}}.**kwargs – Ignored; present for interface compatibility.
- Returns:
float – Dynamic viscosity in Pa s.
Notes
\[\eta_\text{mix}(p, T) = \sum_i x_i \cdot \eta_i(p, T)\]
- tespy.tools.fluid_properties.mixtures.w_mix_fluid_data(fluid_data)[source]¶
Return the humidity ratio of a moist-air mixture from fluid composition.
- Parameters:
fluid_data (dict) – Fluid property data containing H2O and air components.
- Returns:
float – Humidity ratio in kgwater / kgdry air.
Notes
\[w = \frac{x_\text{H2O}}{x_\text{air}}\]
- tespy.tools.fluid_properties.mixtures.w_mix_pT_humidair(p, T, fluid_data, **kwargs)[source]¶
Return effective humidity ratio for a humid-air mixture at given p and T.
Compares the mixture humidity ratio derived from fluid_data with the saturation limit at RH = 1 and caps it if condensation would occur.
- Parameters:
p (float) – Pressure in Pa.
T (float) – Temperature in K.
fluid_data (dict) – Fluid property data containing H2O and air components.
**kwargs – Ignored; present for interface compatibility.
- Returns:
float – Humidity ratio in kgwater / kgdry air.
Notes
\[w = \min\!\left(w_\text{fluid\_data},\; w_\text{sat}(p, T)\right)\]where \(w_\text{sat}(p, T) = w(p, T, \text{RH}{=}1)\).
- tespy.tools.fluid_properties.mixtures.w_mix_pTrh_humidair(p, T, rh)[source]¶
Return humidity ratio at given pressure, temperature and relative humidity.
Thin wrapper around
CoolProp.CoolProp.HAPropsSI().- Parameters:
p (float) – Pressure in Pa.
T (float) – Temperature in K.
rh (float) – Relative humidity (0–1).
- Returns:
float – Humidity ratio in kgwater / kgdry air.
- tespy.tools.fluid_properties.mixtures.w_mix_ph_humidair(p, h, fluid_data, **kwargs)[source]¶
Return effective humidity ratio for a humid-air mixture at given p and h.
Compares the mixture humidity ratio derived from fluid_data with the saturation limit at RH = 1 and caps it if condensation would occur.
- Parameters:
p (float) – Pressure in Pa.
h (float) – Specific enthalpy in J/kg.
fluid_data (dict) – Fluid property data containing H2O and air components.
**kwargs – Ignored; present for interface compatibility.
- Returns:
float – Humidity ratio in kgwater / kgdry air.
Notes
\[w = \min\!\left(w_\text{fluid\_data},\; w_\text{sat}(p, h)\right)\]where \(w_\text{sat}(p, h) = w(p, h, \text{RH}{=}1)\).
- tespy.tools.fluid_properties.mixtures.w_mix_phrh_humidair(p, h, rh)[source]¶
Return humidity ratio at given pressure, enthalpy and relative humidity.
Thin wrapper around
CoolProp.CoolProp.HAPropsSI().- Parameters:
p (float) – Pressure in Pa.
h (float) – Specific enthalpy in J/kg.
rh (float) – Relative humidity (0–1).
- Returns:
float – Humidity ratio in kgwater / kgdry air.
- tespy.tools.fluid_properties.mixtures.w_mix_ps_humidair(p, s, fluid_data, **kwargs)[source]¶
Return effective humidity ratio for a humid-air mixture at given p and s.
Compares the mixture humidity ratio derived from fluid_data with the saturation limit at RH = 1 and caps it if condensation would occur.
- Parameters:
p (float) – Pressure in Pa.
s (float) – Specific entropy in J/(kg K).
fluid_data (dict) – Fluid property data containing H2O and air components.
**kwargs – Ignored; present for interface compatibility.
- Returns:
float – Humidity ratio in kgwater / kgdry air.
Notes
\[w = \min\!\left(w_\text{fluid\_data},\; w_\text{sat}(p, s)\right)\]where \(w_\text{sat}(p, s) = w(p, s, \text{RH}{=}1)\).
- tespy.tools.fluid_properties.mixtures.w_mix_psrh_humidair(p, s, rh)[source]¶
Return humidity ratio at given pressure, entropy and relative humidity.
Thin wrapper around
CoolProp.CoolProp.HAPropsSI().- Parameters:
p (float) – Pressure in Pa.
s (float) – Specific entropy in J/(kg K).
rh (float) – Relative humidity (0–1).
- Returns:
float – Humidity ratio in kgwater / kgdry air.
tespy.tools.fluid_properties.wrappers module¶
Module for fluid property wrappers.
This file is part of project TESPy (github.com/oemof/tespy). It’s copyrighted by the contributors recorded in the version control history of the file, available from its original location tespy/tools/fluid_properties/wrappers.py
SPDX-License-Identifier: MIT
- class tespy.tools.fluid_properties.wrappers.CoolPropWrapper(fluid, back_end=None, **kwargs)[source]¶
Bases:
FluidPropertyWrapper
- class tespy.tools.fluid_properties.wrappers.FluidPropertyWrapper(fluid, back_end=None, **kwargs)[source]¶
Bases:
object
- class tespy.tools.fluid_properties.wrappers.IAPWSWrapper(fluid, back_end=None, **kwargs)[source]¶
Bases:
FluidPropertyWrapper
- class tespy.tools.fluid_properties.wrappers.IncompressibleFluidWrapper(fluid, back_end=None, **kwargs)[source]¶
Bases:
FluidPropertyWrapperClass to represent a fluid in TESPy using tabular data
- Parameters:
fluid (str) – Name of fluid
back_end (str, optional) – Name of the back end in context of CoolProp, by default None
temperature_data (np.ndarray) – Array of temperature measurements in SI units (Kelvin)
density_data (np.ndarray) – Array of corresponding density values in SI units (kg/m3)
heat_capacity_data (np.ndarray) – Array of corresponding heat capacity values in SI units (J/kg)
viscosity_data (np.ndarray) – Array of corresponding dynamic viscosity values in SI units (Pas)
conductivity_data (np.ndarray) – Array of corresponding thermal conductivity values in SI units (W/mK)
- class tespy.tools.fluid_properties.wrappers.PyromatWrapper(fluid, back_end=None, **kwargs)[source]¶
Bases:
FluidPropertyWrapper