Skip to content

Commit

Permalink
Simplified by changing Add to Subtract
Browse files Browse the repository at this point in the history
  • Loading branch information
mwetter committed Sep 29, 2023
1 parent 37b7ae3 commit 3fb5d35
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
Expand Down Expand Up @@ -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}})));
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}));
Expand All @@ -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="<html>
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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),
Expand All @@ -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}));
Expand All @@ -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="<html>
<p>
Expand Down

0 comments on commit 3fb5d35

Please sign in to comment.