Skip to content

Commit

Permalink
the return temperature of the heat consumer is not fixed for the solv…
Browse files Browse the repository at this point in the history
…er anymore, but calculated based on an exact estimate of qext from inlet and controlled return temperature
  • Loading branch information
dlohmeier committed Oct 7, 2024
1 parent 1cd36e9 commit ca47651
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pandapipes/component_models/heat_consumer_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ def create_component_array(cls, net, component_pits):
tbl = net[cls.table_name()]
consumer_array = np.zeros(shape=(len(tbl), cls.internal_cols), dtype=np.float64)
consumer_array[:, cls.DELTAT] = tbl.deltat_k.values
consumer_array[:, cls.TRETURN] = tbl.treturn_k.values
consumer_array[:, cls.QEXT] = tbl.qext_w.values
consumer_array[:, cls.MASS] = tbl.controlled_mdot_kg_per_s.values
mf = tbl.controlled_mdot_kg_per_s.values
tr = tbl.treturn_k.values
dt = tbl.deltat_k.values
Expand Down Expand Up @@ -177,7 +180,7 @@ def adaption_before_derivatives_thermal(cls, net, branch_pit, node_pit, idx_look
cp = get_branch_cp(get_fluid(net), node_pit, hc_pit)
from_nodes = get_from_nodes_corrected(hc_pit[mask])
t_in = node_pit[from_nodes, TINIT]
t_out = hc_pit[mask, TOUTINIT]
t_out = consumer_array[mask, cls.TRETURN]
q_ext = cp[mask] * hc_pit[mask, MDOTINIT] * (t_in - t_out)
hc_pit[mask, QEXT] = q_ext

Expand All @@ -188,7 +191,7 @@ def adaption_after_derivatives_thermal(cls, net, branch_pit, node_pit, idx_looku
consumer_array = get_component_array(net, cls.table_name(), mode='heat_transfer')

# Any MODE where TRETURN is given
mask = np.isin(consumer_array[:, cls.MODE], [cls.MF_TR, cls.QE_TR])
mask = consumer_array[:, cls.MODE] == cls.QE_TR
if np.any(mask):
hc_pit[mask, LOAD_VEC_BRANCHES_T] = 0
hc_pit[mask, JAC_DERIV_DTOUT] = 1
Expand Down

0 comments on commit ca47651

Please sign in to comment.