Buildings.DHC.Loads.HotWater.BaseClasses

Package with base classes that are used by multiple models

Information

This package contains base classes that are used to construct the classes in Buildings.DHC.Loads.Heating.DHW.

Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).

Package Content

Name Description
Buildings.DHC.Loads.HotWater.BaseClasses.HeatExchangerPumpController HeatExchangerPumpController Controller for pump of storage tank with external heat exchanger
Buildings.DHC.Loads.HotWater.BaseClasses.PartialFourPortDHW PartialFourPortDHW A partial model for domestic water heating
Buildings.DHC.Loads.HotWater.BaseClasses.TankChargingController TankChargingController Controller to enable or disable storage tank charging
Buildings.DHC.Loads.HotWater.BaseClasses.TankValveController TankValveController Controller to divert the water to the middle or bottom of the tank

Buildings.DHC.Loads.HotWater.BaseClasses.HeatExchangerPumpController Buildings.DHC.Loads.HotWater.BaseClasses.HeatExchangerPumpController

Controller for pump of storage tank with external heat exchanger

Buildings.DHC.Loads.HotWater.BaseClasses.HeatExchangerPumpController

Information

Controller for heat exchanger mass flow rate.

This controller outputs the set point for the head of the heat exchanger pump on the heating side. The set point is calculated using a PI controller that tracks the set point for the leaving domestic hot water temperature, with a minimum controller output equal to yMin. By default, yMin=0.3, which corresponds to a mass flow rate of 10% of the design flow rate.

If the measured domestic hot water flow rate is close to zero, then the set point for the pump is also set to zero in order to stop the pump if there is no domestic hot water flow rate.

Parameters

TypeNameDefaultDescription
MassFlowRatemDom_flow_nominal Domestic hot water design flow rate (used for scaling) [kg/s]
PressureDifferencedpPum_nominal Heating water pump head at full speed through heat exchanger [Pa]
Realk0.1Proportioanl gain of circulation pump controller
RealTi60Integrator time constant of circulation pump controller
RealyMin0.3Minimum controller output when pump is on

Connectors

TypeNameDescription
input RealInputmDom_flowDomestic hot water mass flow rate [kg/s]
input RealInputTDomSetTemperature setpoint for domestic hot water source from heater [K]
input RealInputTDomMeasured hot water temperature [K]
output RealOutputdpPumHexSet point for pump head on heating water side [Pa]

Modelica definition

block HeatExchangerPumpController "Controller for pump of storage tank with external heat exchanger" parameter Modelica.Units.SI.MassFlowRate mDom_flow_nominal "Domestic hot water design flow rate (used for scaling)"; parameter Modelica.Units.SI.PressureDifference dpPum_nominal( displayUnit="Pa", min=0) "Heating water pump head at full speed through heat exchanger"; parameter Real k=0.1 "Proportioanl gain of circulation pump controller"; parameter Real Ti=60 "Integrator time constant of circulation pump controller"; parameter Real yMin(min=0) = 0.3 "Minimum controller output when pump is on"; Buildings.Controls.OBC.CDL.Interfaces.RealInput mDom_flow( final unit="kg/s") "Domestic hot water mass flow rate"; Modelica.Blocks.Interfaces.RealInput TDomSet( final unit="K", displayUnit="degC") "Temperature setpoint for domestic hot water source from heater"; Modelica.Blocks.Interfaces.RealInput TDom( final unit="K", displayUnit="degC") "Measured hot water temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput dpPumHex( final unit="Pa", displayUnit="Pa") "Set point for pump head on heating water side"; Buildings.Controls.OBC.CDL.Reals.Hysteresis hysMasFlo( uLow=mDom_flow_nominal/1E4, uHigh=2*mDom_flow_nominal/1E4, y(start=false)) "Hysteresis used to switch secondary pump on and off"; Buildings.Controls.OBC.CDL.Reals.PIDWithReset conPI( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI, k=k, Ti=Ti, yMin=0.03, y_reset=0) "PI controller for pump"; Buildings.Controls.OBC.CDL.Reals.Switch swi "Switch for pump control"; protected Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter pumHea(final k=dpPum_nominal) "Gain for hex pump head"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant con(final k=0) "Outputs zero"; equation connect(conPI.y, pumHea.u); connect(hysMasFlo.y,conPI. trigger); connect(hysMasFlo.u, mDom_flow); connect(pumHea.y, swi.u1); connect(con.y, swi.u3); connect(hysMasFlo.y, swi.u2); connect(swi.y, dpPumHex); connect(TDomSet, conPI.u_s); connect(TDom, conPI.u_m); end HeatExchangerPumpController;

Buildings.DHC.Loads.HotWater.BaseClasses.PartialFourPortDHW Buildings.DHC.Loads.HotWater.BaseClasses.PartialFourPortDHW

A partial model for domestic water heating

Buildings.DHC.Loads.HotWater.BaseClasses.PartialFourPortDHW

Information

This partial model can be used for different domestic hot water generation methods.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
replaceable package MediumDomModelica.Media.Interfaces.Pa...Medium for domestic water in the component
replaceable package MediumHeaModelica.Media.Interfaces.Pa...Medium for heating source in the component
Assumptions
BooleanallowFlowReversalDomtrue= false to simplify equations, assuming, but not enforcing, no flow reversal for domestic water
BooleanallowFlowReversalHeatrue= false to simplify equations, assuming, but not enforcing, no flow reversal for heating water

Connectors

TypeNameDescription
replaceable package MediumDomMedium for domestic water in the component
replaceable package MediumHeaMedium for heating source in the component
FluidPort_aport_aDomFluid connector for cold water (or recirculation water)
FluidPort_bport_bDomFluid connector for heated domestic hot water
FluidPort_aport_aHeaFluid connector for heating water (positive design flow direction is from port_a to port_b)
FluidPort_bport_bHeaFluid connector b for heating water (positive design flow direction is from port_a to port_b)
input RealInputTDomSetTemperature setpoint for heated domestic water [K]

Modelica definition

partial model PartialFourPortDHW "A partial model for domestic water heating" extends Modelica.Blocks.Icons.Block; replaceable package MediumDom = Modelica.Media.Interfaces.PartialMedium "Medium for domestic water in the component"; replaceable package MediumHea = Modelica.Media.Interfaces.PartialMedium "Medium for heating source in the component"; parameter Boolean allowFlowReversalDom=true "= false to simplify equations, assuming, but not enforcing, no flow reversal for domestic water"; parameter Boolean allowFlowReversalHea=true "= false to simplify equations, assuming, but not enforcing, no flow reversal for heating water"; Modelica.Fluid.Interfaces.FluidPort_a port_aDom( redeclare final package Medium = MediumDom, m_flow(min=if allowFlowReversalDom then -Modelica.Constants.inf else 0), h_outflow(start=MediumDom.h_default, nominal=MediumDom.h_default)) "Fluid connector for cold water (or recirculation water)"; Modelica.Fluid.Interfaces.FluidPort_b port_bDom( redeclare final package Medium = MediumDom, m_flow(max=if allowFlowReversalDom then +Modelica.Constants.inf else 0), h_outflow(start=MediumDom.h_default, nominal=MediumDom.h_default)) "Fluid connector for heated domestic hot water"; Modelica.Fluid.Interfaces.FluidPort_a port_aHea( redeclare final package Medium = MediumHea, m_flow(min=if allowFlowReversalHea then -Modelica.Constants.inf else 0), h_outflow(start=MediumHea.h_default, nominal=MediumHea.h_default)) "Fluid connector for heating water (positive design flow direction is from port_a to port_b)"; Modelica.Fluid.Interfaces.FluidPort_b port_bHea( redeclare final package Medium = MediumHea, m_flow(max=if allowFlowReversalHea then +Modelica.Constants.inf else 0), h_outflow(start=MediumHea.h_default, nominal=MediumHea.h_default)) "Fluid connector b for heating water (positive design flow direction is from port_a to port_b)"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TDomSet( final unit="K", displayUnit="degC") "Temperature setpoint for heated domestic water"; end PartialFourPortDHW;

Buildings.DHC.Loads.HotWater.BaseClasses.TankChargingController Buildings.DHC.Loads.HotWater.BaseClasses.TankChargingController

Controller to enable or disable storage tank charging

Buildings.DHC.Loads.HotWater.BaseClasses.TankChargingController

Information

Controller that outputs charge=true if the domestic hot water tank needs to be charged, and false otherwise.

Whether the tank needs to be charged depends on the difference between the measured top and bottom tank temperatures and the tank's set point. If the top temperature is below the set point with hysteresis, charging is enabled until the bottom temperature reaches the set point with hysteresis, at which point charging is disabled. The hysteresis is 5 Kelvin.

Connectors

TypeNameDescription
input RealInputTTanTopMeasured temperature at top of tank [K]
input RealInputTTanTopSetTemperature setpoint for top section of hot water tank [K]
output BooleanOutputchargeOutputs true if tank should be charged
input RealInputTTanBotMeasured temperature at bottom of tank [K]

Modelica definition

block TankChargingController "Controller to enable or disable storage tank charging" Buildings.Controls.OBC.CDL.Interfaces.RealInput TTanTop( final unit="K", displayUnit="degC") "Measured temperature at top of tank"; Modelica.Blocks.Interfaces.RealInput TTanTopSet( final unit="K", displayUnit="degC") "Temperature setpoint for top section of hot water tank"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput charge "Outputs true if tank should be charged"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TTanBot(final unit="K", displayUnit= "degC") "Measured temperature at bottom of tank"; Buildings.Controls.OBC.CDL.Logical.Latch lat; Buildings.Controls.OBC.CDL.Logical.Not not1; protected Buildings.Controls.OBC.CDL.Reals.Hysteresis cha(uLow=-5, uHigh=0) "Outputs true if tank should be charged"; Buildings.Controls.OBC.CDL.Reals.Subtract sub; protected Buildings.Controls.OBC.CDL.Reals.Hysteresis cha1(uLow=-5, uHigh=0) "Outputs true if tank should be charged"; Buildings.Controls.OBC.CDL.Reals.Subtract sub1; equation connect(sub.u2, TTanTop); connect(sub.u1, TTanTopSet); connect(sub.y, cha.u); connect(sub1.y, cha1.u); connect(TTanTopSet, sub1.u1); connect(TTanBot, sub1.u2); connect(cha.y, lat.u); connect(lat.y, charge); connect(cha1.y, not1.u); connect(not1.y, lat.clr); end TankChargingController;

Buildings.DHC.Loads.HotWater.BaseClasses.TankValveController Buildings.DHC.Loads.HotWater.BaseClasses.TankValveController

Controller to divert the water to the middle or bottom of the tank

Buildings.DHC.Loads.HotWater.BaseClasses.TankValveController

Information

Controller that outputs the commanded position for the valve that diverts the return water to the middle or bottom of the tank.

The controller changes its commanded valve position continuously between 0 and 1. If the measured temperature TRet is below TSwi, the output is 0, otherwise it is 1. The controller has a hysteresis of 2 Kelvin.

Parameters

TypeNameDefaultDescription
TemperatureTSwi318.15Switching temperature for return water [K]

Connectors

TypeNameDescription
input RealInputTRetReturn water temperature [K]
output RealOutputyValve position

Modelica definition

block TankValveController "Controller to divert the water to the middle or bottom of the tank" parameter Modelica.Units.SI.Temperature TSwi = 318.15 "Switching temperature for return water"; Modelica.Blocks.Interfaces.RealInput TRet(final unit="K", displayUnit="degC") "Return water temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput y "Valve position"; Modelica.Blocks.Continuous.LimIntegrator ram( k=1/120, outMax=1, outMin=0, strict=false) "Ramp signal for valve position"; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea; protected Buildings.Controls.OBC.CDL.Reals.Hysteresis cha(uLow=TSwi - 1, uHigh=TSwi + 1) "Outputs true if tank should be charged"; equation connect(cha.y, booToRea.u); connect(booToRea.y, ram.u); connect(ram.y, y); connect(cha.u, TRet); end TankValveController;