Skip to content

Commit

Permalink
Merge pull request #582 from SimonRubenDrauz/transient_heat_transfer
Browse files Browse the repository at this point in the history
small adaptions
  • Loading branch information
SimonRubenDrauz authored Dec 15, 2023
2 parents f32d153 + 945788a commit 0f2f3b5
Show file tree
Hide file tree
Showing 80 changed files with 2,477 additions and 1,085 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest python-igraph pytest-split
python -m pip install pytest igraph pytest-split
if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi
- name: Install pandapipes from TestPyPI
if: ${{ inputs.upload_server == 'testpypi'}}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run_tests_develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest python-igraph pytest-split
python -m pip install pytest igraph pytest-split
if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install git+https://github.com/e2nIEE/pandapower@develop#egg=pandapower
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest nbmake pytest-xdist pytest-split python-igraph
python -m pip install pytest nbmake pytest-xdist pytest-split igraph
if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install git+https://github.com/e2nIEE/pandapower@develop#egg=pandapower
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/run_tests_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest python-igraph pytest-split
python -m pip install pytest igraph pytest-split
if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install git+https://github.com/e2nIEE/pandapower@master#egg=pandapower
python -m pip install git+https://github.com/e2nIEE/pandapower@master#egg=pandapower;
pip install .
- name: List all installed packages
run: |
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest nbmake pytest-xdist pytest-split python-igraph
python -m pip install pytest nbmake pytest-xdist pytest-split igraph
if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install git+https://github.com/e2nIEE/pandapower@master#egg=pandapower
Expand Down
11 changes: 6 additions & 5 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.9"

python:
version: 3.7
install:
- method: pip
path: .
extra_requirements:
- docs
- requirements: doc/requirements.txt
14 changes: 14 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ Change Log
- [ADDED] multiple creation of heat exchanger
- [ADDED] support Python 3.11 (now included in test pipeline)
- [CHANGED] dropped support for Python 3.7 (no longer included in test pipeline)
- [CHANGED] connectivity check now separated by hydraulics and heat_transfer calculation, so that also results can differ in some rows (NaN or not)
- [CHANGED] dynamic creation of lookups for getting pit as pandas tables
- [CHANGED] components can have their own internal arrays for specific calculations (e.g. for compressor pressure ratio), so that the pit does not need to include such component specific entries
- [CHANGED] .readthedocs.yml due to deprecation
- [FIXED] in STANET converter: bug fix for heat exchanger creation and external temperatures of pipes added
- [REMOVED] broken travis badge removed from readme

[0.8.5] - 2023-06-19
-------------------------------
- [FIXED] consider ambient pressure in calculation of compression power for pumps/compressors
- [FIXED] np.bool error in pipeflow calculation due to deprecation of np.bool
- [FIXED] use igraph package instead of python-igraph (has been renamed)
- [ADDED] gas specific calculation of heat capacity ration kappa = cp/cv (for pumps/compressors)
- [REMOVED] Python 3.7 removed from test pipeline due to inconsistencies with pandapower

[0.8.4] - 2023-02-02
-------------------------------
Expand Down
4 changes: 0 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
:target: http://pandapipes.readthedocs.io/
:alt: docs

.. image:: https://travis-ci.org/e2nIEE/pandapipes.svg?branch=master
:target: https://travis-ci.org/e2nIEE/pandapipes/branches
:alt: travis

.. image:: https://codecov.io/gh/e2nIEE/pandapipes/branch/master/graph/badge.svg
:target: https://codecov.io/github/e2nIEE/pandapipes?branch=master
:alt: codecov
Expand Down
29 changes: 2 additions & 27 deletions doc/source/about/license.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,7 @@ License
.. highlight:: none


pandapipes is published under the following 3-clause BSD license: ::
pandapipes is published under the following 3-clause BSD license:


Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics and
Energy System Technology (IEE) Kassel and individual contributors
(see AUTHORS file for details). All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions
and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or other materials provided
with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to
endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.. literalinclude:: ../../../LICENSE

2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
# The short X.Y version.
version = "0.8"
# The full version, including alpha/beta/rc tags.
release = "0.8.4"
release = "0.8.5"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
9 changes: 9 additions & 0 deletions doc/source/fluid_properties/composition.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
;**Biomethane pure**;**Biomethane treated**
methane; 96.15% ; 90.94%
nitrogen; 0.75 % ;0.69 %
carbon dioxide; 2.9 % ;2.68 %
oxygen; 0.2 % ; 0.19 %
propane; 0 % ; 5 %
butane; 0 %; 0.5 %
Wobbe-Index (normal conditions) :math:`[\frac{KWh}{m^3}]` ; 13.9 ; 14.9
HHV (normal conditions) :math:`[\frac{KWh}{m^3}]`; 10.6 ; 11.6
12 changes: 10 additions & 2 deletions doc/source/fluid_properties/create_fluids.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,16 @@ Fluid from Library
==================

In the fluid library some default fluids are already implemented. Currently it is
possible to work with the default fluids high and low calorific natural
gas (hgas and lgas), hydrogen, methane, water and air. The values are loaded from txt-files in
possible to work with the default fluids:

- ``hgas`` and ``lgas`` (high and low calorific natural gas),
- ``hydrogen``,
- ``methane``,
- ``water``,
- ``biomethane_pure`` and ``biomathane_treated`` (see `here <https://pandapipes.readthedocs.io/en/latest/fluid_properties/fluids.html>`_ for the compositions),
- ``air``.

The values are loaded from txt-files in
the 'pandapipes/properties/[fluid name]' folder.
One of these default fluids can be created and added to an
existing network by calling the following function.
Expand Down
24 changes: 22 additions & 2 deletions doc/source/fluid_properties/fluids.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,29 @@ Fluid Properties in pandapipes

The pipelines in the pandapipes network are run with a certain fluid. This can be
chosen individually for the net from the fluid library or by own creation. The fluids
are defined by certain properties. In the fluid library currently high and low calorific natural
gas (hgas and lgas), hydrogen, methane, water and air are implemented with default properties.
are defined by certain properties.

The following fluids currently exist in the library:

- ``hgas`` and ``lgas`` (high and low calorific natural gas),
- ``hydrogen``,
- ``methane``,
- ``water``,
- ``biomethane_pure`` and ``biomathane_treated`` (compositions below)
- ``air``.


.. Note::
**Biomethane(s)**:
A particularity of injecting biomethane in the gas grid in Germany is the addition of LPG to enhance
the Wobbe-Index and the heating value of the gas and thus make it equivalent to the (high-calorific) natural gas transported
in the grid. This addition is done in a gas treatment unit (Biogaseinspeiseanlage) upstream of the biomethane
feed-in junction. The properties of the biomethane(s) were computed based on the package `CoolProp <http://www.coolprop.org/)>`_.

.. csv-table::
:file: composition.csv
:delim: ;
:widths: 10, 10, 10

The Fluid Class
===============
Expand Down
2 changes: 1 addition & 1 deletion pandapipes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# and Energy System Technology (IEE), Kassel, and University of Kassel. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

__version__ = '0.8.4'
__version__ = '0.8.5'
__format_version__ = '0.8.0'

import pandas as pd
Expand Down
61 changes: 23 additions & 38 deletions pandapipes/component_models/abstract_models/base_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def init_results(cls, net):
return res_table

@classmethod
def extract_results(cls, net, options, branch_results, nodes_connected, branches_connected):
def extract_results(cls, net, options, branch_results, mode):
"""
Function that extracts certain results.
Expand All @@ -43,10 +43,8 @@ def extract_results(cls, net, options, branch_results, nodes_connected, branches
:type options:
:param branch_results:
:type branch_results:
:param nodes_connected:
:type nodes_connected:
:param branches_connected:
:type branches_connected:
:param mode:
:type mode:
:return: No Output.
"""
raise NotImplementedError
Expand Down Expand Up @@ -80,6 +78,15 @@ def adaption_before_derivatives_hydraulic(cls, net, branch_pit, node_pit, idx_lo
def adaption_after_derivatives_hydraulic(cls, net, branch_pit, node_pit, idx_lookups, options):
pass

@classmethod
def adaption_before_derivatives_thermal(cls, net, branch_pit, node_pit, idx_lookups, options):
pass

@classmethod
def adaption_after_derivatives_thermal(cls, net, branch_pit, node_pit, idx_lookups, options):
pass


@classmethod
def create_node_lookups(cls, net, ft_lookups, table_lookup, idx_lookups, current_start,
current_table, internal_nodes_lookup):
Expand Down Expand Up @@ -128,65 +135,43 @@ def create_branch_lookups(cls, net, ft_lookups, table_lookup, idx_lookups, curre
return current_start, current_table

@classmethod
def create_pit_node_entries(cls, net, node_pit):
def create_component_array(cls, net, component_pits):
"""
Function which creates pit branch entries.
Function which creates an internal array of the component in analogy to the pit, but with
component specific entries, that are not needed in the pit.
:param net: The pandapipes network
:type net: pandapipesNet
:param node_pit:
:type node_pit:
:return: No Output.
:param component_pits: dictionary of component specific arrays
:type component_pits: dict
:return:
:rtype:
"""
pass

@classmethod
def create_pit_branch_entries(cls, net, branch_pit):
def create_pit_node_entries(cls, net, node_pit):
"""
Function which creates pit branch entries.
:param net: The pandapipes network
:type net: pandapipesNet
:param branch_pit:
:type branch_pit:
:return: No Output.
"""
pass

@classmethod
def calculate_derivatives_hydraulic(cls, net, branch_pit, node_pit, idx_lookups, options):
"""
Function which creates derivatives.
:param net: The pandapipes network
:type net: pandapipesNet
:param branch_pit:
:type branch_pit:
:param node_pit:
:type node_pit:
:param idx_lookups:
:type idx_lookups:
:param options:
:type options:
:return: No Output.
"""
pass

@classmethod
def calculate_derivatives_thermal(cls, net, branch_pit, node_pit, idx_lookups, options):
def create_pit_branch_entries(cls, net, branch_pit):
"""
Function which creates derivatives.
Function which creates pit branch entries.
:param net: The pandapipes network
:type net: pandapipesNet
:param branch_pit:
:type branch_pit:
:param node_pit:
:type node_pit:
:param idx_lookups:
:type idx_lookups:
:param options:
:type options:
:return: No Output.
"""
pass

Loading

0 comments on commit 0f2f3b5

Please sign in to comment.