tespy 0.2.0__tar.gz → 0.2.1__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.2.0 → TESPy-0.2.1}/PKG-INFO +45 -15
- TESPy-0.2.1/README.rst +92 -0
- {TESPy-0.2.0 → TESPy-0.2.1}/TESPy.egg-info/PKG-INFO +45 -15
- TESPy-0.2.1/TESPy.egg-info/requires.txt +5 -0
- {TESPy-0.2.0 → TESPy-0.2.1}/setup.py +6 -6
- {TESPy-0.2.0 → TESPy-0.2.1}/tespy/__init__.py +1 -1
- {TESPy-0.2.0 → TESPy-0.2.1}/tespy/components/basics.py +138 -62
- {TESPy-0.2.0 → TESPy-0.2.1}/tespy/components/combustion.py +525 -386
- {TESPy-0.2.0 → TESPy-0.2.1}/tespy/components/components.py +61 -58
- {TESPy-0.2.0 → TESPy-0.2.1}/tespy/components/heat_exchangers.py +530 -594
- {TESPy-0.2.0 → TESPy-0.2.1}/tespy/components/nodes.py +373 -377
- {TESPy-0.2.0 → TESPy-0.2.1}/tespy/components/piping.py +107 -76
- {TESPy-0.2.0 → TESPy-0.2.1}/tespy/components/reactors.py +258 -244
- {TESPy-0.2.0 → TESPy-0.2.1}/tespy/components/subsystems.py +0 -2
- {TESPy-0.2.0 → TESPy-0.2.1}/tespy/components/turbomachinery.py +444 -473
- {TESPy-0.2.0 → TESPy-0.2.1}/tespy/connections.py +17 -7
- TESPy-0.2.1/tespy/data/char_lines.json +194 -0
- {TESPy-0.2.0 → TESPy-0.2.1}/tespy/networks/network_reader.py +9 -8
- {TESPy-0.2.0 → TESPy-0.2.1}/tespy/networks/networks.py +305 -518
- {TESPy-0.2.0 → TESPy-0.2.1}/tespy/tools/characteristics.py +54 -3
- {TESPy-0.2.0 → TESPy-0.2.1}/tespy/tools/data_containers.py +47 -51
- {TESPy-0.2.0 → TESPy-0.2.1}/tespy/tools/fluid_properties.py +44 -58
- {TESPy-0.2.0 → TESPy-0.2.1}/tespy/tools/helpers.py +16 -25
- {TESPy-0.2.0 → TESPy-0.2.1}/tespy/tools/logger.py +2 -1
- TESPy-0.2.0/README.rst +0 -62
- TESPy-0.2.0/TESPy.egg-info/requires.txt +0 -5
- TESPy-0.2.0/tespy/data/char_lines.json +0 -191
- {TESPy-0.2.0 → TESPy-0.2.1}/TESPy.egg-info/SOURCES.txt +0 -0
- {TESPy-0.2.0 → TESPy-0.2.1}/TESPy.egg-info/dependency_links.txt +0 -0
- {TESPy-0.2.0 → TESPy-0.2.1}/TESPy.egg-info/top_level.txt +0 -0
- {TESPy-0.2.0 → TESPy-0.2.1}/setup.cfg +0 -0
- {TESPy-0.2.0 → TESPy-0.2.1}/tespy/components/__init__.py +0 -0
- {TESPy-0.2.0 → TESPy-0.2.1}/tespy/data/__init__.py +0 -0
- {TESPy-0.2.0 → TESPy-0.2.1}/tespy/data/char_maps.json +0 -0
- {TESPy-0.2.0 → TESPy-0.2.1}/tespy/networks/__init__.py +0 -0
- {TESPy-0.2.0 → TESPy-0.2.1}/tespy/tools/__init__.py +0 -0
- {TESPy-0.2.0 → TESPy-0.2.1}/tespy/tools/global_vars.py +0 -0
|
@@ -1,50 +1,80 @@
|
|
|
1
1
|
Metadata-Version: 1.2
|
|
2
2
|
Name: TESPy
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Thermal Engineering Systems in Python (TESPy)
|
|
5
5
|
Home-page: http://github.com/oemof/tespy
|
|
6
6
|
Author: Francesco Witte
|
|
7
7
|
Author-email: francesco.witte@web.de
|
|
8
8
|
License: MIT
|
|
9
|
-
Description: .. image:: https://coveralls.io/repos/github/oemof/tespy/badge.svg?branch=
|
|
10
|
-
:target: https://coveralls.io/github/oemof/tespy?branch=
|
|
11
|
-
.. image:: https://travis-ci.org/oemof/tespy.svg?branch=
|
|
9
|
+
Description: .. image:: https://coveralls.io/repos/github/oemof/tespy/badge.svg?branch=master
|
|
10
|
+
:target: https://coveralls.io/github/oemof/tespy?branch=master
|
|
11
|
+
.. image:: https://travis-ci.org/oemof/tespy.svg?branch=master
|
|
12
12
|
:target: https://travis-ci.org/oemof/tespy
|
|
13
|
-
.. image:: https://readthedocs.org/projects/tespy/badge/?version=
|
|
14
|
-
:target: https://tespy.readthedocs.io/en/
|
|
13
|
+
.. image:: https://readthedocs.org/projects/tespy/badge/?version=master
|
|
14
|
+
:target: https://tespy.readthedocs.io/en/master/
|
|
15
15
|
.. image:: https://badge.fury.io/py/TESPy.svg
|
|
16
16
|
:target: https://badge.fury.io/py/TESPy
|
|
17
17
|
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.2555866.svg
|
|
18
18
|
:target: https://doi.org/10.5281/zenodo.2555866
|
|
19
19
|
|
|
20
|
-
TESPy stands for "Thermal Engineering Systems in Python" and provides a
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
TESPy stands for "Thermal Engineering Systems in Python" and provides a
|
|
21
|
+
powerful simulation toolkit for thermal engineering plants such as power
|
|
22
|
+
plants, district heating systems or heat pumps. It is an external extension
|
|
23
|
+
module within the `Open Energy Modelling Framework <https://oemof.org/>`_ and
|
|
24
|
+
can be used as a standalone package.
|
|
25
|
+
|
|
26
|
+
With the TESPy package you are able to calculate stationary operation in order
|
|
27
|
+
to design the process of thermal energy systems. From that point it is possible
|
|
28
|
+
to simulate the offdesign behaviour of your plant using underlying
|
|
29
|
+
characteristics for each of the plants components. The package inlcudes basic
|
|
30
|
+
components, such as turbines, pumps, compressors, heat exchangers, pipes,
|
|
31
|
+
mixers and splitters as well as some advanced components (derivatives of heat
|
|
32
|
+
exchangers, drum).
|
|
33
|
+
|
|
34
|
+
Everybody is welcome to use and/or develop TESPy. Contribution is already
|
|
35
|
+
possible on a low level by simply fixing typos in TESPy's documentation or
|
|
36
|
+
rephrasing sections which are unclear. If you want to support us that way
|
|
37
|
+
please fork the TESPy repository to your own github account and make changes
|
|
38
|
+
as described in the github guidelines:
|
|
39
|
+
https://guides.github.com/activities/hello-world/
|
|
25
40
|
|
|
26
41
|
Documentation
|
|
27
42
|
=============
|
|
28
43
|
|
|
29
|
-
You can find the full documentation at
|
|
44
|
+
You can find the full documentation at
|
|
45
|
+
`readthedocs <http://tespy.readthedocs.org>`_. Use the
|
|
46
|
+
`project site <http://readthedocs.org/projects/tespy>`_ of readthedocs to
|
|
47
|
+
choose the version of the documentation. Go to the
|
|
48
|
+
`download page <http://readthedocs.org/projects/tespy/downloads/>`_ to
|
|
49
|
+
download different versions and formats (pdf, html, epub) of the documentation.
|
|
30
50
|
|
|
31
51
|
To get the latest news visit and follow our `website <https://www.oemof.org>`_.
|
|
32
52
|
|
|
33
53
|
Installing TESPy
|
|
34
54
|
================
|
|
35
55
|
|
|
36
|
-
If you have a working Python3 environment, use pypi to install the latest
|
|
56
|
+
If you have a working Python3 environment, use pypi to install the latest
|
|
57
|
+
tespy version:
|
|
37
58
|
|
|
38
59
|
.. code:: bash
|
|
39
60
|
|
|
40
61
|
pip install tespy
|
|
41
62
|
|
|
42
|
-
If you want to use the latest features, you might want to install the
|
|
63
|
+
If you want to use the latest features, you might want to install the
|
|
64
|
+
**developer version**. See section
|
|
65
|
+
`Developing TESPy <http://tespy.readthedocs.io/en/dev/developing_tespy.html>`_
|
|
66
|
+
for more information. The developer version is not recommended for productive
|
|
67
|
+
use.
|
|
43
68
|
|
|
44
69
|
Examples
|
|
45
70
|
========
|
|
46
71
|
|
|
47
|
-
For a short introduction on how TESPy works and how you can use it, we provide
|
|
72
|
+
For a short introduction on how TESPy works and how you can use it, we provide
|
|
73
|
+
some
|
|
74
|
+
`examples and tutorials <http://tespy.readthedocs.io/en/latest/getting_started.html>`_,
|
|
75
|
+
go and check them out. You can download the python scripts of all example plants from
|
|
76
|
+
the `tespy_examples <https://github.com/oemof/oemof-examples/tree/master/oemof_examples/tespy>`_
|
|
77
|
+
repository.
|
|
48
78
|
|
|
49
79
|
License
|
|
50
80
|
=======
|
TESPy-0.2.1/README.rst
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
.. image:: https://coveralls.io/repos/github/oemof/tespy/badge.svg?branch=master
|
|
2
|
+
:target: https://coveralls.io/github/oemof/tespy?branch=master
|
|
3
|
+
.. image:: https://travis-ci.org/oemof/tespy.svg?branch=master
|
|
4
|
+
:target: https://travis-ci.org/oemof/tespy
|
|
5
|
+
.. image:: https://readthedocs.org/projects/tespy/badge/?version=master
|
|
6
|
+
:target: https://tespy.readthedocs.io/en/master/
|
|
7
|
+
.. image:: https://badge.fury.io/py/TESPy.svg
|
|
8
|
+
:target: https://badge.fury.io/py/TESPy
|
|
9
|
+
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.2555866.svg
|
|
10
|
+
:target: https://doi.org/10.5281/zenodo.2555866
|
|
11
|
+
|
|
12
|
+
TESPy stands for "Thermal Engineering Systems in Python" and provides a
|
|
13
|
+
powerful simulation toolkit for thermal engineering plants such as power
|
|
14
|
+
plants, district heating systems or heat pumps. It is an external extension
|
|
15
|
+
module within the `Open Energy Modelling Framework <https://oemof.org/>`_ and
|
|
16
|
+
can be used as a standalone package.
|
|
17
|
+
|
|
18
|
+
With the TESPy package you are able to calculate stationary operation in order
|
|
19
|
+
to design the process of thermal energy systems. From that point it is possible
|
|
20
|
+
to simulate the offdesign behaviour of your plant using underlying
|
|
21
|
+
characteristics for each of the plants components. The package inlcudes basic
|
|
22
|
+
components, such as turbines, pumps, compressors, heat exchangers, pipes,
|
|
23
|
+
mixers and splitters as well as some advanced components (derivatives of heat
|
|
24
|
+
exchangers, drum).
|
|
25
|
+
|
|
26
|
+
Everybody is welcome to use and/or develop TESPy. Contribution is already
|
|
27
|
+
possible on a low level by simply fixing typos in TESPy's documentation or
|
|
28
|
+
rephrasing sections which are unclear. If you want to support us that way
|
|
29
|
+
please fork the TESPy repository to your own github account and make changes
|
|
30
|
+
as described in the github guidelines:
|
|
31
|
+
https://guides.github.com/activities/hello-world/
|
|
32
|
+
|
|
33
|
+
Documentation
|
|
34
|
+
=============
|
|
35
|
+
|
|
36
|
+
You can find the full documentation at
|
|
37
|
+
`readthedocs <http://tespy.readthedocs.org>`_. Use the
|
|
38
|
+
`project site <http://readthedocs.org/projects/tespy>`_ of readthedocs to
|
|
39
|
+
choose the version of the documentation. Go to the
|
|
40
|
+
`download page <http://readthedocs.org/projects/tespy/downloads/>`_ to
|
|
41
|
+
download different versions and formats (pdf, html, epub) of the documentation.
|
|
42
|
+
|
|
43
|
+
To get the latest news visit and follow our `website <https://www.oemof.org>`_.
|
|
44
|
+
|
|
45
|
+
Installing TESPy
|
|
46
|
+
================
|
|
47
|
+
|
|
48
|
+
If you have a working Python3 environment, use pypi to install the latest
|
|
49
|
+
tespy version:
|
|
50
|
+
|
|
51
|
+
.. code:: bash
|
|
52
|
+
|
|
53
|
+
pip install tespy
|
|
54
|
+
|
|
55
|
+
If you want to use the latest features, you might want to install the
|
|
56
|
+
**developer version**. See section
|
|
57
|
+
`Developing TESPy <http://tespy.readthedocs.io/en/dev/developing_tespy.html>`_
|
|
58
|
+
for more information. The developer version is not recommended for productive
|
|
59
|
+
use.
|
|
60
|
+
|
|
61
|
+
Examples
|
|
62
|
+
========
|
|
63
|
+
|
|
64
|
+
For a short introduction on how TESPy works and how you can use it, we provide
|
|
65
|
+
some
|
|
66
|
+
`examples and tutorials <http://tespy.readthedocs.io/en/latest/getting_started.html>`_,
|
|
67
|
+
go and check them out. You can download the python scripts of all example plants from
|
|
68
|
+
the `tespy_examples <https://github.com/oemof/oemof-examples/tree/master/oemof_examples/tespy>`_
|
|
69
|
+
repository.
|
|
70
|
+
|
|
71
|
+
License
|
|
72
|
+
=======
|
|
73
|
+
|
|
74
|
+
Copyright (c) 2019 oemof developer group
|
|
75
|
+
|
|
76
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
77
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
78
|
+
in the Software without restriction, including without limitation the rights
|
|
79
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
80
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
81
|
+
furnished to do so, subject to the following conditions:
|
|
82
|
+
|
|
83
|
+
The above copyright notice and this permission notice shall be included in all
|
|
84
|
+
copies or substantial portions of the Software.
|
|
85
|
+
|
|
86
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
87
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
88
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
89
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
90
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
91
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
92
|
+
SOFTWARE.
|
|
@@ -1,50 +1,80 @@
|
|
|
1
1
|
Metadata-Version: 1.2
|
|
2
2
|
Name: TESPy
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Thermal Engineering Systems in Python (TESPy)
|
|
5
5
|
Home-page: http://github.com/oemof/tespy
|
|
6
6
|
Author: Francesco Witte
|
|
7
7
|
Author-email: francesco.witte@web.de
|
|
8
8
|
License: MIT
|
|
9
|
-
Description: .. image:: https://coveralls.io/repos/github/oemof/tespy/badge.svg?branch=
|
|
10
|
-
:target: https://coveralls.io/github/oemof/tespy?branch=
|
|
11
|
-
.. image:: https://travis-ci.org/oemof/tespy.svg?branch=
|
|
9
|
+
Description: .. image:: https://coveralls.io/repos/github/oemof/tespy/badge.svg?branch=master
|
|
10
|
+
:target: https://coveralls.io/github/oemof/tespy?branch=master
|
|
11
|
+
.. image:: https://travis-ci.org/oemof/tespy.svg?branch=master
|
|
12
12
|
:target: https://travis-ci.org/oemof/tespy
|
|
13
|
-
.. image:: https://readthedocs.org/projects/tespy/badge/?version=
|
|
14
|
-
:target: https://tespy.readthedocs.io/en/
|
|
13
|
+
.. image:: https://readthedocs.org/projects/tespy/badge/?version=master
|
|
14
|
+
:target: https://tespy.readthedocs.io/en/master/
|
|
15
15
|
.. image:: https://badge.fury.io/py/TESPy.svg
|
|
16
16
|
:target: https://badge.fury.io/py/TESPy
|
|
17
17
|
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.2555866.svg
|
|
18
18
|
:target: https://doi.org/10.5281/zenodo.2555866
|
|
19
19
|
|
|
20
|
-
TESPy stands for "Thermal Engineering Systems in Python" and provides a
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
TESPy stands for "Thermal Engineering Systems in Python" and provides a
|
|
21
|
+
powerful simulation toolkit for thermal engineering plants such as power
|
|
22
|
+
plants, district heating systems or heat pumps. It is an external extension
|
|
23
|
+
module within the `Open Energy Modelling Framework <https://oemof.org/>`_ and
|
|
24
|
+
can be used as a standalone package.
|
|
25
|
+
|
|
26
|
+
With the TESPy package you are able to calculate stationary operation in order
|
|
27
|
+
to design the process of thermal energy systems. From that point it is possible
|
|
28
|
+
to simulate the offdesign behaviour of your plant using underlying
|
|
29
|
+
characteristics for each of the plants components. The package inlcudes basic
|
|
30
|
+
components, such as turbines, pumps, compressors, heat exchangers, pipes,
|
|
31
|
+
mixers and splitters as well as some advanced components (derivatives of heat
|
|
32
|
+
exchangers, drum).
|
|
33
|
+
|
|
34
|
+
Everybody is welcome to use and/or develop TESPy. Contribution is already
|
|
35
|
+
possible on a low level by simply fixing typos in TESPy's documentation or
|
|
36
|
+
rephrasing sections which are unclear. If you want to support us that way
|
|
37
|
+
please fork the TESPy repository to your own github account and make changes
|
|
38
|
+
as described in the github guidelines:
|
|
39
|
+
https://guides.github.com/activities/hello-world/
|
|
25
40
|
|
|
26
41
|
Documentation
|
|
27
42
|
=============
|
|
28
43
|
|
|
29
|
-
You can find the full documentation at
|
|
44
|
+
You can find the full documentation at
|
|
45
|
+
`readthedocs <http://tespy.readthedocs.org>`_. Use the
|
|
46
|
+
`project site <http://readthedocs.org/projects/tespy>`_ of readthedocs to
|
|
47
|
+
choose the version of the documentation. Go to the
|
|
48
|
+
`download page <http://readthedocs.org/projects/tespy/downloads/>`_ to
|
|
49
|
+
download different versions and formats (pdf, html, epub) of the documentation.
|
|
30
50
|
|
|
31
51
|
To get the latest news visit and follow our `website <https://www.oemof.org>`_.
|
|
32
52
|
|
|
33
53
|
Installing TESPy
|
|
34
54
|
================
|
|
35
55
|
|
|
36
|
-
If you have a working Python3 environment, use pypi to install the latest
|
|
56
|
+
If you have a working Python3 environment, use pypi to install the latest
|
|
57
|
+
tespy version:
|
|
37
58
|
|
|
38
59
|
.. code:: bash
|
|
39
60
|
|
|
40
61
|
pip install tespy
|
|
41
62
|
|
|
42
|
-
If you want to use the latest features, you might want to install the
|
|
63
|
+
If you want to use the latest features, you might want to install the
|
|
64
|
+
**developer version**. See section
|
|
65
|
+
`Developing TESPy <http://tespy.readthedocs.io/en/dev/developing_tespy.html>`_
|
|
66
|
+
for more information. The developer version is not recommended for productive
|
|
67
|
+
use.
|
|
43
68
|
|
|
44
69
|
Examples
|
|
45
70
|
========
|
|
46
71
|
|
|
47
|
-
For a short introduction on how TESPy works and how you can use it, we provide
|
|
72
|
+
For a short introduction on how TESPy works and how you can use it, we provide
|
|
73
|
+
some
|
|
74
|
+
`examples and tutorials <http://tespy.readthedocs.io/en/latest/getting_started.html>`_,
|
|
75
|
+
go and check them out. You can download the python scripts of all example plants from
|
|
76
|
+
the `tespy_examples <https://github.com/oemof/oemof-examples/tree/master/oemof_examples/tespy>`_
|
|
77
|
+
repository.
|
|
48
78
|
|
|
49
79
|
License
|
|
50
80
|
=======
|
|
@@ -7,7 +7,7 @@ def read(fname):
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
setup(name='TESPy',
|
|
10
|
-
version='0.2.
|
|
10
|
+
version='0.2.1',
|
|
11
11
|
description='Thermal Engineering Systems in Python (TESPy)',
|
|
12
12
|
url='http://github.com/oemof/tespy',
|
|
13
13
|
author='Francesco Witte',
|
|
@@ -20,8 +20,8 @@ setup(name='TESPy',
|
|
|
20
20
|
data_files=[('tespy/data', ['tespy/data/char_lines.json',
|
|
21
21
|
'tespy/data/char_maps.json'])],
|
|
22
22
|
python_requires='>=3',
|
|
23
|
-
install_requires=['CoolProp
|
|
24
|
-
'numpy
|
|
25
|
-
'pandas
|
|
26
|
-
'scipy
|
|
27
|
-
'tabulate
|
|
23
|
+
install_requires=['CoolProp>=6,<7',
|
|
24
|
+
'numpy>=1.13.3,<2',
|
|
25
|
+
'pandas>=0.19.2,!=1.0.0,<2',
|
|
26
|
+
'scipy>=0.19.1,<2',
|
|
27
|
+
'tabulate>=0.8.2,<0.9'])
|
|
@@ -28,6 +28,8 @@ from tespy.tools.data_containers import dc_simple, dc_cp
|
|
|
28
28
|
|
|
29
29
|
class cycle_closer(component):
|
|
30
30
|
r"""
|
|
31
|
+
Component for closing cycles.
|
|
32
|
+
|
|
31
33
|
Equations
|
|
32
34
|
|
|
33
35
|
**mandatory equations**
|
|
@@ -51,6 +53,21 @@ class cycle_closer(component):
|
|
|
51
53
|
offdesign : list
|
|
52
54
|
List containing offdesign parameters (stated as String).
|
|
53
55
|
|
|
56
|
+
design_path: str
|
|
57
|
+
Path to the components design case.
|
|
58
|
+
|
|
59
|
+
local_offdesign : boolean
|
|
60
|
+
Treat this component in offdesign mode in a design calculation.
|
|
61
|
+
|
|
62
|
+
local_design : boolean
|
|
63
|
+
Treat this component in design mode in an offdesign calculation.
|
|
64
|
+
|
|
65
|
+
char_warnings: boolean
|
|
66
|
+
Ignore warnings on default characteristics usage for this component.
|
|
67
|
+
|
|
68
|
+
printout: boolean
|
|
69
|
+
Include this component in the network's results printout.
|
|
70
|
+
|
|
54
71
|
Note
|
|
55
72
|
----
|
|
56
73
|
This component can be used to close a cycle process. The system of
|
|
@@ -109,8 +126,17 @@ class cycle_closer(component):
|
|
|
109
126
|
|
|
110
127
|
component.comp_init(self, nw)
|
|
111
128
|
|
|
112
|
-
#
|
|
113
|
-
|
|
129
|
+
# number of mandatroy equations for
|
|
130
|
+
# pressure: 1
|
|
131
|
+
# enthalpy: 1
|
|
132
|
+
self.num_eq = 2
|
|
133
|
+
|
|
134
|
+
self.mat_deriv = np.zeros((
|
|
135
|
+
self.num_eq,
|
|
136
|
+
self.num_i + self.num_o + self.num_vars,
|
|
137
|
+
self.num_nw_vars))
|
|
138
|
+
|
|
139
|
+
self.vec_res = np.ones(self.num_eq)
|
|
114
140
|
# derivatives for pressure
|
|
115
141
|
self.mat_deriv[0, 0, 1] = 1
|
|
116
142
|
self.mat_deriv[0, 1, 1] = -1
|
|
@@ -120,46 +146,36 @@ class cycle_closer(component):
|
|
|
120
146
|
|
|
121
147
|
def equations(self):
|
|
122
148
|
r"""
|
|
123
|
-
|
|
149
|
+
Calculate vector vec_res with results of equations.
|
|
124
150
|
|
|
125
151
|
Returns
|
|
126
152
|
-------
|
|
127
153
|
vec_res : list
|
|
128
154
|
Vector of residual values.
|
|
129
155
|
"""
|
|
130
|
-
|
|
131
|
-
|
|
156
|
+
k = 0
|
|
132
157
|
######################################################################
|
|
133
158
|
# equation for pressure
|
|
134
|
-
vec_res
|
|
159
|
+
self.vec_res[k] = self.inl[0].p.val_SI - self.outl[0].p.val_SI
|
|
160
|
+
k += 1
|
|
135
161
|
|
|
136
162
|
######################################################################
|
|
137
163
|
# equation for enthalpy
|
|
138
|
-
vec_res
|
|
139
|
-
|
|
140
|
-
######################################################################
|
|
164
|
+
self.vec_res[k] = self.inl[0].h.val_SI - self.outl[0].h.val_SI
|
|
165
|
+
k += 1
|
|
141
166
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
def derivatives(self):
|
|
145
|
-
r"""
|
|
146
|
-
Calculates matrix of partial derivatives for given equations.
|
|
147
|
-
|
|
148
|
-
Returns
|
|
149
|
-
-------
|
|
150
|
-
mat_deriv : ndarray
|
|
151
|
-
Matrix of partial derivatives.
|
|
152
|
-
"""
|
|
167
|
+
def derivatives(self, vek_z):
|
|
168
|
+
r"""Calculate partial derivatives for given equations."""
|
|
153
169
|
######################################################################
|
|
154
|
-
#
|
|
155
|
-
|
|
156
|
-
return self.mat_deriv
|
|
170
|
+
# all derivatives are static
|
|
157
171
|
|
|
158
172
|
def calc_parameters(self):
|
|
159
173
|
|
|
160
|
-
|
|
161
|
-
|
|
174
|
+
# calculate deviation in mass flow
|
|
175
|
+
self.mass_deviation.val = np.abs(
|
|
176
|
+
self.inl[0].m.val_SI - self.outl[0].m.val_SI)
|
|
162
177
|
|
|
178
|
+
# calculate deviation in fluid composition
|
|
163
179
|
d1 = self.inl[0].fluid.val
|
|
164
180
|
d2 = self.outl[0].fluid.val
|
|
165
181
|
diff = [d1[key] - d2[key] for key in d1.keys()]
|
|
@@ -188,6 +204,21 @@ class sink(component):
|
|
|
188
204
|
offdesign : list
|
|
189
205
|
List containing offdesign parameters (stated as String).
|
|
190
206
|
|
|
207
|
+
design_path: str
|
|
208
|
+
Path to the components design case.
|
|
209
|
+
|
|
210
|
+
local_offdesign : boolean
|
|
211
|
+
Treat this component in offdesign mode in a design calculation.
|
|
212
|
+
|
|
213
|
+
local_design : boolean
|
|
214
|
+
Treat this component in design mode in an offdesign calculation.
|
|
215
|
+
|
|
216
|
+
char_warnings: boolean
|
|
217
|
+
Ignore warnings on default characteristics usage for this component.
|
|
218
|
+
|
|
219
|
+
printout: boolean
|
|
220
|
+
Include this component in the network's results printout.
|
|
221
|
+
|
|
191
222
|
Example
|
|
192
223
|
-------
|
|
193
224
|
Create a sink and specify a label.
|
|
@@ -229,6 +260,21 @@ class source(component):
|
|
|
229
260
|
offdesign : list
|
|
230
261
|
List containing offdesign parameters (stated as String).
|
|
231
262
|
|
|
263
|
+
design_path: str
|
|
264
|
+
Path to the components design case.
|
|
265
|
+
|
|
266
|
+
local_offdesign : boolean
|
|
267
|
+
Treat this component in offdesign mode in a design calculation.
|
|
268
|
+
|
|
269
|
+
local_design : boolean
|
|
270
|
+
Treat this component in design mode in an offdesign calculation.
|
|
271
|
+
|
|
272
|
+
char_warnings: boolean
|
|
273
|
+
Ignore warnings on default characteristics usage for this component.
|
|
274
|
+
|
|
275
|
+
printout: boolean
|
|
276
|
+
Include this component in the network's results printout.
|
|
277
|
+
|
|
232
278
|
Example
|
|
233
279
|
-------
|
|
234
280
|
Create a source and specify a label.
|
|
@@ -254,6 +300,8 @@ class source(component):
|
|
|
254
300
|
|
|
255
301
|
class subsystem_interface(component):
|
|
256
302
|
r"""
|
|
303
|
+
The subsystem interface does not change fluid properties.
|
|
304
|
+
|
|
257
305
|
Equations
|
|
258
306
|
|
|
259
307
|
**mandatory equations**
|
|
@@ -293,6 +341,21 @@ class subsystem_interface(component):
|
|
|
293
341
|
offdesign : list
|
|
294
342
|
List containing offdesign parameters (stated as String).
|
|
295
343
|
|
|
344
|
+
design_path: str
|
|
345
|
+
Path to the components design case.
|
|
346
|
+
|
|
347
|
+
local_offdesign : boolean
|
|
348
|
+
Treat this component in offdesign mode in a design calculation.
|
|
349
|
+
|
|
350
|
+
local_design : boolean
|
|
351
|
+
Treat this component in design mode in an offdesign calculation.
|
|
352
|
+
|
|
353
|
+
char_warnings: boolean
|
|
354
|
+
Ignore warnings on default characteristics usage for this component.
|
|
355
|
+
|
|
356
|
+
printout: boolean
|
|
357
|
+
Include this component in the network's results printout.
|
|
358
|
+
|
|
296
359
|
num_inter : float/tespy.helpers.dc_simple
|
|
297
360
|
Number of interfaces for subsystem.
|
|
298
361
|
|
|
@@ -308,7 +371,8 @@ class subsystem_interface(component):
|
|
|
308
371
|
rest of your network. It is necessary to specify the number of interfaces
|
|
309
372
|
of the subsystem interface, if you want any number other than 1. We will
|
|
310
373
|
not go in depth of subsystem usage in this example. Please refer to
|
|
311
|
-
|
|
374
|
+
:ref:`this section <tespy_subsystems_label>` for more information on
|
|
375
|
+
building your own subsystems.
|
|
312
376
|
|
|
313
377
|
>>> from tespy.components import sink, source, subsystem_interface
|
|
314
378
|
>>> from tespy.connections import connection
|
|
@@ -363,84 +427,96 @@ class subsystem_interface(component):
|
|
|
363
427
|
|
|
364
428
|
component.comp_init(self, nw)
|
|
365
429
|
|
|
366
|
-
#
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
430
|
+
# number of mandatroy equations for
|
|
431
|
+
# fluid: num_inter * num_nw_fluids
|
|
432
|
+
# mass flow: num_inter
|
|
433
|
+
# pressure: num_inter
|
|
434
|
+
# enthalpy: num_inter
|
|
435
|
+
self.num_eq = (self.num_nw_fluids + 3) * self.num_i
|
|
436
|
+
|
|
437
|
+
self.mat_deriv = np.zeros((
|
|
438
|
+
self.num_eq,
|
|
439
|
+
2 * self.num_i,
|
|
440
|
+
self.num_nw_vars))
|
|
441
|
+
|
|
442
|
+
self.vec_res = np.ones(self.num_eq)
|
|
443
|
+
stop = self.num_nw_fluids * self.num_i
|
|
444
|
+
self.mat_deriv[0:stop] = self.fluid_deriv()
|
|
445
|
+
start = stop
|
|
446
|
+
stop = start + self.num_i
|
|
447
|
+
self.mat_deriv[start:stop] = self.inout_deriv(0)
|
|
448
|
+
start = stop
|
|
449
|
+
stop = start + self.num_i
|
|
450
|
+
self.mat_deriv[start:stop] = self.inout_deriv(1)
|
|
451
|
+
start = stop
|
|
452
|
+
stop = start + self.num_i
|
|
453
|
+
self.mat_deriv[start:stop] = self.inout_deriv(2)
|
|
371
454
|
|
|
372
455
|
def equations(self):
|
|
373
456
|
r"""
|
|
374
|
-
|
|
457
|
+
Calculate vector vec_res with results of equations.
|
|
375
458
|
|
|
376
459
|
Returns
|
|
377
460
|
-------
|
|
378
461
|
vec_res : list
|
|
379
462
|
Vector of residual values.
|
|
380
463
|
"""
|
|
381
|
-
|
|
382
|
-
|
|
464
|
+
k = 0
|
|
383
465
|
######################################################################
|
|
384
466
|
# eqations for fluids
|
|
385
467
|
for i in range(self.num_i):
|
|
386
468
|
for fluid, x in self.inl[i].fluid.val.items():
|
|
387
|
-
vec_res
|
|
469
|
+
self.vec_res[k] = x - self.outl[i].fluid.val[fluid]
|
|
470
|
+
k += 1
|
|
388
471
|
|
|
389
472
|
######################################################################
|
|
390
473
|
# equations for mass flow
|
|
391
474
|
for i in range(self.num_i):
|
|
392
|
-
vec_res
|
|
475
|
+
self.vec_res[k] = self.inl[i].m.val_SI - self.outl[i].m.val_SI
|
|
476
|
+
k += 1
|
|
393
477
|
|
|
394
478
|
######################################################################
|
|
395
479
|
# equations for pressure
|
|
396
480
|
for i in range(self.num_i):
|
|
397
|
-
vec_res
|
|
481
|
+
self.vec_res[k] = self.inl[i].p.val_SI - self.outl[i].p.val_SI
|
|
482
|
+
k += 1
|
|
398
483
|
|
|
399
484
|
######################################################################
|
|
400
485
|
# equations for enthalpy
|
|
401
486
|
for i in range(self.num_i):
|
|
402
|
-
vec_res
|
|
487
|
+
self.vec_res[k] = self.inl[i].h.val_SI - self.outl[i].h.val_SI
|
|
488
|
+
k += 1
|
|
403
489
|
|
|
404
490
|
######################################################################
|
|
405
491
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
def derivatives(self):
|
|
409
|
-
r"""
|
|
410
|
-
Calculates matrix of partial derivatives for given equations.
|
|
411
|
-
|
|
412
|
-
Returns
|
|
413
|
-
-------
|
|
414
|
-
mat_deriv : ndarray
|
|
415
|
-
Matrix of partial derivatives.
|
|
416
|
-
"""
|
|
492
|
+
def derivatives(self, vek_z):
|
|
493
|
+
r"""Calculate partial derivatives for given equations."""
|
|
417
494
|
######################################################################
|
|
418
|
-
#
|
|
419
|
-
mat_deriv = self.fl_deriv + self.m_deriv + self.p_deriv + self.h_deriv
|
|
420
|
-
|
|
421
|
-
return np.asarray(mat_deriv)
|
|
495
|
+
# all derivatives are static
|
|
422
496
|
|
|
423
497
|
def fluid_deriv(self):
|
|
424
498
|
r"""
|
|
425
|
-
|
|
499
|
+
Calculate the partial derivatives for all fluid balance equations.
|
|
426
500
|
|
|
427
501
|
Returns
|
|
428
502
|
-------
|
|
429
503
|
deriv : list
|
|
430
504
|
Matrix with partial derivatives for the fluid equations.
|
|
431
505
|
"""
|
|
432
|
-
deriv = np.zeros((
|
|
433
|
-
|
|
506
|
+
deriv = np.zeros((self.num_nw_fluids * self.num_i,
|
|
507
|
+
2 * self.num_i,
|
|
508
|
+
self.num_nw_vars))
|
|
434
509
|
for i in range(self.num_i):
|
|
435
|
-
for j in range(self.
|
|
436
|
-
deriv[i * self.
|
|
437
|
-
deriv[i * self.
|
|
510
|
+
for j in range(self.num_nw_fluids):
|
|
511
|
+
deriv[i * self.num_nw_fluids + j, i, j + 3] = 1
|
|
512
|
+
deriv[i * self.num_nw_fluids + j, self.num_i + i, j + 3] = -1
|
|
438
513
|
return deriv.tolist()
|
|
439
514
|
|
|
440
515
|
def inout_deriv(self, pos):
|
|
441
516
|
r"""
|
|
442
|
-
|
|
443
|
-
|
|
517
|
+
Calculate partial derivatives.
|
|
518
|
+
|
|
519
|
+
Method applies for all mass flow, pressure and enthalpy equations.
|
|
444
520
|
|
|
445
521
|
Parameters
|
|
446
522
|
----------
|
|
@@ -453,7 +529,7 @@ class subsystem_interface(component):
|
|
|
453
529
|
deriv : list
|
|
454
530
|
Matrix with partial derivatives for the fluid equations.
|
|
455
531
|
"""
|
|
456
|
-
deriv = np.zeros((self.num_i, 2 * self.num_i, self.
|
|
532
|
+
deriv = np.zeros((self.num_i, 2 * self.num_i, self.num_nw_vars))
|
|
457
533
|
for i in range(self.num_i):
|
|
458
534
|
deriv[i, i, pos] = 1
|
|
459
535
|
for j in range(self.num_i):
|