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.Borefield Borefield Borefield controller
Buildings.DHC.ETS.Combined.Controls.Chiller Chiller Chiller controller
Buildings.DHC.ETS.Combined.Controls.HeatExchanger HeatExchanger District heat exchanger controller
Buildings.DHC.ETS.Combined.Controls.PIDWithEnable PIDWithEnable PID controller with enable signal
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.SideCold SideCold Control block for cold side
Buildings.DHC.ETS.Combined.Controls.SideHot SideHot Control block for hot side
Buildings.DHC.ETS.Combined.Controls.Supervisory Supervisory Supervisory controller
Buildings.DHC.ETS.Combined.Controls.SwitchBox SwitchBox Controller for flow switch box
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.Borefield Buildings.DHC.ETS.Combined.Controls.Borefield

Borefield controller

Buildings.DHC.ETS.Combined.Controls.Borefield

Information

This block implements the control logic for the borefield system. The main control signal u is yielded by the hot side or cold side controller, see for instance Buildings.DHC.ETS.Combined.Controls.SideHot.

The system is enabled when

When the system is enabled,

Note that the first control signal for the valve is needed to stabilize the control of the system when the mass flow rate required to meet the heat or cold rejection demand is below the flow rate corresponding to the minimum pump speed.

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

Parameters

TypeNameDefaultDescription
TemperatureTBorWatEntMax Maximum value of borefield water entering temperature [K]
RealspePumBorMin0.1Borefield pump minimum speed [1]

Connectors

TypeNameDescription
input RealInputyValIso_actual[2]Isolation valves return position (fractional)
input RealInputuControl signal from supervisory
output RealOutputyPumControl signal for borefield pump [kg/s]
output RealOutputyValMixControl signal for borefield mixing valve [1]
input RealInputTBorWatEntBorefield water entering temperature [K]

Modelica definition

model Borefield "Borefield controller" extends Modelica.Blocks.Icons.Block; parameter Modelica.Units.SI.Temperature TBorWatEntMax(displayUnit="degC") "Maximum value of borefield water entering temperature"; parameter Real spePumBorMin( final unit="1")=0.1 "Borefield pump minimum speed"; Buildings.Controls.OBC.CDL.Interfaces.RealInput yValIso_actual[2] "Isolation valves return position (fractional)"; Buildings.Controls.OBC.CDL.Interfaces.RealInput u "Control signal from supervisory"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPum( final unit="kg/s") "Control signal for borefield pump"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yValMix( final unit="1") "Control signal for borefield mixing valve"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TBorWatEnt( final unit="K", displayUnit="degC") "Borefield water entering temperature"; Buildings.Controls.OBC.CDL.Reals.PIDWithReset conMix( final yMin=0, final yMax=1, final reverseActing=true, y_reset=0, k=0.1, final controllerType=Modelica.Blocks.Types.SimpleController.PI, Ti( displayUnit="s")=120) "Mixing valve controller"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant maxTBorWatEnt( y(final unit="K", displayUnit="degC"), final k=TBorWatEntMax) "Maximum value of borefield water entering temperature"; Buildings.Controls.OBC.CDL.Reals.GreaterThreshold opeVal( final t=0.9, final h=0.1) "True if at least one isolation valve is open"; Buildings.Controls.OBC.CDL.Reals.MultiMax multiMax1( final nin=2) "Maximum opening"; Buildings.Controls.OBC.CDL.Reals.GreaterThreshold enaSup( final t=0.05, final h=0.025) "Borefield enabled from supervisory"; Buildings.Controls.OBC.CDL.Reals.Switch runBor "Enable borefield system pump"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant limVal( final k=0.3) "Control signal value for full opening of the valve"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant speMin( final k=spePumBorMin) "Minimum pump speed"; Buildings.Controls.OBC.CDL.Logical.And enaBor "Borefield enable signal"; Buildings.Controls.OBC.CDL.Reals.Line mapSpe "Mapping function for pump speed"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant one( final k=1) "One"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant zer( final k=0) "Zero"; Buildings.Controls.OBC.CDL.Reals.Line mapVal "Mapping function for valve opening"; Buildings.Controls.OBC.CDL.Reals.Min min1 "Minimum"; equation connect(multiMax1.y,opeVal.u); connect(yValIso_actual,multiMax1.u); connect(u,enaSup.u); connect(enaSup.y,enaBor.u1); connect(opeVal.y,enaBor.u2); connect(enaBor.y,conMix.trigger); connect(maxTBorWatEnt.y,conMix.u_s); connect(runBor.y,yPum); connect(TBorWatEnt,conMix.u_m); connect(enaBor.y,runBor.u2); connect(mapSpe.y,runBor.u1); connect(u,mapSpe.u); connect(speMin.y,mapSpe.f1); connect(min1.y,yValMix); connect(conMix.y,min1.u2); connect(mapVal.y,min1.u1); connect(one.y,mapSpe.x2); connect(one.y,mapSpe.f2); connect(one.y,mapVal.f2); connect(zer.y,mapVal.x1); connect(limVal.y,mapVal.x2); connect(u,mapVal.u); connect(limVal.y,mapSpe.x1); connect(zer.y,mapVal.f1); connect(zer.y,runBor.u3); end Borefield;

Buildings.DHC.ETS.Combined.Controls.Chiller Buildings.DHC.ETS.Combined.Controls.Chiller

Chiller controller

Buildings.DHC.ETS.Combined.Controls.Chiller

Information

This is a controller for the chiller system, which includes the dedicated condenser and evaporator pumps.

The system is enabled if any of the input control signals uHea or uCoo is true. When enabled,

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

Parameters

TypeNameDefaultDescription
TemperatureTConWatEntMin Minimum value of condenser water entering temperature [K]
TemperatureTEvaWatEntMax Maximum value of evaporator water entering temperature [K]

Connectors

TypeNameDescription
input BooleanInputuCooCooling enable signal
input BooleanInputuHeaHeating enable signal
input RealInputTConWatEntCondenser water entering temperature [K]
input RealInputTEvaWatEntEvaporator water entering temperature [K]
output RealOutputyValConCondenser mixing valve control signal
output RealOutputyValEvaEvaporator mixing valve control signal
output BooleanOutputyChiChiller enable signal

Modelica definition

model Chiller "Chiller controller" extends Modelica.Blocks.Icons.Block; parameter Modelica.Units.SI.Temperature TConWatEntMin(displayUnit="degC") "Minimum value of condenser water entering temperature"; parameter Modelica.Units.SI.Temperature TEvaWatEntMax(displayUnit="degC") "Maximum value of evaporator water entering temperature"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uCoo "Cooling enable signal"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uHea "Heating enable signal"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TConWatEnt( final unit="K", displayUnit="degC") "Condenser water entering temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TEvaWatEnt( final unit="K", displayUnit="degC") "Evaporator water entering temperature"; 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 yChi "Chiller enable signal"; Buildings.Controls.OBC.CDL.Logical.Or heaOrCoo "Heating or cooling enabled"; PIDWithEnable conValEva( final controllerType=Modelica.Blocks.Types.SimpleController.PI, final yMax=1, final yMin=0, y_reset=0, k=0.1, Ti( displayUnit="s")=60, final reverseActing=true) "Evaporator three-way valve control"; PIDWithEnable conValCon( final controllerType=Modelica.Blocks.Types.SimpleController.PI, final yMax=1, final yMin=0, y_reset=0, k=0.1, Ti( displayUnit="s")=60, final reverseActing=false) "Condenser three-way valve control"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant maxTEvaWatEnt( y(final unit="K", displayUnit="degC"), final k=TEvaWatEntMax) "Maximum value of evaporator water entering temperature"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant minTConWatEnt( y(final unit="K", displayUnit="degC"), final k=TConWatEntMin) "Minimum value of condenser water entering temperature"; equation connect(TEvaWatEnt,conValEva.u_m); connect(TConWatEnt,conValCon.u_m); connect(heaOrCoo.y,yChi); connect(uHea,heaOrCoo.u1); connect(uCoo,heaOrCoo.u2); connect(maxTEvaWatEnt.y,conValEva.u_s); connect(minTConWatEnt.y,conValCon.u_s); connect(conValEva.y,yValEva); connect(heaOrCoo.y,conValEva.uEna); connect(heaOrCoo.y,conValCon.uEna); connect(conValCon.y,yValCon); end Chiller;

Buildings.DHC.ETS.Combined.Controls.HeatExchanger Buildings.DHC.ETS.Combined.Controls.HeatExchanger

District heat exchanger controller

Buildings.DHC.ETS.Combined.Controls.HeatExchanger

Information

This block implements the control logic for the district heat exchanger, which realizes the interface between the building system and the district system.

The input signal u is yielded by the supervisory controller, see Buildings.DHC.ETS.Combined.Controls.Supervisory. The primary and secondary circuits are enabled to operate if this input signal is greater than zero and the return position of at least one isolation valve is greater than 90%. When enabled,

Note that the valve on the secondary side is needed to stabilize the control of the system when the secondary mass flow rate required to meet the heat or cold rejection demand is below the flow rate corresponding to the minimum pump speed.

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

Parameters

TypeNameDefaultDescription
ConnectionConfigurationconCon District connection configuration
RealspePum1Min0.1Heat exchanger primary pump minimum speed (fractional) [1]
RealspePum2Min0.1Heat exchanger secondary pump minimum speed (fractional) [1]

Connectors

TypeNameDescription
input RealInputyValIso[2]Isolation valves return position (index 1 for condenser)
output RealOutputy1District heat exchanger primary control signal [1]
output RealOutputyPum2District heat exchanger secondary pump control signal [1]
output RealOutputyVal2District heat exchanger secondary valve control signal [1]
input RealInputuControl signal for secondary side (from supervisory)

Modelica definition

model HeatExchanger "District heat exchanger controller" extends Modelica.Blocks.Icons.Block; parameter DHC.ETS.Types.ConnectionConfiguration conCon "District connection configuration"; parameter Real spePum1Min( final unit="1", min=0)=0.1 "Heat exchanger primary pump minimum speed (fractional)"; parameter Real spePum2Min( final unit="1", min=0.01)=0.1 "Heat exchanger secondary pump minimum speed (fractional)"; Buildings.Controls.OBC.CDL.Interfaces.RealInput yValIso[2] "Isolation valves return position (index 1 for condenser)"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput y1(final unit="1") "District heat exchanger primary control signal"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPum2( final unit="1") "District heat exchanger secondary pump control signal"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yVal2( final unit="1") "District heat exchanger secondary valve control signal"; Buildings.Controls.OBC.CDL.Reals.Max max1 "Maximum between control signal and minimum speed or opening"; Buildings.Controls.OBC.CDL.Reals.Switch swiOff1 "Output zero if not enabled"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant min1( final k=if have_val1 then 0 else spePum1Min) "Minimum pump speed or actuator opening"; Buildings.Controls.OBC.CDL.Interfaces.RealInput u "Control signal for secondary side (from supervisory)"; Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr( final t=0.01, final h=0.005) "Check for heat or cold rejection demand"; Buildings.Controls.OBC.CDL.Logical.And and2 "At least one valve is open and HX circuit is enabled"; Buildings.Controls.OBC.CDL.Reals.GreaterThreshold heaRej( final t=0.9, final h=0.1) "Heat rejection if condenser isolation valve is open"; Buildings.Controls.OBC.CDL.Reals.GreaterThreshold cooRej( final t=0.9, final h=0.1) "Cold rejection if evaporator isolation valve is open"; Buildings.Controls.OBC.CDL.Logical.Or or1 "At least one valve is open "; Buildings.Controls.OBC.CDL.Reals.Sources.Constant speMin( final k=spePum2Min) "Minimum pump speed"; Buildings.Controls.OBC.CDL.Reals.Switch swiOff2 "Output zero if not enabled"; Buildings.Controls.OBC.CDL.Reals.Line mapSpe "Mapping function for pump speed"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant one( final k=1) "One"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant zer( final k=0) "Zero"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant hal( final k=0.3) "Control signal value for full opening of the valve"; Buildings.Controls.OBC.CDL.Reals.Line mapVal "Mapping function for valve opening"; protected parameter Boolean have_val1=conCon == DHC.ETS.Types.ConnectionConfiguration.TwoWayValve "True in case of control valve on district side, false in case of a pump"; equation connect(swiOff1.y, y1); connect(max1.y,swiOff1.u1); connect(u,greThr.u); connect(greThr.y,and2.u1); connect(and2.y,swiOff1.u2); connect(cooRej.y,or1.u2); connect(heaRej.y,or1.u1); connect(or1.y,and2.u2); connect(min1.y,max1.u2); connect(swiOff2.y,yPum2); connect(one.y,mapSpe.x2); connect(one.y,mapSpe.f2); connect(u,mapSpe.u); connect(speMin.y,mapSpe.f1); connect(mapSpe.y,swiOff2.u1); connect(zer.y,swiOff2.u3); connect(zer.y,swiOff1.u3); connect(hal.y,mapSpe.x1); connect(u,mapVal.u); connect(zer.y,mapVal.x1); connect(zer.y,mapVal.f1); connect(one.y,mapVal.f2); connect(hal.y,mapVal.x2); connect(mapVal.y,yVal2); connect(and2.y,swiOff2.u2); connect(u, max1.u1); connect(yValIso[1], heaRej.u); connect(yValIso[2], cooRej.u); end HeatExchanger;

Buildings.DHC.ETS.Combined.Controls.PIDWithEnable Buildings.DHC.ETS.Combined.Controls.PIDWithEnable

PID controller with enable signal

Buildings.DHC.ETS.Combined.Controls.PIDWithEnable

Information

This is an update of Buildings.Controls.OBC.CDL.Reals.PIDWithReset with an additional Boolean input representing an enable signal.

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

Parameters

TypeNameDefaultDescription
SimpleControllercontrollerTypeBuildings.Controls.OBC.CDL.T...Type of controller
Realk1Gain of controller
TimeTi0.5Time constant of integrator block [s]
TimeTd0.1Time constant of derivative block [s]
Realr1Typical range of control error, used for scaling the control error
RealyMin0Lower limit of output
RealyMax1Upper limit of output
BooleanreverseActingtrueSet to true for reverse acting, or false for direct acting control action
Realy_resetyMinValue to which the controller output is reset if the boolean trigger has a rising edge
Realy_neutraly_resetValue to which the controller output is reset when the controller is disabled

Connectors

TypeNameDescription
input RealInputu_sConnector of setpoint input signal
input RealInputu_mConnector of measurement input signal
output RealOutputyConnector of actuator output signal
input BooleanInputuEnaEnable signal

Modelica definition

block PIDWithEnable "PID controller with enable signal" extends Modelica.Blocks.Icons.Block; parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Type of controller"; parameter Real k( min=0)=1 "Gain of controller"; parameter Modelica.Units.SI.Time Ti(min=Buildings.Controls.OBC.CDL.Constants.small) = 0.5 "Time constant of integrator block"; parameter Modelica.Units.SI.Time Td(min=0) = 0.1 "Time constant of derivative block"; parameter Real r( min=100*Modelica.Constants.eps)=1 "Typical range of control error, used for scaling the control error"; parameter Real yMin=0 "Lower limit of output"; parameter Real yMax=1 "Upper limit of output"; parameter Boolean reverseActing=true "Set to true for reverse acting, or false for direct acting control action"; parameter Real y_reset=yMin "Value to which the controller output is reset if the boolean trigger has a rising edge"; parameter Real y_neutral=y_reset "Value to which the controller output is reset when the controller is disabled"; Buildings.Controls.OBC.CDL.Interfaces.RealInput u_s "Connector of setpoint input signal"; Buildings.Controls.OBC.CDL.Interfaces.RealInput u_m "Connector of measurement input signal"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput y "Connector of actuator output signal"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uEna "Enable signal"; Buildings.Controls.OBC.CDL.Reals.PIDWithReset conPID( final k=k, final Ti=Ti, final Td=Td, final r=r, final controllerType=controllerType, final yMin=yMin, final yMax=yMax, final reverseActing=reverseActing, final y_reset=y_reset); Buildings.Controls.OBC.CDL.Reals.Switch swi; Buildings.Controls.OBC.CDL.Reals.Switch swi1; Buildings.Controls.OBC.CDL.Reals.Sources.Constant valDis( final k=y_neutral) "Value when disabled"; equation connect(conPID.u_s,swi.y); connect(uEna,swi.u2); connect(u_s,swi.u1); connect(u_m,swi.u3); connect(uEna,conPID.trigger); connect(u_m,conPID.u_m); connect(conPID.y,swi1.u1); connect(swi1.y,y); connect(uEna,swi1.u2); connect(valDis.y,swi1.u3); end PIDWithEnable;

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.

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

Parameters

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

Connectors

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

Modelica definition

model PredictLeavingTemperature "Block that predicts heat exchanger leaving water temperature" extends Modelica.Blocks.Icons.Block; parameter Modelica.Units.SI.TemperatureDifference dTApp_nominal "Heat exchanger approach"; parameter Modelica.Units.SI.MassFlowRate m2_flow_nominal "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.Interfaces.RealInput m2_flow( final unit="kg/s") "Heat exchanger secondary mass flow rate"; protected Real ratLoa "Part load ratio"; equation ratLoa = min(1, abs(m2_flow / m2_flow_nominal)); T2WatLvg = T1WatEnt + dTApp_nominal * ratLoa; 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.

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

Parameters

TypeNameDefaultDescription
HeatFlowRateQ_flow_nominal Heat flow rate at nominal conditions (>0 for condenser) [W]
TemperatureDifferencedT_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" extends Modelica.Blocks.Icons.Block; parameter Modelica.Units.SI.HeatFlowRate Q_flow_nominal "Heat flow rate at nominal conditions (>0 for condenser)"; parameter Modelica.Units.SI.TemperatureDifference dT_nominal(min=if Q_flow_nominal > 0 then Modelica.Constants.eps else -100, max=if Q_flow_nominal < 0 then -Modelica.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)"; constant Modelica.Units.SI.SpecificHeatCapacity cp=Buildings.Utilities.Psychrometrics.Constants.cpWatLiq "Specific heat capacity"; final parameter Modelica.Units.SI.MassFlowRate m_flow_nominal(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.

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

Parameters

TypeNameDefaultDescription
TemperatureTHeaWatSupSetMin Minimum value of heating water supply temperature set point [K]

Connectors

TypeNameDescription
input BooleanInputuHeaHeating enable signal
input RealInputTHeaWatSupPreSetHeating water supply temperature set point [K]
output RealOutputTHeaWatSupSetHeating water supply temperature set point after reset [K]

Modelica definition

model Reset "Supervisory supply temperature reset" extends Modelica.Blocks.Icons.Block; parameter Modelica.Units.SI.Temperature THeaWatSupSetMin(displayUnit="degC") "Minimum value of heating water supply temperature set point"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uHea "Heating enable signal"; Buildings.Controls.OBC.CDL.Interfaces.RealInput THeaWatSupPreSet( final unit="K", displayUnit="degC") "Heating water supply temperature set point"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput THeaWatSupSet( final unit="K", displayUnit="degC") "Heating water supply temperature set point after reset"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant minSet( k=THeaWatSupSetMin) "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(THeaWatSupPreSet,swiHea.u1); connect(minSet.y,swiHea.u3); connect(uHea,swiHea.u2); connect(swiHea.y,ramLimHea.u); connect(ramLimHea.y,THeaWatSupSet); end Reset;

Buildings.DHC.ETS.Combined.Controls.SideCold Buildings.DHC.ETS.Combined.Controls.SideCold

Control block for cold side

Buildings.DHC.ETS.Combined.Controls.SideCold

Information

This block serves as the controller for the cold side of the ETS in Buildings.DHC.ETS.Combined.Controls.Supervisory. It computes the following control signals.

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

Parameters

TypeNameDefaultDescription
IntegernSouAmb1Number of ambient sources to control
TemperatureTChiWatSupSetMin Minimum value of chilled water supply temperature set point [K]
SimpleControllercontrollerTypeBuildings.Controls.OBC.CDL.T...Type of controller
Realk0.1Gain of controller
TimeTi120Time constant of integrator block [s]

Connectors

TypeNameDescription
input RealInputuColCold rejection control signal
output RealOutputTChiWatSupSetChilled water supply temperature set point [K]
input BooleanInputuHeaCooEnable signal for heating or cooling
input RealInputTSetSupply temperature set point (heating or chilled water) [K]
input RealInputTBotTemperature at bottom of tank [K]
output RealOutputyAmb[nSouAmb]Control signal for ambient sources [1]
output RealOutputyValIsoAmbient loop isolation valve control signal [1]

Modelica definition

model SideCold "Control block for cold side" extends Modelica.Blocks.Icons.Block; parameter Integer nSouAmb=1 "Number of ambient sources to control"; parameter Modelica.Units.SI.Temperature TChiWatSupSetMin(displayUnit="degC") "Minimum value of chilled water supply temperature set point"; parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Type of controller"; parameter Real k( min=0)=0.1 "Gain of controller"; parameter Modelica.Units.SI.Time Ti( min=Buildings.Controls.OBC.CDL.Constants.small)=120 "Time constant of integrator block"; Buildings.Controls.OBC.CDL.Interfaces.RealInput uCol "Cold rejection control signal"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput TChiWatSupSet( final unit="K", displayUnit="degC") "Chilled water supply temperature set point"; Buildings.Controls.OBC.CDL.Reals.Line mapFun[nSouAmb] "Mapping functions for ambient source control"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant x1[nSouAmb]( final k={(i-1) for i in 1:nSouAmb}) "x1"; Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator rep( final nout=nSouAmb) "Replicate control signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant f1[nSouAmb]( each final k=0) "f1"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant f2[nSouAmb]( each final k=1) "f2"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant x2[nSouAmb]( final k={(i) for i in 1:nSouAmb}) "x2"; Combined.Controls.PIDWithEnable conTChiWatSup( final k=k, final Ti=Ti, final controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI, final yMin=0, final yMax=1, final reverseActing=false) "Controller for CHWST"; Buildings.Controls.OBC.CDL.Reals.Line mapFunTChiSupSet "Mapping function for CHWST reset"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant minTChiWatSup( y(final unit="K", displayUnit="degC"), final k=TChiWatSupSetMin) "Minimum value of chilled water supply temperature"; Buildings.Controls.OBC.CDL.Reals.AddParameter addPar( p=nSouAmb) "One minus control loop output"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai( k=-nSouAmb) "Gain factor"; Buildings.Controls.OBC.CDL.Reals.Max max1 "CHWST reset signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant zer( k=0) "Zero"; Buildings.Controls.OBC.CDL.Reals.AddParameter subNumSou( p=-nSouAmb) "Control signal minus nSouAmb"; Buildings.Controls.OBC.CDL.Reals.Min min1 "Ambient source control signal"; Buildings.Controls.OBC.CDL.Reals.LimitSlewRate ramLimHea( raisingSlewRate=0.1) "Limit the rate of change"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uHeaCoo "Enable signal for heating or cooling"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TSet( final unit="K", displayUnit="degC") "Supply temperature set point (heating or chilled water)"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TBot( final unit="K", displayUnit="degC") "Temperature at bottom of tank"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yAmb[nSouAmb]( each final unit="1") "Control signal for ambient sources"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yValIso( final unit="1") "Ambient loop isolation valve control signal"; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea "Convert DO to AO signal"; Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr( t=0.01) "Control signal is non zero (with 1% tolerance)"; Modelica.Blocks.Discrete.ZeroOrderHold zeroOrderHold( samplePeriod=60); equation connect(x1.y,mapFun.x1); connect(rep.y,mapFun.u); connect(f1.y,mapFun.f1); connect(f2.y,mapFun.f2); connect(x2.y,mapFun.x2); connect(TSet,conTChiWatSup.u_s); connect(TBot,conTChiWatSup.u_m); connect(f2[1].y,mapFunTChiSupSet.x2); connect(minTChiWatSup.y,mapFunTChiSupSet.f2); connect(TSet,mapFunTChiSupSet.f1); connect(uCol,subNumSou.u); connect(max1.y,mapFunTChiSupSet.u); connect(uCol,min1.u1); connect(addPar.y,min1.u2); connect(min1.y,rep.u); connect(mapFun.y,yAmb); connect(ramLimHea.y,TChiWatSupSet); connect(uHeaCoo,conTChiWatSup.uEna); connect(zer.y,mapFunTChiSupSet.x1); connect(uCol,greThr.u); connect(greThr.y,booToRea.u); connect(booToRea.y,zeroOrderHold.u); connect(zeroOrderHold.y,yValIso); connect(mapFunTChiSupSet.y,ramLimHea.u); connect(zer.y,max1.u2); connect(subNumSou.y,max1.u1); connect(conTChiWatSup.y, gai.u); connect(gai.y, addPar.u); end SideCold;

Buildings.DHC.ETS.Combined.Controls.SideHot Buildings.DHC.ETS.Combined.Controls.SideHot

Control block for hot side

Buildings.DHC.ETS.Combined.Controls.SideHot

Information

This block serves as the controller for the hot side of the ETS in Buildings.DHC.ETS.Combined.Controls.Supervisory. It computes the following control signals.

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

Parameters

TypeNameDefaultDescription
IntegernSouAmb1Number of ambient sources to control
TemperatureDifferencedTDea1Temperature difference band between set point tracking and heat rejection (absolute value) [K]
TemperatureDifferencedTLocdTDea + 2Temperature difference between set point tracking and cold rejection lockout (absolute value) [K]
SimpleControllercontrollerTypeBuildings.Controls.OBC.CDL.T...Type of controller
Realk0.1Gain of controller
TimeTi120Time constant of integrator block [s]

Connectors

TypeNameDescription
output RealOutputyColControl signal for cold side [1]
input BooleanInputuHeaCooEnable signal for heating or cooling
input RealInputTSetSupply temperature set point (heating or chilled water) [K]
input RealInputTTopTemperature at top of tank [K]
output RealOutputyAmb[nSouAmb]Control signal for ambient sources [1]
output RealOutputyValIsoAmbient loop isolation valve control signal [1]
input RealInputyValIsoCon_actualReturn position of condenser to ambient loop isolation valve [1]
input RealInputyValIsoEva_actualReturn position of evaporator to ambient loop isolation valve [1]

Modelica definition

block SideHot "Control block for hot side" extends Modelica.Blocks.Icons.Block; parameter Integer nSouAmb=1 "Number of ambient sources to control"; parameter Modelica.Units.SI.TemperatureDifference dTDea(min=0) = 1 "Temperature difference band between set point tracking and heat rejection (absolute value)"; parameter Modelica.Units.SI.TemperatureDifference dTLoc(min=0) = dTDea + 2 "Temperature difference between set point tracking and cold rejection lockout (absolute value)"; parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Type of controller"; parameter Real k( min=0)=0.1 "Gain of controller"; parameter Modelica.Units.SI.Time Ti(min=Buildings.Controls.OBC.CDL.Constants.small)= 120 "Time constant of integrator block"; PIDWithEnable conColRej( final k=k, final Ti=Ti, final controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI, final yMin=0, final yMax=nSouAmb+1, final reverseActing=true) "Controller for cold rejection"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yCol( final unit="1") "Control signal for cold side"; Buildings.Controls.OBC.CDL.Reals.GreaterThreshold greThr( final t=0.01) "Control signal is non zero (with 1% tolerance)"; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal booToRea "Convert DO to AO signal"; PIDWithEnable conHeaRej( final k=k, final Ti=Ti, final controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI, final yMin=0, final yMax=nSouAmb, final reverseActing=false) "Controller for heat rejection"; Buildings.Controls.OBC.CDL.Reals.Line mapFun[nSouAmb] "Mapping functions for controlled systems"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant x1[nSouAmb]( final k={(i-1) for i in 1:nSouAmb}) "x1"; Buildings.Controls.OBC.CDL.Routing.RealScalarReplicator rep( final nout=nSouAmb) "Replicate control signal"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant f1[nSouAmb]( each final k=0) "f1"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant f2[nSouAmb]( each final k=1) "f2"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant x2[nSouAmb]( final k={(i) for i in 1:nSouAmb}) "x2"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput uHeaCoo "Enable signal for heating or cooling"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TSet( final unit="K", displayUnit="degC") "Supply temperature set point (heating or chilled water)"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TTop( final unit="K", displayUnit="degC") "Temperature at top of tank"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yAmb[nSouAmb]( each final unit="1") "Control signal for ambient sources"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yValIso( final unit="1") "Ambient loop isolation valve control signal"; Buildings.Controls.OBC.CDL.Interfaces.RealInput yValIsoCon_actual( final unit="1") "Return position of condenser to ambient loop isolation valve"; Buildings.Controls.OBC.CDL.Interfaces.RealInput yValIsoEva_actual( final unit="1") "Return position of evaporator to ambient loop isolation valve"; Buildings.Controls.OBC.CDL.Reals.LessThreshold isValIsoConClo( final t=1E-6, h=0.5E-6) "Check if isolation valve is closed"; Buildings.Controls.OBC.CDL.Reals.LessThreshold isValIsoEvaClo( final t=1E-6, h=0.5E-6) "At least one signal is non zero"; Buildings.Controls.OBC.CDL.Logical.MultiAnd mulAnd( nin=3); Buildings.Controls.OBC.CDL.Reals.AddParameter addDea( p=dTDea) "Add dead band"; Modelica.Blocks.Discrete.ZeroOrderHold zeroOrderHold( samplePeriod=60); Buildings.Controls.OBC.CDL.Reals.AddParameter addLoc( p=dTLoc) "Add temperature difference for lockout"; Buildings.Controls.OBC.CDL.Reals.Less isBelLoc( h=0.1) "Check if temperature is below cold rejection lockout"; equation connect(mapFun.y,yAmb); connect(TSet,conColRej.u_s); connect(TTop,conColRej.u_m); connect(conHeaRej.y,greThr.u); connect(x1.y,mapFun.x1); connect(conHeaRej.y,rep.u); connect(rep.y,mapFun.u); connect(f1.y,mapFun.f1); connect(f2.y,mapFun.f2); connect(x2.y,mapFun.x2); connect(conColRej.y,yCol); connect(TTop,conHeaRej.u_m); connect(yValIsoCon_actual,isValIsoConClo.u); connect(yValIsoEva_actual,isValIsoEvaClo.u); connect(mulAnd.y,conColRej.uEna); connect(isValIsoEvaClo.y,conHeaRej.uEna); connect(TSet,addDea.u); connect(addDea.y,conHeaRej.u_s); connect(greThr.y,booToRea.u); connect(booToRea.y,zeroOrderHold.u); connect(zeroOrderHold.y,yValIso); connect(TSet,addLoc.u); connect(TTop,isBelLoc.u1); connect(addLoc.y,isBelLoc.u2); connect(uHeaCoo,mulAnd.u[1]); connect(isValIsoConClo.y,mulAnd.u[2]); connect(isBelLoc.y,mulAnd.u[3]); end SideHot;

Buildings.DHC.ETS.Combined.Controls.Supervisory Buildings.DHC.ETS.Combined.Controls.Supervisory

Supervisory controller

Buildings.DHC.ETS.Combined.Controls.Supervisory

Information

This block implements the supervisory control functions of the ETS model Buildings.DHC.ETS.Combined.ChillerBorefield.

Extends from Buildings.DHC.ETS.Combined.Controls.BaseClasses.PartialSupervisory (Partial model for supervisory controller).

Parameters

TypeNameDefaultDescription
IntegernSouAmb Number of ambient sources to control
SimpleControllercontrollerTypeBuildings.Controls.OBC.CDL.T...Type of controller
RealkHot0.05Gain of controller on hot side
RealkCol0.1Gain of controller on cold side
TimeTiHot300Time constant of integrator block on hot side [s]
TimeTiCol120Time constant of integrator block on cold side [s]
TemperatureTHeaWatSupSetMin Minimum value of heating water supply temperature set point [K]
TemperatureTChiWatSupSetMin Minimum value of chilled water supply temperature set point [K]

Connectors

TypeNameDescription
input BooleanInputuHeaHeating enable signal
input BooleanInputuCooCooling enable signal
input RealInputTChiWatSupPreSetChilled water supply temperature set point [K]
input RealInputTChiWatBotChilled water temperature at tank bottom [K]
input RealInputTHeaWatTopHeating water temperature at tank top [K]
input RealInputTHeaWatSupPreSetHeating water supply temperature set point [K]
output RealOutputTHeaWatSupSetHeating water supply temperature set point after reset [K]
output RealOutputTChiWatSupSetChilled water supply temperature set point after reset [K]
output RealOutputyValIsoEvaEvaporator to ambient loop isolation valve control signal [1]
output RealOutputyValIsoConCondenser to ambient loop isolation valve control signal [1]
output RealOutputyAmb[nSouAmb]Control output for ambient sources [1]
output BooleanOutputyHeaTank in heating demand
output BooleanOutputyCooTank in cooling demand
input RealInputyValIsoCon_actualReturn position of condenser to ambient loop isolation valve [1]
input RealInputyValIsoEva_actualReturn position of evaporator to ambient loop isolation valve [1]

Modelica definition

model Supervisory "Supervisory controller" extends Buildings.DHC.ETS.Combined.Controls.BaseClasses.PartialSupervisory; parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Type of controller"; parameter Real kHot( min=0)=0.05 "Gain of controller on hot side"; parameter Real kCol( min=0)=0.1 "Gain of controller on cold side"; parameter Modelica.Units.SI.Time TiHot(min=Buildings.Controls.OBC.CDL.Constants.small) = 300 "Time constant of integrator block on hot side"; parameter Modelica.Units.SI.Time TiCol(min=Buildings.Controls.OBC.CDL.Constants.small) = 120 "Time constant of integrator block on cold side"; parameter Modelica.Units.SI.Temperature THeaWatSupSetMin(displayUnit="degC") "Minimum value of heating water supply temperature set point"; parameter Modelica.Units.SI.Temperature TChiWatSupSetMin(displayUnit="degC") "Minimum value of chilled water supply temperature set point"; Buildings.Controls.OBC.CDL.Interfaces.RealInput yValIsoCon_actual( final unit="1") "Return position of condenser to ambient loop isolation valve"; Buildings.Controls.OBC.CDL.Interfaces.RealInput yValIsoEva_actual( final unit="1") "Return position of evaporator to ambient loop isolation valve"; Combined.Controls.SideHot conHot( final k=kHot, final Ti=TiHot, final nSouAmb=nSouAmb, final controllerType=controllerType) "Hot side controller"; SideCold conCol( final k=kCol, final Ti=TiCol, final nSouAmb=nSouAmb, final controllerType=controllerType, final TChiWatSupSetMin=TChiWatSupSetMin) "Cold side controller"; Buildings.Controls.OBC.CDL.Reals.Max max1[nSouAmb] "Maximum of output control signals"; Reset resTSup( final THeaWatSupSetMin=THeaWatSupSetMin) "Supply temperature reset"; equation connect(conHot.yAmb,max1.u1); connect(conCol.yAmb,max1.u2); connect(conHot.yCol,conCol.uCol); connect(resTSup.THeaWatSupSet,conHot.TSet); connect(THeaWatTop,conHot.TTop); connect(max1.y,yAmb); connect(TChiWatBot,conCol.TBot); connect(THeaWatSupPreSet,resTSup.THeaWatSupPreSet); connect(conHot.yValIso,yValIsoCon); connect(conCol.yValIso,yValIsoEva); connect(resTSup.THeaWatSupSet,THeaWatSupSet); connect(conCol.TChiWatSupSet,TChiWatSupSet); connect(TChiWatSupPreSet,conCol.TSet); connect(uHeaHol.y,conHot.uHeaCoo); connect(uCooHol.y,conCol.uHeaCoo); connect(uHeaHol.y,resTSup.uHea); connect(uHeaHol.y,yHea); connect(uCooHol.y,yCoo); connect(yValIsoCon_actual,conHot.yValIsoCon_actual); connect(yValIsoEva_actual,conHot.yValIsoEva_actual); end Supervisory;

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.

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

Parameters

TypeNameDefaultDescription
RealtrueHoldDuration true hold duration [s]
RealfalseHoldDurationtrueHoldDurationfalse hold duration [s]
Nominal condition
MassFlowRatem_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" extends Modelica.Blocks.Icons.Block; parameter Modelica.Units.SI.MassFlowRate m_flow_nominal "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 t, h=0.001*m_flow_nominal) "Output true in case of dominating positive flow"; Modelica.Blocks.Logical.Switch swi "Switch to select the mode"; Modelica.Blocks.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"; Modelica.Blocks.Sources.Constant revModOn(final k=0) "Output signal in case of dominating reverse flow"; protected Buildings.Controls.OBC.CDL.Reals.Subtract sub "Differences in mass flow rates"; 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(posDom.u, sub.y); connect(mPos_flow, sub.u1); connect(mRev_flow, sub.u2); end SwitchBox;

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

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

Parameters

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

Connectors

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

Modelica definition

model WatersideEconomizer "Waterside economizer controller" extends Modelica.Blocks.Icons.Block; parameter Modelica.Units.SI.MassFlowRate m2_flow_nominal "Heat exchanger secondary mass flow rate"; parameter Modelica.Units.SI.Temperature T_a1_nominal "Nominal water inlet temperature on district side"; parameter Modelica.Units.SI.Temperature T_b2_nominal "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 Modelica.Units.SI.TemperatureDifference dTEna=1 "Minimum delta-T above predicted heat exchanger leaving water temperature to enable WSE"; parameter Modelica.Units.SI.TemperatureDifference dTDis=0.5 "Minimum delta-T across heat exchanger before disabling WSE"; Buildings.Controls.OBC.CDL.Interfaces.RealInput T1WatEnt( final unit="K", displayUnit="degC") "Heat exchanger primary water entering temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput m2_flow( final unit="kg/s") "Heat exchanger secondary mass flow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealInput T2WatLvg( final unit="K", displayUnit="degC") "Heat exchanger secondary water leaving temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput T2WatEnt( final unit="K", displayUnit="degC") "Heat exchanger secondary water entering temperature"; 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(t=dTDis) "Compare to threshold for disabling WSE"; 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 "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.Interfaces.BooleanInput uCoo "Cooling enable signal"; 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=1E-6, h=0.5E-6) "True if valve closed"; Buildings.Controls.OBC.CDL.Interfaces.RealInput yValIsoEva_actual(final unit="1") "Return position of evaporator to ambient loop isolation valve"; 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( 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;