From 3fb5d35c1c5234f2750960b83dfa934c8120387f Mon Sep 17 00:00:00 2001 From: Michael Wetter Date: Fri, 29 Sep 2023 11:57:19 -0700 Subject: [PATCH] Simplified by changing Add to Subtract --- .../PartialHeatPumpHeatExchanger.mo | 12 +++---- .../Combined/HeatPumpHeatExchanger.mo | 4 +-- .../Combined/HeatPumpHeatExchangerDHWTank.mo | 36 ++++++++++--------- 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/Buildings/Experimental/DHC/EnergyTransferStations/Combined/BaseClasses/PartialHeatPumpHeatExchanger.mo b/Buildings/Experimental/DHC/EnergyTransferStations/Combined/BaseClasses/PartialHeatPumpHeatExchanger.mo index 38bef9c8009..cf37de3b337 100644 --- a/Buildings/Experimental/DHC/EnergyTransferStations/Combined/BaseClasses/PartialHeatPumpHeatExchanger.mo +++ b/Buildings/Experimental/DHC/EnergyTransferStations/Combined/BaseClasses/PartialHeatPumpHeatExchanger.mo @@ -362,8 +362,8 @@ model PartialHeatPumpHeatExchanger Buildings.Controls.OBC.CDL.Reals.Subtract delT if have_hotWat "Compute DeltaT needed on condenser side" annotation (Placement(transformation(extent={{-150,-10},{-130,10}}))); - Fluid.Sensors.MassFlowRate senMasFloHeaWatPri(redeclare final package Medium - = MediumBui, final allowFlowReversal=allowFlowReversalBui) + Fluid.Sensors.MassFlowRate senMasFloHeaWatPri(redeclare final package Medium = + MediumBui, final allowFlowReversal=allowFlowReversalBui) "Primary heating water mass flow rate" annotation (Placement(transformation(extent={{30,270},{50,250}}))); Buildings.Controls.OBC.CDL.Logical.TrueFalseHold enaSHW( @@ -382,7 +382,8 @@ model PartialHeatPumpHeatExchanger Buildings.Controls.OBC.CDL.Reals.MultiSum PHeaTot(nin=2) "Total power used for heating and hot water production" annotation (Placement(transformation(extent={{270,70},{290,90}}))); - Buildings.Controls.OBC.CDL.Reals.Add heaFloEvaSHW if have_hotWat and have_varFloEva + Buildings.Controls.OBC.CDL.Reals.Subtract + heaFloEvaSHW if have_hotWat and have_varFloEva "Heat flow rate at evaporator" annotation (Placement(transformation(extent={{-100,90},{-80,110}}))); Buildings.Controls.OBC.CDL.Reals.Subtract dTHHW @@ -422,9 +423,6 @@ model PartialHeatPumpHeatExchanger if have_varFloEva or have_varFloCon "Heating load" annotation (Placement(transformation(extent={{-140,270},{-120,290}}))); - Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter toSub(final k=-1) - if have_hotWat and have_varFloEva "Convert to subtraction" - annotation (Placement(transformation(extent={{-80,70},{-100,90}}))); Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter toSub1(final k=-1) if have_varFloEva "Convert to subtraction" annotation (Placement(transformation(extent={{-80,216},{-100,236}}))); @@ -585,8 +583,6 @@ equation annotation (Line(points={{-118,280},{-102,280}}, color={0,0,127})); connect(loaHHW.y, heaFloEvaHHW.u1) annotation (Line(points={{-118,280},{-110, 280},{-110,246},{-102,246}}, color={0,0,127})); - connect(toSub.y, heaFloEvaSHW.u2) annotation (Line(points={{-102,80},{-108,80}, - {-108,94},{-102,94}}, color={0,0,127})); connect(proHeaWat.PHea, toSub1.u) annotation (Line(points={{12,217},{20,217}, {20,226},{-78,226}}, color={0,0,127})); connect(toSub1.y, heaFloEvaHHW.u2) annotation (Line(points={{-102,226},{-110, diff --git a/Buildings/Experimental/DHC/EnergyTransferStations/Combined/HeatPumpHeatExchanger.mo b/Buildings/Experimental/DHC/EnergyTransferStations/Combined/HeatPumpHeatExchanger.mo index 0d82576438b..e8f54e8d24d 100644 --- a/Buildings/Experimental/DHC/EnergyTransferStations/Combined/HeatPumpHeatExchanger.mo +++ b/Buildings/Experimental/DHC/EnergyTransferStations/Combined/HeatPumpHeatExchanger.mo @@ -48,8 +48,6 @@ equation color={0,0,127})); connect(enaSHW.y, proHotWat.uEna) annotation (Line(points={{-118,80},{-114,80}, {-114,43},{-12,43}}, color={255,0,255})); - connect(proHotWat.PHea, toSub.u) annotation (Line(points={{12,37},{18,37},{18, - 80},{-78,80}}, color={0,0,127})); connect(proHotWat.PPum, PPumHeaTot.u[2]) annotation (Line(points={{12,34},{176, 34},{176,420},{188,420},{188,420.5}}, color={0,0,127})); @@ -71,6 +69,8 @@ equation annotation (Line(points={{10,40},{260,40},{260,-360}}, color={0,127,255})); connect(heaFloEvaSHW.u1, div1.u1) annotation (Line(points={{-102,106},{-290, 106},{-290,-34},{-102,-34}}, color={0,0,127})); + connect(proHotWat.PHea, heaFloEvaSHW.u2) annotation (Line(points={{12,37},{14, + 37},{14,80},{-108,80},{-108,94},{-102,94}}, color={0,0,127})); annotation ( Documentation(info="

diff --git a/Buildings/Experimental/DHC/EnergyTransferStations/Combined/HeatPumpHeatExchangerDHWTank.mo b/Buildings/Experimental/DHC/EnergyTransferStations/Combined/HeatPumpHeatExchangerDHWTank.mo index bd5a43c0086..bc54d1af6df 100644 --- a/Buildings/Experimental/DHC/EnergyTransferStations/Combined/HeatPumpHeatExchangerDHWTank.mo +++ b/Buildings/Experimental/DHC/EnergyTransferStations/Combined/HeatPumpHeatExchangerDHWTank.mo @@ -13,7 +13,7 @@ model HeatPumpHeatExchangerDHWTank transformation( extent={{10,-10},{-10,10}}, rotation=180, - origin={-50,-10}))); + origin={-52,-56}))); Subsystems.HeatPumpDHWTank proHotWat( redeclare final package Medium1 = MediumBui, redeclare final package Medium2 = MediumSer, @@ -39,7 +39,7 @@ model HeatPumpHeatExchangerDHWTank Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter toSin(final k=-1) if have_hotWat "Convert to sink" annotation (Placement(transformation(extent={{-100,50},{-80,70}}))); - Loads.HotWater.ThermostaticMixingValve tmv( + Loads.HotWater.ThermostaticMixingValve theMixVal( redeclare package Medium = MediumBui, mHot_flow_nominal=QHotWat_flow_nominal/cpBui_default/(THotWatSup_nominal - TColWat_nominal), @@ -59,14 +59,12 @@ equation color={0,0,127})); connect(conFloEvaSHW.m_flow, proHotWat.m2_flow) annotation (Line(points={{-38,100}, {28,100},{28,31},{30,31}}, color={0,0,127})); - connect(souDCW.T_in, delT.u2) annotation (Line(points={{-62,-14},{-64,-14},{ - -64,-60},{-156,-60},{-156,-6},{-152,-6}}, color={0,0,127})); + connect(souDCW.T_in, delT.u2) annotation (Line(points={{-64,-60},{-156,-60},{ + -156,-6},{-152,-6}}, color={0,0,127})); connect(enaSHW.y, proHotWat.uEna) annotation (Line(points={{-118,80},{-114,80}, {-114,43},{30,43}}, color={255,0,255})); connect(proHotWat.port_b2, volMix_b.ports[4]) annotation (Line(points={{52,40},{260,40},{260,-360}}, color={0,127,255})); - connect(proHotWat.PHea, toSub.u) annotation (Line(points={{54,37},{56,37},{56, - 80},{-78,80}}, color={0,0,127})); connect(proHotWat.PHea, PHeaTot.u[2]) annotation (Line(points={{54,37},{66,37}, {66,38},{268,38},{268,80.5}}, color={0,0,127})); @@ -83,20 +81,24 @@ equation {-76,68},{-70,68}}, color={0,0,127})); connect(proHotWat.port_a2, volMix_a.ports[4]) annotation (Line(points={{52,28}, {56,28},{56,20},{-260,20},{-260,-360}}, color={0,127,255})); - connect(tmv.port_hot, sinDHW.ports[1]) annotation (Line(points={{-40,61},{-45, - 61},{-45,60},{-48,60}}, color={0,127,255})); - connect(souDCW.ports[1], dcwSpl.port_1) annotation (Line(points={{-40,-10},{ - -12,-10},{-12,-6}}, color={0,127,255})); + connect(theMixVal.port_hot, sinDHW.ports[1]) annotation (Line(points={{-40,61}, + {-45,61},{-45,60},{-48,60}}, color={0,127,255})); + connect(souDCW.ports[1], dcwSpl.port_1) annotation (Line(points={{-42,-56},{ + -12,-56},{-12,-6}}, color={0,127,255})); connect(dcwSpl.port_3, proHotWat.port_a1) - annotation (Line(points={{-2,4},{0,4},{0,28},{32,28}}, color={0,127,255})); - connect(dcwSpl.port_2, tmv.port_col) annotation (Line(points={{-12,14},{-12, - 56.6},{-20,56.6}}, color={0,127,255})); - connect(proHotWat.port_b1,tmv.port_hotSou) annotation (Line(points={{32,40}, - {0,40},{0,65.4},{-20,65.4}}, color={0,127,255})); - connect(tmv.TSet, delT.u1) annotation (Line(points={{-18,69.8},{-12,69.8},{ - -12,70},{-8,70},{-8,26},{-160,26},{-160,6},{-152,6}}, color={0,0,127})); + annotation (Line(points={{-2,4},{12,4},{12,28},{32,28}}, + color={0,127,255})); + connect(dcwSpl.port_2, theMixVal.port_col) annotation (Line(points={{-12,14}, + {-12,56.6},{-20,56.6}}, color={0,127,255})); + connect(proHotWat.port_b1, theMixVal.port_hotSou) annotation (Line(points={{ + 32,40},{0,40},{0,65.4},{-20,65.4}}, color={0,127,255})); + connect(theMixVal.TSet, delT.u1) annotation (Line(points={{-18,69.8},{-12, + 69.8},{-12,70},{-8,70},{-8,26},{-160,26},{-160,6},{-152,6}}, color={0, + 0,127})); connect(proHotWat.QCon_flow, heaFloEvaSHW.u1) annotation (Line(points={{54,24}, {68,24},{68,120},{-108,120},{-108,106},{-102,106}}, color={0,0,127})); + connect(proHotWat.PHea, heaFloEvaSHW.u2) annotation (Line(points={{54,37},{60, + 37},{60,80},{-108,80},{-108,94},{-102,94}}, color={0,0,127})); annotation ( Documentation(info="