Skip to content

Commit

Permalink
Merge branch 'dev' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
fwitte committed Jul 14, 2021
2 parents 67650cd + 4df5e11 commit 67c3c3f
Show file tree
Hide file tree
Showing 37 changed files with 712 additions and 380 deletions.
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
The developer rules can be found in the chapter [developing TESPy](https://tespy.readthedocs.io/en/latest/developing_tespy.html) of the tespy.documentation.
The developer rules can be found in the chapter
[developing TESPy](https://tespy.readthedocs.io/en/dev/developing_tespy.html)
of the tespy.documentation.
2 changes: 1 addition & 1 deletion docs/api/tespy.tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tespy.tools module
:show-inheritance:

tespy.tools.analyses module
--------------------------
---------------------------

.. automodule:: tespy.tools.analyses
:members:
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ['./_build/_static']

html_css_files = ['css/custom.css', ]

Expand Down
7 changes: 0 additions & 7 deletions docs/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,3 @@ @book{Bejan1996
year={1996},
publisher = {Wiley}
}

@book{ET1,
editor = {George Tsatsaronis},
title = {Energietechnik - Umdruck zur Vorlesung},
publisher = {TU Berlin - Institut für Energietechnik - Fachgebiet für Energietechnik und Umweltschutz},
year = {2018}
}
3 changes: 2 additions & 1 deletion docs/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Discover noteable new features and improvements in each release
:depth: 1
:local:
:backlinks: top


.. include:: whats_new/v0-4-4.rst
.. include:: whats_new/v0-4-3-003.rst
.. include:: whats_new/v0-4-3-001.rst
.. include:: whats_new/v0-4-3.rst
Expand Down
6 changes: 4 additions & 2 deletions docs/whats_new/v0-0-5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ v0.0.5 (October, 25, 2018)

New Features
############
- added new component: motoric cogeneration unit (`79a1177 <https://github.com/oemof/tespy/commit/79a1177d5db130465676907d9a51b680005bdc7a>`_). An example is provided `here <https://github.com/fwitte/tespy_examples/tree/master/cogeneration_unit>`_.
- added new component: motoric cogeneration unit (`79a1177 <https://github.com/oemof/tespy/commit/79a1177d5db130465676907d9a51b680005bdc7a>`_).
An example is provided `here <https://github.com/oemof/oemof-examples/tree/master/oemof_examples/tespy/combustion>`_.
- improved fluid property checks (`8adc76c <https://github.com/oemof/tespy/commit/8adc76c25ef976ed90ac6fba0d8c2f94e43ca7c5>`_).
- added bus characteristics for modeling variable efficiencys (e.g. for generator, motor, boiler) (`79a1177 <https://github.com/oemof/tespy/commit/79a1177d5db130465676907d9a51b680005bdc7a>`_).
- isentropic efficiency characteristic for compressor linked to pressure ratio (`85d317d <https://github.com/oemof/tespy/commit/85d317dea8cce8b7f6d149cca90317e6595a2485>`_).
- added volumetric flow specification (`63db64d <https://github.com/oemof/tespy/commit/63db64de7fc5a26eb4d36b94bdd67fc3a4f7f715>`_).

Documentation
#############
- adapted documentation and (`example code <https://github.com/fwitte/tespy_examples>`_) in regard of new features.
- adapted documentation and (`example code <https://github.com/oemof/oemof-examples/tree/master/oemof_examples/tespy/>`_)
in regard of new features.
- fixed some typos in documentation.

Parameter renaming
Expand Down
32 changes: 32 additions & 0 deletions docs/whats_new/v0-4-4.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
v0.4.4 - Reynolds' Reminiscence (July, 14, 2021)
++++++++++++++++++++++++++++++++++++++++++++++++

Documentation
#############
- Fix some typos here and there.

Bug Fixes
#########
- Fix pandas version 1.3.0 dependencies
(`PR #277 <https://github.com/oemof/tespy/pull/277>`_).
- Add missing results for some components in the results DataFrame of the
network (`PR #277 <https://github.com/oemof/tespy/pull/277>`_).
- Fix exergy balance equation of class merge
:py:class:`tespy.components.nodes.merge.Merge.exergy_balance`
(`PR #280 <https://github.com/oemof/tespy/pull/280>`_).
- Fix a lot of DeprecationWarnings in pandas
(`PR #280 <https://github.com/oemof/tespy/pull/280>`_).

Other Changes
#############
- Add warning logs for missing fluid composition data in the initialisation
process of the network
(`PR #278 <https://github.com/oemof/tespy/pull/278>`_).
- Add Dodecane to the available fuels for combustion
(`PR #273 <https://github.com/oemof/tespy/pull/273>`_).
- Add tests for the solar energy generating system
(`PR #280 <https://github.com/oemof/tespy/pull/280>`_).

Contributors
############
- Francesco Witte (`@fwitte <https://github.com/fwitte>`_)
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ max-line-length = 140
exclude = */migrations/*, docs/conf.py

[metadata]
description-file = README.rst
description_file = README.rst

[options]
# tests_require is a list of dependencies that are *absolutely required*
Expand Down Expand Up @@ -47,7 +47,7 @@ python_files =
tests.py
addopts =
-ra
--strict
--strict-markers
--doctest-modules
--doctest-glob=\*.rst
--tb=short
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def read(*names, **kwargs):

setup(
name='TESPy',
version='0.4.3-005',
version='0.4.4',
license='MIT',
description='Thermal Engineering Systems in Python (TESPy)',
long_description='%s' % (
Expand Down Expand Up @@ -58,7 +58,7 @@ def read(*names, **kwargs):
],
project_urls={
'Documentation': 'https://tespy.readthedocs.io/',
'Changelog': 'https://tespy.readthedocs.io/en/latest/whats_new.html',
'Changelog': 'https://tespy.readthedocs.io/en/main/whats_new.html',
'Issue Tracker': 'https://github.com/oemof/tespy/issues',
},
python_requires='>=3.7, <3.9',
Expand All @@ -72,6 +72,6 @@ def read(*names, **kwargs):
],
extras_require={
'dev': ['pytest', 'sphinx', 'sphinx_rtd_theme',
'sphinxcontrib.bibtex', ],
'sphinxcontrib.bibtex', 'tox', ],
'dummy': ['tespy']}
)
2 changes: 1 addition & 1 deletion src/tespy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8

__version__ = '0.4.3-005 - Grassmann\'s Graph'
__version__ = '0.4.4 - Reynolds\' Reminiscence'

# tespy data and connections import
from . import connections # noqa: F401
Expand Down
30 changes: 0 additions & 30 deletions src/tespy/components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,33 +26,3 @@
from .turbomachinery.compressor import Compressor # noqa: F401
from .turbomachinery.pump import Pump # noqa: F401
from .turbomachinery.turbine import Turbine # noqa: F401

# ############## deprecated components errors ############## #

from .deprecated import source # noqa: F401
from .deprecated import sink # noqa: F401
from .deprecated import cycle_closer # noqa: F401
from .deprecated import subsystem_interface # noqa: F401
from .deprecated import combustion_chamber # noqa: F401
from .deprecated import combustion_chamber_stoich # noqa: F401
from .deprecated import combustion_engine # noqa: F401
from .deprecated import orc_evaporator # noqa: F401
from .deprecated import condenser # noqa: F401
from .deprecated import desuperheater # noqa: F401
from .deprecated import heat_exchanger # noqa: F401
from .deprecated import heat_exchanger_simple # noqa: F401
from .deprecated import parabolic_trough # noqa: F401
from .deprecated import solar_collector # noqa: F401
from .deprecated import droplet_separator # noqa: F401
from .deprecated import drum # noqa: F401
from .deprecated import merge # noqa: F401
from .deprecated import node # noqa: F401
from .deprecated import separator # noqa: F401
from .deprecated import splitter # noqa: F401
from .deprecated import pipe # noqa: F401
from .deprecated import valve # noqa: F401
from .deprecated import water_electrolyzer # noqa: F401
from .deprecated import compressor # noqa: F401
from .deprecated import pump # noqa: F401
from .deprecated import turbine # noqa: F401
from .deprecated import subsystem # noqa: F401
4 changes: 2 additions & 2 deletions src/tespy/components/basics/cycle_closer.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ def component():
@staticmethod
def get_variables():
return {
'mass_deviation': dc_cp(val=0, max_val=1e-3),
'fluid_deviation': dc_cp(val=0, max_val=1e-5)
'mass_deviation': dc_cp(val=0, max_val=1e-3, is_result=True),
'fluid_deviation': dc_cp(val=0, max_val=1e-5, is_result=True)
}

def get_mandatory_constraints(self):
Expand Down
2 changes: 1 addition & 1 deletion src/tespy/components/basics/sink.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def exergy_balance(self, T0):
----
.. math::
\dot{E}_\mathrm{bus} = E_\mathrm{in}^\mathrm{PH}
\dot{E}_\mathrm{bus} = \dot{E}_\mathrm{in}^\mathrm{PH}
"""
self.E_P = np.nan
self.E_F = np.nan
Expand Down
2 changes: 1 addition & 1 deletion src/tespy/components/basics/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def exergy_balance(self, T0):
----
.. math::
\dot{E}_\mathrm{bus} = E_\mathrm{out}^\mathrm{PH}
\dot{E}_\mathrm{bus} = \dot{E}_\mathrm{out}^\mathrm{PH}
"""
self.E_P = np.nan
self.E_F = np.nan
Expand Down
11 changes: 7 additions & 4 deletions src/tespy/components/combustion/combustion_chamber.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,22 +201,24 @@ def comp_init(self, nw):
def setup_reaction_parameters(self):
r"""Setup parameters for reaction (gas name aliases and LHV)."""
self.fuel_list = []
fuels = ['methane', 'ethane', 'propane', 'butane', 'hydrogen']
fuels = [
'methane', 'ethane', 'propane', 'butane', 'hydrogen', 'nDodecane']
for f in fuels:
self.fuel_list += [x for x in self.nw_fluids if x in [
a.replace(' ', '') for a in CP.get_aliases(f)]]

if len(self.fuel_list) == 0:
msg = ('Your network\'s fluids do not contain any fuels, that are '
'available for the component ' + self.label + ' of type ' +
self.component() + '. Available fuels are: ' + str(fuels) +
'.')
self.component() + '. Available fuels are: ' +
', '.join(fuels) + '.')
logging.error(msg)
raise TESPyComponentError(msg)

else:
msg = ('The fuels for component ' + self.label + ' of type ' +
self.component() + ' are: ' + str(self.fuel_list) + '.')
self.component() + ' are: ' + ', '.join(self.fuel_list) +
'.')
logging.debug(msg)

for fluid in ['o2', 'co2', 'h2o', 'n2']:
Expand Down Expand Up @@ -277,6 +279,7 @@ def calc_lhv(self, f):
hf['ethane'] = -84.68
hf['propane'] = -103.8
hf['butane'] = -124.51
hf['nDodecane'] = -288.1
hf[self.o2] = 0
hf[self.co2] = -393.5
# water (gaseous)
Expand Down
129 changes: 0 additions & 129 deletions src/tespy/components/deprecated.py

This file was deleted.

3 changes: 3 additions & 0 deletions src/tespy/components/heat_exchangers/heat_exchanger_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,9 @@ def calc_parameters(self):
td_log = np.nan

self.kA.val = abs(i[0] * (o[2] - i[2]) / td_log)
self.kA.is_result = True
else:
self.kA.is_result = False

def entropy_balance(self):
r"""
Expand Down
3 changes: 3 additions & 0 deletions src/tespy/components/heat_exchangers/parabolic_trough.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,3 +366,6 @@ def calc_parameters(self):
))
if self.energy_group.is_set:
self.Q_loss.val = - self.E.val * self.A.val + self.Q.val
self.Q_loss.is_result = True
else:
self.Q_loss.is_result = False
Loading

0 comments on commit 67c3c3f

Please sign in to comment.