Buildings.Experimental.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.Experimental.DHC.Networks.Controls.MainPump MainPump Main pump controller

Buildings.Experimental.DHC.Networks.Controls.MainPump Buildings.Experimental.DHC.Networks.Controls.MainPump

Main pump controller

Buildings.Experimental.DHC.Networks.Controls.MainPump

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.

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

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

Parameters

TypeNameDefaultDescription
IntegernMix Number of mixing points after the substations
IntegernSou 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_temperatureShifttrueSet to false to disable temperature shift of slopes
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]

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]
output RealOutputyPump control signal [1]

Modelica definition

model MainPump "Main pump controller" extends Modelica.Blocks.Icons.Block; 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 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 = true "Set to false to disable temperature shift of slopes"; 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.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( nin=nSou, k=fill(1, 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.MultiplyByParameter gai( final k=-delta) "Gain factor"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai1( final k=-delta) "Gain factor"; equation connect(TMix, TMixMin.u); connect(TMix, TMixMax.u); connect(mulSum.u, dTSou.y); 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(sNeg.y, gai1.u); connect(gai1.y, TMin_lower.u2); connect(sPos.y, gai.u); connect(gai.y, TMax_upper.u2); end MainPump;