Buildings.DHC.Loads.HotWater.Examples

Example implementations of district-integrated DHW models

Information

This package contains a collection of domestic hot water (DHW) models to demonstrate how these models might be used in district heating systems.

Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

Package Content

Name Description
Buildings.DHC.Loads.HotWater.Examples.HeaterAndFixtureDirectHeatExchangerWithElectricHeat HeaterAndFixtureDirectHeatExchangerWithElectricHeat Example model for direct heat exchanger with auxiliary electric heater
Buildings.DHC.Loads.HotWater.Examples.StorageTankWithExternalHeatExchanger StorageTankWithExternalHeatExchanger Example model for storage tank with external heat exchanger

Buildings.DHC.Loads.HotWater.Examples.HeaterAndFixtureDirectHeatExchangerWithElectricHeat Buildings.DHC.Loads.HotWater.Examples.HeaterAndFixtureDirectHeatExchangerWithElectricHeat

Example model for direct heat exchanger with auxiliary electric heater

Buildings.DHC.Loads.HotWater.Examples.HeaterAndFixtureDirectHeatExchangerWithElectricHeat

Information

Example model of a fresh water station that heats up domestic hot water. Input is a load profile which is sent to a model that computes the hot and cold water draw. The domestic hot water is produced by a heat exchanger with a district water source and optionally an electric heater. Examples with and without the electric heater are shown.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model HeaterAndFixtureDirectHeatExchangerWithElectricHeat "Example model for direct heat exchanger with auxiliary electric heater" extends Modelica.Icons.Example; package Medium = Buildings.Media.Water "Medium model"; Buildings.Fluid.Sources.Boundary_pT souCol( nPorts=3, redeclare package Medium = Medium, T(displayUnit="degC") = 283.15) "Source of domestic cold water"; Buildings.DHC.Loads.HotWater.ThermostaticMixingValve theMixVal(redeclare package Medium = Medium, mMix_flow_nominal=1) "Ideal thermostatic mixing valve"; Buildings.Fluid.Sources.MassFlowSource_T souDisAmb( redeclare package Medium = Medium, m_flow=1, T(displayUnit="degC") = 298.15, nPorts=1) "Source of district water from ambient network"; Modelica.Blocks.Sources.Constant conTHotSet(k( final unit="K", displayUnit="degC") = 313.15) "Temperature setpoint for hot water supply to fixture"; Buildings.Fluid.Sources.Boundary_pT sinDis( redeclare package Medium = Medium, T(displayUnit="degC"), nPorts=3) "Sink of district network water"; Modelica.Blocks.Sources.Constant conTSetMix(k( final unit="K", displayUnit="degC") = 308.15) "Temperature setpoint for mixed water supply to fixture"; Buildings.DHC.Loads.HotWater.DirectHeatExchangerWithElectricHeat gen( redeclare package MediumDom = Medium, redeclare package MediumHea = Medium, mDom_flow_nominal=1, mHea_flow_nominal=1) "Hot water generated by heat exchanger and auxiliary heat"; Modelica.Blocks.Sources.CombiTimeTable sch( tableOnFile=true, tableName="tab1", fileName=Modelica.Utilities.Files.loadResource("modelica://Buildings/Resources/Data/DHC/Loads/HotWater/DHW_ApartmentMidRise.mos"), smoothness=Modelica.Blocks.Types.Smoothness.ContinuousDerivative, extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic) "Domestic hot water fixture draw fraction schedule"; Buildings.DHC.Loads.HotWater.DirectHeatExchangerWithElectricHeat genNoEle( redeclare package MediumDom = Medium, redeclare package MediumHea = Medium, have_eleHea=false, mDom_flow_nominal=1, mHea_flow_nominal=1) "Hot water generated by heat exchanger without auxiliary heat"; Buildings.DHC.Loads.HotWater.ThermostaticMixingValve theMixValNoEle(redeclare package Medium = Medium, mMix_flow_nominal=1) "Ideal thermostatic mixing valve"; Buildings.Fluid.Sources.MassFlowSource_T souDisHot( redeclare package Medium = Medium, m_flow=1, T(displayUnit="degC") = 323.15, nPorts=1) "Source of district water from hot network"; equation connect(conTSetMix.y,theMixVal. TMixSet); connect(conTHotSet.y, gen.TDomSet); connect(sch.y[1], theMixVal.yMixSet); connect(gen.port_bDom, theMixVal.port_hot); connect(theMixVal.port_col, souCol.ports[1]); connect(gen.port_aDom, souCol.ports[2]); connect(gen.port_bHea, sinDis.ports[1]); connect(gen.port_aHea, souDisAmb.ports[1]); connect(sch.y[1], theMixValNoEle.yMixSet); connect(conTSetMix.y, theMixValNoEle.TMixSet); connect(conTHotSet.y, genNoEle.TDomSet); connect(genNoEle.port_bDom, theMixValNoEle.port_hot); connect(souDisHot.ports[1], genNoEle.port_aHea); connect(genNoEle.port_bHea, sinDis.ports[2]); connect(theMixValNoEle.port_col, souCol.ports[3]); connect(genNoEle.port_aDom, sinDis.ports[3]); end HeaterAndFixtureDirectHeatExchangerWithElectricHeat;

Buildings.DHC.Loads.HotWater.Examples.StorageTankWithExternalHeatExchanger Buildings.DHC.Loads.HotWater.Examples.StorageTankWithExternalHeatExchanger

Example model for storage tank with external heat exchanger

Buildings.DHC.Loads.HotWater.Examples.StorageTankWithExternalHeatExchanger

Information

Example model of a fresh water station that heats up domestic hot water. Input is a load profile which is sent to a model that computes the hot and cold water draw. If the tank needs to be recharged, then tank water is circulated through a heater with a prescribed temperature lift.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
TemperatureTCol273.15 + 10Temperature of domestic cold water supply [K]
MassFlowRatemHea_flow_nominaldatWatHea.QHex_flow_nominal/...Tank heater water loop nominal mass flow [kg/s]
GenericDomesticHotWaterWithHeatExchangerdatWatHeadatWatHea(VTan=0.1892706, mD...Data for heat pump water heater with tank

Modelica definition

model StorageTankWithExternalHeatExchanger "Example model for storage tank with external heat exchanger" extends Modelica.Icons.Example; package Medium = Buildings.Media.Water "Medium model"; parameter Modelica.Units.SI.Temperature TCol = 273.15+10 "Temperature of domestic cold water supply"; parameter Modelica.Units.SI.MassFlowRate mHea_flow_nominal = datWatHea.QHex_flow_nominal/4200/(55 - 50) "Tank heater water loop nominal mass flow"; parameter Buildings.DHC.Loads.HotWater.Data.GenericDomesticHotWaterWithHeatExchanger datWatHea(VTan=0.1892706, mDom_flow_nominal=6.52944E-06*1000) "Data for heat pump water heater with tank"; Modelica.Blocks.Sources.CombiTimeTable sch( tableOnFile=true, tableName="tab1", fileName=Modelica.Utilities.Files.loadResource( "modelica://Buildings/Resources/Data/DHC/Loads/HotWater/DHW_ApartmentMidRise.mos"), smoothness=Modelica.Blocks.Types.Smoothness.ContinuousDerivative, extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic) "Domestic hot water fixture draw fraction schedule"; Buildings.Fluid.Sources.Boundary_pT souCol( nPorts=2, redeclare package Medium = Medium, T(displayUnit="degC") = 283.15) "Source of domestic cold water"; Modelica.Blocks.Sources.Constant conTSetMix(k( final unit="K", displayUnit="degC") = 308.15) "Temperature setpoint for mixed water supply to fixture"; Buildings.DHC.Loads.HotWater.StorageTankWithExternalHeatExchanger domHotWatTan(redeclare package MediumDom = Medium, redeclare package MediumHea = Medium, dat=datWatHea) "Storage tank with external heat exchanger"; Buildings.DHC.Loads.HotWater.ThermostaticMixingValve theMixVal(redeclare package Medium = Medium, mMix_flow_nominal=1.2*datWatHea.mDom_flow_nominal); Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea(realTrue= mHea_flow_nominal); Modelica.Blocks.Sources.Constant conTSetHot(k( final unit="K", displayUnit="degC") = 313.15) "Temperature setpoint for hot water supply to fixture"; Buildings.Fluid.HeatExchangers.Heater_T hea( redeclare package Medium = Medium, m_flow_nominal=mHea_flow_nominal, dp_nominal=0); Buildings.Fluid.Movers.FlowControlled_m_flow mov( redeclare package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, nominalValuesDefineDefaultPressureCurve=true, m_flow_nominal=mHea_flow_nominal); Buildings.Fluid.Sensors.TemperatureTwoPort senTem( redeclare package Medium = Medium, m_flow_nominal=mHea_flow_nominal, tau=0); Buildings.Controls.OBC.CDL.Reals.AddParameter addPar(p=5) "dT for heater"; Buildings.Fluid.Sources.Boundary_pT preRef( nPorts=1, redeclare package Medium = Medium, T(displayUnit="degC")) "Reference pressure"; equation connect(theMixVal.yMixSet, sch.y[1]); connect(conTSetMix.y, theMixVal.TMixSet); connect(domHotWatTan.port_bDom, theMixVal.port_hot); connect(souCol.ports[1], domHotWatTan.port_aDom); connect(souCol.ports[2], theMixVal.port_col); connect(booToRea.u, domHotWatTan.charge); connect(domHotWatTan.TDomSet, conTSetHot.y); connect(mov.port_b, domHotWatTan.port_aHea); connect(hea.port_b, mov.port_a); connect(booToRea.y, mov.m_flow_in); connect(domHotWatTan.port_bHea, senTem.port_a); connect(senTem.port_b, hea.port_a); connect(addPar.y, hea.TSet); connect(senTem.T, addPar.u); connect(hea.port_b, preRef.ports[1]); end StorageTankWithExternalHeatExchanger;