Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added pipe standard type 'heating pipe' #569

Closed
wants to merge 14 commits into from

Conversation

EPrade
Copy link
Contributor

@EPrade EPrade commented Oct 5, 2023

Added a standard type for heating pipes.

The reason for this addition is, that in literature and industry the parameter for heat loss specified is predominantly U [W/mK] instead of alpha [W/m²K].

  • I added a csv file from a DH pipe manufacturer for parameters ajar to the existing pipe.csv.
  • In create_empty_network a new function parameter 'type' has been added to chose between 'generic', 'gas' and 'heating'. At the moment 'heating' uses the new data and 'generic' and 'gas' use the old. Maybe we should specify here for water(if there are specific parameters for this type of pipes?) or just drop either 'gas' or 'generic' and only differentiate between gas and not gas.
  • I created the function 'add_heating_std_types' from 'add_basic_std_types' which extracts data from the new csv and calculates alpha from the given U values

@codecov
Copy link

codecov bot commented Oct 5, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

❗ No coverage uploaded for pull request base (develop@7d82b3f). Click here to learn what that means.
Report is 18 commits behind head on develop.

❗ Current head 7152f68 differs from pull request most recent head cd259c5. Consider uploading reports for the commit cd259c5 to get more accurate results

Files Patch % Lines
pandapipes/create.py 42.85% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #569   +/-   ##
==========================================
  Coverage           ?   85.10%           
==========================================
  Files              ?       90           
  Lines              ?     6209           
  Branches           ?        0           
==========================================
  Hits               ?     5284           
  Misses             ?      925           
  Partials           ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@EPrade EPrade added the heating everything related to heating networks label Oct 5, 2023
@SimonRubenDrauz
Copy link
Collaborator

Thanks for the contribution. I think this is a good idea. In my opinion, however, I think we should not add a second pipe.csv. I would rather extend the exisiting pipe.csv and add Nones for the pipes which do not have U values. The reason is that, if you implement it your way, at two different places the user needs to decide whether she/he has a heating or a non-heating system - at the beginning, when he/she creates the net, and during the pipeflow (this could lead to unitended errors). Furthermore, in future it could be that it might be interesting to investigate a heating/gas grid. For example in case of a steam network. In that case we would need to change your implementation again, which would affect convert_format and make thinks quite comlicated. This is my feeling. @dlohmeier, what do you think?

SimonRubenDrauz and others added 7 commits October 9, 2023 17:13
-using toolbox for alpha calculation results in circular import(how to fix?)
-raise userwarning stop the process?
-fixed circular import (moved import into function)
-fixed userwarning
-changed u.type from string to float
-fixed circular import (moved import into function)
-fixed userwarning
-changed u.type from string to float
@EPrade
Copy link
Contributor Author

EPrade commented Oct 30, 2023

@SimonRubenDrauz @dlohmeier I updated the pull request. Could you take a look again?

add_new_component(net, Pipe)

index = _get_index_with_check(net, "pipe", index)
_check_branch(net, "Pipe", index, from_junction, to_junction)
_check_std_type(net, std_type, "pipe", "create_pipe")

pipe_parameter = load_std_type(net, std_type, "pipe")

if pd.notna(pipe_parameter['u_w/mk']) and alpha_w_per_m2k == 0.0:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to use u_w_per_mk here in analogy to the naming of other parameters.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when renaming u to alpha in table, this is not needed anymore

@@ -5,7 +5,7 @@
import os
import warnings
import re

import numpy as np
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this import statement is not needed, would look better wrt codacy to remove.

@@ -615,3 +615,6 @@ def get_internal_tables_pandas(net, convert_types=True):
tbl[col] = tbl[col].astype(np.bool_)

return node_table, branch_table

def calculate_alpha(d, u):
Copy link
Collaborator

@dlohmeier dlohmeier Oct 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rename this function and signature: def alpha_from_u(u_w_per_mk, s_m) . As far as I can recall using s for the wall thickness is more common than d, which is usually the diameter, and the unit would be very helpful here so that the user doesn't have to check the code. Otherwise, it could make sense to name it precisely as thickness.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And to avoid confusion, I would write some docs, describing the meaning of alpha, u and s.

1600_ST<16;1600;1620.0;1588.0;101.25;ST
1800_ST<16;1800;1820.0;1785.0;104.0;ST
2000_ST<16;2000;2020.0;1980.0;101.0;ST
std_type;nominal_width_mm;outer_diameter_mm;inner_diameter_mm;standard_dimension_ratio;material;u_w/mk
Copy link
Collaborator

@dlohmeier dlohmeier Nov 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

u_w/mk to alpha_w_per_m2k

@EPrade EPrade closed this Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
heating everything related to heating networks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants