oemof / tespy

Thermal Engineering Systems in Python (TESPy). This package provides a powerful simulation toolkit for thermal engineering plants such as power plants, district heating systems or heat pumps.
https://tespy.readthedocs.io
MIT License
256 stars 80 forks source link

New Feature: Support for INCOMP binary mixtures #294

Closed jelic1marko closed 8 months ago

jelic1marko commented 2 years ago

This pull request aims to implement minor changes to the backend processing of fluid properties so that mass-based binary mixtures included in CoolProp can be natively supported as network fluids. These fluids are crucial for simulation of low temperature applications such as ground-sourced energy.

The API is relatively straightforward. These mixtures should be included into the network just as any other, with a specified mass fraction and back end following the given syntax:

nw = Network(fluids=['INCOMP::MEG[0.2]', 'INCOMP::MPG[0.4]', 'water', ...], ...)

while these fluids can later be utilized as connection parameters like:

meg_in_hx.set_attr(fluid={'MEG[0.2]': 1, 'MPG[0.4]': 0, 'water': 0, ...}, ...).

No bugs appear to arise from this introduction and the regular operation appears not to be influenced in any way.

A simple demonstration of how these mixtures can be utilized is depicted in tutorials/binary_mixtures.py.

pep8speaks commented 2 years ago

Hello @jelic1marko! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 11:80: E501 line too long (87 > 79 characters)

fwitte commented 2 years ago

Thank you very much for you suggestion :). Will look into it as soon as possible. We might need to set up one or two tests, and then we can include it with the next release.

fwitte commented 8 months ago

Dealt with by #384