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
Closed
11 changes: 11 additions & 0 deletions pandapipes/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from pandapipes.std_types.std_type_class import regression_function, PumpStdType
from pandapipes.std_types.std_types import add_basic_std_types, create_pump_std_type, \
load_std_type
#from pandapipes.toolbox import calculate_alpha

try:
import pandaplan.core.pplog as logging
Expand Down Expand Up @@ -429,13 +430,23 @@
>>> std_type='315_PE_80_SDR_17', length_km=1)

"""
from pandapipes.toolbox import calculate_alpha
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

pipe_parameter['u_w/mk'] = float(pipe_parameter['u_w/mk'])
alpha_w_per_m2k = calculate_alpha(pipe_parameter['inner_diameter_mm'], pipe_parameter['u_w/mk'])

Check warning on line 444 in pandapipes/create.py

View check run for this annotation

Codecov / codecov/patch

pandapipes/create.py#L443-L444

Added lines #L443 - L444 were not covered by tests
elif pd.notna(pipe_parameter['u_w/mk']) and alpha_w_per_m2k != 0.0:
alpha_w_per_m2k = alpha_w_per_m2k
logger.warning('you have defined alpha which overwrites the heat_transfer coefficient of the pipe standard type')

Check warning on line 447 in pandapipes/create.py

View check run for this annotation

Codecov / codecov/patch

pandapipes/create.py#L446-L447

Added lines #L446 - L447 were not covered by tests
else:
alpha_w_per_m2k = alpha_w_per_m2k
v = {"name": name, "from_junction": from_junction, "to_junction": to_junction,
"std_type": std_type, "length_km": length_km,
"diameter_m": pipe_parameter["inner_diameter_mm"] / 1000, "k_mm": k_mm,
Expand Down
Loading
Loading