diff --git a/.gitignore b/.gitignore index d8fc1a9..1ef042a 100644 --- a/.gitignore +++ b/.gitignore @@ -110,3 +110,4 @@ venv.bak/ *.todo /extern_docs .vscode/ +docs/source/README.md \ No newline at end of file diff --git a/README.md b/README.md index 75f1c55..ebf8180 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,22 @@ -# XSteam +# pyXSteam -Original Released by Magnus Holmgren for Matlab and Excel: - and/or +pyXSteam is a Python library designed for calculating thermodynamic properties of water and steam based on the [IAPWS](http://www.iapws.org) (International Association for the Properties of Water and Steam) formulations. -At [this github repository](https://github.com/stu314159/xsteam) you can find the/a matlab version. +This library was ported from the original Matlab released by Magnus Holmgren. The original can be founbd at [Sourceforge](http://xsteam.sourceforge.net) and/or . -XSteam provides (mostly) accurate steam and water properties from 0 - -1000 bar and from 0 - 2000 °C according to the [IAPWS release IF-97](http://www.iapws.org/relguide/IF97-Rev.pdf). For -accuracy of the functions in different regions see IF-97 Page 4 +pyXSteam and XSteam provide (mostly) accurate steam and water properties from 0 - 1000 bar and from 0 - 2000 °C according to the [IAPWS release IF-97 (R7-97(2012))](http://www.iapws.org/relguide/IF97-Rev.pdf) . For accuracy of the functions in different regions see IF-97 Page 4. We take no responsibilities for any errors in the code or damage thereby! -Also includes thermal conductivity and viscosity, which are not part of -the IF97 release. -* Thermal Conductivity: IAPWS R15-11 -* Viscosity: IAPWS R12-08 -* Surface Tension: IAPWS R1-76(2014) +Also included are functions for thermal conductivity and viscosity which are not part of R7-97(2012). + - [IAPWS R15-11: Thermal Conductivity of Ordinary Water Substance](http://www.iapws.org/relguide/ThCond.pdf) + - [IAPWS R12-08: Viscosity of Ordinary Water Substance](http://www.iapws.org/relguide/visc.pdf) + - [IAPWS R1-76(2014): Surface Tension of Ordinary Water Substance](https://www.iapws.org/relguide/Surf-H2O-2014.pdf) -Some effort has been made to include the refined function of more recent releases -and also functions for calculations on heavy water. This includes: -* IAPWS R4 -* Surface Tension: IAPWS R5-85(1994) -* IAPWS R14 +Some effort has been made to include the refined function of more recent releases and also functions for calculations on heavy water. This implementation is still in progress, these function should not be used. This includes: + + - IAPWS R4 (deprecated) + - IAPWS R5-85(1994) + - IAPWS R14 ## Contributors @@ -32,75 +28,107 @@ In chronological order: - gonmolina - xjtu-blacksmith +## Documentation -## Requirements +Check out [pyXSteam at readthedocs](https://pyxsteam.readthedocs.io) -There are no requirements for installing pyXSteam with Python 3.6 and up. +## Requirements -Tests require numpy, demos require numpy and matplotlib +There are no requirements for installing pyXSteam with Python 3.8 and up. The demos require `numpy` and `matplotlib`. -## Install +### Tests -run `python3 setup.py install` +Tests require `pytest` and `numpy` -To run unittests you need two additional packages: `pytest` and `numpy`. After installing both, just run pytest in -the base directory. The tests use some fixed values from the documentation to make sure that every coefficient -and formula works as intended. +## Install -To test if setup was successful, run `python3 bin/pyXSteamDemo.py`. This will require numpy and matplotlib to be installed. +run `pip install pyXSteam` -## Nomenclature +To run unittests you need two additional packages: `pytest` and `numpy`. After installing both, just run pytest in the base directory. The tests use some fixed values from the documentation to make sure that every coefficient and formula works as intended. -All Functions follow the same naming schema: First the wanted property, -then a underscore `_`, then the wanted input properties Example: -`t_ph` is temperature as a function of pressure and enthalpy. For a list -of valid functions se below: - -| Property | Description | -|----------|--------------------------------------------------------------| -| t | Temperature (°C or °F) | -| p | Pressure (bar or psi) | -| h | Enthalpy (kJ/kg or btu/lb) | -| v | Specific volume (m3/kg or ft\^3/lb) | -| rho | Density (kg/m3 or lb/ft\^3) | -| s | Specific entropy (kJ/(kg °C) or btu/(lb °F)) | -| u | Specific internal energy (kJ/kg or btu/lb) | -| Cp | Specific isobaric heat capacity (kJ/(kg °C) or btu/(lb °F)) | -| Cv | Specific isochoric heat capacity (kJ/(kg °C) or btu/(lb °F)) | -| w | Speed of sound (m/s or ft/s) | -| my | Viscosity (N s/m\^2 or lbm/ft/hr) | -| tc | Thermal Conductivity (W/(m °C) or btu/(h ft °F)) | -| st | Surface Tension (N/m or lb/ft) | -| x | Vapor fraction | -| vx | Vapor Volume Fraction | +To test if setup was successful, run `pyXSteamDemo`. This will require numpy and matplotlib to be installed. ## Usage Simple Example: +``` from pyXSteam.XSteam import XSteam steamTable = XSteam(XSteam.UNIT_SYSTEM_MKS) print(steamTable.hL_p(220.0)) +``` By using the unitSystem Parameter, you can tell XSteam witch Unit System you are using. +``` steamTable = XSteam(XSteam.UNIT_SYSTEM_MKS) # m/kg/sec/°C/bar/W steamTable = XSteam(XSteam.UNIT_SYSTEM_FLS) # ft/lb/sec/°F/psi/btu steamTable = XSteam(XSteam.UNIT_SYSTEM_BARE) # m/kg/sec/K/MPa/W +``` To enable logging, add the following lines to your code: +``` import logging logging.basicConfig(level=logging.INFO) +``` or alternatively +``` import logging logger = logging.getLogger('pyXSteam') logger.setLevel(logging.DEBUG) sh = logging.StreamHandler() sh.setFormatter(logging.Formatter('%(name)s - %(levelname)s - %(message)s')) logger.addHandler(sh) +``` + +## Related projects + +Implementations of the IAPWS releases are also available for other programming languages: + +- Matlab and Excel: [xsteam](http://xsteam.sourceforge.net) +- Matlab: [xsteam](https://github.com/stu314159/xsteam) +- .NET: [XSteamNET](https://github.com/rogerlew/XSteamNET) + + +## Notes + +### Density (rho) + +Density is calculated as 1/v. See section for Specific volume + +### Viscosity + +Viscosity is not part of IAPWS Steam IF97. Equations from "Revised Release on the IAPWS Formulation 1985 for the Viscosity of Ordinary Water Substance", 2003 are used. Viscosity in the mixed region (4) is interpolated according to the density. This is not true since it will be two phases. + +### Thermal conductivity + +Revised release on the IAPS Formulation 1985 for the Thermal Conductivity of ordinary water substance (IAPWS 1998) + +## Nomenclature + +All Functions follow the same naming schema: First the wanted property, then a underscore `_`, then the wanted input properties Example: `t_ph` is temperature as a function of pressure and enthalpy. For a list of valid functions se below: + +| Property | Description | +|----------|--------------------------------------------------------------| +| t | Temperature (°C or °F) | +| p | Pressure (bar or psi) | +| h | Enthalpy (kJ/kg or btu/lb) | +| v | Specific volume (m3/kg or ft\^3/lb) | +| rho | Density (kg/m3 or lb/ft\^3) | +| s | Specific entropy (kJ/(kg °C) or btu/(lb °F)) | +| u | Specific internal energy (kJ/kg or btu/lb) | +| Cp | Specific isobaric heat capacity (kJ/(kg °C) or btu/(lb °F)) | +| Cv | Specific isochoric heat capacity (kJ/(kg °C) or btu/(lb °F)) | +| w | Speed of sound (m/s or ft/s) | +| my | Viscosity (N s/m\^2 or lbm/ft/hr) | +| tc | Thermal Conductivity (W/(m °C) or btu/(h ft °F)) | +| st | Surface Tension (N/m or lb/ft) | +| x | Vapor fraction | +| vx | Vapor Volume Fraction | + ## Available Functions @@ -241,25 +269,18 @@ or alternatively | x_ph | vapor fraction as a function of pressure and enthalpy | | x_ps | vapor fraction as a function of pressure and entropy | -## vapor volume fraction +### vapor volume fraction | Function | Description | |----------|--------------------------------------------------------------| | vx_ph | vapor volume fraction as a function of pressure and enthalpy | | vx_ps | vapor volume fraction as a function of pressure and entropy | -## Pressure along the Melting and Sublimation Curves -| Function | Description | -|--------------|--------------------------------------------------------------------| -| pmelt_t | Pressure along the melting curve as a function of temperature | -| vx_psubl_tps | Pressure along the sublimation curve as a function of temperature | - -# Available Functions for Heavy Water -| Function | Description | -|----------|---------------------------------------------------------------| -| my_rhoT | Viscosity as a function of density and temperature | -| tc_rhoT | Thermal conductivity as a function of density and temperature | - +### Pressure along the Melting and Sublimation Curves +| Function | Description | +|----------|--------------------------------------------------------------------| +| pmelt_t | Pressure along the melting curve as a function of temperature | +| psubl_t | Pressure along the sublimation curve as a function of temperature | -# Development +## Development - pull requests are always wellcome! - code style is enforced by black diff --git a/docs/Makefile b/docs/Makefile index 69fe55e..cf87ce8 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -16,4 +16,5 @@ help: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile + cp -f ../README.md ./source/ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index 2973740..b26022d 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -43,6 +43,7 @@ "sphinx.ext.autodoc", "sphinx.ext.githubpages", "sphinx_autodoc_typehints", + "myst_parser", ] # Add any paths that contain templates here, relative to this directory. @@ -67,7 +68,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = [] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] # The name of the Pygments (syntax highlighting) style to use. pygments_style = None @@ -186,6 +187,12 @@ # -- Extension configuration ------------------------------------------------- set_type_checking_flag = True -typehints_fully_qualified = True + +# -- Options for sphinx_autodoc_typehints ------------------------------------ +typehints_fully_qualified = False always_document_param_types = True typehints_document_rtype = True +typehints_use_rtype = True +typehints_defaults = "comma" +simplify_optional_unions = True +typehints_formatter = None diff --git a/docs/source/index.rst b/docs/source/index.rst index 4a32fd9..6334f79 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,82 +1,18 @@ -.. pyXSteam documentation master file, created by - sphinx-quickstart on Fri Mar 8 16:32:11 2019. - -Welcome to pyXSteam's documentation! -#################################### - -Original Released by Magnus Holmgren for Matlab and Excel: and/or - -XSteam provides (mostly) accurate steam and water properties from 0 - 1000 bar and from 0 - 2000 °C according to the [IAPWS release IF-97](http://www.iapws.org/relguide/IF97-Rev.pdf). For accuracy of the functions in different regions see IF-97 Page 4 - -Also includes thermal conductivity and viscosity, which are not part of the IF97 release. -* `Thermal Conductivity: (IAPWS 1998) `_ - -This Python Library is based on the original XSteam Library for Matlab and Excel from Magnus Holmgren, www.x-eng.com. We take no responsibilities for any errors in the code or damage thereby! - -See README.md for examples - -Some effort has been made to include the refined function of more recent releases and also functions for calculations on heavy water. This includes: -* IAPWS R4 -* IAPWS R14 - -Usage Examples -************** -Check out the examples given in :doc:`pyXSteamDemo` for a quick overview of how to use pyXSteam in different use cases. - -Notes -***** -Density (rho) -============= -Density is calculated as 1/v. See section for Specific volume - -Viscosity -========= -Viscosity is not part of IAPWS Steam IF97. Equations from "Revised Release on the IAPWS Formulation 1985 for the Viscosity of Ordinary Water Substance", 2003 are used. Viscosity in the mixed region (4) is interpolated according to the density. This is not true since it will be two phases. - -Thermal conductivity -==================== -Revised release on the IAPS Formulation 1985 for the Thermal Conductivity of ordinary water substance (IAPWS 1998) - -Nomenclature -============ -All Functions follow the same naming schema: First the wanted property, then a underscore `_`, then the wanted input properties Example: `t_ph` is temperature as a function of pressure and enthalpy. For a list of valid functions se below: - -======== ============================================================ -Property Description -======== ============================================================ -t Temperature (°C or °F) -p Pressure (bar or psi) -h Enthalpy (kJ/kg or btu/lb) -v Specific volume (m3/kg or ft\^3/lb)| -rho Density (kg/m3 or lb/ft\^3) -s Specific entropy (kJ/(kg °C) or btu/(lb °F)) -u Specific internal energy (kJ/kg or btu/lb) -Cp Specific isobaric heat capacity (kJ/(kg °C) or btu/(lb °F)) -Cv Specific isochoric heat capacity (kJ/(kg °C) or btu/(lb °F)) -w Speed of sound (m/s or ft/s) -my Viscosity (N s/m\^2 or lbm/ft/hr) -tc Thermal Conductivity (W/(m °C) or btu/(h ft °F)) -st Surface Tension (N/m or lb/ft) -x Vapor fraction -vx Vapor Volume Fraction -======== ============================================================ - -Related projects -================ - -Implementations of the IAPWS releases are also available for other programming languages: - -- Matlab: [xsteam](https://github.com/stu314159/xsteam) -- .NET: [XSteamNET](https://github.com/rogerlew/XSteamNET) +====================================== + Welcome to pyXSteam's documentation! +====================================== .. toctree:: :maxdepth: 2 :caption: Contents: - pyXSteamAvailibleFunctions + README.md pyXSteam pyXSteamDemo +.. automodule:: pyXSteam.XSteam + :noindex: + Indices and tables ================== diff --git a/docs/source/pyXSteamAvailibleFunctions.rst b/docs/source/pyXSteamAvailibleFunctions.rst deleted file mode 100644 index 667f5ac..0000000 --- a/docs/source/pyXSteamAvailibleFunctions.rst +++ /dev/null @@ -1,207 +0,0 @@ -Available Functions -################### - -Temperature -+++++++++++ -======== ================================================= -Function Description -======== ================================================= -tsat_p Saturation temperature -t_ph Temperature as a function of pressure and enthalpy -t_ps Temperature as a function of pressure and entropy -t_hs Temperature as a function of enthalpy and entropy -======== ================================================= - -Pressure -++++++++ -======== ================================================= -Function Description -======== ================================================= -psat_t Saturation pressure -p_hs Pressure as a function of h and s. -p_hrho Pressure as a function of h and rho. Very inaccurate for solid water region since it's almost incompressible! -======== ================================================= - -Enthalpy -++++++++ -======== ================================================= -Function Description -======== ================================================= -hV_p Saturated vapor enthalpy -hL_p Saturated liquid enthalpy -hV_t Saturated vapor enthalpy -hL_t Saturated liquid enthalpy -h_pt Enthalpy as a function of pressure and temperature -h_ps Enthalpy as a function of pressure and entropy -h_px Enthalpy as a function of pressure and vapor fraction -h_prho Enthalpy as a function of pressure and density. Observe for low temperatures (liquid) this equation has 2 solutions -h_tx Enthalpy as a function of temperature and vapor fraction -======== ================================================= - -Specific volume -+++++++++++++++ -======== ================================================= -Function Description -======== ================================================= -vV_p Saturated vapor volume -vL_p Saturated liquid volume -vV_t Saturated vapor volume -vL_t Saturated liquid volume -v_pt Specific volume as a function of pressure and temperature -v_ph Specific volume as a function of pressure and enthalpy -v_ps Specific volume as a function of pressure and entropy -======== ================================================= - -Density -+++++++ -======== ================================================= -Function Description -======== ================================================= -rhoV_p Saturated vapor density -rhoL_p Saturated liquid density -rhoV_t Saturated vapor density -rhoL_t Saturated liquid density -rho_pt Density as a function of pressure and temperature -rho_ph Density as a function of pressure and enthalpy -rho_ps Density as a function of pressure and entropy -======== ================================================= - -Specific entropy -++++++++++++++++ -======== ================================================= -Function Description -======== ================================================= -sV_p Saturated vapor entropy -sL_p Saturated liquid entropy -sV_t Saturated vapor entropy -sL_t Saturated liquid entropy -s_pt Specific entropy as a function of pressure and temperature (Returns saturated vapor enthalpy if mixture) -s_ph Specific entropy as a function of pressure and enthalpy -======== ================================================= - -Specific internal energy -++++++++++++++++++++++++ -======== ================================================= -Function Description -======== ================================================= -uV_p Saturated vapor internal energy -uL_p Saturated liquid internal energy -uV_t Saturated vapor internal energy -uL_t Saturated liquid internal energy -u_pt Specific internal energy as a function of pressure and temperature -u_ph Specific internal energy as a function of pressure and enthalpy -u_ps Specific internal energy as a function of pressure and entropy -======== ================================================= - -Specific isobaric heat capacity -+++++++++++++++++++++++++++++++ -======== ================================================= -Function Description -======== ================================================= -CpV_p Saturated vapor heat capacity -CpL_p Saturated liquid heat capacity -CpV_t Saturated vapor heat capacity -CpL_t Saturated liquid heat capacity -Cp_pt Specific isobaric heat capacity as a function of pressure and temperature -Cp_ph Specific isobaric heat capacity as a function of pressure and enthalpy -Cp_ps Specific isobaric heat capacity as a function of pressure and entropy -======== ================================================= - -Specific isochoric heat capacity -++++++++++++++++++++++++++++++++ -======== ================================================= -Function Description -======== ================================================= -CvV_p Saturated vapor isochoric heat capacity -CvL_p Saturated liquid isochoric heat capacity -CvV_t Saturated vapor isochoric heat capacity -CvL_t Saturated liquid isochoric heat capacity -Cv_pt Specific isochoric heat capacity as a function of pressure and temperature -Cv_ph Specific isochoric heat capacity as a function of pressure and enthalpy -Cv_ps Specific isochoric heat capacity as a function of pressure and entropy -======== ================================================= - -Speed of sound -++++++++++++++ -======== ================================================= -Function Description -======== ================================================= -wV_p Saturated vapor speed of sound -wL_p Saturated liquid speed of sound -wV_t Saturated vapor speed of sound -wL_t Saturated liquid speed of sound -w_pt Speed of sound as a function of pressure and temperature -w_ph Speed of sound as a function of pressure and enthalpy -w_ps Speed of sound as a function of pressure and entropy -======== ================================================= - -Viscosity -+++++++++ -======== ================================================= -Function Description -======== ================================================= -my_pt Viscosity as a function of pressure and temperature -my_ph Viscosity as a function of pressure and enthalpy -my_ps Viscosity as a function of pressure and entropy -======== ================================================= - -Thermal Conductivity -++++++++++++++++++++ -======== ================================================= -Function Description -======== ================================================= -tcL_p Saturated vapor thermal conductivity -tcV_p Saturated liquid thermal conductivity -tcL_t Saturated vapor thermal conductivity -tcV_t Saturated liquid thermal conductivity -tc_pt Thermal conductivity as a function of pressure and temperature -tc_ph Thermal conductivity as a function of pressure and enthalpy -tc_hs Thermal conductivity as a function of enthalpy and entropy -======== ================================================= - -Surface tension -+++++++++++++++ -======== ================================================= -Function Description -======== ================================================= -st_t Surface tension for two phase water/steam as a function of T -st_p Surface tension for two phase water/steam as a function of p -======== ================================================= - -vapor fraction -++++++++++++++ -======== ================================================= -Function Description -======== ================================================= -x_ph vapor fraction as a function of pressure and enthalpy -x_ps vapor fraction as a function of pressure and entropy -======== ================================================= - -vapor volume fraction -+++++++++++++++++++++ -======== ================================================= -Function Description -======== ================================================= -vx_ph vapor volume fraction as a function of pressure and enthalpy -vx_ps vapor volume fraction as a function of pressure and entropy -======== ================================================= - -Pressure along the Melting and Sublimation Curves -+++++++++++++++++++++++++++++++++++++++++++++++++ -======== ================================================= -Function Description -======== ================================================= -pmelt_t Pressure along the melting curve as a function of temperature -psubl_t Pressure along the sublimation curve as a function of temperature -======== ================================================= - - -Available Functions for Heavy Water -################################### - -======== ================================================= -Function Description -======== ================================================= -my_rhoT Viscosity as a function of density and temperature -tc_rhoT Thermal conductivity as a function of density and temperature -======== ================================================= diff --git a/docs/source/pyXSteamDemo.rst b/docs/source/pyXSteamDemo.rst index 4d74082..b0b14a4 100644 --- a/docs/source/pyXSteamDemo.rst +++ b/docs/source/pyXSteamDemo.rst @@ -34,7 +34,7 @@ By converting one to the functions to a NumPy universal function it is easy to u >>> npv_pt = np.frompyfunc(steam_table.v_pt, 2, 1) * `NumPy documentation for frombyfunc `_ -* `pyXSteamDemo.py `_ +* `pyXSteamDemo.py `_ Usage with pandas ================= @@ -67,7 +67,18 @@ Example: To draw a T(p) diagram showing the saturation curve:: pyplot.setp(line1, linewidth=1, color='b') pyplot.show() -For more demos, see `pyXSteamDemo.py `_ +For more demos, see `pyXSteamDemo.py `_ + +More Diagrams +------------- + +For even more examples of diagrams generated with pyXSteam, see the repositories by Richard J Smith + + - `steam-properties `_ + - `steam-cycles-Ideal `_ + - `steam-cycles-non-ideal `_ + - `steam-cycles-regenerative `_ + Heavy Water functions ===================== @@ -83,7 +94,7 @@ Content of the demo files Main demo file pyXSteamDemo.py ============================== -.. literalinclude:: ../../bin/pyXSteamDemo.py +.. literalinclude:: ../../pyXSteam/scripts/pyXSteamDemo.py :language: python Example on how to calculate the values for a rankine cycle @@ -91,5 +102,5 @@ Example on how to calculate the values for a rankine cycle Matlab example from converted example from Stu Blair converted to python Original can be found at `his github page `_ -.. literalinclude:: ../../bin/pyXSteamRankineDemo.py +.. literalinclude:: ../../pyXSteam/scripts/pyXSteamRankineDemo.py :language: python diff --git a/pyXSteam/Constants.py b/pyXSteam/Constants.py index 4355b3d..134ebd5 100755 --- a/pyXSteam/Constants.py +++ b/pyXSteam/Constants.py @@ -4,16 +4,15 @@ Constants for the calculation of water steam properties Sources: - -* IAPWS Industrial formulation 1997 for the Thermodynamic Properties of Water -and Steam, September 1997 - -* IAWPS Release on Values of Temperature, Pressure and Density of Ordinary and -Heavy Water Substances at their Respective Critical Points Released -September 1992, Revision of the Release of 1992 +* IAPWS Industrial formulation 1997 for the Thermodynamic Properties of Waterand Steam, September 1997 +* IAWPS R2-83(1992) Values of Temperature, Pressure and Density of Ordinary and Heavy Water Substances at their Respective Critical Points +* IAPWS R15-11 +* IAPWS R17 and IAPWS R18 +* https://doi.org/10.1063/1.5053993 """ from enum import IntEnum + SPECIFIC_GAS_CONSTANT = 0.461526 # kJ / (kg K) CRITICAL_TEMPERATURE = 647.096 # K CRITICAL_PRESSURE = 22.06395 # MPa @@ -24,10 +23,8 @@ FREEZING_TEMPERATURE_H2O = 273.15 # K -# IAWPS Release on Values of Temperature, Pressure and Density of Ordinary and -# Heavy Water Substances at their Respective Critical Points -# IAPWS R2-83(1992) -# Released September 1992, Revision of the Release of 1983 +# IAWPS R2-83(1992) Release on Values of Temperature, Pressure and Density of Ordinary and Heavy Water Substances at their +# Respective Critical Points, Released September 1992, Revision of the Release of 1983 # http://www.iapws.org/relguide/crits.pdf CRITICAL_TEMPERATURE_H20_1992 = 647.096 # +-0.1 K CRITICAL_PRESSURE_H20_1992 = 22.067 # +0.27*(+-0.1)+-0.005 MPa @@ -37,12 +34,10 @@ CRITICAL_PRESSURE_D20_1992 = 21.671 # +0.27*(+-0.2)+-0.01 MPa CRITICAL_DENSITY_D20_1992 = 356.0 # +-5 kg / m - # Other common constants used in calculations ABSOLUTE_ZERO_CELSIUS = -273.15 # °C ABSOLUTE_ZERO_FAHRENHEIT = -459.67 # °F - # IAPWS R15-11 __SPECIFIC_GAS_CONSTANT_IAPWS_R15_11__ = 0.46151805 # kJ kg^-1 K^-1 __CRITICAL_TEMPERATURE_IAPWS_R15_11__ = 647.096 # K diff --git a/pyXSteam/XSteam.py b/pyXSteam/XSteam.py index d0d9dc6..0267d32 100755 --- a/pyXSteam/XSteam.py +++ b/pyXSteam/XSteam.py @@ -1909,7 +1909,6 @@ def my_pt(self, p: float, t: float) -> float: Note: Viscosity is not part of IAPWS Steam IF97. Equations from "Revised Release on the IAPWS Formulation 1985 for the Viscosity of Ordinary Water Substance", 2003 are used. Viscosity in the mixed region (4) is interpolated according to the density. This is not true since it will be two phases. - Viscosity as a function of pressure and temperature :param p: preasure @@ -2301,12 +2300,10 @@ def pmelt_t(self, t: float, hint: IceType = IceType.NONE) -> float: `IceType.V` = 5 `IceType.VI` = 6 `IceType.VII` = 7 - If the hint is not one of the values above or None(Default), an Exception is - raised + If the hint is not one of the values above or None(Default), an Exception is raised :param t: temperature - :param hint: hint for the selection logic to decide which part of the melting - curve to use. For supported values see IceType + :param hint: hint for the selection logic to decide which part of the melting curve to use. For supported values see IceType :raises ValueError: unknown value for hint