exerpy 0.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. exerpy/__init__.py +12 -0
  2. exerpy/analyses.py +1711 -0
  3. exerpy/components/__init__.py +16 -0
  4. exerpy/components/combustion/__init__.py +0 -0
  5. exerpy/components/combustion/base.py +248 -0
  6. exerpy/components/component.py +126 -0
  7. exerpy/components/heat_exchanger/__init__.py +0 -0
  8. exerpy/components/heat_exchanger/base.py +449 -0
  9. exerpy/components/heat_exchanger/condenser.py +323 -0
  10. exerpy/components/heat_exchanger/simple.py +358 -0
  11. exerpy/components/heat_exchanger/steam_generator.py +264 -0
  12. exerpy/components/helpers/__init__.py +0 -0
  13. exerpy/components/helpers/cycle_closer.py +104 -0
  14. exerpy/components/nodes/__init__.py +0 -0
  15. exerpy/components/nodes/deaerator.py +318 -0
  16. exerpy/components/nodes/drum.py +164 -0
  17. exerpy/components/nodes/flash_tank.py +89 -0
  18. exerpy/components/nodes/mixer.py +332 -0
  19. exerpy/components/piping/__init__.py +0 -0
  20. exerpy/components/piping/valve.py +394 -0
  21. exerpy/components/power_machines/__init__.py +0 -0
  22. exerpy/components/power_machines/generator.py +168 -0
  23. exerpy/components/power_machines/motor.py +173 -0
  24. exerpy/components/turbomachinery/__init__.py +0 -0
  25. exerpy/components/turbomachinery/compressor.py +318 -0
  26. exerpy/components/turbomachinery/pump.py +310 -0
  27. exerpy/components/turbomachinery/turbine.py +351 -0
  28. exerpy/data/Ahrendts.json +90 -0
  29. exerpy/functions.py +637 -0
  30. exerpy/parser/__init__.py +0 -0
  31. exerpy/parser/from_aspen/__init__.py +0 -0
  32. exerpy/parser/from_aspen/aspen_config.py +61 -0
  33. exerpy/parser/from_aspen/aspen_parser.py +721 -0
  34. exerpy/parser/from_ebsilon/__init__.py +38 -0
  35. exerpy/parser/from_ebsilon/check_ebs_path.py +74 -0
  36. exerpy/parser/from_ebsilon/ebsilon_config.py +1055 -0
  37. exerpy/parser/from_ebsilon/ebsilon_functions.py +181 -0
  38. exerpy/parser/from_ebsilon/ebsilon_parser.py +660 -0
  39. exerpy/parser/from_ebsilon/utils.py +79 -0
  40. exerpy/parser/from_tespy/tespy_config.py +23 -0
  41. exerpy-0.0.1.dist-info/METADATA +158 -0
  42. exerpy-0.0.1.dist-info/RECORD +44 -0
  43. exerpy-0.0.1.dist-info/WHEEL +4 -0
  44. exerpy-0.0.1.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,79 @@
1
+ import functools
2
+ from typing import Any
3
+ from typing import Callable
4
+ from typing import TypeVar
5
+ from typing import cast
6
+
7
+ from exerpy.parser.from_ebsilon import __ebsilon_available__
8
+
9
+ # Type variable for the decorated function
10
+ F = TypeVar('F', bound=Callable[..., Any])
11
+
12
+ def require_ebsilon(func: F) -> F:
13
+ """
14
+ Decorator to ensure that Ebsilon functionality is available.
15
+
16
+ Args:
17
+ func: The function that requires Ebsilon functionality
18
+
19
+ Returns:
20
+ The wrapped function that checks for Ebsilon availability
21
+
22
+ Raises:
23
+ RuntimeError: If Ebsilon functionality is not available
24
+ """
25
+ @functools.wraps(func)
26
+ def wrapper(*args: Any, **kwargs: Any) -> Any:
27
+ if not __ebsilon_available__:
28
+ error_msg = (
29
+ "Ebsilon functionality is not available because the 'EBS' "
30
+ "environment variable is not set or EbsOpen could not be imported. "
31
+ "Please set the EBS environment variable to your Ebsilon installation path."
32
+ )
33
+ raise RuntimeError(error_msg)
34
+ return func(*args, **kwargs)
35
+
36
+ return cast(F, wrapper)
37
+
38
+
39
+ # Stub classes for when Ebsilon isn't available
40
+ class EpSubstanceStub:
41
+ """Stub class for EpSubstance when Ebsilon is not available."""
42
+ epSubstanceN2 = 0
43
+ epSubstanceO2 = 1
44
+ epSubstanceCO2 = 2
45
+ epSubstanceH2O = 3
46
+ epSubstanceAR = 4
47
+ # Add other substance constants as needed with placeholder values
48
+
49
+ @staticmethod
50
+ def get_substance_name(substance_id: int) -> str:
51
+ """Return placeholder substance name for the given ID."""
52
+ return f"Substance_{substance_id}"
53
+
54
+
55
+ class EpFluidTypeStub:
56
+ """Stub class for EpFluidType when Ebsilon is not available."""
57
+ epFluidTypeNONE = 0
58
+ epFluidTypeAir = 1
59
+ epFluidTypeFluegas = 2
60
+ epFluidTypeSteam = 3
61
+ epFluidTypeWater = 4
62
+ # Add other fluid type constants as needed
63
+
64
+
65
+ class EpSteamTableStub:
66
+ """Stub class for EpSteamTable when Ebsilon is not available."""
67
+ epSteamTableFromSuperiorModel = 0
68
+
69
+
70
+ class EpGasTableStub:
71
+ """Stub class for EpGasTable when Ebsilon is not available."""
72
+ epGasTableFromSuperiorModel = 0
73
+
74
+
75
+ class EpCalculationResultStatus2Stub:
76
+ """Stub class for EpCalculationResultStatus2 when Ebsilon is not available."""
77
+ epCalculationResultStatus2OK = 0
78
+ epCalculationResultStatus2Warning = 1
79
+ epCalculationResultStatus2Error = 2
@@ -0,0 +1,23 @@
1
+ EXERPY_TESPY_MAPPINGS = {
2
+ "SteamTurbine": "Turbine",
3
+ "HeatExchanger": "HeatExchanger",
4
+ "MovingBoundaryHeatExchanger": "HeatExchanger",
5
+ "Desuperheater": "HeatExchanger",
6
+ "MovingBoundaryHeatExchanger": "HeatExchanger",
7
+ "Condenser": "Condenser",
8
+ "SimpleHeatExchanger": "SimpleHeatExchanger",
9
+ "ParabolicTrough": "SimpleHeatExchanger",
10
+ "Pipe": "SimpleHeatExchanger",
11
+ "SolarCollector": "SimpleHeatExchanger",
12
+ "CombustionChamber": "CombustionChamber",
13
+ "DiabaticCombustionChamber": "CombustionChamber",
14
+ "Valve": "Valve",
15
+ "Compressor": "Compressor",
16
+ "Pump": "Pump",
17
+ "Turbine": "Turbine",
18
+ "Merge": "Mixer",
19
+ "Generator": "Generator",
20
+ "Motor": "Motor",
21
+ "Drum": "Drum",
22
+ "CycleCloser": "CycleCloser",
23
+ }
@@ -0,0 +1,158 @@
1
+ Metadata-Version: 2.4
2
+ Name: exerpy
3
+ Version: 0.0.1
4
+ Summary: Exergy analysis for tabular input data
5
+ Author-email: Sergio Tomasinelli <s.tomasinelli@tu-berlin.de>, Robert Müller <robert.mueller.2@tu-berlin.de>, Francesco Witte <github@witte.sh>
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/x-rst
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Intended Audience :: Science/Research
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: Unix
13
+ Classifier: Operating System :: POSIX
14
+ Classifier: Operating System :: Microsoft :: Windows
15
+ Classifier: Operating System :: MacOS
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: Implementation :: CPython
22
+ Classifier: Topic :: Utilities
23
+ License-File: LICENSE
24
+ Requires-Dist: pandas
25
+ Requires-Dist: numpy
26
+ Requires-Dist: pywin32 ; extra == "aspen"
27
+ Requires-Dist: build ; extra == "dev"
28
+ Requires-Dist: flit ; extra == "dev"
29
+ Requires-Dist: furo ; extra == "dev"
30
+ Requires-Dist: isort ; extra == "dev"
31
+ Requires-Dist: pytest ; extra == "dev"
32
+ Requires-Dist: sphinx>=7.2.2 ; extra == "dev"
33
+ Requires-Dist: sphinx-copybutton ; extra == "dev"
34
+ Requires-Dist: sphinx-design ; extra == "dev"
35
+ Requires-Dist: sphinxcontrib.bibtex ; extra == "dev"
36
+ Requires-Dist: tespy ; extra == "dev"
37
+ Requires-Dist: tox ; extra == "dev"
38
+ Requires-Dist: pywin32 ; extra == "ebsilon"
39
+ Requires-Dist: tespy ; extra == "tespy"
40
+ Project-URL: Changelog, https://exerpy.readthedocs.io/en/latest/whats_new.html
41
+ Project-URL: Documentation, https://exerpy.readthedocs.io/
42
+ Project-URL: Homepage, https://github.com/oemof/exerpy
43
+ Project-URL: Issue Tracker, https://github.com/oemof/exerpy/issues
44
+ Provides-Extra: aspen
45
+ Provides-Extra: dev
46
+ Provides-Extra: ebsilon
47
+ Provides-Extra: tespy
48
+
49
+ #################################
50
+ ExerPy: Exergy Analysis in Python
51
+ #################################
52
+
53
+ ExerPy is a Python library designed to perform detailed exergy analysis of
54
+ energy conversion systems. It builds on the exergy analysis methodology
55
+ implemented in TESPy, while extending its capabilities to seamlessly integrate
56
+ with simulation tools such as Ebsilon Professional, Aspen Plus, and TESPy itself.
57
+ ExerPy enables engineers and researchers to identify inefficiencies and optimize
58
+ the performance of thermodynamic systems through automated workflows and
59
+ consistent data handling.
60
+
61
+ With its advanced features, ExerPy calculates both physical and chemical exergy,
62
+ allowing users to analyze both individual components and entire systems. This
63
+ helps to identify where and why exergy losses occur, facilitating strategies to improve
64
+ efficiency, reduce costs, and support sustainable energy usage.
65
+
66
+ .. figure:: https://raw.githubusercontent.com/oemof/exerpy/refs/heads/main/docs/_static/images/logo_exerpy_big.svg
67
+ :align: center
68
+
69
+ ************
70
+ Key Features
71
+ ************
72
+
73
+ - **Comprehensive Exergy Analysis**: Calculate physical and chemical exergy, perform component-level and system-wide analysis.
74
+ - **Flexible Integration**: Compatible with multiple simulation tools (Ebsilon Professional, Aspen Plus, TESPy).
75
+ - **Advanced Component Library**: Pre-built components for common energy system elements (turbines, heat exchangers, etc.).
76
+ - **Extensible Architecture**: Easy-to-use framework for implementing custom components and analysis methods.
77
+ - **Robust Data Handling**: Consistent fluid property models and automated data extraction from simulation tools.
78
+ - **Open Source**: MIT licensed, free for academic and commercial use.
79
+
80
+ ***************
81
+ Getting Started
82
+ ***************
83
+
84
+ ============
85
+ Installation
86
+ ============
87
+ You can install the latest version of ExerPy using pip:
88
+
89
+ .. code:: bash
90
+
91
+ pip install exerpy
92
+
93
+ ===================
94
+ Quick Start Example
95
+ ===================
96
+ Here's a simple example how to perform an exergy analysis using ExerPy:
97
+
98
+ .. code:: python
99
+
100
+ from exerpy import ExergyAnalysis
101
+
102
+ model_path = 'my_model.ebs'
103
+
104
+ ean = ExergyAnalysis.from_ebsilon(model_path, chemExLib='Ahrendts')
105
+
106
+ fuel = {"inputs": ['Fuel'], "outputs": []}
107
+ product = {"inputs": ['Power'], "outputs": []}
108
+
109
+ ean.analyse(E_F=fuel, E_P=product)
110
+ ean.exergy_results()
111
+
112
+ For more detailed tutorials and examples, see the
113
+ `online documentation <https://exerpy.readthedocs.io>`__.
114
+
115
+ ********
116
+ Citation
117
+ ********
118
+
119
+ If you use ExerPy in your scientific work, please consider citing it to support
120
+ ongoing development. You can cite ExerPy using the following BibTeX entry:
121
+
122
+ .. code::
123
+
124
+ @software{ExerPy,
125
+ author = {Tomasinelli, Sergio and Witte, Francesco and Müller, Robert},
126
+ title = {{ExerPy}: Exergy Analysis in Python},
127
+ note = {Supervision: Prof. Dr.-Ing. Fontina Petrakopoulou}
128
+ url = {https://github.com/oemof/exerpy},
129
+ version = {0.0.1},
130
+ year = {2025}
131
+ }
132
+
133
+ *******
134
+ License
135
+ *******
136
+
137
+ MIT License
138
+
139
+ Copyright (c) Sergio Tomasinelli
140
+
141
+ Permission is hereby granted, free of charge, to any person obtaining a copy
142
+ of this software and associated documentation files (the "Software"), to deal
143
+ in the Software without restriction, including without limitation the rights
144
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
145
+ copies of the Software, and to permit persons to whom the Software is
146
+ furnished to do so, subject to the following conditions:
147
+
148
+ The above copyright notice and this permission notice shall be included in all
149
+ copies or substantial portions of the Software.
150
+
151
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
152
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
153
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
154
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
155
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
156
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
157
+ SOFTWARE.
158
+
@@ -0,0 +1,44 @@
1
+ exerpy/__init__.py,sha256=a8a1TdAkXtgHwFSPnW5oSthAPUDWfscgMhXjhKGs3KM,280
2
+ exerpy/analyses.py,sha256=IXAtiJhVutig1PXIzPaxtL8BzetM4oDTmsvwYBQ_XA0,79098
3
+ exerpy/functions.py,sha256=STNgo7YyT0pZWSVOO0iJb_7Wh9qecNaujJF2eC6Jv7E,30142
4
+ exerpy/components/__init__.py,sha256=KbYJVGaQMlV1KqmQNOYLHa9cN1V9RicclwHPL3VieXU,709
5
+ exerpy/components/component.py,sha256=oWaE8WZ5t_RWlRjtPmgfzAxMO5UVDC3SlX9JPjBQ9hI,3899
6
+ exerpy/components/combustion/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ exerpy/components/combustion/base.py,sha256=oCI7pdSdU6rgHayHuHhgHM2gkjib3RmOTk3mORf0edY,10497
8
+ exerpy/components/heat_exchanger/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
+ exerpy/components/heat_exchanger/base.py,sha256=GDHKH22kLwdiDCDyvHz73uNIsXuBCEuAqyFetRghINw,23563
10
+ exerpy/components/heat_exchanger/condenser.py,sha256=QW2eULJEHNPcSsIcOow5NUZxxCZioIelSb4-pngIYn4,15365
11
+ exerpy/components/heat_exchanger/simple.py,sha256=0cvikDqES6WsM5Yp2AqnypnoC46Ld2LINTx4uadWnhc,16047
12
+ exerpy/components/heat_exchanger/steam_generator.py,sha256=dvA4kAJEANEt4GFvd8e7CEZCuGIrB87N6-11j0VZvxs,11336
13
+ exerpy/components/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
+ exerpy/components/helpers/cycle_closer.py,sha256=FY4K-HzNIfd3HiiPluoFDFcv-HD1rNdXdqfVZZ0cnzE,3898
15
+ exerpy/components/nodes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
+ exerpy/components/nodes/deaerator.py,sha256=vJiwV2gayeRx5LSXfGXaDsueItfJPrXLppQTZN1UsqQ,13392
17
+ exerpy/components/nodes/drum.py,sha256=VQHWDPICVI7zlqSO0n7V8dHGOTycZGs-5FVZASIPwFQ,7557
18
+ exerpy/components/nodes/flash_tank.py,sha256=y1e5hp8w_HcAo5IX_nsPleRcU0OcnRd55mScXUhtdR0,3582
19
+ exerpy/components/nodes/mixer.py,sha256=bijow9KF-7vHdSchkCaX3SnabwGqWmzkM756Fg8I-mU,14115
20
+ exerpy/components/piping/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
+ exerpy/components/piping/valve.py,sha256=SiBqVcWxV6WqGMICbXNPsC4mfpY4-zoFX06nMg7Ka_M,17006
22
+ exerpy/components/power_machines/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
+ exerpy/components/power_machines/generator.py,sha256=fmCs0jzsPqG26fvR1N9DV38T-032RwEIgnXAj1rXmVg,6227
24
+ exerpy/components/power_machines/motor.py,sha256=_K73bN0tjD6kz1fvUU9rWI8yAHsQqI9GHwyRYCDGWHg,6306
25
+ exerpy/components/turbomachinery/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
+ exerpy/components/turbomachinery/compressor.py,sha256=HmQdUaYN3rxoq7-GxqomCHWCHnthS7We748I0wMkcPs,14074
27
+ exerpy/components/turbomachinery/pump.py,sha256=t5ZrolL0gU5K6uTeQFrSqmM9qahCSR-h7W1lfnIrK6w,13469
28
+ exerpy/components/turbomachinery/turbine.py,sha256=K7NThlNAvKSjvFl_RVMlOuYdzd0uiVaX7ErVrNYoNvE,15667
29
+ exerpy/data/Ahrendts.json,sha256=Wy7iSBW2u9V_RSjI9nAAfqC9aMo2owNKnyf5ZRLxa0c,9263
30
+ exerpy/parser/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
+ exerpy/parser/from_aspen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
+ exerpy/parser/from_aspen/aspen_config.py,sha256=GkRJ7AZlglalPWXlbjM5eICLRG8CQuXOhF88zYzNAWM,1749
33
+ exerpy/parser/from_aspen/aspen_parser.py,sha256=QOrVIFeLBX8yvsoKUugDRjCYSxht2dKcpkSsZqXqLRc,38811
34
+ exerpy/parser/from_ebsilon/__init__.py,sha256=rzTkkko93YomWo0EYDnaPP5f7wITorcr5pztPwu54AI,1086
35
+ exerpy/parser/from_ebsilon/check_ebs_path.py,sha256=Ad49eggah8LQkn1hQrHjC_MAgeXkAlVd-YPrC2lpOpo,2618
36
+ exerpy/parser/from_ebsilon/ebsilon_config.py,sha256=7VPvPQrG6OBRI7cTKRSVDDr7-GZ6zKtmFRHcRxXOqvs,39520
37
+ exerpy/parser/from_ebsilon/ebsilon_functions.py,sha256=mY25RPnKJHvBBsqOI87JU7DH-EttdGdAy-eOVqqdd0U,6557
38
+ exerpy/parser/from_ebsilon/ebsilon_parser.py,sha256=AFfoBiKDTvWRa8hr9ViqmtCIog4QUQZwtYZDnA_tNlQ,31209
39
+ exerpy/parser/from_ebsilon/utils.py,sha256=HB3PyzSN_UqgiScY_Cr4gOPOJdcAjL6hJmgQl4P8-fg,2510
40
+ exerpy/parser/from_tespy/tespy_config.py,sha256=_e8YwJNKAw0O5WRpO92GtVhj-PNziAoYluoOurwI9zs,796
41
+ exerpy-0.0.1.dist-info/licenses/LICENSE,sha256=AZCjT0DYrLExG_BV3UJnoFG1z3CACPxBk-rgcm1as8s,1091
42
+ exerpy-0.0.1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
43
+ exerpy-0.0.1.dist-info/METADATA,sha256=-tnGmymLpxQ2kcpwgniWq5mPN1sei0L0FNEK7YVU16w,6119
44
+ exerpy-0.0.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: flit 3.12.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Sergio Tomasinelli
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.