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

Changed heat consumer flow control when qext_w is zero #681

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
9 changes: 6 additions & 3 deletions src/pandapipes/component_models/heat_consumer_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,15 @@ def create_pit_branch_entries(cls, net, branch_pit):
treturn = net[cls.table_name()].treturn_k.values
hc_pit[~np.isnan(treturn), TOUTINIT] = treturn[~np.isnan(treturn)]
hc_pit[:, FLOW_RETURN_CONNECT] = True
mask_q0 = qext == 0 & np.isnan(mdot)

# Ensure no flow occurs through the heat consumer when qext_w is zero
mask_q0 = qext == 0
if np.any(mask_q0):
hc_pit[mask_q0, ACTIVE] = False
hc_pit[mask_q0, MDOTINIT] = 0 # Set mass flow to zero
logger.warning(r'qext_w is equals to zero for heat consumers with index %s. '
r'Therefore, the defined temperature control cannot be maintained.' \
r'Setting mdot to zero to ensure no flow.' \
%net[cls.table_name()].index[mask_q0])

return hc_pit

@classmethod
Expand Down