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

Issue4003 heat pump water heaters #4013

Draft
wants to merge 35 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
7b503da
First rough implementation of the HPWH
terrancelu92 Nov 15, 2023
d7eb538
Parameterize the model
terrancelu92 Dec 8, 2023
9f10274
Add an example to the wrapped configuration model
terrancelu92 Dec 11, 2023
d04cded
Add sensor location, and condenser location as model inputs
terrancelu92 Dec 29, 2023
6553823
Add validation cases
terrancelu92 Jan 8, 2024
b0c98fd
Change model based on EnergyPlus source code (1) Add heating fraction…
terrancelu92 Jan 31, 2024
4ae4fcc
Add documentation to heat pump water heater wrapped models
terrancelu92 Feb 5, 2024
e3c7379
Add baseclass model for two configurations
terrancelu92 Feb 13, 2024
8e58730
Change example model setup
terrancelu92 Feb 19, 2024
f309ce8
Add curve fitting data and script
terrancelu92 Jun 2, 2024
b2978e5
Merge branch 'master' into HeatPumpWaterHeater_Pumped
terrancelu92 Jun 2, 2024
705d785
First implementation of pumped configuration HPWH
terrancelu92 Jun 4, 2024
a7d92d5
Implement a validation case for pumped HPWH
terrancelu92 Jun 11, 2024
6b2db3d
Add debugging code
terrancelu92 Sep 4, 2024
547a72d
Finalize the validation case
terrancelu92 Sep 17, 2024
cdbce2b
Add all the documentation
terrancelu92 Sep 17, 2024
a77dd18
Remove unnecessary debugging files
terrancelu92 Sep 17, 2024
fe05471
Reduce the tank node from 12 to 5; Reduce the time period of validati…
terrancelu92 Sep 19, 2024
2c4090c
Updated formating
cerrinamouchref-pnnl Sep 21, 2024
36a9cf5
Revisions update
cerrinamouchref-pnnl Sep 24, 2024
945cccc
Merge pull request #152 from cerrinamouchref-pnnl/issue4003_HeatPumpW…
karthikeyad-pnnl Sep 26, 2024
2363b33
Restructured heat pump water heater package, including data records
karthikeyad-pnnl Sep 29, 2024
ebd00d0
Deleted examples package
karthikeyad-pnnl Sep 29, 2024
4a8aed0
Merge pull request #153 from terrancelu92/HeatPumpWaterHeater
karthikeyad-pnnl Sep 30, 2024
b6ec4ff
Merge branch 'issue4003_HeatPumpWaterHeaters_forPR' into issue4003_He…
karthikeyad-pnnl Sep 30, 2024
1e4870b
Restored files with unnecessary changes
karthikeyad-pnnl Sep 30, 2024
f8d8a82
Reverted additional files with unnecessary changes in Resources folder
karthikeyad-pnnl Sep 30, 2024
07d4032
Removed unused Dymola scripts
karthikeyad-pnnl Sep 30, 2024
e6b5ac1
Rectified indexing issues in Dymola scripts
karthikeyad-pnnl Sep 30, 2024
739a702
Updated models to meet Buildings library conventions
karthikeyad-pnnl Sep 30, 2024
b6bacad
Merge pull request #155 from karthikeyad-pnnl/issue4003_HeatPumpWater…
karthikeyad-pnnl Sep 30, 2024
fe666e8
Merge pull request #156 from lbl-srg/master
karthikeyad-pnnl Sep 30, 2024
d107e77
Added parameter to expansion tank to fix errors during unit test
karthikeyad-pnnl Sep 30, 2024
d670620
Update for the unit test.
lzwang26 Sep 30, 2024
9da5844
Merge pull request #157 from lzwang26/issue4003_HeatPumpWaterHeaters
karthikeyad-pnnl Sep 30, 2024
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
within Buildings.Fluid.Storage.HeatPumpWaterHeater.BaseClasses;
partial model PartialHeater
"Partial heat pump water heater model for wrapped and pumped configuration"
extends Buildings.Fluid.Interfaces.PartialFourPortInterface(
final m1_flow_nominal=mAir_flow_nominal,
final m2_flow_nominal=mWat_flow_nominal,
redeclare package Medium1 = MediumAir,
redeclare package Medium2 = MediumTan);

package MediumAir = Buildings.Media.Air
"Medium representing outdoor air";

package MediumTan = Buildings.Media.Water
"Medium in the tank";

parameter Modelica.Units.SI.MassFlowRate mAir_flow_nominal
"Nominal mass flow rate of air"
annotation(Dialog(group="Nominal conditions"));

parameter Modelica.Units.SI.MassFlowRate mWat_flow_nominal
"Nominal mass flow rate of domestic hot water"
annotation(Dialog(group="Nominal conditions"));

parameter Modelica.Units.SI.PressureDifference dpAir_nominal
"Total pressure difference across supply and return ports in airloop"
annotation(Dialog(group="Nominal conditions"));

Modelica.Blocks.Math.BooleanToReal yMov
"Boolean to real for fan signal"
annotation (Placement(transformation(extent={{-80,70},{-60,90}})));

Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heaPorBot
"Heat port tank bottom (outside insulation)"
annotation (Placement(transformation(extent={{-10,-110},{10,-90}}),
iconTransformation(extent={{-10,-90},{10,-70}})));

Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heaPorSid
"Heat port tank side (outside insulation)"
annotation (Placement(transformation(extent={{90,-30},{110,-10}}),
iconTransformation(extent={{50,-10},{70,10}})));

Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heaPorTop
"Heat port tank top (outside insulation)"
annotation (Placement(transformation(extent={{-10,90},{10,110}}),
iconTransformation(extent={{-10,70},{10,90}})));

Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TSen
"Temperature tank sensor"
annotation (Placement(transformation(extent={{70,-50},{90,-30}})));

Modelica.Blocks.Math.Gain gai_mAir_flow(k=mAir_flow_nominal)
"Nominal mass flow rate"
annotation (Placement(transformation(extent={{10,70},{30,90}})));

Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heaPorVol[datHPWH.datTanWat.nSeg]
"Heat port that connects to the control volumes of the tank"
annotation (Placement(transformation(extent={{-110,-30},{-90,-10}}),
iconTransformation(extent={{-10,-10},{10,10}})));

replaceable Buildings.Fluid.Storage.StratifiedEnhanced tan(
redeclare package Medium = MediumTan,
m_flow_nominal=mWat_flow_nominal,
VTan=datHPWH.datTanWat.VTan,
hTan=datHPWH.datTanWat.hTan,
dIns=datHPWH.datTanWat.dIns,
kIns=datHPWH.datTanWat.kIns,
nSeg=datHPWH.datTanWat.nSeg)
"Water tank"
annotation(Placement(
transformation(
extent={{-10,-10},{10,10}},
rotation=0,
origin={40,-30})));

Buildings.Fluid.Movers.FlowControlled_m_flow fan(
redeclare package Medium = MediumAir,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
per=datHPWH.datFan,
m_flow_nominal=mAir_flow_nominal,
dp_nominal=dpAir_nominal)
"Evaporator coil fan"
annotation (Placement(transformation(extent={{30,50},{50,70}})));

replaceable Buildings.Fluid.Storage.HeatPumpWaterHeater.Data.WrappedCondenser datHPWH
constrainedby
Buildings.Fluid.Storage.HeatPumpWaterHeater.Data.WrappedCondenser
"Data record for system components"
annotation (Placement(transformation(extent={{70,72},{90,92}})),
choicesAllMatching=true);

//--inputs--//
Modelica.Blocks.Interfaces.BooleanInput on
"Heat pump water heater on/off signal"
annotation (Placement(transformation(extent={{-140,60},{-100,100}}),
iconTransformation(extent={{-140,-20},{-100,20}})));

//--outputs--//

Modelica.Blocks.Interfaces.RealOutput TWat(
final unit="K",
displayUnit="degC")
"Absolute temperature as output signal"
annotation (Placement(transformation(extent={{100,-50},{120,-30}}),
iconTransformation(extent={{100,-20},{120,0}})));

Modelica.Blocks.Interfaces.RealOutput P(
final quantity="Power",
final unit="W")
"Electrical power consumed by the unit"
annotation (Placement(transformation(extent={{100,10},{120,30}}),
iconTransformation(extent={{100,-50},{120,-30}})));

equation
connect(fan.port_b, port_b1)
annotation (Line(points={{50,60},{100,60}}, color={0,127,255}));

connect(port_a2, tan.port_b)
annotation (Line(points={{100,-60},{40,-60},{40,-40}}, color={0,127,255}));

connect(tan.port_a, port_b2)
annotation (Line(points={{40,-20},{40,-10},{-80,-10},{-80,-60},{-100,-60}}, color={0,127,255}));

connect(TSen.port, tan.heaPorVol[datHPWH.datTanWat.segTemSen])
annotation (Line(points={{70,-40},{70,-54},{20,-54},{20,-30},{40,-30}},
color={191,0,0}));

connect(tan.heaPorBot, heaPorBot)
annotation (Line(points={{42,-37.4},{42,-86},{0,-86},{0,-100}}, color={191,0,0}));

connect(tan.heaPorSid, heaPorSid)
annotation (Line(points={{45.6,-30},{66,-30},{66,-20},{100,-20}},
color={191,0,0}));

connect(tan.heaPorTop, heaPorTop)
annotation (Line(points={{42,-22.6},{42,20},{0,20},{0,100}},color={191,0,0}));

connect(yMov.y, gai_mAir_flow.u)
annotation (Line(points={{-59,80},{8,80}}, color={0,0,127}));

connect(gai_mAir_flow.y, fan.m_flow_in)
annotation (Line(points={{31,80},{40,80},{40,72}}, color={0,0,127}));

connect(TSen.T, TWat)
annotation (Line(points={{91,-40},{110,-40}}, color={0,0,127}));

connect(on, yMov.u)
annotation (Line(points={{-120,80},{-82,80}}, color={255,0,255}));

connect(port_b2, port_b2)
annotation (Line(points={{-100,-60},{-92,-60},{-92,-60},{-100,-60}}, color={0,127,255}));

connect(heaPorTop, heaPorTop)
annotation (Line(points={{0,100},{0,100}},
color={191,0,0}));

connect(tan.heaPorVol, heaPorVol)
annotation (Line(points={{40,-30},{20,-30},{20,-20},{-100,-20}},
color={191,0,0}));

annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},
{100,100}}), graphics={
Rectangle(extent={{-40,60},{40,20}},lineColor={255,0,0},fillColor={255,0,0},
fillPattern=FillPattern.Solid),
Rectangle(extent={{-40,-20},{40,-60}},lineColor={0,0,255},pattern=LinePattern.None,fillColor={0,0,127},
fillPattern=FillPattern.Solid),
Rectangle(extent={{-40,20},{40,-20}},lineColor={255,0,0}, pattern=LinePattern.None,fillColor={0,0,127},
fillPattern=FillPattern.CrossDiag),
Rectangle(extent={{-10,10},{10,-10}},lineColor={0,0,0},
fillPattern=FillPattern.Sphere,fillColor={255,255,255}),
Rectangle(extent={{50,68},{40,-66}},lineColor={0,0,255},pattern=LinePattern.None,fillColor={255,255,0},
fillPattern=FillPattern.Solid),
Rectangle(extent={{-40,66},{-50,-68}},lineColor={0,0,255},pattern=LinePattern.None,fillColor={255,255,0},
fillPattern=FillPattern.Solid),
Rectangle(extent={{-48,68},{50,60}},lineColor={0,0,255},pattern=LinePattern.None,fillColor={255,255,0},
fillPattern=FillPattern.Solid),
Rectangle(extent={{-48,-60},{50,-68}},lineColor={0,0,255},pattern=LinePattern.None,fillColor={255,255,0},
fillPattern=FillPattern.Solid),
Rectangle(extent={{-40,20},{40,-20}},lineColor={0,0,255},pattern=LinePattern.None,fillColor={0,0,127},
fillPattern=FillPattern.Solid),
Rectangle(extent={{-10,10},{10,-10}},lineColor={0,0,0},
fillPattern=FillPattern.Sphere,fillColor={255,255,255}),
Rectangle(extent={{-40,68},{-50,-66}},lineColor={0,0,255},pattern=LinePattern.None,fillColor={255,255,0},
fillPattern=FillPattern.Solid),
Rectangle(extent={{50,68},{40,-66}},lineColor={0,0,255},pattern=LinePattern.None,fillColor={255,255,0},
fillPattern=FillPattern.Solid)}), Diagram(
coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}})),
experiment(StopTime=10800,Tolerance=1e-05,
__Dymola_Algorithm="Cvode"),
Documentation(
info="<html>
<p>
This partial model is the base class for
<a href=\"modelica://Buildings.Fluid.Storage.HeatPumpWaterHeater.WrappedCondenser\">
Buildings.Fluid.Storage.HeatPumpWaterHeater.WrappedCondenser</a> and
<a href=\"modelica://Buildings.Fluid.Storage.HeatPumpWaterHeater.PumpedCondenser\">
Buildings.Fluid.Storage.HeatPumpWaterHeater.PumpedCondenser</a>.
</p>
</html>", revisions="<html>
<ul>
<li>
September 24, 2024 by Xing Lu, Karthik Devaprasad and Cerrina Mouchref:</br>
First implementation.
</li>
</ul>
</html>"));
end PartialHeater;
12 changes: 12 additions & 0 deletions Buildings/Fluid/Storage/HeatPumpWaterHeater/BaseClasses/package.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
within Buildings.Fluid.Storage.HeatPumpWaterHeater;
package BaseClasses "Baseclasses for heat pump water heater models"
extends Modelica.Icons.BasesPackage;

annotation (Documentation(info="<html>
<p>
This package contains base classes that are used to construct the models in
<a href=\"modelica://Buildings.Fluid.Storage.HeatPumpWaterHeater\">
Buildings.Fluid.Storage.HeatPumpWaterHeater</a>.
</p>
</html>"));
end BaseClasses;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PartialHeater
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
within Buildings.Fluid.Storage.HeatPumpWaterHeater.Data.Baseclasses;
record WaterTank "Hot water tank data"
extends Modelica.Icons.Record;
parameter Modelica.Units.SI.Length hTan
"Height of tank (without insulation)";
parameter Modelica.Units.SI.Volume VTan
"Tank volume";
parameter Modelica.Units.SI.Length dIns
"Thickness of insulation";
parameter Modelica.Units.SI.ThermalConductivity kIns
"Specific heat conductivity of insulation";
parameter Modelica.Units.SI.Length hTemSen
"Height of temperature sensor in the tank from the bottom";
parameter Integer nSeg
"Number of volume segments"
annotation(Dialog(group="Computational parameters"));
parameter Modelica.Units.SI.Length hSegBot
"Height of condenser/heat exchanger bottom from bottom";
parameter Modelica.Units.SI.Length hSegTop
"Height of condenser/heat exchanger top from bottom";
final parameter Modelica.Units.SI.Length hSeg = hTan / nSeg
"Height of each node";
final parameter Integer segBot = integer(nSeg - floor(hSegBot / hSeg))
"Node number where the condenser/heat exchanger bottom is located";
final parameter Integer segTop = integer(nSeg - floor(hSegTop / hSeg))
"Node number where the condenser/heat exchanger top is located";
final parameter Integer nSegCon = segBot - segTop + 1
"Number of condenser/heat exchanger nodes";
final parameter Integer segTemSen = integer(nSeg - floor(hTemSen / hSeg))
"Node number where the temperature sensor is located";
final parameter Real conHeaFraTop = (hSegTop - (nSeg - segTop)*hSeg)/hSeg
"Heating fraction of condenser/heat exchanger top node";
final parameter Real conHeaFraBot = ((nSeg + 1 - segBot)*hSeg - hSegBot)/hSeg
"Heating fraction of condenser/heat exchanger bottom node";
final parameter Real conHeaFra[nSegCon] = cat(1, {conHeaFraTop}, fill(1.0, nSegCon-2), {conHeaFraBot})
"Heating fraction for each condenser/heat exchanger node";
final parameter Real conHeaFraSca[nSegCon] = conHeaFra/sum(conHeaFra)
"Scaled heating fraction for each condenser/heat exchanger node, sum up to 1";

annotation (preferredView="info",
defaultComponentName="datTanWat",
Documentation(info="<html>
<p>This record declares the geometry and performance data for the hot water tank
in the heat pump water heater. For the both configurations, the record calculates
the scaled heating fraction for each condenser/heat exchanger node based on the
geometry data.</p>
</html>",
revisions="<html>
<ul>
<li>
September 24, 2024 by Xing Lu, Karthik Devaprasad and Cerrina Mouchref:</br>
First implementation.
</li>
</ul>
</html>"));

end WaterTank;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
within Buildings.Fluid.Storage.HeatPumpWaterHeater.Data;
package Baseclasses "Data record baseclasses for constructing heat pump water heater data records"
extends Modelica.Icons.BasesPackage;

annotation (Documentation(info="<html>
<p>Package with performance data record baseclasses for heat pump water heaters.
</p>
</html>"));
end Baseclasses;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
WaterTank
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
within Buildings.Fluid.Storage.HeatPumpWaterHeater.Data;
record PumpedCondenser "Pumped condenser heat pump water heater data"
extends Buildings.Fluid.Storage.HeatPumpWaterHeater.Data.WrappedCondenser(
redeclare Buildings.Fluid.DXSystems.Cooling.WaterSource.Data.Generic.DXCoil
datCoi);
replaceable parameter Buildings.Fluid.Movers.Data.Generic datPum
constrainedby Buildings.Fluid.Movers.Data.Generic
"Sizing and performance data for condenser pump"
annotation(choicesAllMatching=true);

annotation (preferredView="info",
defaultComponentName="datPumHPWH",
Documentation(info="<html>
<p>This record declares the performance data for the components in the pumped condenser
heat pump water heater, including the water tank, evaporator fan, heat pump system
and the condenser pump. The parameters for the integrated heat exchanger in the
water tank are included within the water tank data record <code>datTanWat</code>.</p>
</html>",
revisions="<html>
<ul>
<li>
September 24, 2024 by Karthik Devaprasad:</br>
First implementation.
</li>
</ul>
</html>"));

end PumpedCondenser;
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
within Buildings.Fluid.Storage.HeatPumpWaterHeater.Data;
record WrappedCondenser
"Wrapped condenser heat pump water heater data"
extends Modelica.Icons.Record;
replaceable parameter Buildings.Fluid.Storage.HeatPumpWaterHeater.Data.Baseclasses.WaterTank datTanWat
constrainedby
Buildings.Fluid.Storage.HeatPumpWaterHeater.Data.Baseclasses.WaterTank
"Sizing and performance data for water tank and integrated condenser coil/heat exchanger"
annotation(choicesAllMatching=true);

replaceable parameter Buildings.Fluid.Movers.Data.Generic datFan
constrainedby Buildings.Fluid.Movers.Data.Generic
"Sizing and performance data for evaporator fan"
annotation(choicesAllMatching=true);

replaceable parameter Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.DXCoil datCoi
constrainedby
Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.DXCoil
"Sizing and performance data for evaporator coil"
annotation(choicesAllMatching=true);

annotation (preferredView="info",
defaultComponentName="datWraHPWH",
Documentation(info="<html>
<p>This record declares the performance data for the components in the wrapped condenser
heat pump water heater, including the water tank, evaporator fan and the evaporator
coil. The parameters for the integrated condenser coil in the water tank are included
within the water tank data record <code>datTanWat</code>.</p>
</html>",
revisions="<html>
<ul>
<li>
September 24, 2024 by Karthik Devaprasad:</br>
First implementation.
</li>
</ul>
</html>"));

end WrappedCondenser;
8 changes: 8 additions & 0 deletions Buildings/Fluid/Storage/HeatPumpWaterHeater/Data/package.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
within Buildings.Fluid.Storage.HeatPumpWaterHeater;
package Data "Data records for heat pump water heater"
extends Modelica.Icons.MaterialPropertiesPackage;

annotation (Documentation(info="<html>
<p>Package with performance data records for heat pump water heaters.</p>
</html>"));
end Data;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PumpedCondenser
WrappedCondenser
Baseclasses
Loading
Loading