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

Update design_graphfcns.py #354

Merged
merged 5 commits into from
Dec 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/swmmanywhere/graphfcns/design_graphfcns.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@ def process_successors(
hydraulic_design (parameters.HydraulicDesign): A HydraulicDesign parameter
object
"""
# Find contributing area with ancestors
# TODO - could do timearea here if i hated myself enough
anc = nx.ancestors(G, node).union([node])
tot = sum([G.nodes[anc_node]["contributing_area"] for anc_node in anc])
M3_PER_HR_TO_M3_PER_S = 1 / 60 / 60
Q = tot * hydraulic_design.precipitation * M3_PER_HR_TO_M3_PER_S

for ix, ds_node in enumerate(G.successors(node)):
edge = G.get_edge_data(node, ds_node, 0)
# Find contributing area with ancestors
# TODO - could do timearea here if i hated myself enough
anc = nx.ancestors(G, node).union([node])
tot = sum([G.nodes[anc_node]["contributing_area"] for anc_node in anc])

M3_PER_HR_TO_M3_PER_S = 1 / 60 / 60
Q = tot * hydraulic_design.precipitation * M3_PER_HR_TO_M3_PER_S

# Design the pipe to find the diameter and invert depth
diam, depth = design_pipe(
Expand Down
Loading