Buildings.DHC.ETS.Combined.Controls

Package of control blocks for fifth generation DHC ETS

Information

This package contains control blocks for energy transfer stations in fifth generation district heating and cooling systems.

Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).

Package Content

Name Description
Buildings.DHC.ETS.Combined.Controls.EtsHex EtsHex Controller for enabling the ETS heat exchanger
Buildings.DHC.ETS.Combined.Controls.HeatPumpModular HeatPumpModular Modular heat pump controller
Buildings.DHC.ETS.Combined.Controls.PredictLeavingTemperature PredictLeavingTemperature Block that predicts heat exchanger leaving water temperature
Buildings.DHC.ETS.Combined.Controls.PrimaryVariableFlow PrimaryVariableFlow Ideal control of condenser or evaporator variable flow rate
Buildings.DHC.ETS.Combined.Controls.Reset Reset Supervisory supply temperature reset
Buildings.DHC.ETS.Combined.Controls.SwitchBox SwitchBox Controller for flow switch box
Buildings.DHC.ETS.Combined.Controls.TankChargingController TankChargingController Controller to enable or disable storage tank charging
Buildings.DHC.ETS.Combined.Controls.TwoTankCoordination TwoTankCoordination  
Buildings.DHC.ETS.Combined.Controls.WatersideEconomizer WatersideEconomizer Waterside economizer controller
Buildings.DHC.ETS.Combined.Controls.BaseClasses BaseClasses Package with base classes

Buildings.DHC.ETS.Combined.Controls.EtsHex Buildings.DHC.ETS.Combined.Controls.EtsHex

Controller for enabling the ETS heat exchanger

Buildings.DHC.ETS.Combined.Controls.EtsHex

Information

Controller for enabling the ETS heat exchanger pump.

The controller outputs true to enable the heat exchanger pump if no tank is requesting to be charged, and if at least one of the two isolation valves is sufficiently open. Otherwise, the controller outputs false.

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

Connectors

TypeNameDescription
output BooleanOutputonIf true, operate heat exchanger
input RealInputyVal1Valve position [1]
input RealInputyVal2Valve position [1]

Modelica definition

model EtsHex "Controller for enabling the ETS heat exchanger" extends Modelica.Blocks.Icons.Block; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput on "If true, operate heat exchanger"; Buildings.Controls.OBC.CDL.Interfaces.RealInput yVal1( final min=0, final max=1, final unit="1") "Valve position"; Buildings.Controls.OBC.CDL.Interfaces.RealInput yVal2( final min=0, final max=1, final unit="1") "Valve position"; Buildings.Controls.OBC.CDL.Reals.Add yVal "Sum of valve position to ensure that one of the two isolation valves is sufficiently open"; Buildings.Controls.OBC.CDL.Reals.GreaterThreshold valOpe(t=0.3, h=0.05) "Outputs true if at least one valve is partially open"; equation connect(yVal1,yVal. u1); connect(yVal2,yVal. u2); connect(valOpe.u,yVal. y); connect(valOpe.y, on); end EtsHex;

Buildings.DHC.ETS.Combined.Controls.HeatPumpModular Buildings.DHC.ETS.Combined.Controls.HeatPumpModular

Modular heat pump controller

Buildings.DHC.ETS.Combined.Controls.HeatPumpModular

Information

This is a controller for the heat pump system, which includes controls for the valves that ensure a minimum condenser outlet and a maximum evaporator outlet temperature.

The system is enabled if any of the input control signals uHeaSpa, uHeaDhw, or uCoo is true. When enabled, the following control is used:

Parameters

TypeNameDefaultDescription
RealPLRMin Minimum part load ratio
RealkHea2Gain of controller for compressor during heating operation
RealkCoo2Gain of controller for compressor during cooling
RealTHeaWatSupSetMin Minimum value of heating water supply temperature set point [K]
RealTChiWatSupSetMax Maximum value of chilled water supply temperature set point [K]
TemperatureDifferencedTOffSetHea Temperature to be added to the set point in order to be slightly above what the heating load requires [K]
TemperatureDifferencedTOffSetCoo Temperature to be added to the set point in order to be slightly below what the cooling load requires [K]

Connectors

TypeNameDescription
input BooleanInputuHeaSpaTrue if space heating is required from tank
input BooleanInputuHeaDhwTrue if domestic hot water heating is required from tank
input BooleanInputuCooTrue if cooling is required from tank
input RealInputTHeaWatSupSetSet point temperature for heating water [K]
input RealInputTConWatLvgCondenser water leaving temperature [K]
input RealInputTEvaWatLvgEvaporator water leaving temperature [K]
input RealInputTChiWatSupSetSet point temperature for chilled water [K]
output RealOutputyValConCondenser mixing valve control signal
output RealOutputyValEvaEvaporator mixing valve control signal
output BooleanOutputyPumPrimary pump enable signal
output BooleanOutputyComOnOutputs true if the compressor is on
output RealOutputyComCompressor speed control signal

Modelica definition

model HeatPumpModular "Modular heat pump controller" parameter Real PLRMin(min=0) "Minimum part load ratio"; parameter Real kHea=2 "Gain of controller for compressor during heating operation"; parameter Real kCoo=2 "Gain of controller for compressor during cooling"; parameter Real THeaWatSupSetMin( final quantity="ThermodynamicTemperature", final unit="K", displayUnit="degC") "Minimum value of heating water supply temperature set point"; parameter Real TChiWatSupSetMax( final quantity="ThermodynamicTemperature", final unit="K", displayUnit="degC") "Maximum value of chilled water supply temperature set point"; parameter Modelica.Units.SI.TemperatureDifference dTOffSetHea( min=0.5, displayUnit="K") "Temperature to be added to the set point in order to be slightly above what the heating load requires"; parameter Modelica.Units.SI.TemperatureDifference dTOffSetCoo( max=-0.5, displayUnit="K") "Temperature to be added to the set point in order to be slightly below what the cooling load requires"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uHeaSpa "True if space heating is required from tank"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uHeaDhw "True if domestic hot water heating is required from tank"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uCoo "True if cooling is required from tank"; Buildings.Controls.OBC.CDL.Interfaces.RealInput THeaWatSupSet(final unit="K", displayUnit="degC") "Set point temperature for heating water"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TConWatLvg(final unit="K", displayUnit="degC") "Condenser water leaving temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TEvaWatLvg(final unit="K", displayUnit="degC") "Evaporator water leaving temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TChiWatSupSet(final unit="K", displayUnit="degC") "Set point temperature for chilled water"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yValCon "Condenser mixing valve control signal"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yValEva "Evaporator mixing valve control signal"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yPum "Primary pump enable signal"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yComOn "Outputs true if the compressor is on"; Buildings.Controls.OBC.CDL.Logical.Or heaOrCoo "Heating or cooling requested"; Buildings.Controls.OBC.CDL.Reals.PID conValHea( final controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.P, final yMax=1, final yMin=0, k=kHea, Ti=60, final reverseActing=false, u_s(final unit="K", displayUnit="degC"), u_m(final unit="K", displayUnit="degC")) "Condenser three-way valve control"; Buildings.Controls.OBC.CDL.Reals.PID conValCoo( final controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.P, final yMax=1, final yMin=0, k=kCoo, Ti=60, final reverseActing=true, u_s(final unit="K", displayUnit="degC"), u_m(final unit="K", displayUnit="degC")) "Evaporator three-way valve control"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yCom "Compressor speed control signal"; Buildings.Controls.OBC.Utilities.PIDWithEnable conCoo( final controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.P, final yMax=1, final yMin=PLRMin, final k=kCoo, y_reset=PLRMin, Ti(displayUnit="s") = 300, final reverseActing=false, final y_neutral=0, u_s(final unit="K", displayUnit="degC"), u_m(final unit="K", displayUnit="degC")) "Chiller compressor speed control during cooling mode"; Buildings.Controls.OBC.Utilities.PIDWithEnable conHea( final controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.P, final yMax=1, final yMin=PLRMin, final k=kHea, y_reset=PLRMin, Ti(displayUnit="s") = 300, final reverseActing=true, final y_neutral=0, u_s(final unit="K", displayUnit="degC"), u_m(final unit="K", displayUnit="degC")) "Chiller compressor speed control during heating mode"; Buildings.Controls.OBC.CDL.Reals.Switch swi "Switch to select heating or cooling control signal"; Buildings.Controls.OBC.CDL.Reals.LimitSlewRate ramLimCom( raisingSlewRate=1/(15*60), fallingSlewRate=-1/30, Td=1) "Ramp limiter to avoid sudden load increase from chiller"; Buildings.Controls.OBC.CDL.Logical.Or hea "Heating requested"; Buildings.Controls.OBC.CDL.Reals.MovingAverage movAveHea(delta=600) "Moving average of heating compressor signal"; Buildings.Controls.OBC.CDL.Reals.MovingAverage movAveCoo(delta=600) "Moving average of cooling compressor signal"; Buildings.Controls.OBC.CDL.Reals.Greater heaDom(h=0.001) "Output true if heating dominates the operation"; Buildings.Controls.OBC.CDL.Reals.Switch swi1 "Switch to select heating or cooling control signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant zer(final k=0) "Outputs zero"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant TSupSetDhw( y(final unit="K", displayUnit="degC"), final k( final unit="K", displayUnit="degC") = 323.15) "Supply water temperature set point during domestic hot water charging"; Buildings.Controls.OBC.CDL.Reals.Switch swiTSupSetHea( u1(final unit="K", displayUnit="degC"), u3(final unit="K", displayUnit="degC"), y(final unit="K", displayUnit="degC")) "Switch for heating water temperature set point"; Buildings.Controls.OBC.CDL.Reals.AddParameter offSetHea( p(final unit="K")=-1/kHea*2, u(final unit="K", displayUnit="degC"), y(final unit="K", displayUnit="degC")) "Offset temperature for 3-way valve control during heating"; Buildings.Controls.OBC.CDL.Reals.AddParameter offSetCoo( p(final unit="K")=+1/kCoo*2, u(final unit="K", displayUnit="degC"), y(final unit="K", displayUnit="degC")) "Offset temperature for 3-way valve control during cooling"; Buildings.DHC.ETS.Combined.Controls.Reset resTHeaSup( final TWatSupSetMinMax=THeaWatSupSetMin) "Heating water supply temperature reset"; Buildings.DHC.ETS.Combined.Controls.Reset resTCooSup( final TWatSupSetMinMax=TChiWatSupSetMax) "Chilled water supply temperature reset"; Buildings.Controls.OBC.CDL.Reals.Max maxTSup( u1(final unit="K", displayUnit="degC"), u2(final unit="K", displayUnit="degC"), y(final unit="K", displayUnit="degC")) "Maximum to pick the larger value of space heating or hot water supply temperature setpoint"; Buildings.Controls.OBC.CDL.Logical.TrueDelay delSta(delayTime=30) "Delay start of compressor to ensure pumps have sufficient speed"; Buildings.Controls.OBC.CDL.Logical.TrueDelay delPumOff(delayTime=30) "Delay pump off signal to allow compressor to ramp down"; Buildings.Controls.OBC.CDL.Logical.Not not1; Buildings.Controls.OBC.CDL.Logical.Not not2; Buildings.Controls.OBC.CDL.Reals.AddParameter dTOffHea( p=dTOffSetHea, u(final unit="K", displayUnit="degC"), y(final unit="K", displayUnit="degC")) "Offset to slightly increase the set point"; Buildings.Controls.OBC.CDL.Reals.AddParameter dTOffCoo( p=dTOffSetCoo, u(final unit="K", displayUnit="degC"), y(final unit="K", displayUnit="degC")) "Offset to slightly decrease the set point"; equation connect(uCoo,heaOrCoo.u2); connect(TEvaWatLvg,conCoo. u_m); connect(TConWatLvg, conHea.u_m); connect(conCoo.uEna, uCoo); connect(hea.u1, uHeaSpa); connect(hea.u2, uHeaDhw); connect(hea.y, heaOrCoo.u1); connect(hea.y, conHea.uEna); connect(movAveHea.u, conHea.y); connect(conCoo.y, movAveCoo.u); connect(movAveHea.y, heaDom.u1); connect(movAveCoo.y, heaDom.u2); connect(heaDom.y, swi.u2); connect(conHea.y, swi.u1); connect(conCoo.y, swi.u3); connect(zer.y, swi1.u3); connect(swiTSupSetHea.u2, uHeaDhw); connect(conValHea.u_s, offSetHea.y); connect(TConWatLvg, conValHea.u_m); connect(conValCoo.u_s, offSetCoo.y); connect(conValHea.y, yValCon); connect(conValCoo.y, yValEva); connect(resTHeaSup.TWatSupSet, swiTSupSetHea.u3); connect(resTCooSup.TWatSupSet, conCoo.u_s); connect(resTCooSup.u, uCoo); connect(resTHeaSup.u, uHeaSpa); connect(maxTSup.y, swiTSupSetHea.u1); connect(TSupSetDhw.y, maxTSup.u1); connect(resTHeaSup.TWatSupSet, maxTSup.u2); connect(TEvaWatLvg, conValCoo.u_m); connect(resTCooSup.TWatSupSet, offSetCoo.u); connect(delSta.y, swi1.u2); connect(delSta.u, heaOrCoo.y); connect(swi.y, swi1.u1); connect(swi1.y, ramLimCom.u); connect(ramLimCom.y,yCom); connect(heaOrCoo.y, not1.u); connect(not1.y, delPumOff.u); connect(delPumOff.y, not2.u); connect(not2.y, yPum); connect(yComOn, delSta.y); connect(offSetHea.u, swiTSupSetHea.y); connect(swiTSupSetHea.y, conHea.u_s); connect(TChiWatSupSet, dTOffCoo.u); connect(dTOffCoo.y, resTCooSup.TWatSupPreSet); connect(THeaWatSupSet, dTOffHea.u); connect(dTOffHea.y, resTHeaSup.TWatSupPreSet); end HeatPumpModular;

Buildings.DHC.ETS.Combined.Controls.PredictLeavingTemperature Buildings.DHC.ETS.Combined.Controls.PredictLeavingTemperature

Block that predicts heat exchanger leaving water temperature

Buildings.DHC.ETS.Combined.Controls.PredictLeavingTemperature

Information

This block computes the predicted heat exchanger leaving water temperature as used in Buildings.DHC.ETS.Combined.Controls.WatersideEconomizer.

The predicted heat exchanger approach is computed as

dTApp = dTApp_nominal * m2_flow / m2_flow_nominal,

which gives the predicted heat exchanger leaving water temperature as

T2WatLvg = T1WatEnt + dTApp.

Parameters

TypeNameDefaultDescription
Nominal condition
RealdTApp_nominal Heat exchanger approach [K]
Realm2_flow_nominal Heat exchanger secondary mass flow rate [kg/s]

Connectors

TypeNameDescription
input RealInputm2_flowHeat exchanger secondary mass flow rate [kg/s]
input RealInputT1WatEntHeat exchanger primary water entering temperature [K]
output RealOutputT2WatLvgHeat exchanger secondary water leaving temperature [K]

Modelica definition

model PredictLeavingTemperature "Block that predicts heat exchanger leaving water temperature" parameter Real dTApp_nominal( final quantity="TemperatureDifference", final unit="K") "Heat exchanger approach"; parameter Real m2_flow_nominal( final quantity="MassFlowRate", final unit="kg/s") "Heat exchanger secondary mass flow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealInput m2_flow( final unit="kg/s") "Heat exchanger secondary mass flow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealInput T1WatEnt( final unit="K", displayUnit="degC") "Heat exchanger primary water entering temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput T2WatLvg( final unit="K", displayUnit="degC") "Heat exchanger secondary water leaving temperature"; Buildings.Controls.OBC.CDL.Reals.Divide div1 "Calculate flow ratio"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant con( final k=m2_flow_nominal) "Heat exchanger secondary nominal mass flow rate"; Buildings.Controls.OBC.CDL.Reals.Min min1 "Output the smaller input"; Buildings.Controls.OBC.CDL.Reals.Abs abs1 "Output the absolute value"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant con1( final k=1) "One"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant con2( final k=dTApp_nominal) "Heat exchanger approach"; Buildings.Controls.OBC.CDL.Reals.Multiply mul "Output product"; Buildings.Controls.OBC.CDL.Reals.Add add2 "Calculate the leaving water temperature"; equation connect(m2_flow, div1.u1); connect(con.y, div1.u2); connect(div1.y, abs1.u); connect(abs1.y, min1.u1); connect(con1.y, min1.u2); connect(con2.y, mul.u2); connect(min1.y, mul.u1); connect(mul.y, add2.u1); connect(T1WatEnt, add2.u2); connect(add2.y, T2WatLvg); end PredictLeavingTemperature;

Buildings.DHC.ETS.Combined.Controls.PrimaryVariableFlow Buildings.DHC.ETS.Combined.Controls.PrimaryVariableFlow

Ideal control of condenser or evaporator variable flow rate

Buildings.DHC.ETS.Combined.Controls.PrimaryVariableFlow

Information

This block implements an ideal control of the evaporator (or condenser) water mass flow rate. The control intent aims to maintain a constant water temperature difference dT_nominal across the heat exchanger, within the limit of a minimum mass flow rate ratio ratFloMin. For computational performance and to avoid the use of a PI controller, the required mass flow rate is computed based on a signal representative of the load.

Parameters

TypeNameDefaultDescription
RealQ_flow_nominal Heat flow rate at nominal conditions (>0 for condenser) [W]
RealdT_nominal DeltaT at nominal conditions (>0 for condenser) [K]
RealratFloMin0.3Minimum mass flow rate (ratio to nominal) [1]

Connectors

TypeNameDescription
input RealInputloaSignal approximating the load on condenser or evaporator [W]
output RealOutputm_flowMass flow rate [kg/s]

Modelica definition

block PrimaryVariableFlow "Ideal control of condenser or evaporator variable flow rate" constant Real cp( final quantity="SpecificHeatCapacity", final unit="J/(kg.K)")=Buildings.Utilities.Psychrometrics.Constants.cpWatLiq "Specific heat capacity"; parameter Real Q_flow_nominal( final quantity="HeatFlowRate", final unit="W") "Heat flow rate at nominal conditions (>0 for condenser)"; parameter Real dT_nominal( final quantity="TemperatureDifference", final unit="K", min=if Q_flow_nominal > 0 then Buildings.Controls.OBC.CDL.Constants.eps else -100, max=if Q_flow_nominal < 0 then -Buildings.Controls.OBC.CDL.Constants.eps else 100) "DeltaT at nominal conditions (>0 for condenser)"; parameter Real ratFloMin( final unit="1", final min=0, final max=1)=0.3 "Minimum mass flow rate (ratio to nominal)"; final parameter Real m_flow_nominal( final quantity="MassFlowRate", final unit="kg/s", final min=0)= Q_flow_nominal/cp/dT_nominal "Mass flow rate at nominal conditions"; Buildings.Controls.OBC.CDL.Interfaces.RealInput loa(final unit="W") "Signal approximating the load on condenser or evaporator"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput m_flow(final unit="kg/s") "Mass flow rate"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant masFloMin( final k=ratFloMin*m_flow_nominal) "Minimum mass flow rate"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter masFlo_dT( final k=1/cp/dT_nominal) "Mass flow rate for constant DeltaT"; Buildings.Controls.OBC.CDL.Reals.Max masFlo "Mass flow rate"; Buildings.Controls.OBC.CDL.Reals.Abs abs1 "Absolute value"; equation connect(loa, masFlo_dT.u); connect(masFloMin.y, masFlo.u1); connect(masFlo.y, m_flow); connect(masFlo_dT.y, abs1.u); connect(abs1.y, masFlo.u2); end PrimaryVariableFlow;

Buildings.DHC.ETS.Combined.Controls.Reset Buildings.DHC.ETS.Combined.Controls.Reset

Supervisory supply temperature reset

Buildings.DHC.ETS.Combined.Controls.Reset

Information

This block implements the supervisory reset of the heating water supply temperature. The heating water supply temperature is reset down whenever the heating demand signal yielded by the building automation system is false. This enables operating the chiller at a reduced lift whenever there is no requirement on the water temperature supplied to the building system.

Note that the chilled water supply temperature is not reset for the sake of simplicity. It would indeed require a more involved algorithm preventing the reset in case it limits the cold rejection capacity considering the actual district water temperature.

Parameters

TypeNameDefaultDescription
RealTWatSupSetMinMax Minimum of maximum value of heating or cooling water supply temperature set point [K]

Connectors

TypeNameDescription
input BooleanInputuHeating or cooling enable signal
input RealInputTWatSupPreSetHeating or cooling water supply temperature set point [K]
output RealOutputTWatSupSetHeating or cooling water supply temperature set point after reset [K]

Modelica definition

model Reset "Supervisory supply temperature reset" parameter Real TWatSupSetMinMax( final quantity="ThermodynamicTemperature", final unit="K", displayUnit="degC") "Minimum of maximum value of heating or cooling water supply temperature set point"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput u "Heating or cooling enable signal"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TWatSupPreSet(final unit="K", displayUnit="degC") "Heating or cooling water supply temperature set point"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput TWatSupSet(final unit="K", displayUnit="degC") "Heating or cooling water supply temperature set point after reset"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant minSet( k=TWatSupSetMinMax) "Minimum value of HW set point"; Buildings.Controls.OBC.CDL.Reals.Switch swiHea "Switch"; Buildings.Controls.OBC.CDL.Reals.LimitSlewRate ramLimHea( raisingSlewRate=0.1) "Limit the rate of change"; equation connect(TWatSupPreSet, swiHea.u1); connect(minSet.y,swiHea.u3); connect(u, swiHea.u2); connect(swiHea.y,ramLimHea.u); connect(ramLimHea.y, TWatSupSet); end Reset;

Buildings.DHC.ETS.Combined.Controls.SwitchBox Buildings.DHC.ETS.Combined.Controls.SwitchBox

Controller for flow switch box

Buildings.DHC.ETS.Combined.Controls.SwitchBox

Information

This block implements a control logic preventing flow reversal in the service line, for instance with the hydronic configuration of Buildings.DHC.ETS.Combined.HeatPumpHeatExchanger. The block requires two input signals representing the mass flow rate contributing to a positive flow direction mPos_flow and the mass flow contributing to a reverse flow direction mRev_flow. The output signal y switches to maintain mPos_flow ≥ mRev_flow with a temporization avoiding short cycling. Due to the temporization, the mass flow rate may transiently change direction as illustrated in Buildings.DHC.ETS.Combined.Subsystems.Validation.SwitchBox.

Parameters

TypeNameDefaultDescription
RealtrueHoldDuration true hold duration [s]
RealfalseHoldDurationtrueHoldDurationfalse hold duration [s]
Nominal condition
Realm_flow_nominal Nominal mass flow rate, used for scaling to avoid chattering [kg/s]

Connectors

TypeNameDescription
input RealInputmPos_flowService water mass flow rate in positive direction [kg/s]
input RealInputmRev_flowService water mass flow rate in reverse direction [kg/s]
output RealOutputyControl output signal [1]

Modelica definition

block SwitchBox "Controller for flow switch box" parameter Real m_flow_nominal( final quantity="MassFlowRate", final unit="kg/s") "Nominal mass flow rate, used for scaling to avoid chattering"; parameter Real trueHoldDuration( final quantity="Time", final unit="s") "true hold duration"; parameter Real falseHoldDuration( final quantity="Time", final unit="s") = trueHoldDuration "false hold duration"; Buildings.Controls.OBC.CDL.Interfaces.RealInput mPos_flow( final unit="kg/s") "Service water mass flow rate in positive direction"; Buildings.Controls.OBC.CDL.Interfaces.RealInput mRev_flow( final unit="kg/s") "Service water mass flow rate in reverse direction"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput y( final unit="1") "Control output signal"; Buildings.Controls.OBC.CDL.Reals.GreaterThreshold posDom( final h=0.001*m_flow_nominal) "Output true in case of dominating positive flow"; Buildings.Controls.OBC.CDL.Reals.Switch swi "Switch to select the mode"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant posModOn( final k=1) "Output signal in case of dominating positive flow"; Buildings.Controls.OBC.CDL.Logical.TrueFalseHold truFalHol( final trueHoldDuration=trueHoldDuration, final falseHoldDuration=falseHoldDuration) "True-false hold to remove the risk of chattering"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant revModOn(final k=0) "Output signal in case of dominating reverse flow"; Buildings.Controls.OBC.CDL.Reals.Subtract sub "Flow difference"; Buildings.Controls.OBC.CDL.Reals.MovingAverage movAve( final delta=trueHoldDuration/10) "Rolling average of flow difference"; equation connect(posModOn.y, swi.u1); connect(swi.y, y); connect(posDom.y, truFalHol.u); connect(truFalHol.y, swi.u2); connect(revModOn.y, swi.u3); connect(mPos_flow, sub.u1); connect(mRev_flow, sub.u2); connect(posDom.u, movAve.y); connect(movAve.u, sub.y); end SwitchBox;

Buildings.DHC.ETS.Combined.Controls.TankChargingController Buildings.DHC.ETS.Combined.Controls.TankChargingController

Controller to enable or disable storage tank charging

Buildings.DHC.ETS.Combined.Controls.TankChargingController

Information

Adapted fromBuildings.DHC.Loads.HotWater.BaseClasses.TankChargingController.

Parameters

TypeNameDefaultDescription
TemperatureDifferencedTOffSetif isHotWat then +1 else -1Offset for set point to have a slightly higher (or lower) temperature than the required supply from the load [K]
BooleanisHotWat True if the tank supplies hot water, False for chilled water

Connectors

TypeNameDescription
input RealInputTTanTopMeasured temperature at top of tank [K]
input RealInputTTanSetTank temperature set point, top for hot tank and bottom for cold 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" parameter Modelica.Units.SI.TemperatureDifference dTOffSet= if isHotWat then +1 else -1 "Offset for set point to have a slightly higher (or lower) temperature than the required supply from the load"; parameter Boolean isHotWat "True if the tank supplies hot water, False for chilled water"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TTanTop( final unit="K", displayUnit="degC") "Measured temperature at top of tank"; Modelica.Blocks.Interfaces.RealInput TTanSet( final unit="K", displayUnit="degC") "Tank temperature set point, top for hot tank and bottom for cold 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 "Latch to enable charging and hold it until charged"; Buildings.Controls.OBC.CDL.Logical.Not not1 "Negation of charge signal"; Buildings.Controls.OBC.CDL.Logical.And chaTopBot "Outputs true if top and bottom test wants tank to be charged. Used to override latch if tank temperature drops without triggering latch"; Buildings.Controls.OBC.CDL.Logical.Or or1 "Or block to enable charge if one of the inputs request charging"; Buildings.Controls.OBC.CDL.Reals.AddParameter dTOffChaOn( final p=dTOffSet, u(final unit="K", displayUnit="degC"), y(final unit="K", displayUnit="degC")) "Offset for charge on signal"; Buildings.Controls.OBC.CDL.Reals.AddParameter dTOffChaOff( final p=2*dTOffSet, u(final unit="K", displayUnit="degC"), y(final unit="K", displayUnit="degC")) "Offset for charge off signal"; Buildings.Controls.OBC.CDL.Reals.Greater chaTopHea( h=dTOffSet/2, u1(final unit="K", displayUnit="degC"), u2(final unit="K", displayUnit="degC")) if isHotWat "Charging signal for hot water tank"; Buildings.Controls.OBC.CDL.Reals.Greater chaTBotHea( h=dTOffSet/2, u1(final unit="K", displayUnit="degC"), u2(final unit="K", displayUnit="degC")) if isHotWat "Charging signal for hot water tank"; Buildings.Controls.OBC.CDL.Reals.Less chaTBotCoo( h=-dTOffSet/2, u1(final unit="K", displayUnit="degC"), u2(final unit="K", displayUnit="degC")) if not isHotWat "Charging signal for cold water tank"; Buildings.Controls.OBC.CDL.Reals.Less chaTTopCoo( h=-dTOffSet/2, u1(final unit="K", displayUnit="degC"), u2(final unit="K", displayUnit="degC")) if not isHotWat "Charging signal for cold water tank"; equation connect(not1.y, lat.clr); connect(or1.y, charge); connect(lat.y, or1.u2); connect(or1.u1, chaTopBot.y); connect(TTanSet, dTOffChaOn.u); connect(chaTopHea.u1, dTOffChaOn.y); connect(dTOffChaOff.y, chaTBotHea.u1); connect(TTanTop, chaTopHea.u2); connect(chaTopHea.y, chaTopBot.u1); connect(chaTBotHea.y, chaTopBot.u2); connect(lat.u, chaTopHea.y); connect(not1.u, chaTBotHea.y); connect(chaTTopCoo.u1, dTOffChaOff.y); connect(chaTBotCoo.u1, dTOffChaOn.y); connect(chaTBotCoo.u2, TTanBot); connect(chaTTopCoo.u2, TTanTop); connect(chaTBotCoo.y, chaTopBot.u1); connect(chaTTopCoo.y, chaTopBot.u2); connect(not1.u, chaTTopCoo.y); connect(chaTBotCoo.y, lat.u); connect(dTOffChaOff.u, TTanSet); connect(chaTBotHea.u2, TTanBot); end TankChargingController;

Buildings.DHC.ETS.Combined.Controls.TwoTankCoordination Buildings.DHC.ETS.Combined.Controls.TwoTankCoordination


Buildings.DHC.ETS.Combined.Controls.TwoTankCoordination

Information


This block routes the connectors on the evaporator side of the ETS depending on whether DHW integration is present. It also sends a signal to open the diversion valve when there is HHW or DHW load present. If the DHW integration is present, this block also controls the mixing valve which directs the condenser water to the HHW or DHW tanks, sometimes both.

When DHW integration is present:

Input: load present Output
DHW HHW yMix yDiv TTop TSet
T T 0.5 1 The one with higher TSet Max of two
T F 0 1 DHW DHW
F T 1 1 HHW HHW
F F 1 0 HHW HHW

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

Parameters

TypeNameDefaultDescription
Booleanhave_hotWattrueTrue if there is integrated DHW

Connectors

TypeNameDescription
input BooleanInputuDhwCharge request from the domestic hot water tank
input BooleanInputuHeaCharge request from the heating hot water tank
output BooleanOutputyEnable command
output RealOutputyMixMixing valve control signal [1]
output BooleanOutputyDhwCharge command from DHW tank, or false if no tank present

Modelica definition

block TwoTankCoordination extends Modelica.Blocks.Icons.Block; parameter Boolean have_hotWat=true "True if there is integrated DHW"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uDhw if have_hotWat "Charge request from the domestic hot water tank"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uHea "Charge request from the heating hot water tank"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y "Enable command"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yMix(final unit="1") if have_hotWat "Mixing valve control signal"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput yDhw "Charge command from DHW tank, or false if no tank present"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant con(k=false) if not have_hotWat "Output true as dummy signal if no DHW is present"; block WithDHW extends Modelica.Blocks.Icons.Block; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uDhw "Charge request from the domestic hot water tank"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uHea "Charge request from the heating hot water tank"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yMix(final unit="1") "Mixing valve control signal"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y "Enable command"; equation y =uDhw or uHea; if uDhw and uHea then yMix = 0.5; elseif uDhw and not uHea then yMix = 0; elseif uHea and not uDhw then yMix = 1; else yMix = 1; end if; end WithDHW; block WithoutDHW extends Modelica.Blocks.Icons.Block; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uHea "Charge request from the heating hot water tank"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y "Enable command"; equation connect(uHea, y); end WithoutDHW; WithDHW withDHW if have_hotWat; WithoutDHW withoutDHW if not have_hotWat; equation connect(withoutDHW.uHea, uHea); connect(withDHW.uDhw,uDhw); connect(uHea, withDHW.uHea); connect(withDHW.yMix, yMix); connect(withDHW.y, y); connect(withoutDHW.y, y); connect(uDhw, yDhw); connect(con.y, yDhw); end TwoTankCoordination;

Buildings.DHC.ETS.Combined.Controls.WatersideEconomizer Buildings.DHC.ETS.Combined.Controls.WatersideEconomizer

Waterside economizer controller

Buildings.DHC.ETS.Combined.Controls.WatersideEconomizer

Information

This block implements the control logic for the waterside economizer.

The system is enabled if

The system is disabled if

When the system is enabled

When the system is disabled

Parameters

TypeNameDefaultDescription
Nominal condition
Realm2_flow_nominal Heat exchanger secondary mass flow rate [kg/s]
RealT_a1_nominal Nominal water inlet temperature on district side [K]
RealT_b2_nominal Nominal water outlet temperature on building side [K]
Controls
Realy1Min0.05Minimum pump flow rate or valve opening for temperature measurement (fractional) [1]
RealdTEna1Minimum delta-T above predicted heat exchanger leaving water temperature to enable WSE [K]
RealdTDis0.5Minimum delta-T across heat exchanger before disabling WSE [K]

Connectors

TypeNameDescription
input BooleanInputuCooCooling enable signal
input RealInputm2_flowHeat exchanger secondary mass flow rate [kg/s]
input RealInputT1WatEntHeat exchanger primary water entering temperature [K]
input RealInputT2WatEntHeat exchanger secondary water entering temperature [K]
input RealInputT2WatLvgHeat exchanger secondary water leaving temperature [K]
input RealInputyValIsoEva_actualReturn position of evaporator to ambient loop isolation valve [1]
output RealOutputy1Primary control signal (pump or valve) [1]
output RealOutputyVal2Secondary valve control signal [1]

Modelica definition

model WatersideEconomizer "Waterside economizer controller" parameter Real m2_flow_nominal( final quantity="MassFlowRate", final unit="kg/s") "Heat exchanger secondary mass flow rate"; parameter Real T_a1_nominal( final unit="K", displayUnit="degC", final quantity="ThermodynamicTemperature") "Nominal water inlet temperature on district side"; parameter Real T_b2_nominal( final unit="K", displayUnit="degC", final quantity="ThermodynamicTemperature") "Nominal water outlet temperature on building side"; parameter Real y1Min(final unit="1")=0.05 "Minimum pump flow rate or valve opening for temperature measurement (fractional)"; parameter Real dTEna( final quantity="TemperatureDifference", final unit="K")=1 "Minimum delta-T above predicted heat exchanger leaving water temperature to enable WSE"; parameter Real dTDis( final quantity="TemperatureDifference", final unit="K")=0.5 "Minimum delta-T across heat exchanger before disabling WSE"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uCoo "Cooling enable signal"; Buildings.Controls.OBC.CDL.Interfaces.RealInput m2_flow( final unit="kg/s") "Heat exchanger secondary mass flow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealInput T1WatEnt( final unit="K", displayUnit="degC") "Heat exchanger primary water entering temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput T2WatEnt( final unit="K", displayUnit="degC") "Heat exchanger secondary water entering temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput T2WatLvg( final unit="K", displayUnit="degC") "Heat exchanger secondary water leaving temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput yValIsoEva_actual( final unit="1") "Return position of evaporator to ambient loop isolation valve"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput y1( final unit="1") "Primary control signal (pump or valve)"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yVal2( final unit="1") "Secondary valve control signal"; Buildings.Controls.OBC.CDL.Reals.AddParameter addDelTem( final p=dTEna) "Add threshold for enabling WSE"; Modelica.StateGraph.InitialStepWithSignal iniSta(nIn=1, nOut=1) "Initial state "; Modelica.StateGraph.TransitionWithSignal ena "Transition to enabled state"; Modelica.StateGraph.StepWithSignal actSta(nIn=1, nOut=1) "Active WSE"; Modelica.StateGraph.TransitionWithSignal dis "Transition to disabled state"; Buildings.Controls.OBC.CDL.Reals.Subtract delT1 "Add delta-T"; Buildings.Controls.OBC.CDL.Reals.LessThreshold delTemDis( final t = dTDis, final h = 0.05) "Compare to threshold for disabling WSE"; Buildings.DHC.ETS.Combined.Controls.PredictLeavingTemperature calTemLvg( final dTApp_nominal=abs(T_a1_nominal - T_b2_nominal), final m2_flow_nominal=m2_flow_nominal) "Compute predicted leaving water temperature"; Buildings.Controls.OBC.CDL.Reals.Less delTemDis1( final h = 0.05) "Compare to threshold for enabling WSE"; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea( final realTrue=1, final realFalse=0) "Convert to real signal (close bypass valve when WSE enabled)"; inner Modelica.StateGraph.StateGraphRoot stateGraphRoot "Root of state graph"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant min1( final k=y1Min) "Minimum signal"; Buildings.Controls.OBC.CDL.Reals.Line lin "Linear variation bounded by minimum and 1"; Buildings.Controls.OBC.CDL.Reals.Switch swiOff1 "Output zero if cooling not enabled or isolation valve open (cold rejection)"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant zer(final k=0) "Zero"; Buildings.Controls.OBC.CDL.Logical.MultiAnd mulAnd(nin=4) "Enable if cooling enabled and temperature criterion verified"; Buildings.Controls.OBC.CDL.Logical.MultiOr or1(nin=3) "Cooling disabled or temperature criterion verified"; Buildings.Controls.OBC.CDL.Logical.Not not2 "Cooling disabled"; Buildings.Controls.OBC.CDL.Logical.Timer tim(t=1200) "True when WSE active for more than t"; Buildings.Controls.OBC.CDL.Logical.Timer tim1(t=1200) "True when WSE inactive for more than t"; Buildings.Controls.OBC.CDL.Logical.And and2 "Cooling disabled or temperature criterion verified"; Buildings.Controls.OBC.CDL.Reals.LessThreshold isValIsoEvaClo( final t=0.01, h=0.005) "True if valve closed"; Buildings.Controls.OBC.CDL.Logical.Not not1 "True if valve open"; Buildings.Controls.OBC.CDL.Logical.And and1 "Cooling disabled or temperature criterion verified"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter nor2( final k=1/m2_flow_nominal) "Normalize"; Buildings.Controls.OBC.CDL.Reals.Switch swiOff2 "Switch between enabled and disabled mode"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant one(final k=1) "One"; equation connect(T2WatEnt, delT1.u1); connect(T2WatLvg, delT1.u2); connect(delT1.y, delTemDis.u); connect(T1WatEnt, calTemLvg.T1WatEnt); connect(calTemLvg.T2WatLvg, addDelTem.u); connect(addDelTem.y, delTemDis1.u1); connect(T2WatEnt, delTemDis1.u2); connect(iniSta.outPort[1], ena.inPort); connect(ena.outPort, actSta.inPort[1]); connect(actSta.outPort[1], dis.inPort); connect(dis.outPort, iniSta.inPort[1]); connect(booToRea.y, yVal2); connect(zer.y, swiOff1.u3); connect(mulAnd.y, ena.condition); connect(uCoo, not2.u); connect(actSta.active, booToRea.u); connect(delTemDis1.y, mulAnd.u[1]); connect(iniSta.active, tim1.u); connect(tim1.passed, mulAnd.u[2]); connect(uCoo, mulAnd.u[3]); connect(actSta.active, tim.u); connect(tim.passed, and2.u1); connect(or1.y, and2.u2); connect(and2.y, dis.condition); connect(m2_flow, calTemLvg.m2_flow); connect(yValIsoEva_actual,isValIsoEvaClo.u); connect(isValIsoEvaClo.y, mulAnd.u[4]); connect(isValIsoEvaClo.y, not1.u); connect(delTemDis.y, or1.u[1]); connect(not2.y, or1.u[2]); connect(not1.y, or1.u[3]); connect(uCoo, and1.u1); connect(and1.y, swiOff1.u2); connect(isValIsoEvaClo.y, and1.u2); connect(m2_flow, nor2.u); connect(min1.y, swiOff1.u1); connect(swiOff2.y, y1); connect(swiOff1.y, swiOff2.u1); connect(iniSta.active, swiOff2.u2); connect(lin.y, swiOff2.u3); connect(nor2.y, lin.u); connect(one.y, lin.x2); connect(one.y, lin.f2); connect(zer.y, lin.x1); connect(min1.y, lin.f1); end WatersideEconomizer;

Buildings.DHC.ETS.Combined.Controls.TwoTankCoordination.WithDHW Buildings.DHC.ETS.Combined.Controls.TwoTankCoordination.WithDHW


Buildings.DHC.ETS.Combined.Controls.TwoTankCoordination.WithDHW

Information

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

Connectors

TypeNameDescription
input BooleanInputuDhwCharge request from the domestic hot water tank
input BooleanInputuHeaCharge request from the heating hot water tank
output RealOutputyMixMixing valve control signal [1]
output BooleanOutputyEnable command

Modelica definition

block WithDHW extends Modelica.Blocks.Icons.Block; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uDhw "Charge request from the domestic hot water tank"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uHea "Charge request from the heating hot water tank"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yMix(final unit="1") "Mixing valve control signal"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y "Enable command"; equation y =uDhw or uHea; if uDhw and uHea then yMix = 0.5; elseif uDhw and not uHea then yMix = 0; elseif uHea and not uDhw then yMix = 1; else yMix = 1; end if; end WithDHW;

Buildings.DHC.ETS.Combined.Controls.TwoTankCoordination.WithoutDHW Buildings.DHC.ETS.Combined.Controls.TwoTankCoordination.WithoutDHW


Buildings.DHC.ETS.Combined.Controls.TwoTankCoordination.WithoutDHW

Information

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

Connectors

TypeNameDescription
input BooleanInputuHeaCharge request from the heating hot water tank
output BooleanOutputyEnable command

Modelica definition

block WithoutDHW extends Modelica.Blocks.Icons.Block; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uHea "Charge request from the heating hot water tank"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y "Enable command"; equation connect(uHea, y); end WithoutDHW;