tespy 0.3.1__tar.gz → 0.3.2__tar.gz

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 (162) hide show
  1. {TESPy-0.3.1 → TESPy-0.3.2}/PKG-INFO +3 -3
  2. TESPy-0.3.2/docs/whats_new/v0-3-2.rst +47 -0
  3. {TESPy-0.3.1 → TESPy-0.3.2}/docs/whats_new.rst +2 -1
  4. {TESPy-0.3.1 → TESPy-0.3.2}/setup.py +1 -1
  5. {TESPy-0.3.1 → TESPy-0.3.2}/src/TESPy.egg-info/PKG-INFO +3 -3
  6. {TESPy-0.3.1 → TESPy-0.3.2}/src/TESPy.egg-info/SOURCES.txt +1 -0
  7. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/__init__.py +1 -1
  8. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/components/heat_exchangers.py +4 -4
  9. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/connections.py +2 -2
  10. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/networks/network_reader.py +2 -2
  11. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/networks/networks.py +22 -8
  12. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/tools/fluid_properties.py +45 -64
  13. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/tools/global_vars.py +7 -0
  14. {TESPy-0.3.1 → TESPy-0.3.2}/tests/test_errors.py +0 -6
  15. {TESPy-0.3.1 → TESPy-0.3.2}/tests/test_tools/test_fluid_properties.py +3 -1
  16. {TESPy-0.3.1 → TESPy-0.3.2}/.bumpversion.cfg +0 -0
  17. {TESPy-0.3.1 → TESPy-0.3.2}/.coveragerc +0 -0
  18. {TESPy-0.3.1 → TESPy-0.3.2}/.editorconfig +0 -0
  19. {TESPy-0.3.1 → TESPy-0.3.2}/.gitignore +0 -0
  20. {TESPy-0.3.1 → TESPy-0.3.2}/.pep8speaks.yml +0 -0
  21. {TESPy-0.3.1 → TESPy-0.3.2}/.readthedocs.yml +0 -0
  22. {TESPy-0.3.1 → TESPy-0.3.2}/.travis.yml +0 -0
  23. {TESPy-0.3.1 → TESPy-0.3.2}/CODE_OF_CONDUCT.md +0 -0
  24. {TESPy-0.3.1 → TESPy-0.3.2}/CONTRIBUTING.md +0 -0
  25. {TESPy-0.3.1 → TESPy-0.3.2}/LICENSE +0 -0
  26. {TESPy-0.3.1 → TESPy-0.3.2}/MANIFEST.in +0 -0
  27. {TESPy-0.3.1 → TESPy-0.3.2}/PULL_REQUEST_TEMPLATE.md +0 -0
  28. {TESPy-0.3.1 → TESPy-0.3.2}/README.rst +0 -0
  29. {TESPy-0.3.1 → TESPy-0.3.2}/ci/appveyor-with-compiler.cmd +0 -0
  30. {TESPy-0.3.1 → TESPy-0.3.2}/ci/bootstrap.py +0 -0
  31. {TESPy-0.3.1 → TESPy-0.3.2}/ci/requirements.txt +0 -0
  32. {TESPy-0.3.1 → TESPy-0.3.2}/ci/templates/.appveyor.yml +0 -0
  33. {TESPy-0.3.1 → TESPy-0.3.2}/ci/templates/.travis.yml +0 -0
  34. {TESPy-0.3.1 → TESPy-0.3.2}/ci/templates/tox.ini +0 -0
  35. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/basic.svg +0 -0
  36. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/basic_efficiency.svg +0 -0
  37. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/cc_bp.svg +0 -0
  38. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/chp.svg +0 -0
  39. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/chp_PQ.svg +0 -0
  40. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/combustion_chamber.svg +0 -0
  41. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/combustion_engine.svg +0 -0
  42. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/compressor.svg +0 -0
  43. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/condenser.svg +0 -0
  44. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/dhs.svg +0 -0
  45. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/dhs_closed.svg +0 -0
  46. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/dhs_forks.svg +0 -0
  47. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/dhs_open.svg +0 -0
  48. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/droplet_separator.svg +0 -0
  49. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/drum.svg +0 -0
  50. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/heat_exchanger.svg +0 -0
  51. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/heat_pump.svg +0 -0
  52. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/heat_pump_COP_air.svg +0 -0
  53. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/heat_pump_COP_water.svg +0 -0
  54. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/heat_pump_example.svg +0 -0
  55. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/intro_connections.svg +0 -0
  56. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/intro_district_heating_scheme.svg +0 -0
  57. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/logph_diagram_states.svg +0 -0
  58. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/merge.svg +0 -0
  59. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/node.svg +0 -0
  60. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/orc_evaporator.svg +0 -0
  61. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/parabolic_trough.svg +0 -0
  62. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/pipe.svg +0 -0
  63. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/pump.svg +0 -0
  64. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/solar_collector.svg +0 -0
  65. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/split.svg +0 -0
  66. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/subsys_interface.svg +0 -0
  67. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/subsystem_waste_heat_generator.svg +0 -0
  68. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/turbine.svg +0 -0
  69. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/tutorial_heat_pump.svg +0 -0
  70. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/valve.svg +0 -0
  71. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/_images/water_electrolyzer.svg +0 -0
  72. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/modules.rst +0 -0
  73. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/tespy.components.rst +0 -0
  74. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/tespy.networks.rst +0 -0
  75. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/tespy.rst +0 -0
  76. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api/tespy.tools.rst +0 -0
  77. {TESPy-0.3.1 → TESPy-0.3.2}/docs/api.rst +0 -0
  78. {TESPy-0.3.1 → TESPy-0.3.2}/docs/conf.py +0 -0
  79. {TESPy-0.3.1 → TESPy-0.3.2}/docs/developing_tespy.rst +0 -0
  80. {TESPy-0.3.1 → TESPy-0.3.2}/docs/first_steps.rst +0 -0
  81. {TESPy-0.3.1 → TESPy-0.3.2}/docs/index.rst +0 -0
  82. {TESPy-0.3.1 → TESPy-0.3.2}/docs/installation.rst +0 -0
  83. {TESPy-0.3.1 → TESPy-0.3.2}/docs/introduction.rst +0 -0
  84. {TESPy-0.3.1 → TESPy-0.3.2}/docs/references.bib +0 -0
  85. {TESPy-0.3.1 → TESPy-0.3.2}/docs/requirements.txt +0 -0
  86. {TESPy-0.3.1 → TESPy-0.3.2}/docs/tespy_modules/characteristics.rst +0 -0
  87. {TESPy-0.3.1 → TESPy-0.3.2}/docs/tespy_modules/components.rst +0 -0
  88. {TESPy-0.3.1 → TESPy-0.3.2}/docs/tespy_modules/connections.rst +0 -0
  89. {TESPy-0.3.1 → TESPy-0.3.2}/docs/tespy_modules/fluid_properties.rst +0 -0
  90. {TESPy-0.3.1 → TESPy-0.3.2}/docs/tespy_modules/networks.rst +0 -0
  91. {TESPy-0.3.1 → TESPy-0.3.2}/docs/tespy_modules/other.rst +0 -0
  92. {TESPy-0.3.1 → TESPy-0.3.2}/docs/tespy_modules/subsystems.rst +0 -0
  93. {TESPy-0.3.1 → TESPy-0.3.2}/docs/tespy_modules.rst +0 -0
  94. {TESPy-0.3.1 → TESPy-0.3.2}/docs/tutorials_examples/clausius_rankine.rst +0 -0
  95. {TESPy-0.3.1 → TESPy-0.3.2}/docs/tutorials_examples/clausius_rankine_chp.rst +0 -0
  96. {TESPy-0.3.1 → TESPy-0.3.2}/docs/tutorials_examples/combined_cycle_chp.rst +0 -0
  97. {TESPy-0.3.1 → TESPy-0.3.2}/docs/tutorials_examples/combustion_engine.rst +0 -0
  98. {TESPy-0.3.1 → TESPy-0.3.2}/docs/tutorials_examples/district_heating.rst +0 -0
  99. {TESPy-0.3.1 → TESPy-0.3.2}/docs/tutorials_examples/heat_pump.rst +0 -0
  100. {TESPy-0.3.1 → TESPy-0.3.2}/docs/tutorials_examples/solar_collector.rst +0 -0
  101. {TESPy-0.3.1 → TESPy-0.3.2}/docs/tutorials_examples/tutorial_combustion_chamber.rst +0 -0
  102. {TESPy-0.3.1 → TESPy-0.3.2}/docs/tutorials_examples/tutorial_heat_pump.rst +0 -0
  103. {TESPy-0.3.1 → TESPy-0.3.2}/docs/tutorials_examples.rst +0 -0
  104. {TESPy-0.3.1 → TESPy-0.3.2}/docs/whats_new/v0-0-1.rst +0 -0
  105. {TESPy-0.3.1 → TESPy-0.3.2}/docs/whats_new/v0-0-2.rst +0 -0
  106. {TESPy-0.3.1 → TESPy-0.3.2}/docs/whats_new/v0-0-3.rst +0 -0
  107. {TESPy-0.3.1 → TESPy-0.3.2}/docs/whats_new/v0-0-4.rst +0 -0
  108. {TESPy-0.3.1 → TESPy-0.3.2}/docs/whats_new/v0-0-5.rst +0 -0
  109. {TESPy-0.3.1 → TESPy-0.3.2}/docs/whats_new/v0-1-0.rst +0 -0
  110. {TESPy-0.3.1 → TESPy-0.3.2}/docs/whats_new/v0-1-1.rst +0 -0
  111. {TESPy-0.3.1 → TESPy-0.3.2}/docs/whats_new/v0-1-2.rst +0 -0
  112. {TESPy-0.3.1 → TESPy-0.3.2}/docs/whats_new/v0-1-3.rst +0 -0
  113. {TESPy-0.3.1 → TESPy-0.3.2}/docs/whats_new/v0-1-4.rst +0 -0
  114. {TESPy-0.3.1 → TESPy-0.3.2}/docs/whats_new/v0-2-0.rst +0 -0
  115. {TESPy-0.3.1 → TESPy-0.3.2}/docs/whats_new/v0-2-1.rst +0 -0
  116. {TESPy-0.3.1 → TESPy-0.3.2}/docs/whats_new/v0-2-2.rst +0 -0
  117. {TESPy-0.3.1 → TESPy-0.3.2}/docs/whats_new/v0-3-0.rst +0 -0
  118. {TESPy-0.3.1 → TESPy-0.3.2}/docs/whats_new/v0-3-1.rst +0 -0
  119. {TESPy-0.3.1 → TESPy-0.3.2}/docs/zliterature.rst +0 -0
  120. {TESPy-0.3.1 → TESPy-0.3.2}/paper.bib +0 -0
  121. {TESPy-0.3.1 → TESPy-0.3.2}/paper.md +0 -0
  122. {TESPy-0.3.1 → TESPy-0.3.2}/pyproject.toml +0 -0
  123. {TESPy-0.3.1 → TESPy-0.3.2}/setup.cfg +0 -0
  124. {TESPy-0.3.1 → TESPy-0.3.2}/src/TESPy.egg-info/dependency_links.txt +0 -0
  125. {TESPy-0.3.1 → TESPy-0.3.2}/src/TESPy.egg-info/not-zip-safe +0 -0
  126. {TESPy-0.3.1 → TESPy-0.3.2}/src/TESPy.egg-info/requires.txt +0 -0
  127. {TESPy-0.3.1 → TESPy-0.3.2}/src/TESPy.egg-info/top_level.txt +0 -0
  128. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/components/__init__.py +0 -0
  129. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/components/basics.py +0 -0
  130. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/components/combustion.py +0 -0
  131. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/components/components.py +0 -0
  132. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/components/customs.py +0 -0
  133. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/components/nodes.py +0 -0
  134. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/components/piping.py +0 -0
  135. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/components/reactors.py +0 -0
  136. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/components/subsystems.py +0 -0
  137. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/components/turbomachinery.py +0 -0
  138. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/data/__init__.py +0 -0
  139. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/data/char_lines.json +0 -0
  140. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/data/char_maps.json +0 -0
  141. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/networks/__init__.py +0 -0
  142. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/tools/__init__.py +0 -0
  143. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/tools/characteristics.py +0 -0
  144. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/tools/data_containers.py +0 -0
  145. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/tools/helpers.py +0 -0
  146. {TESPy-0.3.1 → TESPy-0.3.2}/src/tespy/tools/logger.py +0 -0
  147. {TESPy-0.3.1 → TESPy-0.3.2}/tests/test_busses.py +0 -0
  148. {TESPy-0.3.1 → TESPy-0.3.2}/tests/test_components/test_combustion.py +0 -0
  149. {TESPy-0.3.1 → TESPy-0.3.2}/tests/test_components/test_heat_exchangers.py +0 -0
  150. {TESPy-0.3.1 → TESPy-0.3.2}/tests/test_components/test_orc_evaporator.py +0 -0
  151. {TESPy-0.3.1 → TESPy-0.3.2}/tests/test_components/test_piping.py +0 -0
  152. {TESPy-0.3.1 → TESPy-0.3.2}/tests/test_components/test_reactors.py +0 -0
  153. {TESPy-0.3.1 → TESPy-0.3.2}/tests/test_components/test_turbomachinery.py +0 -0
  154. {TESPy-0.3.1 → TESPy-0.3.2}/tests/test_models/test_gas_turbine_models.py +0 -0
  155. {TESPy-0.3.1 → TESPy-0.3.2}/tests/test_models/test_heat_pump_model.py +0 -0
  156. {TESPy-0.3.1 → TESPy-0.3.2}/tests/test_networks/test_network.py +0 -0
  157. {TESPy-0.3.1 → TESPy-0.3.2}/tests/test_tools/test_characteristics.py +0 -0
  158. {TESPy-0.3.1 → TESPy-0.3.2}/tests/test_tools/test_helpers.py +0 -0
  159. {TESPy-0.3.1 → TESPy-0.3.2}/tox.ini +0 -0
  160. {TESPy-0.3.1 → TESPy-0.3.2}/tutorial/step_1.py +0 -0
  161. {TESPy-0.3.1 → TESPy-0.3.2}/tutorial/step_2.py +0 -0
  162. {TESPy-0.3.1 → TESPy-0.3.2}/tutorial/step_3.py +0 -0
@@ -1,14 +1,14 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: TESPy
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: Thermal Engineering Systems in Python (TESPy)
5
5
  Home-page: https://github.com/oemof/tespy
6
6
  Author: Francesco Witte
7
7
  Author-email: francesco.witte@hs-flensburg.de
8
8
  License: MIT
9
+ Project-URL: Issue Tracker, https://github.com/oemof/tespy/issues
9
10
  Project-URL: Documentation, https://tespy.readthedocs.io/
10
11
  Project-URL: Changelog, https://tespy.readthedocs.io/en/latest/whats_new.html
11
- Project-URL: Issue Tracker, https://github.com/oemof/tespy/issues
12
12
  Description: Thermal Engineering Systems in Python
13
13
  =====================================
14
14
 
@@ -139,5 +139,5 @@ Classifier: Programming Language :: Python :: 3.7
139
139
  Classifier: Programming Language :: Python :: 3.8
140
140
  Classifier: Topic :: Scientific/Engineering
141
141
  Requires-Python: >=3.6, <3.9
142
- Provides-Extra: dev
143
142
  Provides-Extra: dummy
143
+ Provides-Extra: dev
@@ -0,0 +1,47 @@
1
+ v0.3.2 - Carnot's Colors (June, 10, 2020)
2
+ +++++++++++++++++++++++++++++++++++++++++
3
+
4
+ New features
5
+ ############
6
+ - Colored printouts are available in the :code:`print_results()` method of the
7
+ network class. There are three different color codes available with default
8
+ settings:
9
+
10
+ - user specified parameters (:code:`'set'`, blue)
11
+ - component parameters specified as variables (:code:`'var'`, green)
12
+ - faulty parameters (:code:`'err'`, red)
13
+
14
+ In order to change the colors, simply import :code:`coloring` from the
15
+ :py:mod:`tespy.tools.global_vars` module and adjust the escape codes. For
16
+ example, to reset all colors to white text:
17
+
18
+ .. code-block:: python
19
+
20
+ from tespy.tools.global_vars import coloring
21
+ coloring['set'] = '\033[0m'
22
+ coloring['err'] = '\033[0m'
23
+ coloring['var'] = '\033[0m'
24
+
25
+ See `here <https://en.wikipedia.org/wiki/ANSI_escape_code#Colors>`_ for a
26
+ list of available codes
27
+ (`PR #205 <https://github.com/oemof/tespy/pull/205>`_).
28
+
29
+ Bug fixes
30
+ #########
31
+ - Readd method for :code:`T_mix_ps` calculation for pure fluids: In case the
32
+ fluid propagation did not go through (e.g. due to availability of good
33
+ starting values) the fluid composition at a turbomachine's inlet and outlet
34
+ may not be equal (`PR #207 <https://github.com/oemof/tespy/pull/207>`_).
35
+ - Fix the calculation of mixture density: The density is calculated as sum of
36
+ the densities of the mixture components at their respective partial pressure
37
+ and the mixture temperature
38
+ (`PR #207 <https://github.com/oemof/tespy/pull/207>`_). With the old method,
39
+ the specific volume was calculated according to Amagat's law, which produced
40
+ incorrect values if one or more components of the mixture were liquid at the
41
+ mixture's temperature and pressure. See discussion about humid air propreties
42
+ here: `Issue #206 <https://github.com/oemof/tespy/issues/206>`_.
43
+
44
+ Contributors
45
+ ############
46
+ - Francesco Witte (`@fwitte <https://github.com/fwitte>`_)
47
+ - `@jbueck <https://github.com/jbueck>`_
@@ -7,7 +7,8 @@ Discover noteable new features and improvements in each release
7
7
  :depth: 1
8
8
  :local:
9
9
  :backlinks: top
10
-
10
+
11
+ .. include:: whats_new/v0-3-2.rst
11
12
  .. include:: whats_new/v0-3-1.rst
12
13
  .. include:: whats_new/v0-3-0.rst
13
14
  .. include:: whats_new/v0-2-2.rst
@@ -25,7 +25,7 @@ def read(*names, **kwargs):
25
25
 
26
26
  setup(
27
27
  name='TESPy',
28
- version='0.3.1',
28
+ version='0.3.2',
29
29
  license='MIT',
30
30
  description='Thermal Engineering Systems in Python (TESPy)',
31
31
  long_description='%s' % (
@@ -1,14 +1,14 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: TESPy
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: Thermal Engineering Systems in Python (TESPy)
5
5
  Home-page: https://github.com/oemof/tespy
6
6
  Author: Francesco Witte
7
7
  Author-email: francesco.witte@hs-flensburg.de
8
8
  License: MIT
9
+ Project-URL: Issue Tracker, https://github.com/oemof/tespy/issues
9
10
  Project-URL: Documentation, https://tespy.readthedocs.io/
10
11
  Project-URL: Changelog, https://tespy.readthedocs.io/en/latest/whats_new.html
11
- Project-URL: Issue Tracker, https://github.com/oemof/tespy/issues
12
12
  Description: Thermal Engineering Systems in Python
13
13
  =====================================
14
14
 
@@ -139,5 +139,5 @@ Classifier: Programming Language :: Python :: 3.7
139
139
  Classifier: Programming Language :: Python :: 3.8
140
140
  Classifier: Topic :: Scientific/Engineering
141
141
  Requires-Python: >=3.6, <3.9
142
- Provides-Extra: dev
143
142
  Provides-Extra: dummy
143
+ Provides-Extra: dev
@@ -109,6 +109,7 @@ docs/whats_new/v0-2-1.rst
109
109
  docs/whats_new/v0-2-2.rst
110
110
  docs/whats_new/v0-3-0.rst
111
111
  docs/whats_new/v0-3-1.rst
112
+ docs/whats_new/v0-3-2.rst
112
113
  src/TESPy.egg-info/PKG-INFO
113
114
  src/TESPy.egg-info/SOURCES.txt
114
115
  src/TESPy.egg-info/dependency_links.txt
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8
2
2
 
3
- __version__ = '0.3.1 - Mayer\'s Merit'
3
+ __version__ = '0.3.2 - Carnot\'s Colors'
4
4
 
5
5
  # tespy data and connection import
6
6
  from . import connections # noqa: F401
@@ -319,7 +319,7 @@ class heat_exchanger_simple(component):
319
319
  'in the calculation. If you want to use the value adaption of '
320
320
  'kA by the characteristic line, please use kA_char as '
321
321
  'parameter instead (occurred at ' + self.label + '). This '
322
- 'warning will disappear in TESPy version 0.3.2.')
322
+ 'warning will disappear in TESPy version 0.4.0.')
323
323
  warnings.warn(msg, FutureWarning, stacklevel=2)
324
324
 
325
325
  self.jacobian = np.zeros((
@@ -1828,7 +1828,7 @@ class heat_exchanger(component):
1828
1828
  'in the calculation. If you want to use the value adaption of '
1829
1829
  'kA by the characteristic line, please use kA_char as '
1830
1830
  'parameter instead (occurred at ' + self.label + '). This '
1831
- 'warning will disappear in TESPy version 0.3.2.')
1831
+ 'warning will disappear in TESPy version 0.4.0.')
1832
1832
  warnings.warn(msg, FutureWarning, stacklevel=2)
1833
1833
 
1834
1834
  self.jacobian = np.zeros((
@@ -2705,7 +2705,7 @@ class condenser(heat_exchanger):
2705
2705
  'in the calculation. If you want to use the value adaption of '
2706
2706
  'kA by the characteristic line, please use kA_char as '
2707
2707
  'parameter instead (occurred at ' + self.label + '). This '
2708
- 'warning will disappear in TESPy version 0.3.2.')
2708
+ 'warning will disappear in TESPy version 0.4.0.')
2709
2709
  warnings.warn(msg, FutureWarning, stacklevel=2)
2710
2710
 
2711
2711
  self.jacobian = np.zeros((
@@ -3073,7 +3073,7 @@ class desuperheater(heat_exchanger):
3073
3073
  'in the calculation. If you want to use the value adaption of '
3074
3074
  'kA by the characteristic line, please use kA_char as '
3075
3075
  'parameter instead (occurred at ' + self.label + '). This '
3076
- 'warning will disappear in TESPy version 0.3.2.')
3076
+ 'warning will disappear in TESPy version 0.4.0.')
3077
3077
  warnings.warn(msg, FutureWarning, stacklevel=2)
3078
3078
 
3079
3079
  self.jacobian = np.zeros((
@@ -902,7 +902,7 @@ class bus:
902
902
  comp = c['c']
903
903
  msg = (
904
904
  'The dictionary keyword "c" will be removed in '
905
- 'TESPy version 0.3.2. Please use "comp" instead.')
905
+ 'TESPy version 0.4.0. Please use "comp" instead.')
906
906
  warnings.warn(msg, FutureWarning, stacklevel=2)
907
907
  else:
908
908
  comp = c['comp']
@@ -924,7 +924,7 @@ class bus:
924
924
  if k == 'p':
925
925
  msg = (
926
926
  'The dictionary keyword "p" will be removed '
927
- 'TESPy version 0.3.2. Please use "param" '
927
+ 'TESPy version 0.4.0. Please use "param" '
928
928
  'instead.')
929
929
  warnings.warn(msg, FutureWarning, stacklevel=2)
930
930
  if isinstance(v, str) or v is None:
@@ -214,7 +214,7 @@ def load_network(path):
214
214
  >>> eta_s_t
215
215
  0.898
216
216
  >>> igva
217
- 20.139
217
+ 20.138
218
218
 
219
219
  The designed network is exported to the path 'exported_nwk'. Now import the
220
220
  network and recalculate. Check if the results match with the previous
@@ -305,7 +305,7 @@ def load_network(path):
305
305
  'component data for component of type ' + f[:-4] + '. '
306
306
  'Please make sure to add the column bus_base to your data '
307
307
  'or recreate the network export with the TESPy 0.3.x API. '
308
- 'This warning will be removed in TESPy version 0.3.2.')
308
+ 'This warning will be removed in TESPy version 0.4.0.')
309
309
  warnings.warn(msg, FutureWarning, stacklevel=2)
310
310
 
311
311
  comps = pd.concat((comps, df[cols]), axis=0)
@@ -42,6 +42,7 @@ from tespy.components.reactors import water_electrolyzer
42
42
  from tespy.tools import data_containers as dc
43
43
  from tespy.tools import fluid_properties as fp
44
44
  from tespy.tools import helpers as hlp
45
+ from tespy.tools.global_vars import coloring
45
46
  from tespy.tools.global_vars import err
46
47
 
47
48
 
@@ -2542,13 +2543,18 @@ class network:
2542
2543
  if c.printout is True:
2543
2544
  row = (c.source.label + ':' + c.source_id + ' -> ' +
2544
2545
  c.target.label + ':' + c.target_id)
2545
- df.loc[row] = (
2546
- [c.m.val_SI / self.m[self.m_unit],
2547
- c.p.val_SI / self.p[self.p_unit],
2548
- c.h.val_SI / self.h[self.h_unit],
2549
- c.T.val_SI / self.T[self.T_unit][1] -
2550
- self.T[self.T_unit][0]]
2551
- )
2546
+
2547
+ row_data = []
2548
+ for var in ['m', 'p', 'h', 'T']:
2549
+ if c.get_attr(var).val_set is True:
2550
+ row_data += [
2551
+ coloring['set'] + str(c.get_attr(var).val) +
2552
+ coloring['end']
2553
+ ]
2554
+ else:
2555
+ row_data += [str(c.get_attr(var).val)]
2556
+
2557
+ df.loc[row] = row_data
2552
2558
  if len(df) > 0:
2553
2559
  print('##### RESULTS (connections) #####')
2554
2560
  print(
@@ -2580,7 +2586,15 @@ class network:
2580
2586
 
2581
2587
  def print_components(c, *args):
2582
2588
  if c.name.printout is True:
2583
- return c.name.get_attr(args[0]).val
2589
+ val = float(c.name.get_attr(args[0]).val)
2590
+ if (val < c.name.get_attr(args[0]).min_val or
2591
+ val > c.name.get_attr(args[0]).max_val):
2592
+ return coloring['err'] + ' ' + str(val) + ' ' + coloring['end']
2593
+ if c.name.get_attr(args[0]).is_var:
2594
+ return coloring['var'] + ' ' + str(val) + ' ' + coloring['end']
2595
+ if c.name.get_attr(args[0]).is_set:
2596
+ return coloring['set'] + ' ' + str(val) + ' ' + coloring['end']
2597
+ return str(val)
2584
2598
  else:
2585
2599
  return np.nan
2586
2600
 
@@ -114,19 +114,16 @@ class tespy_fluid:
114
114
  0.0
115
115
 
116
116
  >>> v_tespy = v_mix_pT(fluid_props, T2)
117
- >>> fluid_props_CP = [0, p, 0, {'air': 1}]
118
117
  >>> v = v_mix_pT(fluid_props_CP, T2)
119
118
  >>> round(abs(v_tespy - v) / v, 2)
120
119
  0.0
121
120
 
122
121
  >>> s_tespy = s_mix_pT(fluid_props, T2) - s_mix_pT(fluid_props, T1)
123
- >>> fluid_props_CP = [0, p, 0, {'air': 1}]
124
122
  >>> s = s_mix_pT(fluid_props_CP, T2) - s_mix_pT(fluid_props_CP, T1)
125
123
  >>> round(abs(s_tespy - s) / s, 2)
126
124
  0.0
127
125
 
128
126
  >>> visc_tespy = visc_mix_pT(fluid_props, T2)
129
- >>> fluid_props_CP = [0, p, 0, {'air': 1}]
130
127
  >>> visc = visc_mix_pT(fluid_props_CP, T2)
131
128
  >>> round(abs(visc_tespy - visc) / visc, 2)
132
129
  0.0
@@ -767,67 +764,46 @@ def T_mix_ps(flow, s, T0=300):
767
764
 
768
765
  val = newton(s_mix_pT, ds_mix_pdT, flow, s, val0=T0,
769
766
  valmin=valmin, valmax=3000, imax=10)
770
- if memorisation is True:
771
- new = np.asarray(
772
- [[flow[1], flow[2]] + list(flow[3].values()) + [s, val]])
773
- # memorise the newly calculated value
774
- memorise.T_ps[fl] = np.append(memorise.T_ps[fl], new, axis=0)
775
767
 
776
- return val
777
768
  else:
778
769
  # calculate fluid property for pure fluids
779
- msg = ('The calculation of temperature from pressure and entropy '
780
- 'for pure fluids should not be required, as the '
781
- 'calculation is always possible from pressure and '
782
- 'enthalpy. If there is a case, where you need to calculate '
783
- 'temperature from these properties, please inform us: '
784
- 'https://github.com/oemof/tespy.')
785
- logging.error(msg)
786
- raise ValueError(msg)
770
+ val = T_ps(flow[1], s, fluid)
771
+
772
+ if memorisation is True:
773
+ new = np.asarray(
774
+ [[flow[1], flow[2]] + list(flow[3].values()) + [s, val]])
775
+ # memorise the newly calculated value
776
+ memorise.T_ps[fl] = np.append(memorise.T_ps[fl], new, axis=0)
777
+
778
+ return val
779
+
780
+
781
+ def T_ps(p, s, fluid):
782
+ r"""
783
+ Calculate the temperature from pressure and entropy for a pure fluid.
784
+
785
+ Parameters
786
+ ----------
787
+ p : float
788
+ Pressure p / Pa.
787
789
 
788
- # %% deprecated
789
- # for fluid, x in flow[3].items():
790
- # if x > err:
791
- # val = T_ps(flow[1], s, fluid)
792
- # new = np.array([[flow[1], flow[2]] +
793
- # list(flow[3].values()) + [s, val]])
794
- # # memorise the newly calculated value
795
- # memorise.T_ps[fl] = np.append(memorise.T_ps[fl],
796
- # new, axis=0)
797
- # return val
798
- #
799
- #
800
- # def T_ps(p, s, fluid):
801
- # r"""
802
- # Calculate the temperature from pressure and entropy for a pure fluid.
803
- #
804
- # Parameters
805
- # ----------
806
- # p : float
807
- # Pressure p / Pa.
808
- #
809
- # s : float
810
- # Specific entropy h / (J/(kgK)).
811
- #
812
- # fluid : str
813
- # Fluid name.
814
- #
815
- # Returns
816
- # -------
817
- # T : float
818
- # Temperature T / K.
819
- # """
820
- # if 'IDGAS::' in fluid:
821
- # msg = 'Ideal gas calculation not available by now.'
822
- # logging.warning(msg)
823
- # if 'TESPy::' in fluid:
824
- # db = tespy_fluid.fluids[fluid].funcs['s_pT']
825
- # return newton(reverse_2d, reverse_2d_deriv, [db, p, s], 0)
826
- # elif 'INCOMP::' in fluid:
827
- # return CPPSI('T', 'P', p, 'H', s, fluid)
828
- # else:
829
- # memorise.state[fluid].update(CP.PSmass_INPUTS, p, s)
830
- # return memorise.state[fluid].T()
790
+ s : float
791
+ Specific entropy h / (J/(kgK)).
792
+
793
+ fluid : str
794
+ Fluid name.
795
+
796
+ Returns
797
+ -------
798
+ T : float
799
+ Temperature T / K.
800
+ """
801
+ if fluid in tespy_fluid.fluids.keys():
802
+ db = tespy_fluid.fluids[fluid].funcs['s_pT']
803
+ return newton(reverse_2d, reverse_2d_deriv, [db, p, s], 0)
804
+ else:
805
+ memorise.state[fluid].update(CP.PSmass_INPUTS, p, s)
806
+ return memorise.state[fluid].T()
831
807
 
832
808
  # %%
833
809
 
@@ -1327,14 +1303,19 @@ def v_mix_pT(flow, T):
1327
1303
 
1328
1304
  .. math::
1329
1305
 
1330
- v_{mix}(p,T)=\sum_{i} \frac{x_i}{\rho(p, T, fluid_{i})}
1306
+ v_{mix}(p,T)=\frac{1}{\sum_{i} \rho(pp_{i}, T, fluid_{i})}\;
1307
+ \forall i \in \text{fluid components}\\
1308
+ pp: \text{partial pressure}
1331
1309
  """
1332
- v = 0
1310
+ n = molar_mass_flow(flow[3])
1311
+
1312
+ d = 0
1333
1313
  for fluid, x in flow[3].items():
1334
1314
  if x > err:
1335
- v += x / d_pT(flow[1], T, fluid)
1315
+ ni = x / molar_masses[fluid]
1316
+ d += d_pT(flow[1] * ni / n, T, fluid)
1336
1317
 
1337
- return v
1318
+ return 1 / d
1338
1319
 
1339
1320
 
1340
1321
  def d_mix_pT(flow, T):
@@ -13,3 +13,10 @@ err = 1e-6
13
13
  molar_masses = {}
14
14
  gas_constants = {}
15
15
  gas_constants['uni'] = 8.3144598
16
+ # Define colors for highlighting values in result table
17
+ coloring = {
18
+ 'end': '\033[0m',
19
+ 'set': '\033[94m',
20
+ 'err': '\033[31m',
21
+ 'var': '\033[32m'
22
+ }
@@ -32,7 +32,6 @@ from tespy.tools.characteristics import load_custom_char
32
32
  from tespy.tools.data_containers import data_container
33
33
  from tespy.tools.data_containers import dc_cc
34
34
  from tespy.tools.data_containers import dc_flu
35
- from tespy.tools.fluid_properties import T_mix_ps
36
35
  from tespy.tools.fluid_properties import h_mix_pQ
37
36
  from tespy.tools.fluid_properties import memorise
38
37
  from tespy.tools.fluid_properties import tespy_fluid
@@ -720,8 +719,3 @@ def test_IF97_back_end():
720
719
  def test_h_mix_pQ_on_mixtures():
721
720
  with raises(ValueError):
722
721
  h_mix_pQ([0, 0, 0, {'O2': 0.24, 'N2': 0.76}], 0.75)
723
-
724
-
725
- def test_T_mix_ps_on_pure_fluids():
726
- with raises(ValueError):
727
- T_mix_ps([0, 0, 0, {'O2': 1}], 1e3)
@@ -168,9 +168,11 @@ def test_tespy_fluid_mixture():
168
168
  pmin = 1e4
169
169
  pmax = 1e7
170
170
 
171
+ # As the tespy fluid is part of a mixture, the minimum pressure for lookup
172
+ # table creation must be much lower than the actual pressure range tested.
171
173
  fp.tespy_fluid(
172
174
  alias='partial', fluid=partial_mix,
173
- p_range=[pmin, pmax], T_range=[Tmin, Tmax])
175
+ p_range=[pmin / 3, pmax], T_range=[Tmin, Tmax])
174
176
 
175
177
  flow_mix = [0, 0, 0, mixture]
176
178
  flow_full = [0, 0, 0, full_mix]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes