Buildings.DHC.Networks.Controls

Package of control blocks for distribution systems

Information

This package contains models for control of distribution networks.

Package Content

Name Description
Buildings.DHC.Networks.Controls.AgentPump1Pipe AgentPump1Pipe Ambient network storage and plants agent pump control, developed for reservoir network
Buildings.DHC.Networks.Controls.MainPump1Pipe MainPump1Pipe Main pump controller for 1 pipe networks, developed for reservoir network main circulation loop
Buildings.DHC.Networks.Controls.Examples Examples District controller example models

Buildings.DHC.Networks.Controls.AgentPump1Pipe Buildings.DHC.Networks.Controls.AgentPump1Pipe

Ambient network storage and plants agent pump control, developed for reservoir network

Buildings.DHC.Networks.Controls.AgentPump1Pipe

Information

Controller for balacing agents (i.e. reservoirs and plants) pump.

This controller decides to turn on or off the agent pump depending on the current net demand of the district if TRetDis > TSupDis cooling else heating and the temperature differential between the agent source temperature TSou and the agent inlet temperature TSouIn adjusted by the offset dToff. In particular the pump turns on : if heating and TSou - TSouIn - dToff > 0 or if cooling and TSouIn - Tsou - dToff > 0. Then if the pump is turned on a PID controller, by default used as P, controls the pump control input by using TSouOut as measurement and as setpoint TSou - dToff for heating or TSou + dToff for cooling. dToff can be considered the nominal value of the agent heat exchanger pinch point temperature difference.

References

Ettore Zanetti, David Blum, Michael Wetter Control development and sizing analysis for a 5th generation district heating and cooling network using Modelica, 2023 International Modelica conference proceedings.

Parameters

TypeNameDefaultDescription
SimpleControllercontrollerTypeBuildings.Controls.OBC.CDL.T...Type of controller
RealyPumMin0.05Minimum pump speed [1]
RealyPumMax1Upper limit of output [1]
Realk1Gain of controller
RealTi0.5Time constant of integrator block
RealTd0.1Time constant of derivative block
TemperatureDifferencedToff1Temperature offset to account for heat exchanger pinch point [K]
RealuLowHea1if y=true and u<uLow, switch to y=false
RealuHighHea2if y=false and u>uHigh, switch to y=true
RealuLowCoo1if y=true and u<uLow, switch to y=false
RealuHighCoo2if y=false and u>uHigh, switch to y=true
Realh0.15Hysteresis for net demand temperature calculation

Connectors

TypeNameDescription
input RealInputTSouInTemperatures at the inlet of the source [K]
input RealInputTSouOutAgent supply temperature [K]
input RealInputTSouAverage temperature available at source [K]
input RealInputTRetDisDistrict return temperature [K]
input RealInputTSupDisPlant supply temperature [K]
output RealOutputyPump control signal [1]

Modelica definition

block AgentPump1Pipe "Ambient network storage and plants agent pump control, developed for reservoir network" parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerType = Buildings.Controls.OBC.CDL.Types.SimpleController.P "Type of controller"; parameter Real yPumMin(min=0, max=1, final unit="1") = 0.05 "Minimum pump speed"; parameter Real yPumMax(min=0, max=1, final unit="1") = 1 "Upper limit of output"; parameter Real k = 1 "Gain of controller"; parameter Real Ti = 0.5 "Time constant of integrator block"; parameter Real Td = 0.1 "Time constant of derivative block"; parameter Modelica.Units.SI.TemperatureDifference dToff(min=0.1) = 1 "Temperature offset to account for heat exchanger pinch point"; parameter Real uLowHea = 1 "if y=true and u<uLow, switch to y=false"; parameter Real uHighHea = 2 "if y=false and u>uHigh, switch to y=true"; parameter Real uLowCoo = 1 "if y=true and u<uLow, switch to y=false"; parameter Real uHighCoo = 2 "if y=false and u>uHigh, switch to y=true"; parameter Real h = 0.15 "Hysteresis for net demand temperature calculation"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TSouIn(final unit="K", displayUnit="degC") "Temperatures at the inlet of the source"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TSouOut(final unit="K", displayUnit="degC") "Agent supply temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TSou(final unit="K", displayUnit="degC") "Average temperature available at source"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TRetDis(final unit="K", displayUnit="degC") "District return temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TSupDis(final unit="K", displayUnit="degC") "Plant supply temperature"; Buildings.Controls.OBC.CDL.Reals.Less NetDemBool(h=h) "Net district demand boolean"; Buildings.Controls.OBC.CDL.Reals.Switch swi; Buildings.Controls.OBC.CDL.Interfaces.RealOutput y( min=0, max=1, unit="1") "Pump control signal"; Buildings.Controls.OBC.CDL.Reals.PID conPIDHea( controllerType=controllerType, k=k, Ti=Ti, Td=Td, yMax=yPumMax, yMin=yPumMin) "Controller to track target heating setpoint temperature"; Buildings.Controls.OBC.CDL.Reals.PID conPIDCoo( controllerType=controllerType, k=k, Ti=Ti, Td=Td, yMax=yPumMax, yMin=yPumMin, reverseActing=false) "Controller to track target cooling setpoint temperature"; Buildings.Controls.OBC.CDL.Reals.Hysteresis hys(uLow=uLowCoo, uHigh=uHighCoo) "Turn on pump when source temperature lower than inlet temperature"; Buildings.Controls.OBC.CDL.Reals.Switch swi1; Buildings.Controls.OBC.CDL.Reals.Sources.Constant Zero(k=0) "Pump off signal"; Buildings.Controls.OBC.CDL.Reals.Hysteresis hys1(uLow=uLowHea, uHigh=uHighHea) "Turn on pump when source temperature higher than inlet temperature"; Buildings.Controls.OBC.CDL.Reals.Switch swi2; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai1(k=-1) "Change sign for hysteresis"; Buildings.Controls.OBC.CDL.Reals.AddParameter Tsou_negshift(final p=-dToff, y(final unit="K", displayUnit="degC")) "Source temperature after negative shift"; Buildings.Controls.OBC.CDL.Reals.AddParameter Tsou_posshift(final p=dToff, y(final unit="K", displayUnit="degC")) "Source temperature after positive shift"; Buildings.Controls.OBC.CDL.Reals.Subtract dTSouSup "Temperature difference between source and source inlet"; Buildings.Controls.OBC.CDL.Reals.AddParameter dTSouSupHea(final p=-dToff, y(final unit="K", displayUnit="degC")) "Temperature difference between source and source inlet corrected for heating"; Buildings.Controls.OBC.CDL.Reals.AddParameter dTSouSupCoo(final p=dToff, y(final unit="K", displayUnit="degC")) "Temperature difference between source and source inlet corrected for cooling"; equation connect(NetDemBool.y, swi.u2); connect(TRetDis, NetDemBool.u1); connect(TSupDis, NetDemBool.u2); connect(hys.y, swi1.u2); connect(Zero.y, swi1.u3); connect(swi.y, y); connect(conPIDCoo.y, swi1.u1); connect(swi1.y, swi.u3); connect(hys1.y, swi2.u2); connect(conPIDHea.y, swi2.u1); connect(Zero.y, swi2.u3); connect(swi2.y, swi.u1); connect(TSou, Tsou_negshift.u); connect(Tsou_negshift.y, conPIDHea.u_s); connect(TSou, Tsou_posshift.u); connect(Tsou_posshift.y, conPIDCoo.u_s); connect(TSouOut, conPIDCoo.u_m); connect(TSouOut, conPIDHea.u_m); connect(gai1.y, hys.u); connect(dTSouSup.y, dTSouSupHea.u); connect(TSou,dTSouSup. u1); connect(dTSouSupHea.y, hys1.u); connect(dTSouSup.y,dTSouSupCoo. u); connect(dTSouSupCoo.y, gai1.u); connect(TSouIn,dTSouSup. u2); end AgentPump1Pipe;

Buildings.DHC.Networks.Controls.MainPump1Pipe Buildings.DHC.Networks.Controls.MainPump1Pipe

Main pump controller for 1 pipe networks, developed for reservoir network main circulation loop

Buildings.DHC.Networks.Controls.MainPump1Pipe

Information

Controller for the main circulation pump.

This controller adjusts the pump speed in order to reduce it, unless the water temperature at the mixing points after the agents in the district is too high or too low, as measured by the difference to TMin and TMax. In that case, the pump speed is increased to prevent the loop getting too cold or too warm. The control is as follows: Let TMixMin and TMixMax be the minimum and maximum mixing temperatures. If TMax-TMixMax or TMixMin-TMin is too small, the pump speed is increased. If the difference is larger than dTSlo, then the pump speed is set to the minimum speed yPumMin. This calculation is done for both, TMixMin and TMixMax. The actual pump speed is then the larger of the two pump signals. Therefore, the pump speeds are calculated as shown in the figure below.


Image of the control that adjusts the pump speed

Moreover, if the parameter use_temperatureShift is set to true, then the district loop temperature is adjusted by changing the mass flow rate of the pump to increase the overall efficiency if there is net cooling or net heating on the loop. Specifically, if the district heating or cooling loop is in net heating (cooling) mode, it may be favorable to increase (decrease) the loop temperature, which can be done by increasing the pump speed. Whether the loop is in heating or cooling mode is determined based on the temperature differences across the loop sources, which are the inputs TSouIn and TSouOut. Each heat source or sink needs to be connected to one element of these vectorized input signals. This net difference is then used with a PI-controller to determine how much the slopes should be shifted in order to increase the pump speed. The shift of these slopes is indicated by the arrows in the figure. Note that this controller must be configured to be slow reacting, as it requires the feedback from the district heating and cooling loop. Furthermore, if the parameter use_constantHeaTemShift is set to true, then a constant temperature offset offTMax is added when only heating is present, this determination is done by checking that the cooling demand for each energy transfer station via QCoo is close to zero. This mode can used by itself or in conjuction with use_temperatureShift.

For a typical usage of this controller, see Buildings.DHC.Examples.Combined.SeriesVariableFlow.

Parameters

TypeNameDefaultDescription
IntegernMix Number of mixing points after the substations
IntegernSou Number of heat sources (and heat sinks)
IntegernBui Number of heat sources (and heat sinks)
RealyPumMin0.05Minimum pump speed [1]
TemperatureTMin281.15Minimum loop temperature [K]
TemperatureTMax291.15Maximum loop temperature [K]
TemperatureDifferencedTSlo2Temperature difference for slope [K]
Booleanuse_temperatureShiftfalseSet to false to disable temperature shift of slopes
Booleanuse_constantHeaTemShifttrueSet to false to disable constant temperature shift of TMax when only heating is occurring
TemperatureDifferenceoffTMax2TMax constant temperature shift [K]
TemperatureDifferencedTSou_nominal[nSou]fill(4, nSou)Nominal temperature difference over source [K]
Realk0.01Gain of controller that shifts upper and lower temperature setpoints
TimeTi300Time constant of integrator block that shifts upper and lower temperature setpoints [s]
RealPpumCooThr100Threshold for comparison for pump cooling power
RealhysPpumCoo10Hysteresis for cooling pump power threshold

Connectors

TypeNameDescription
input RealInputTMix[nMix]Temperatures at the mixing points [K]
input RealInputTSouIn[nSou]Temperatures at the inlets of the sources [K]
input RealInputTSouOut[nSou]Temperatures at the outlets of the sources [K]
input RealInputQCoo_flow[nBui]Cooling power required by each building [W]
output RealOutputyPump control signal [1]

Modelica definition

model MainPump1Pipe "Main pump controller for 1 pipe networks, developed for reservoir network main circulation loop" parameter Integer nMix(min=1) "Number of mixing points after the substations"; parameter Integer nSou(min=1) "Number of heat sources (and heat sinks)"; parameter Integer nBui(min=1) "Number of heat sources (and heat sinks)"; parameter Real yPumMin(min=0.01, max=1, final unit="1") = 0.05 "Minimum pump speed"; parameter Modelica.Units.SI.Temperature TMin(displayUnit="degC") = 281.15 "Minimum loop temperature"; parameter Modelica.Units.SI.Temperature TMax(displayUnit="degC") = 291.15 "Maximum loop temperature"; parameter Modelica.Units.SI.TemperatureDifference dTSlo(min=1) = 2 "Temperature difference for slope"; parameter Boolean use_temperatureShift = false "Set to false to disable temperature shift of slopes"; parameter Boolean use_constantHeaTemShift = true "Set to false to disable constant temperature shift of TMax when only heating is occurring"; parameter Modelica.Units.SI.TemperatureDifference offTMax = 2 "TMax constant temperature shift"; final parameter Modelica.Units.SI.TemperatureDifference delta=if use_temperatureShift then TMax - TMin - 3*dTSlo else 0 "Maximum shift of slopes"; parameter Modelica.Units.SI.TemperatureDifference dTSou_nominal[nSou]( each min=0) = fill(4, nSou) "Nominal temperature difference over source"; parameter Real k=0.01 "Gain of controller that shifts upper and lower temperature setpoints"; parameter Modelica.Units.SI.Time Ti(displayUnit="min") = 300 "Time constant of integrator block that shifts upper and lower temperature setpoints"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TMix[nMix]( each final unit="K", each displayUnit="degC") "Temperatures at the mixing points"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TSouIn[nSou]( each final unit="K", each displayUnit="degC") "Temperatures at the inlets of the sources"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TSouOut[nSou]( each final unit="K", each displayUnit="degC") "Temperatures at the outlets of the sources"; Buildings.Controls.OBC.CDL.Interfaces.RealInput QCoo_flow[nBui](each final unit= "W") "Cooling power required by each building"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput y(min=0, max=1, unit="1") "Pump control signal"; Buildings.Controls.OBC.CDL.Reals.MultiMin TMixMin( final nin=nMix, y(final unit="K", displayUnit="degC")) "Minimum temperature at mixing points"; Buildings.Controls.OBC.CDL.Reals.MultiMax TMixMax( final nin=nMix, y(final unit="K", displayUnit="degC")) "Maximum temperature at mixing points"; Buildings.Controls.OBC.CDL.Reals.MultiSum mulSum( k=fill(1, nSou), nin=nSou); Buildings.Controls.OBC.CDL.Reals.Subtract dTSou[nSou] "Temperature differences over source"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter dTSou_nor(k=1/( sum(dTSou_nominal))) "Normalization of temperature difference over source"; Buildings.Controls.OBC.CDL.Reals.PID conShi( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI, final k=k, Ti(displayUnit="min") = Ti, final yMax=1, final yMin=-1) "Controller to shift the min/max slopes"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant zer(k=0) "Set point for source dT"; Buildings.Controls.OBC.CDL.Reals.Line uppCur "Upper curve"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant one(k=1) "Constant 1"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant yMin(k=yPumMin) "Minimum pump speed"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant TMax_nominal(k=TMax) "Maximum temperature"; Buildings.Controls.OBC.CDL.Reals.Add TMax_upper( y(final unit="K", displayUnit="degC")) "Upper value of upper slope after shifting it"; Buildings.Controls.OBC.CDL.Reals.Max sPos "Positive shift"; Buildings.Controls.OBC.CDL.Reals.Min sNeg "Negative shift"; Buildings.Controls.OBC.CDL.Reals.AddParameter TMax_lower( final p=-dTSlo, y(final unit="K", displayUnit="degC")) "Minimum temperatuer value of upper slope after shifting it"; Buildings.Controls.OBC.CDL.Reals.Line lowCur "Lower curve"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant TMin_nominal(k=TMin) "Minimum temperature"; Buildings.Controls.OBC.CDL.Reals.Add TMin_lower( y(unit="K", displayUnit="degC")) "Lower value of lower slope after shifting it"; Buildings.Controls.OBC.CDL.Reals.AddParameter TMin_upper( final p=dTSlo, y(final unit="K", displayUnit="degC")) "Maximum temperatuer value of lower slope after shifting it"; Buildings.Controls.OBC.CDL.Reals.Max ySetPum "Change in pump signal"; Buildings.Controls.OBC.CDL.Reals.Switch swi2 "Switch on and off constant offset"; Modelica.Blocks.Sources.BooleanExpression booleanExpression(y= use_constantHeaTemShift) "Boolean parameter to activate mode"; Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr( t=PpumCooThr, h=hysPpumCoo, pre_y_start=false) "Check pump consumption higher than zero"; Buildings.Controls.OBC.CDL.Logical.And and2; Buildings.Controls.OBC.CDL.Reals.MultiSum mulSum1( k=fill(1, nBui), nin=nBui) "Sum of all pump consumptions"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai(final k=-delta) "Gain factor"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai2(final k=-delta) "Gain factor"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant offTMaxExp(k=offTMax) "Constant TMax offset"; Buildings.Controls.OBC.CDL.Reals.Add Add(y(unit="K", displayUnit="degC")) "If use_heaTemShift and not use_temperatureShift use constant offset, if use_temperatureShift use PI"; parameter Real PpumCooThr=100 "Threshold for comparison for pump cooling power"; parameter Real hysPpumCoo=10 "Hysteresis for cooling pump power threshold"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai1(final k=-1) "Gain factor"; equation connect(TMix, TMixMin.u); connect(TMix, TMixMax.u); connect(mulSum.y, dTSou_nor.u); connect(dTSou_nor.y, conShi.u_m); connect(conShi.u_s, zer.y); connect(uppCur.u, TMixMax.y); connect(uppCur.f1, yMin.y); connect(uppCur.f2, one.y); connect(TMax_nominal.y, TMax_upper.u1); connect(zer.y, sPos.u1); connect(zer.y, sNeg.u1); connect(conShi.y, sPos.u2); connect(conShi.y, sNeg.u2); connect(TMax_lower.u, TMax_upper.y); connect(uppCur.x1, TMax_lower.y); connect(TMax_upper.y, uppCur.x2); connect(TMixMin.y, lowCur.u); connect(TMin_nominal.y, TMin_lower.u1); connect(TMin_lower.y, TMin_upper.u); connect(TMin_upper.y, lowCur.x2); connect(TMin_lower.y, lowCur.x1); connect(lowCur.f1, one.y); connect(lowCur.f2, yMin.y); connect(uppCur.y, ySetPum.u1); connect(lowCur.y, ySetPum.u2); connect(ySetPum.y, y); connect(TSouOut, dTSou.u1); connect(TSouIn, dTSou.u2); connect(booleanExpression.y, and2.u2); connect(and2.y, swi2.u2); connect(dTSou.y, mulSum.u); connect(greThr.y, and2.u1); connect(QCoo_flow, mulSum1.u); connect(sPos.y, gai.u); connect(sNeg.y, gai2.u); connect(gai2.y, TMin_lower.u2); connect(swi2.y, Add.u1); connect(gai.y, Add.u2); connect(Add.y, TMax_upper.u2); connect(offTMaxExp.y, swi2.u3); connect(zer.y, swi2.u1); connect(mulSum1.y, gai1.u); connect(gai1.y, greThr.u); end MainPump1Pipe;