diff --git a/src/pandapipes/component_models/component_toolbox.py b/src/pandapipes/component_models/component_toolbox.py index a12cc1a0..4ba1324d 100644 --- a/src/pandapipes/component_models/component_toolbox.py +++ b/src/pandapipes/component_models/component_toolbox.py @@ -84,7 +84,7 @@ def init_results_element(net, element, output, all_float): """ res_element = "res_" + element if all_float: - net[res_element] = pd.DataFrame(np.NAN, columns=output, index=net[element].index, + net[res_element] = pd.DataFrame(np.nan, columns=output, index=net[element].index, dtype=np.float64) else: net[res_element] = pd.DataFrame(np.zeros(0, dtype=output), index=[]) diff --git a/src/pandapipes/component_models/heat_consumer_component.py b/src/pandapipes/component_models/heat_consumer_component.py index c7d1d31f..d3f574ef 100644 --- a/src/pandapipes/component_models/heat_consumer_component.py +++ b/src/pandapipes/component_models/heat_consumer_component.py @@ -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 @@ -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 @@ -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 diff --git a/src/pandapipes/pf/result_extraction.py b/src/pandapipes/pf/result_extraction.py index 0b674d31..19e6faf0 100644 --- a/src/pandapipes/pf/result_extraction.py +++ b/src/pandapipes/pf/result_extraction.py @@ -308,10 +308,10 @@ def extract_results_active_pit(net, mode="hydraulics"): amb = get_net_option(net, 'ambient_temperature') - net["_pit"]["node"][~nodes_connected, result_node_col] = np.NaN if mode == "hydraulics" else amb + net["_pit"]["node"][~nodes_connected, result_node_col] = np.nan if mode == "hydraulics" else amb net["_pit"]["node"][rows_nodes[:, np.newaxis], copied_node_cols[np.newaxis, :]] = \ net["_active_pit"]["node"][:, copied_node_cols] - net["_pit"]["branch"][~branches_connected, result_branch_col] = np.NaN if mode == "hydraulics" else \ + net["_pit"]["branch"][~branches_connected, result_branch_col] = np.nan if mode == "hydraulics" else \ net["_pit"]["branch"][~branches_connected, TEXT] net["_pit"]["branch"][rows_branches[:, np.newaxis], copied_branch_cols[np.newaxis, :]] = \ net["_active_pit"]["branch"][:, copied_branch_cols]