Skip to content

Commit

Permalink
Merge pull request #598 from dlohmeier/rename_deriv_tout
Browse files Browse the repository at this point in the history
renamed JAC_DERIV_DT1 to JAC_DERIV_DTOUT in branch_idx
  • Loading branch information
SimonRubenDrauz committed Apr 8, 2024
2 parents 3c78a13 + 9385283 commit 2104e36
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/pandapipes/idx_branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
CP = 21 # Slot for fluid heat capacity values
ALPHA = 22 # Slot for heat transfer coefficient
JAC_DERIV_DT = 23
JAC_DERIV_DT1 = 24
JAC_DERIV_DTOUT = 24
LOAD_VEC_BRANCHES_T = 25
TOUTINIT = 26 # Internal slot for outlet pipe temperature
JAC_DERIV_DT_NODE = 27 # Slot for the derivative fpr T for the nodes connected to branch
Expand Down
4 changes: 2 additions & 2 deletions src/pandapipes/pf/build_system_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import numpy as np
from pandapipes.idx_branch import FROM_NODE, TO_NODE, JAC_DERIV_DV, JAC_DERIV_DP, JAC_DERIV_DP1, \
JAC_DERIV_DV_NODE, LOAD_VEC_NODES, LOAD_VEC_BRANCHES, JAC_DERIV_DT, JAC_DERIV_DT1, \
JAC_DERIV_DV_NODE, LOAD_VEC_NODES, LOAD_VEC_BRANCHES, JAC_DERIV_DT, JAC_DERIV_DTOUT, \
JAC_DERIV_DT_NODE, LOAD_VEC_NODES_T, LOAD_VEC_BRANCHES_T, FROM_NODE_T, TO_NODE_T, BRANCH_TYPE
from pandapipes.idx_node import LOAD, TINIT
from pandapipes.idx_node import P, PC, NODE_TYPE, T, NODE_TYPE_T
Expand Down Expand Up @@ -82,7 +82,7 @@ def build_system_matrix(net, branch_pit, node_pit, heat_mode):
else:
system_data[:len_b] = branch_pit[:, JAC_DERIV_DT]
# pdF_dpi1
system_data[len_b:2 * len_b] = branch_pit[:, JAC_DERIV_DT1]
system_data[len_b:2 * len_b] = branch_pit[:, JAC_DERIV_DTOUT]
# jdF_dv_from_nodes
system_data[2 * len_b:len_fn1] = inc_flow_sum[tn_unique_der]
# jdF_dv_to_nodes
Expand Down
4 changes: 2 additions & 2 deletions src/pandapipes/pf/derivative_calculation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pandapipes.idx_branch import LENGTH, ETA, RHO, D, K, RE, LAMBDA, LOAD_VEC_BRANCHES, \
JAC_DERIV_DV, JAC_DERIV_DP, JAC_DERIV_DP1, LOAD_VEC_NODES, JAC_DERIV_DV_NODE, VINIT, \
FROM_NODE, TO_NODE, CP, VINIT_T, FROM_NODE_T, TOUTINIT, TEXT, AREA, ALPHA, TL, QEXT, LOAD_VEC_NODES_T, \
LOAD_VEC_BRANCHES_T, JAC_DERIV_DT, JAC_DERIV_DT1, JAC_DERIV_DT_NODE
LOAD_VEC_BRANCHES_T, JAC_DERIV_DT, JAC_DERIV_DTOUT, JAC_DERIV_DT_NODE
from pandapipes.idx_node import TINIT as TINIT_NODE
from pandapipes.properties.fluids import get_fluid

Expand Down Expand Up @@ -94,7 +94,7 @@ def calculate_derivatives_thermal(net, branch_pit, node_pit, options):
- alpha * (t_amb - t_m) * length + qext)

branch_pit[:, JAC_DERIV_DT] = - rho * area * cp * v_init + alpha / 2 * length
branch_pit[:, JAC_DERIV_DT1] = rho * area * cp * v_init + alpha / 2 * length
branch_pit[:, JAC_DERIV_DTOUT] = rho * area * cp * v_init + alpha / 2 * length

branch_pit[:, JAC_DERIV_DT_NODE] = rho * v_init * branch_pit[:, AREA]
branch_pit[:, LOAD_VEC_NODES_T] = rho * v_init * branch_pit[:, AREA] \
Expand Down

0 comments on commit 2104e36

Please sign in to comment.