Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.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.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.Borefield Borefield Borefield controller
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.Chiller Chiller Chiller controller
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.HeatExchanger HeatExchanger District heat exchanger controller
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.PIDWithEnable PIDWithEnable PID controller with enable signal
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.PrimaryVariableFlow PrimaryVariableFlow Ideal control of condenser or evaporator variable flow rate
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.Reset Reset Supervisory supply temperature reset
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.SideCold SideCold Control block for cold side
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.SideHot SideHot Control block for hot side
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.Supervisory Supervisory Supervisory controller
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.SwitchBox SwitchBox Controller for flow switch box
Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.BaseClasses BaseClasses Package with base classes

Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.Borefield Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.Borefield

Borefield controller

Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.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.Experimental.DHC.EnergyTransferStations.Combined.Generation5.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.SIunits.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.Continuous.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.Continuous.Sources.Constant maxTBorWatEnt( y(final unit="K", displayUnit="degC"), final k=TBorWatEntMax) "Maximum value of borefield water entering temperature"; Buildings.Controls.OBC.CDL.Continuous.GreaterThreshold opeVal( final t=0.9, final h=0.1) "True if at least one isolation valve is open"; Buildings.Controls.OBC.CDL.Continuous.MultiMax multiMax1( final nin=2) "Maximum opening"; Buildings.Controls.OBC.CDL.Continuous.GreaterThreshold enaSup( final t=0.05, final h=0.025) "Borefield enabled from supervisory"; Buildings.Controls.OBC.CDL.Logical.Switch runBor "Enable borefield system pump"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant limVal( final k=0.3) "Control signal value for full opening of the valve"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant speMin( final k=spePumBorMin) "Minimum pump speed"; Buildings.Controls.OBC.CDL.Logical.And enaBor "Borefield enable signal"; Buildings.Controls.OBC.CDL.Continuous.Line mapSpe "Mapping function for pump speed"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant one( final k=1) "One"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant zer( final k=0) "Zero"; Buildings.Controls.OBC.CDL.Continuous.Line mapVal "Mapping function for valve opening"; Buildings.Controls.OBC.CDL.Continuous.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.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.Chiller Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.Chiller

Chiller controller

Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.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.SIunits.Temperature TConWatEntMin( displayUnit="degC") "Minimum value of condenser water entering temperature"; parameter Modelica.SIunits.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.Continuous.Sources.Constant maxTEvaWatEnt( y(final unit="K", displayUnit="degC"), final k=TEvaWatEntMax) "Maximum value of evaporator water entering temperature"; Buildings.Controls.OBC.CDL.Continuous.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.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.HeatExchanger Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.HeatExchanger

District heat exchanger controller

Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.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.Experimental.DHC.EnergyTransferStations.Combined.Generation5.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
RealspePum1HexMin0.1Heat exchanger primary pump minimum speed (fractional) [1]
RealyVal1HexMin0.1Minimum valve opening for temperature measurement (fractional) [1]
RealspePum2HexMin0.1Heat exchanger secondary pump minimum speed (fractional) [1]
TemperatureDifferencedT1HexSet[2] Primary side deltaT set point schedule (index 1 for heat rejection) [K]
Realk[2] Gain schedule for controller (index 1 for heat rejection)
TimeTi Time constant of integrator block [s]

Connectors

TypeNameDescription
input RealInputT1HexWatEntDistrict heat exchanger primary water entering temperature [K]
input RealInputT1HexWatLvgDistrict heat exchanger primary water leaving temperature [K]
input RealInputyValIso[2]Isolation valves return position (index 1 for condenser)
output RealOutputy1HexDistrict heat exchanger primary control signal [1]
output RealOutputyPum2HexDistrict heat exchanger secondary pump control signal [1]
output RealOutputyVal2HexDistrict 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 Buildings.Experimental.DHC.EnergyTransferStations.Types.ConnectionConfiguration conCon "District connection configuration"; parameter Real spePum1HexMin( final unit="1", min=0)=0.1 "Heat exchanger primary pump minimum speed (fractional)"; parameter Real yVal1HexMin( final unit="1", min=0.01)=0.1 "Minimum valve opening for temperature measurement (fractional)"; parameter Real spePum2HexMin( final unit="1", min=0.01)=0.1 "Heat exchanger secondary pump minimum speed (fractional)"; parameter Modelica.SIunits.TemperatureDifference dT1HexSet[2] "Primary side deltaT set point schedule (index 1 for heat rejection)"; parameter Real k[2] "Gain schedule for controller (index 1 for heat rejection)"; final parameter Real kNor[2]=k ./ k[1] "Normalized gain schedule for controller (index 1 for heat rejection)"; parameter Modelica.SIunits.Time Ti( min=0) "Time constant of integrator block"; Buildings.Controls.OBC.CDL.Interfaces.RealInput T1HexWatEnt( final unit="K", displayUnit="degC") "District heat exchanger primary water entering temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput T1HexWatLvg( final unit="K", displayUnit="degC") "District heat exchanger primary water leaving temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput yValIso[2] "Isolation valves return position (index 1 for condenser)"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput y1Hex( final unit="1") "District heat exchanger primary control signal"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yPum2Hex( final unit="1") "District heat exchanger secondary pump control signal"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput yVal2Hex( final unit="1") "District heat exchanger secondary valve control signal"; Buildings.Controls.OBC.CDL.Continuous.Add delT( k2=-1) "Compute deltaT"; Buildings.Controls.OBC.CDL.Continuous.Abs absDelT "Absolute value"; Buildings.Controls.Continuous.LimPID con1Hex( final k=1, final Ti=Ti, final reset=Buildings.Types.Reset.Parameter, final reverseActing=false, final yMin=0, final yMax=1, final controllerType=Modelica.Blocks.Types.SimpleController.PI) "Primary circuit controller"; Buildings.Controls.OBC.CDL.Continuous.Max max1 "Maximum between control signal and minimum speed or opening"; Buildings.Controls.OBC.CDL.Logical.Switch swiOff1 "Output zero if not enabled"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant min1( final k= if have_val1Hex then yVal1HexMin else spePum1HexMin) "Minimum pump speed or actuator opening"; Buildings.Controls.OBC.CDL.Interfaces.RealInput u "Control signal for secondary side (from supervisory)"; Buildings.Controls.OBC.CDL.Continuous.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.Continuous.GreaterThreshold heaRej( final t=0.9, final h=0.1) "Heat rejection if condenser isolation valve is open"; Buildings.Controls.OBC.CDL.Continuous.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.Continuous.Product pro "Gain scheduling"; Buildings.Controls.OBC.CDL.Continuous.Product pro1 "Gain scheduling"; Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger idxSch( integerTrue=2, integerFalse=1) "Conversion to integer for gain scheduling"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant schSet[2]( final k=dT1HexSet) "Set point schedule"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant schGai[2]( k=kNor) "Gain schedule"; Buildings.Controls.OBC.CDL.Routing.RealExtractor setAct( nin=2) "Actual set point"; Buildings.Controls.OBC.CDL.Routing.RealExtractor gaiAct( nin=2) "Actual gain"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant speMin( final k=spePum2HexMin) "Minimum pump speed"; Buildings.Controls.OBC.CDL.Logical.Switch swiOff2 "Output zero if not enabled"; Buildings.Controls.OBC.CDL.Continuous.Line mapSpe "Mapping function for pump speed"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant one( final k=1) "One"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant zer( final k=0) "Zero"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant hal( final k=0.3) "Control signal value for full opening of the valve"; Buildings.Controls.OBC.CDL.Continuous.Line mapVal "Mapping function for valve opening"; protected parameter Boolean have_val1Hex=conCon == Buildings.Experimental.DHC.EnergyTransferStations.Types.ConnectionConfiguration.TwoWayValve "True in case of control valve on district side, false in case of a pump"; equation connect(delT.y,absDelT.u); connect(T1HexWatEnt,delT.u1); connect(T1HexWatLvg,delT.u2); connect(swiOff1.y,y1Hex); 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(yValIso[1],heaRej.u); connect(yValIso[2],cooRej.u); connect(and2.y,con1Hex.trigger); connect(pro1.y,con1Hex.u_m); connect(absDelT.y,pro1.u1); connect(cooRej.y,idxSch.u); connect(schSet.y,setAct.u); connect(schGai.y,gaiAct.u); connect(gaiAct.y,pro.u2); connect(gaiAct.y,pro1.u2); connect(idxSch.y,gaiAct.index); connect(idxSch.y,setAct.index); connect(con1Hex.y,max1.u1); connect(min1.y,max1.u2); connect(swiOff2.y,yPum2Hex); 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(pro.y,con1Hex.u_s); connect(setAct.y,pro.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,yVal2Hex); connect(and2.y,swiOff2.u2); end HeatExchanger;

Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.PIDWithEnable Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.PIDWithEnable

PID controller with enable signal

Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.PIDWithEnable

Information

This is an update of Buildings.Controls.OBC.CDL.Continuous.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]
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

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.SIunits.Time Ti( min=Buildings.Controls.OBC.CDL.Constants.small)=0.5 "Time constant of integrator block"; parameter Modelica.SIunits.Time Td( min=0)=0.1 "Time constant of derivative block"; 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"; 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.Continuous.PIDWithReset conPID( final k=k, final Ti=Ti, final Td=Td, final controllerType=controllerType, final yMin=yMin, final yMax=yMax, final reverseActing=reverseActing); Buildings.Controls.OBC.CDL.Logical.Switch swi; Buildings.Controls.OBC.CDL.Logical.Switch swi1; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant valDis( final k=0) "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.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.PrimaryVariableFlow Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.PrimaryVariableFlow

Ideal control of condenser or evaporator variable flow rate

Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.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.SIunits.HeatFlowRate Q_flow_nominal "Heat flow rate at nominal conditions (>0 for condenser)"; parameter Modelica.SIunits.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.SIunits.SpecificHeatCapacity cp= Buildings.Utilities.Psychrometrics.Constants.cpWatLiq "Specific heat capacity"; final parameter Modelica.SIunits.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.Continuous.Sources.Constant masFloMin( final k=ratFloMin*m_flow_nominal) "Minimum mass flow rate"; Buildings.Controls.OBC.CDL.Continuous.Gain masFlo_dT( final k=1/cp/dT_nominal) "Mass flow rate for constant DeltaT"; Buildings.Controls.OBC.CDL.Continuous.Max masFlo "Mass flow rate"; Buildings.Controls.OBC.CDL.Continuous.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.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.Reset Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.Reset

Supervisory supply temperature reset

Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.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.SIunits.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.Continuous.Sources.Constant minSet( k=THeaWatSupSetMin) "Minimum value of HW set point"; Buildings.Controls.OBC.CDL.Logical.Switch swiHea "Switch"; Buildings.Controls.OBC.CDL.Continuous.SlewRateLimiter 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.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.SideCold Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.SideCold

Control block for cold side

Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.SideCold

Information

This block serves as the controller for the cold side of the ETS in Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.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.SIunits.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.SIunits.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.Continuous.Line mapFun[nSouAmb] "Mapping functions for ambient source control"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant x1[nSouAmb]( final k={(i-1) for i in 1:nSouAmb}) "x1"; Buildings.Controls.OBC.CDL.Routing.RealReplicator rep( final nout=nSouAmb) "Replicate control signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant f1[nSouAmb]( each final k=0) "f1"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant f2[nSouAmb]( each final k=1) "f2"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant x2[nSouAmb]( final k={(i) for i in 1:nSouAmb}) "x2"; PIDWithEnable conTChiWatSup( final k=k, final Ti=Ti, final controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI, final yMin=-1, final yMax=0, final reverseActing=true) "Controller for CHWST"; Buildings.Controls.OBC.CDL.Continuous.Line mapFunTChiSupSet "Mapping function for CHWST reset"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant minTChiWatSup( y(final unit="K", displayUnit="degC"), final k=TChiWatSupSetMin) "Minimum value of chilled water supply temperature"; Buildings.Controls.OBC.CDL.Continuous.AddParameter addPar( p=nSouAmb, k=nSouAmb) "One minus control loop output"; Buildings.Controls.OBC.CDL.Continuous.Max max1 "CHWST reset signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant zer( k=0) "Zero"; Buildings.Controls.OBC.CDL.Continuous.AddParameter subNumSou( p=-nSouAmb, k=1) "Control signal minus nSouAmb"; Buildings.Controls.OBC.CDL.Continuous.Min min1 "Ambient source control signal"; Buildings.Controls.OBC.CDL.Continuous.SlewRateLimiter 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.Continuous.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(conTChiWatSup.y,addPar.u); 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); end SideCold;

Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.SideHot Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.SideHot

Control block for hot side

Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.SideHot

Information

This block serves as the controller for the hot side of the ETS in Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.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.SIunits.TemperatureDifference dTDea( min=0)=1 "Temperature difference band between set point tracking and heat rejection (absolute value)"; parameter Modelica.SIunits.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.SIunits.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.Continuous.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.Continuous.Line mapFun[nSouAmb] "Mapping functions for controlled systems"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant x1[nSouAmb]( final k={(i-1) for i in 1:nSouAmb}) "x1"; Buildings.Controls.OBC.CDL.Routing.RealReplicator rep( final nout=nSouAmb) "Replicate control signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant f1[nSouAmb]( each final k=0) "f1"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant f2[nSouAmb]( each final k=1) "f2"; Buildings.Controls.OBC.CDL.Continuous.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.Continuous.LessThreshold isValIsoConClo( final t=1E-6, h=0.5E-6) "Check if isolation valve is closed"; Buildings.Controls.OBC.CDL.Continuous.LessThreshold isValIsoEvaClo( final t=1E-6, h=0.5E-6) "At least one signal is non zero"; Buildings.Controls.OBC.CDL.Logical.MultiAnd mulAnd( nu=3); Buildings.Controls.OBC.CDL.Continuous.AddParameter addDea( p=dTDea, k=1) "Add dead band"; Modelica.Blocks.Discrete.ZeroOrderHold zeroOrderHold( samplePeriod=60); Buildings.Controls.OBC.CDL.Continuous.AddParameter addLoc( p=dTLoc, k=1) "Add temperature difference for lockout"; Buildings.Controls.OBC.CDL.Continuous.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.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.Supervisory Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.Supervisory

Supervisory controller

Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.Supervisory

Information

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

Extends from 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 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.SIunits.Time TiHot( min=Buildings.Controls.OBC.CDL.Constants.small)=300 "Time constant of integrator block on hot side"; parameter Modelica.SIunits.Time TiCol( min=Buildings.Controls.OBC.CDL.Constants.small)=120 "Time constant of integrator block on cold side"; parameter Modelica.SIunits.Temperature THeaWatSupSetMin( displayUnit="degC") "Minimum value of heating water supply temperature set point"; parameter Modelica.SIunits.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"; 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.Continuous.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.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.SwitchBox Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.SwitchBox

Controller for flow switch box

Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.Controls.SwitchBox

Information

This block implements a control logic preventing flow reversal in the service line, for instance with the hydronic configuration of Buildings.Experimental.DHC.EnergyTransferStations.Combined.Generation5.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.Experimental.DHC.EnergyTransferStations.Combined.Generation5.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]

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 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"; Modelica.Blocks.Logical.GreaterEqual posDom "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"; equation connect(posModOn.y, swi.u1); connect(swi.y, y); connect(mRev_flow, posDom.u2); connect(posDom.y, truFalHol.u); connect(truFalHol.y, swi.u2); connect(mPos_flow, posDom.u1); connect(revModOn.y, swi.u3); end SwitchBox;