tespy 0.3.0__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.
- {TESPy-0.3.0 → TESPy-0.3.2}/PKG-INFO +3 -3
- TESPy-0.3.2/docs/whats_new/v0-3-1.rst +11 -0
- TESPy-0.3.2/docs/whats_new/v0-3-2.rst +47 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/whats_new.rst +3 -1
- {TESPy-0.3.0 → TESPy-0.3.2}/setup.py +1 -1
- {TESPy-0.3.0 → TESPy-0.3.2}/src/TESPy.egg-info/PKG-INFO +3 -3
- {TESPy-0.3.0 → TESPy-0.3.2}/src/TESPy.egg-info/SOURCES.txt +2 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/__init__.py +1 -1
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/components/heat_exchangers.py +4 -6
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/connections.py +2 -2
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/networks/network_reader.py +2 -2
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/networks/networks.py +93 -97
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/tools/fluid_properties.py +45 -64
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/tools/global_vars.py +7 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/tools/logger.py +1 -2
- {TESPy-0.3.0 → TESPy-0.3.2}/tests/test_errors.py +0 -6
- {TESPy-0.3.0 → TESPy-0.3.2}/tests/test_tools/test_fluid_properties.py +3 -1
- {TESPy-0.3.0 → TESPy-0.3.2}/.bumpversion.cfg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/.coveragerc +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/.editorconfig +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/.gitignore +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/.pep8speaks.yml +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/.readthedocs.yml +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/.travis.yml +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/CODE_OF_CONDUCT.md +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/CONTRIBUTING.md +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/LICENSE +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/MANIFEST.in +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/PULL_REQUEST_TEMPLATE.md +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/README.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/ci/appveyor-with-compiler.cmd +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/ci/bootstrap.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/ci/requirements.txt +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/ci/templates/.appveyor.yml +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/ci/templates/.travis.yml +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/ci/templates/tox.ini +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/basic.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/basic_efficiency.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/cc_bp.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/chp.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/chp_PQ.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/combustion_chamber.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/combustion_engine.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/compressor.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/condenser.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/dhs.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/dhs_closed.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/dhs_forks.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/dhs_open.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/droplet_separator.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/drum.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/heat_exchanger.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/heat_pump.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/heat_pump_COP_air.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/heat_pump_COP_water.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/heat_pump_example.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/intro_connections.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/intro_district_heating_scheme.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/logph_diagram_states.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/merge.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/node.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/orc_evaporator.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/parabolic_trough.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/pipe.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/pump.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/solar_collector.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/split.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/subsys_interface.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/subsystem_waste_heat_generator.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/turbine.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/tutorial_heat_pump.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/valve.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/_images/water_electrolyzer.svg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/modules.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/tespy.components.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/tespy.networks.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/tespy.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api/tespy.tools.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/api.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/conf.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/developing_tespy.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/first_steps.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/index.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/installation.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/introduction.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/references.bib +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/requirements.txt +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/tespy_modules/characteristics.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/tespy_modules/components.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/tespy_modules/connections.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/tespy_modules/fluid_properties.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/tespy_modules/networks.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/tespy_modules/other.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/tespy_modules/subsystems.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/tespy_modules.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/tutorials_examples/clausius_rankine.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/tutorials_examples/clausius_rankine_chp.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/tutorials_examples/combined_cycle_chp.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/tutorials_examples/combustion_engine.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/tutorials_examples/district_heating.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/tutorials_examples/heat_pump.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/tutorials_examples/solar_collector.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/tutorials_examples/tutorial_combustion_chamber.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/tutorials_examples/tutorial_heat_pump.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/tutorials_examples.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/whats_new/v0-0-1.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/whats_new/v0-0-2.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/whats_new/v0-0-3.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/whats_new/v0-0-4.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/whats_new/v0-0-5.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/whats_new/v0-1-0.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/whats_new/v0-1-1.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/whats_new/v0-1-2.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/whats_new/v0-1-3.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/whats_new/v0-1-4.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/whats_new/v0-2-0.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/whats_new/v0-2-1.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/whats_new/v0-2-2.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/whats_new/v0-3-0.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/docs/zliterature.rst +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/paper.bib +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/paper.md +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/pyproject.toml +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/setup.cfg +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/src/TESPy.egg-info/dependency_links.txt +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/src/TESPy.egg-info/not-zip-safe +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/src/TESPy.egg-info/requires.txt +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/src/TESPy.egg-info/top_level.txt +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/components/__init__.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/components/basics.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/components/combustion.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/components/components.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/components/customs.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/components/nodes.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/components/piping.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/components/reactors.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/components/subsystems.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/components/turbomachinery.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/data/__init__.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/data/char_lines.json +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/data/char_maps.json +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/networks/__init__.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/tools/__init__.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/tools/characteristics.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/tools/data_containers.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/src/tespy/tools/helpers.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/tests/test_busses.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/tests/test_components/test_combustion.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/tests/test_components/test_heat_exchangers.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/tests/test_components/test_orc_evaporator.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/tests/test_components/test_piping.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/tests/test_components/test_reactors.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/tests/test_components/test_turbomachinery.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/tests/test_models/test_gas_turbine_models.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/tests/test_models/test_heat_pump_model.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/tests/test_networks/test_network.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/tests/test_tools/test_characteristics.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/tests/test_tools/test_helpers.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/tox.ini +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/tutorial/step_1.py +0 -0
- {TESPy-0.3.0 → TESPy-0.3.2}/tutorial/step_2.py +0 -0
- {TESPy-0.3.0 → 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.
|
|
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,11 @@
|
|
|
1
|
+
v0.3.1 - Fix for Mayer's Merit (May, 29, 2020)
|
|
2
|
+
++++++++++++++++++++++++++++++++++++++++++++++
|
|
3
|
+
|
|
4
|
+
Bug fixes
|
|
5
|
+
#########
|
|
6
|
+
- Remove a debugging printout in the kA_func of the
|
|
7
|
+
:py:class:`tespy.components.heat_exchangers.heat_exchanger_simple` class.
|
|
8
|
+
|
|
9
|
+
Contributors
|
|
10
|
+
############
|
|
11
|
+
- Francesco Witte (`@fwitte <https://github.com/fwitte>`_)
|
|
@@ -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,9 @@ 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
|
|
12
|
+
.. include:: whats_new/v0-3-1.rst
|
|
11
13
|
.. include:: whats_new/v0-3-0.rst
|
|
12
14
|
.. include:: whats_new/v0-2-2.rst
|
|
13
15
|
.. include:: whats_new/v0-2-1.rst
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: TESPy
|
|
3
|
-
Version: 0.3.
|
|
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
|
|
@@ -108,6 +108,8 @@ docs/whats_new/v0-2-0.rst
|
|
|
108
108
|
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
|
+
docs/whats_new/v0-3-1.rst
|
|
112
|
+
docs/whats_new/v0-3-2.rst
|
|
111
113
|
src/TESPy.egg-info/PKG-INFO
|
|
112
114
|
src/TESPy.egg-info/SOURCES.txt
|
|
113
115
|
src/TESPy.egg-info/dependency_links.txt
|
|
@@ -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.
|
|
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((
|
|
@@ -647,8 +647,6 @@ class heat_exchanger_simple(component):
|
|
|
647
647
|
else:
|
|
648
648
|
td_log = 0
|
|
649
649
|
|
|
650
|
-
print(ttd_1, ttd_2)
|
|
651
|
-
|
|
652
650
|
return i[0] * (o[2] - i[2]) + self.kA.val * td_log
|
|
653
651
|
|
|
654
652
|
def kA_char_func(self):
|
|
@@ -1830,7 +1828,7 @@ class heat_exchanger(component):
|
|
|
1830
1828
|
'in the calculation. If you want to use the value adaption of '
|
|
1831
1829
|
'kA by the characteristic line, please use kA_char as '
|
|
1832
1830
|
'parameter instead (occurred at ' + self.label + '). This '
|
|
1833
|
-
'warning will disappear in TESPy version 0.
|
|
1831
|
+
'warning will disappear in TESPy version 0.4.0.')
|
|
1834
1832
|
warnings.warn(msg, FutureWarning, stacklevel=2)
|
|
1835
1833
|
|
|
1836
1834
|
self.jacobian = np.zeros((
|
|
@@ -2707,7 +2705,7 @@ class condenser(heat_exchanger):
|
|
|
2707
2705
|
'in the calculation. If you want to use the value adaption of '
|
|
2708
2706
|
'kA by the characteristic line, please use kA_char as '
|
|
2709
2707
|
'parameter instead (occurred at ' + self.label + '). This '
|
|
2710
|
-
'warning will disappear in TESPy version 0.
|
|
2708
|
+
'warning will disappear in TESPy version 0.4.0.')
|
|
2711
2709
|
warnings.warn(msg, FutureWarning, stacklevel=2)
|
|
2712
2710
|
|
|
2713
2711
|
self.jacobian = np.zeros((
|
|
@@ -3075,7 +3073,7 @@ class desuperheater(heat_exchanger):
|
|
|
3075
3073
|
'in the calculation. If you want to use the value adaption of '
|
|
3076
3074
|
'kA by the characteristic line, please use kA_char as '
|
|
3077
3075
|
'parameter instead (occurred at ' + self.label + '). This '
|
|
3078
|
-
'warning will disappear in TESPy version 0.
|
|
3076
|
+
'warning will disappear in TESPy version 0.4.0.')
|
|
3079
3077
|
warnings.warn(msg, FutureWarning, stacklevel=2)
|
|
3080
3078
|
|
|
3081
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
|
@@ -305,11 +306,11 @@ class network:
|
|
|
305
306
|
self.h_range_SI = np.array([1e3, 7e6])
|
|
306
307
|
|
|
307
308
|
for prop in ['m', 'p', 'h']:
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
309
|
+
limits = self.get_attr(prop + '_range_SI')
|
|
310
|
+
msg = (
|
|
311
|
+
'Default ' + self.props[prop] + ' limits, min: ' +
|
|
312
|
+
str(limits[0]) + ' ' + self.SI_units[prop] + ', max: ' +
|
|
313
|
+
str(limits[1]) + ' ' + self.SI_units[prop] + '.')
|
|
313
314
|
logging.debug(msg)
|
|
314
315
|
|
|
315
316
|
self.set_attr(**kwargs)
|
|
@@ -365,7 +366,7 @@ class network:
|
|
|
365
366
|
logging.error(msg)
|
|
366
367
|
raise ValueError(msg)
|
|
367
368
|
else:
|
|
368
|
-
self.__dict__
|
|
369
|
+
self.__dict__.update({unit: kwargs[unit]})
|
|
369
370
|
msg = ('Setting ' + self.props[prop] + ' unit: ' +
|
|
370
371
|
kwargs[unit] + '.')
|
|
371
372
|
logging.debug(msg)
|
|
@@ -382,13 +383,13 @@ class network:
|
|
|
382
383
|
self.__dict__.update(
|
|
383
384
|
{prop + '_range_SI':
|
|
384
385
|
np.array(kwargs[prop + '_range']) *
|
|
385
|
-
self.
|
|
386
|
+
self.get_attr(prop)[self.get_attr(prop + '_unit')]})
|
|
386
387
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
388
|
+
limits = self.get_attr(prop + '_range_SI')
|
|
389
|
+
msg = (
|
|
390
|
+
'Setting ' + self.props[prop] + ' limits, min: ' +
|
|
391
|
+
str(limits[0]) + ' ' + self.SI_units[prop] + ', max: ' +
|
|
392
|
+
str(limits[1]) + ' ' + self.SI_units[prop] + '.')
|
|
392
393
|
logging.debug(msg)
|
|
393
394
|
|
|
394
395
|
# update non SI value ranges
|
|
@@ -438,18 +439,6 @@ class network:
|
|
|
438
439
|
for c in subsys.conns.values():
|
|
439
440
|
self.add_conns(c)
|
|
440
441
|
|
|
441
|
-
def add_nwks(self, *args):
|
|
442
|
-
"""
|
|
443
|
-
Add connections from a different network.
|
|
444
|
-
|
|
445
|
-
:param args: network objects si :code:`add_subsys(s1, s2, s3, ...)`
|
|
446
|
-
:type args: tespy.networks.network
|
|
447
|
-
:returns: no return value
|
|
448
|
-
"""
|
|
449
|
-
for nw in args:
|
|
450
|
-
for c in nw.conns.index:
|
|
451
|
-
self.add_conns(c)
|
|
452
|
-
|
|
453
442
|
def add_conns(self, *args):
|
|
454
443
|
r"""
|
|
455
444
|
Add one or more connections to the network.
|
|
@@ -613,18 +602,18 @@ class network:
|
|
|
613
602
|
num_o = (self.conns[['source', 'target']] == comp).sum().source
|
|
614
603
|
num_i = (self.conns[['source', 'target']] == comp).sum().target
|
|
615
604
|
if num_o != comp.num_o:
|
|
616
|
-
msg = (
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
605
|
+
msg = (
|
|
606
|
+
comp.label + ' is missing ' + str(comp.num_o - num_o) + ' '
|
|
607
|
+
'outgoing connections. Make sure all outlets are connected'
|
|
608
|
+
' and all connections have been added to the network.')
|
|
620
609
|
logging.error(msg)
|
|
621
610
|
# raise an error in case network check is unsuccesful
|
|
622
611
|
raise hlp.TESPyNetworkError(msg)
|
|
623
612
|
elif num_i != comp.num_i:
|
|
624
|
-
msg = (
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
613
|
+
msg = (
|
|
614
|
+
comp.label + ' is missing ' + str(comp.num_i - num_i) + ' '
|
|
615
|
+
'incoming connections. Make sure all inlets are connected '
|
|
616
|
+
'and all connections have been added to the network.')
|
|
628
617
|
logging.error(msg)
|
|
629
618
|
# raise an error in case network check is unsuccesful
|
|
630
619
|
raise hlp.TESPyNetworkError(msg)
|
|
@@ -679,10 +668,10 @@ class network:
|
|
|
679
668
|
|
|
680
669
|
# check for duplicates in the component labels
|
|
681
670
|
if len(labels) != len(list(set(labels))):
|
|
682
|
-
duplicates = [
|
|
683
|
-
|
|
684
|
-
msg = ('All Components must have unique labels, duplicates are: '
|
|
685
|
-
|
|
671
|
+
duplicates = [
|
|
672
|
+
item for item, count in Counter(labels).items() if count > 1]
|
|
673
|
+
msg = ('All Components must have unique labels, duplicates are: ' +
|
|
674
|
+
str(duplicates) + '.')
|
|
686
675
|
logging.error(msg)
|
|
687
676
|
raise hlp.TESPyNetworkError(msg)
|
|
688
677
|
|
|
@@ -702,9 +691,9 @@ class network:
|
|
|
702
691
|
- Switch from design/offdesign parameter specification.
|
|
703
692
|
"""
|
|
704
693
|
if len(self.conns) == 0:
|
|
705
|
-
msg = (
|
|
706
|
-
|
|
707
|
-
|
|
694
|
+
msg = (
|
|
695
|
+
'No connections have been added to the network, please make '
|
|
696
|
+
'sure to add your connections with the .add_conns() method.')
|
|
708
697
|
logging.error(msg)
|
|
709
698
|
raise hlp.TESPyNetworkError(msg)
|
|
710
699
|
|
|
@@ -818,11 +807,10 @@ class network:
|
|
|
818
807
|
# read design point information
|
|
819
808
|
path = hlp.modify_path_os(
|
|
820
809
|
cp.design_path + '/components/' + c + '.csv')
|
|
821
|
-
df = pd.read_csv(
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
})
|
|
810
|
+
df = pd.read_csv(
|
|
811
|
+
path, sep=';', decimal='.', converters={
|
|
812
|
+
'busses': ast.literal_eval,
|
|
813
|
+
'bus_P_ref': ast.literal_eval})
|
|
826
814
|
df.set_index('label', inplace=True)
|
|
827
815
|
# write data
|
|
828
816
|
self.init_comp_design_params(cp, df.loc[cp.label])
|
|
@@ -884,14 +872,15 @@ class network:
|
|
|
884
872
|
(connections) handle the parameter specification.
|
|
885
873
|
"""
|
|
886
874
|
# components without any parameters
|
|
887
|
-
not_required = [
|
|
888
|
-
|
|
875
|
+
not_required = [
|
|
876
|
+
'source', 'sink', 'node', 'merge', 'splitter', 'separator', 'drum',
|
|
877
|
+
'subsystem_interface', 'droplet_separator']
|
|
889
878
|
# fetch all components, reindex with label
|
|
890
879
|
cp_sort = self.comps.copy()
|
|
891
880
|
# get class name
|
|
892
881
|
cp_sort['cp'] = cp_sort.apply(network.get_class_base, axis=1)
|
|
893
|
-
cp_sort['label'] = cp_sort.apply(
|
|
894
|
-
|
|
882
|
+
cp_sort['label'] = cp_sort.apply(
|
|
883
|
+
network.get_props, axis=1, args=('label',))
|
|
895
884
|
cp_sort['comp'] = cp_sort.index
|
|
896
885
|
cp_sort.set_index('label', inplace=True)
|
|
897
886
|
|
|
@@ -931,7 +920,7 @@ class network:
|
|
|
931
920
|
# write data to components
|
|
932
921
|
self.init_comp_design_params(comp, data)
|
|
933
922
|
|
|
934
|
-
msg = '
|
|
923
|
+
msg = 'Done reading design point information for components.'
|
|
935
924
|
logging.debug(msg)
|
|
936
925
|
|
|
937
926
|
# read connection design point information
|
|
@@ -952,8 +941,8 @@ class network:
|
|
|
952
941
|
'Reading individual design point information for '
|
|
953
942
|
'connection ' + c.label + ' from path ' + path_c + '.')
|
|
954
943
|
logging.debug(msg)
|
|
955
|
-
df_c = pd.read_csv(
|
|
956
|
-
|
|
944
|
+
df_c = pd.read_csv(
|
|
945
|
+
path_c, index_col=0, delimiter=';', decimal='.')
|
|
957
946
|
|
|
958
947
|
# write data
|
|
959
948
|
self.init_conn_design_params(c, df_c)
|
|
@@ -962,7 +951,7 @@ class network:
|
|
|
962
951
|
# write data
|
|
963
952
|
self.init_conn_design_params(c, df)
|
|
964
953
|
|
|
965
|
-
msg = '
|
|
954
|
+
msg = 'Done reading design point information for connections.'
|
|
966
955
|
logging.debug(msg)
|
|
967
956
|
|
|
968
957
|
def init_comp_design_params(self, component, data):
|
|
@@ -1006,19 +995,13 @@ class network:
|
|
|
1006
995
|
df['source_id'].isin([c.source_id]) &
|
|
1007
996
|
df['target_id'].isin([c.target_id])]
|
|
1008
997
|
|
|
1009
|
-
|
|
998
|
+
try:
|
|
1010
999
|
# read connection information
|
|
1011
1000
|
conn_id = conn.index[0]
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
c.h.design = (
|
|
1017
|
-
df.loc[conn_id, 'h'] * self.h[df.loc[conn_id, 'h_unit']])
|
|
1018
|
-
c.v.design = (
|
|
1019
|
-
df.loc[conn_id, 'v'] * self.v[df.loc[conn_id, 'v_unit']])
|
|
1020
|
-
c.x.design = (
|
|
1021
|
-
df.loc[conn_id, 'x'] * self.x[df.loc[conn_id, 'x_unit']])
|
|
1001
|
+
for var in ['m', 'p', 'h', 'v', 'x']:
|
|
1002
|
+
c.get_attr(var).design = (
|
|
1003
|
+
df.loc[conn_id, var] *
|
|
1004
|
+
self.get_attr(var)[df.loc[conn_id, var + '_unit']])
|
|
1022
1005
|
c.T.design = ((df.loc[conn_id, 'T'] +
|
|
1023
1006
|
self.T[df.loc[conn_id, 'T_unit']][0]) *
|
|
1024
1007
|
self.T[df.loc[conn_id, 'T_unit']][1])
|
|
@@ -1026,7 +1009,7 @@ class network:
|
|
|
1026
1009
|
self.T[df.loc[conn_id, 'T_unit']][1])
|
|
1027
1010
|
for fluid in self.fluids:
|
|
1028
1011
|
c.fluid.design[fluid] = df.loc[conn_id, fluid]
|
|
1029
|
-
|
|
1012
|
+
except IndexError:
|
|
1030
1013
|
# no matches in the connections of the network and the design files
|
|
1031
1014
|
msg = (
|
|
1032
1015
|
'Could not find connection ' + c.label + ' in design case. '
|
|
@@ -1123,9 +1106,9 @@ class network:
|
|
|
1123
1106
|
# iterate over connectons, create ordered dicts
|
|
1124
1107
|
for c in self.conns.index:
|
|
1125
1108
|
c.conn_loc = self.conns.index.get_loc(c)
|
|
1126
|
-
tmp = c.fluid.val
|
|
1127
|
-
tmp0 = c.fluid.val0
|
|
1128
|
-
tmp_set = c.fluid.val_set
|
|
1109
|
+
tmp = c.fluid.val
|
|
1110
|
+
tmp0 = c.fluid.val0
|
|
1111
|
+
tmp_set = c.fluid.val_set
|
|
1129
1112
|
c.fluid.val = OrderedDict()
|
|
1130
1113
|
c.fluid.val0 = OrderedDict()
|
|
1131
1114
|
c.fluid.val_set = OrderedDict()
|
|
@@ -1375,7 +1358,7 @@ class network:
|
|
|
1375
1358
|
c.get_attr(key).unit = self.get_attr('T_unit')
|
|
1376
1359
|
else:
|
|
1377
1360
|
c.get_attr(key).unit = self.get_attr(key + '_unit')
|
|
1378
|
-
if (key
|
|
1361
|
+
if (key in ['m', 'p', 'h'] and
|
|
1379
1362
|
c.get_attr(key).val_set is False):
|
|
1380
1363
|
if c.good_starting_values is False:
|
|
1381
1364
|
self.init_val0(c, key)
|
|
@@ -1412,7 +1395,10 @@ class network:
|
|
|
1412
1395
|
|
|
1413
1396
|
# starting values for specified vapour content or temperature
|
|
1414
1397
|
if c.x.val_set and not c.h.val_set:
|
|
1415
|
-
|
|
1398
|
+
try:
|
|
1399
|
+
c.h.val_SI = fp.h_mix_pQ(c.to_flow(), c.x.val_SI)
|
|
1400
|
+
except ValueError:
|
|
1401
|
+
pass
|
|
1416
1402
|
|
|
1417
1403
|
if c.T.val_set and not c.h.val_set:
|
|
1418
1404
|
try:
|
|
@@ -1500,7 +1486,7 @@ class network:
|
|
|
1500
1486
|
df['target'].isin([c.target.label]) &
|
|
1501
1487
|
df['source_id'].isin([c.source_id]) &
|
|
1502
1488
|
df['target_id'].isin([c.target_id])]
|
|
1503
|
-
|
|
1489
|
+
try:
|
|
1504
1490
|
conn_id = conn.index[0]
|
|
1505
1491
|
# overwrite SI-values with values from init_file,
|
|
1506
1492
|
# except user specified values
|
|
@@ -1523,7 +1509,7 @@ class network:
|
|
|
1523
1509
|
c.h.val0 = c.h.val_SI / self.h[c.h.unit]
|
|
1524
1510
|
c.fluid.val0 = c.fluid.val.copy()
|
|
1525
1511
|
c.good_starting_values = True
|
|
1526
|
-
|
|
1512
|
+
except IndexError:
|
|
1527
1513
|
msg = (
|
|
1528
1514
|
'Could not find connection ' + c.label + ' in '
|
|
1529
1515
|
'connections.csv of init_path ' + self.init_path + '.')
|
|
@@ -1575,18 +1561,18 @@ class network:
|
|
|
1575
1561
|
For more information on the solution process have a look at the online
|
|
1576
1562
|
documentation at tespy.readthedocs.io in the section "using TESPy".
|
|
1577
1563
|
"""
|
|
1564
|
+
self.new_design = False
|
|
1578
1565
|
if self.design_path == design_path and design_path is not None:
|
|
1579
1566
|
for c in self.conns.index:
|
|
1580
1567
|
if c.new_design is True:
|
|
1581
1568
|
self.new_design = True
|
|
1582
1569
|
break
|
|
1570
|
+
if self.new_design is False:
|
|
1571
|
+
for cp in self.comps.index:
|
|
1572
|
+
if cp.new_design is True:
|
|
1573
|
+
self.new_design = True
|
|
1574
|
+
break
|
|
1583
1575
|
|
|
1584
|
-
for cp in self.comps.index:
|
|
1585
|
-
if cp.new_design is True:
|
|
1586
|
-
self.new_design = True
|
|
1587
|
-
break
|
|
1588
|
-
|
|
1589
|
-
self.new_design = False
|
|
1590
1576
|
else:
|
|
1591
1577
|
self.new_design = True
|
|
1592
1578
|
|
|
@@ -1899,7 +1885,7 @@ class network:
|
|
|
1899
1885
|
# keep mass fractions within [0, 1]
|
|
1900
1886
|
if c.fluid.val[fluid] < err:
|
|
1901
1887
|
c.fluid.val[fluid] = 0
|
|
1902
|
-
|
|
1888
|
+
elif c.fluid.val[fluid] > 1 - err:
|
|
1903
1889
|
c.fluid.val[fluid] = 1
|
|
1904
1890
|
|
|
1905
1891
|
j += 1
|
|
@@ -1922,7 +1908,7 @@ class network:
|
|
|
1922
1908
|
# keep value within specified value range
|
|
1923
1909
|
if var.val < var.min_val:
|
|
1924
1910
|
var.val = var.min_val
|
|
1925
|
-
|
|
1911
|
+
elif var.val > var.max_val:
|
|
1926
1912
|
var.val = var.max_val
|
|
1927
1913
|
|
|
1928
1914
|
sum_c_var += cp.num_vars
|
|
@@ -2059,10 +2045,12 @@ class network:
|
|
|
2059
2045
|
"""
|
|
2060
2046
|
flow = c.to_flow()
|
|
2061
2047
|
Tmin = max(
|
|
2062
|
-
[fp.memorise.value_range[f][2] for
|
|
2048
|
+
[fp.memorise.value_range[f][2] for
|
|
2049
|
+
f in flow[3].keys() if flow[3][f] > err]
|
|
2063
2050
|
) + 100
|
|
2064
2051
|
Tmax = min(
|
|
2065
|
-
[fp.memorise.value_range[f][3] for
|
|
2052
|
+
[fp.memorise.value_range[f][3] for
|
|
2053
|
+
f in flow[3].keys() if flow[3][f] > err]
|
|
2066
2054
|
) - 100
|
|
2067
2055
|
hmin = fp.h_mix_pT(flow, Tmin)
|
|
2068
2056
|
hmax = fp.h_mix_pT(flow, Tmax)
|
|
@@ -2391,7 +2379,6 @@ class network:
|
|
|
2391
2379
|
# equations and derivatives for specified primary variables are static
|
|
2392
2380
|
if self.iter == 0:
|
|
2393
2381
|
for c in self.conns.index:
|
|
2394
|
-
flow = c.to_flow()
|
|
2395
2382
|
col = c.conn_loc * self.num_conn_vars
|
|
2396
2383
|
|
|
2397
2384
|
# specified mass flow, pressure and enthalpy
|
|
@@ -2422,15 +2409,12 @@ class network:
|
|
|
2422
2409
|
if bus.P.is_set is True:
|
|
2423
2410
|
P_res = 0
|
|
2424
2411
|
for cp in bus.comps.index:
|
|
2425
|
-
i = self.comps.loc[cp, 'inlets'].tolist()
|
|
2426
|
-
o = self.comps.loc[cp, 'outlets'].tolist()
|
|
2427
2412
|
|
|
2428
|
-
P_res
|
|
2413
|
+
P_res -= cp.calc_bus_value(bus)
|
|
2429
2414
|
deriv = -cp.bus_deriv(bus)
|
|
2430
2415
|
|
|
2431
2416
|
j = 0
|
|
2432
|
-
for
|
|
2433
|
-
loc = self.conns.index.get_loc(c)
|
|
2417
|
+
for loc in cp.conn_loc:
|
|
2434
2418
|
# start collumn index
|
|
2435
2419
|
coll_s = loc * self.num_conn_vars
|
|
2436
2420
|
# end collumn index
|
|
@@ -2438,8 +2422,7 @@ class network:
|
|
|
2438
2422
|
self.jacobian[row, coll_s:coll_e] = deriv[:, j]
|
|
2439
2423
|
j += 1
|
|
2440
2424
|
|
|
2441
|
-
self.residual[row] = bus.P.val
|
|
2442
|
-
|
|
2425
|
+
self.residual[row] = bus.P.val + P_res
|
|
2443
2426
|
row += 1
|
|
2444
2427
|
|
|
2445
2428
|
def postprocessing(self):
|
|
@@ -2560,13 +2543,18 @@ class network:
|
|
|
2560
2543
|
if c.printout is True:
|
|
2561
2544
|
row = (c.source.label + ':' + c.source_id + ' -> ' +
|
|
2562
2545
|
c.target.label + ':' + c.target_id)
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
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
|
|
2570
2558
|
if len(df) > 0:
|
|
2571
2559
|
print('##### RESULTS (connections) #####')
|
|
2572
2560
|
print(
|
|
@@ -2598,7 +2586,15 @@ class network:
|
|
|
2598
2586
|
|
|
2599
2587
|
def print_components(c, *args):
|
|
2600
2588
|
if c.name.printout is True:
|
|
2601
|
-
|
|
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)
|
|
2602
2598
|
else:
|
|
2603
2599
|
return np.nan
|
|
2604
2600
|
|