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 |
HeaterAndFixtureDirectHeatExchangerWithElectricHeat
|
Example model for direct heat exchanger with auxiliary electric heater |
StorageTankWithExternalHeatExchanger
|
Example model for storage tank with external heat exchanger |
Example model for direct heat exchanger with auxiliary electric heater
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
extends Modelica.Icons.Example;
package Medium =
Buildings.Media.Water ;
Buildings.Fluid.Sources.Boundary_pT souCol(
nPorts=3,
redeclare package Medium = Medium,
T(displayUnit="degC") = 283.15)
;
Buildings.DHC.Loads.HotWater.ThermostaticMixingValve theMixVal(
redeclare
package Medium = Medium,
mMix_flow_nominal=1) ;
Buildings.Fluid.Sources.MassFlowSource_T souDisAmb(
redeclare package Medium = Medium,
m_flow=1,
T(displayUnit="degC") = 298.15,
nPorts=1) ;
Modelica.Blocks.Sources.Constant conTHotSet(k(
final unit="K",
displayUnit="degC") = 313.15)
;
Buildings.Fluid.Sources.Boundary_pT sinDis(
redeclare package Medium = Medium,
T(displayUnit="degC"),
nPorts=3) ;
Modelica.Blocks.Sources.Constant conTSetMix(k(
final unit="K",
displayUnit="degC") = 308.15)
;
Buildings.DHC.Loads.HotWater.DirectHeatExchangerWithElectricHeat gen(
redeclare package MediumDom = Medium,
redeclare package MediumHea = Medium,
mDom_flow_nominal=1,
mHea_flow_nominal=1)
;
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)
;
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)
;
Buildings.DHC.Loads.HotWater.ThermostaticMixingValve theMixValNoEle(
redeclare
package Medium = Medium,
mMix_flow_nominal=1) ;
Buildings.Fluid.Sources.MassFlowSource_T souDisHot(
redeclare package Medium = Medium,
m_flow=1,
T(displayUnit="degC") = 323.15,
nPorts=1) ;
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;
Example model for storage tank with external heat exchanger
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
| Type | Name | Default | Description |
| Temperature | TCol | 273.15 + 10 | Temperature of domestic cold water supply [K] |
| MassFlowRate | mHea_flow_nominal | datWatHea.QHex_flow_nominal/... | Tank heater water loop nominal mass flow [kg/s] |
| GenericDomesticHotWaterWithHeatExchanger | datWatHea | datWatHea(VTan=0.1892706, mD... | Data for heat pump water heater with tank |
Modelica definition
model StorageTankWithExternalHeatExchanger
extends Modelica.Icons.Example;
package Medium =
Buildings.Media.Water ;
parameter Modelica.Units.SI.Temperature TCol = 273.15+10 ;
parameter Modelica.Units.SI.MassFlowRate mHea_flow_nominal = datWatHea.QHex_flow_nominal/4200/(55 - 50) ;
parameter Buildings.DHC.Loads.HotWater.Data.GenericDomesticHotWaterWithHeatExchanger
datWatHea(VTan=0.1892706, mDom_flow_nominal=6.52944E-06*1000)
;
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)
;
Buildings.Fluid.Sources.Boundary_pT souCol(
nPorts=2,
redeclare package Medium = Medium,
T(displayUnit="degC") = 283.15) ;
Modelica.Blocks.Sources.Constant conTSetMix(k(
final unit="K",
displayUnit="degC") = 308.15)
;
Buildings.DHC.Loads.HotWater.StorageTankWithExternalHeatExchanger
domHotWatTan(
redeclare package MediumDom = Medium,
redeclare package
MediumHea = Medium,
dat=datWatHea) ;
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)
;
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) ;
Buildings.Fluid.Sources.Boundary_pT preRef(
nPorts=1,
redeclare package Medium = Medium,
T(displayUnit="degC")) ;
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;