Skip to content

Commit

Permalink
-fixed u name
Browse files Browse the repository at this point in the history
  • Loading branch information
EPrade committed Nov 6, 2023
1 parent f16fc41 commit 7152f68
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
9 changes: 4 additions & 5 deletions pandapipes/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,6 @@ def create_pipe(net, from_junction, to_junction, std_type, length_km, k_mm=0.2,
>>> 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)
Expand All @@ -439,10 +438,10 @@ def create_pipe(net, from_junction, to_junction, std_type, length_km, k_mm=0.2,

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

if pd.notna(pipe_parameter['u_w/mk']) and alpha_w_per_m2k == 0.0:
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'])
elif pd.notna(pipe_parameter['u_w/mk']) and alpha_w_per_m2k != 0.0:
if pd.notna(pipe_parameter['u_w_per_m2k']) and alpha_w_per_m2k == 0.0:
pipe_parameter['u_w_per_m2k'] = float(pipe_parameter['u_w_per_m2k'])
alpha_w_per_m2k = pipe_parameter['u_w_per_mk']

Check warning on line 443 in pandapipes/create.py

View check run for this annotation

Codecov / codecov/patch

pandapipes/create.py#L442-L443

Added lines #L442 - L443 were not covered by tests
elif pd.notna(pipe_parameter['u_w_per_m2k']) 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 446 in pandapipes/create.py

View check run for this annotation

Codecov / codecov/patch

pandapipes/create.py#L445-L446

Added lines #L445 - L446 were not covered by tests
else:
Expand Down
2 changes: 1 addition & 1 deletion pandapipes/std_types/library/Pipe.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
std_type;nominal_width_mm;outer_diameter_mm;inner_diameter_mm;standard_dimension_ratio;material;u_w/mk
std_type;nominal_width_mm;outer_diameter_mm;inner_diameter_mm;standard_dimension_ratio;material;u_w_per_m2k
80_GGG;80;98;86;16.33;GGG;
100_GGG;100;118;105.8;19.34;GGG;
125_GGG;125;144;131.6;23.23;GGG;
Expand Down
1 change: 0 additions & 1 deletion pandapipes/std_types/std_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import os
import warnings
import re
import numpy as np
import pandas as pd
from pandapipes import pp_dir
from pandapipes.std_types.std_type_class import get_data, PumpStdType
Expand Down
3 changes: 0 additions & 3 deletions pandapipes/toolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,3 @@ 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):
return u / (d/1000 * np.pi)

0 comments on commit 7152f68

Please sign in to comment.