Buildings.DHC.Plants.Cooling.Controls

Package of control sequences for cooling plants

Information

This package contains control sequences for central cooling plants.

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

Package Content

Name Description
Buildings.DHC.Plants.Cooling.Controls.ChilledWaterBypass ChilledWaterBypass Controller for chilled water bypass valve
Buildings.DHC.Plants.Cooling.Controls.ChilledWaterPumpSpeed ChilledWaterPumpSpeed Controller for two headered variable speed chilled water pumps
Buildings.DHC.Plants.Cooling.Controls.ChillerStage ChillerStage Chiller staging controller for plants with two chillers of the same size
Buildings.DHC.Plants.Cooling.Controls.FlowControl FlowControl This block controls the flow at the primary and secondary pumps
Buildings.DHC.Plants.Cooling.Controls.SelectMin SelectMin Block that includes or excludes storage plant pressure signal for min
Buildings.DHC.Plants.Cooling.Controls.TankStatus TankStatus Returns the tank status from its temperature sensors
Buildings.DHC.Plants.Cooling.Controls.Validation Validation Collection of validation models

Buildings.DHC.Plants.Cooling.Controls.ChilledWaterBypass Buildings.DHC.Plants.Cooling.Controls.ChilledWaterBypass

Controller for chilled water bypass valve

Buildings.DHC.Plants.Cooling.Controls.ChilledWaterBypass

Information

This model implements the chilled water loop bypass valve control logic as follows:

When the plant is on, the PID controller controls the valve opening ratio to reach the scaled mass flow rate setpoint.

The setpoint is mMin_flow multiplied by the number of chillers that are on. mMin_flow is the minimum mass flow rate required by one chiller.

This control sequence assumes that all the chillers are identical and the cooling load is evenly split between all of the chillers that are on.

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

Parameters

TypeNameDefaultDescription
IntegernumChi Number of chillers
MassFlowRatemMin_flow Minimum mass flow rate of single chiller [kg/s]
Realk0.06Gain of controller
TimeTi60Time constant of Integrator block [s]
SimpleControllercontrollerTypeModelica.Blocks.Types.Simple...Type of controller

Connectors

TypeNameDescription
input BooleanInputchiOn[numChi]On signals of the chillers
input RealInputmFloChiMass flow rate through the chillers [kg/s]
output RealOutputyBypass valve opening ratio

Modelica definition

model ChilledWaterBypass "Controller for chilled water bypass valve" extends Modelica.Blocks.Icons.Block; parameter Integer numChi( min=1) "Number of chillers"; parameter Modelica.Units.SI.MassFlowRate mMin_flow "Minimum mass flow rate of single chiller"; parameter Real k(min=0) = 0.06 "Gain of controller"; parameter Modelica.Units.SI.Time Ti(min=Modelica.Constants.small) = 60 "Time constant of Integrator block"; parameter Modelica.Blocks.Types.SimpleController controllerType= Modelica.Blocks.Types.SimpleController.PI "Type of controller"; Modelica.Blocks.Interfaces.BooleanInput chiOn[numChi] "On signals of the chillers"; Modelica.Blocks.Interfaces.RealInput mFloChi(final unit="kg/s") "Mass flow rate through the chillers"; Modelica.Blocks.Interfaces.RealOutput y "Bypass valve opening ratio"; Buildings.Controls.OBC.CDL.Reals.PIDWithReset bypValCon( controllerType=controllerType, final k=k, final Ti=Ti, y_reset=0) "Chilled water bypass valve controller"; Modelica.Blocks.Math.BooleanToInteger booToInt[numChi] "Boolean signal to integer"; Buildings.Controls.OBC.CDL.Integers.GreaterThreshold intGreThr "Greater than zero"; Buildings.Controls.OBC.CDL.Integers.MultiSum numChiOn(nin=numChi) "Number of chillers on"; Buildings.Controls.OBC.CDL.Conversions.IntegerToReal intToRea "Integer to real"; Modelica.Blocks.Math.Gain mFloSetSca(k=1/numChi) "Normalize mass flowrate setpoint"; Modelica.Blocks.Math.Gain mFloBypSca(k=1/(numChi*mMin_flow)) "Normalize the measured mass flowrate"; equation connect(chiOn, booToInt.u); connect(booToInt.y, numChiOn.u); connect(numChiOn.y, intGreThr.u); connect(intGreThr.y, bypValCon.trigger); connect(numChiOn.y, intToRea.u); connect(bypValCon.y, y); connect(intToRea.y, mFloSetSca.u); connect(mFloSetSca.y, bypValCon.u_s); connect(mFloChi, mFloBypSca.u); connect(mFloBypSca.y, bypValCon.u_m); end ChilledWaterBypass;

Buildings.DHC.Plants.Cooling.Controls.ChilledWaterPumpSpeed Buildings.DHC.Plants.Cooling.Controls.ChilledWaterPumpSpeed

Controller for two headered variable speed chilled water pumps

Buildings.DHC.Plants.Cooling.Controls.ChilledWaterPumpSpeed

Information

This model implements the control logic for variable speed pumps. The staging of pumps is implemented through an instance of Buildings.Applications.BaseClasses.Controls.VariableSpeedPumpStage.

The pump speed is controlled to maintain the pressure difference setpoint through a PI controller.

The model inputs are the measured chilled water mass flow rate masFloPum and the pressure difference dpMea at a reference point from the demand side. The output y is a vector of pump speeds.

The model currently only supports the control of two variable speed pumps.

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

Parameters

TypeNameDefaultDescription
PressureDifferencedpSetPoi Pressure difference setpoint [Pa]
TimetWai Waiting time [s]
MassFlowRatem_flow_nominal Nominal mass flow rate of single chilled water pump [kg/s]
RealminSpe0.05Minimum speed ratio required by chilled water pumps [1]
MassFlowRatecriPoiFlo0.7*m_flow_nominalCritcal point of flowrate for switching pump on or off [kg/s]
MassFlowRatedeaBanFlo0.1*m_flow_nominalDeadband for critical point of flowrate [kg/s]
RealcriPoiSpe0.5Critical point of speed signal for switching on or off
RealdeaBanSpe0.3Deadband for critical point of speed signal
Speed Controller
SimpleControllercontrollerTypeModelica.Blocks.Types.Simple...Type of pump speed controller
Realk1Gain of controller [1]
TimeTi60Time constant of Integrator block [s]
TimeTd0.1Time constant of Derivative block [s]

Connectors

TypeNameDescription
input RealInputmasFloPumTotal mass flowrate of chilled water pumps [kg/s]
input RealInputdpMeaMeasured pressure difference [Pa]
output RealOutputy[numPum]Pump speed signal [1]
input BooleanInputonOn signal of the plant

Modelica definition

model ChilledWaterPumpSpeed "Controller for two headered variable speed chilled water pumps" extends Modelica.Blocks.Icons.Block; parameter Modelica.Units.SI.PressureDifference dpSetPoi(displayUnit="Pa") "Pressure difference setpoint"; parameter Modelica.Units.SI.Time tWai "Waiting time"; parameter Modelica.Units.SI.MassFlowRate m_flow_nominal "Nominal mass flow rate of single chilled water pump"; parameter Real minSpe( final unit="1", final min=0, final max=1)=0.05 "Minimum speed ratio required by chilled water pumps"; parameter Modelica.Units.SI.MassFlowRate criPoiFlo=0.7*m_flow_nominal "Critcal point of flowrate for switching pump on or off"; parameter Modelica.Units.SI.MassFlowRate deaBanFlo=0.1*m_flow_nominal "Deadband for critical point of flowrate"; parameter Real criPoiSpe=0.5 "Critical point of speed signal for switching on or off"; parameter Real deaBanSpe=0.3 "Deadband for critical point of speed signal"; parameter Modelica.Blocks.Types.SimpleController controllerType= Modelica.Blocks.Types.SimpleController.PI "Type of pump speed controller"; parameter Real k( final unit="1", final min=0)=1 "Gain of controller"; parameter Modelica.Units.SI.Time Ti(final min=Modelica.Constants.small) = 60 "Time constant of Integrator block"; parameter Modelica.Units.SI.Time Td(final min=0) = 0.1 "Time constant of Derivative block"; Modelica.Blocks.Interfaces.RealInput masFloPum( final unit="kg/s") "Total mass flowrate of chilled water pumps"; Modelica.Blocks.Interfaces.RealInput dpMea( final unit="Pa") "Measured pressure difference"; Modelica.Blocks.Interfaces.RealOutput y[numPum]( each final unit="1", each final min=0, each final max=1) "Pump speed signal"; Modelica.Blocks.Math.Product pumSpe[numPum] "Output pump speed"; Buildings.Applications.BaseClasses.Controls.VariableSpeedPumpStage pumStaCon( final tWai=tWai, final m_flow_nominal=m_flow_nominal, final minSpe=minSpe, final criPoiFlo=criPoiFlo, final deaBanFlo=deaBanFlo, final criPoiSpe=criPoiSpe, final deaBanSpe=deaBanSpe) "Chilled water pump staging control"; Buildings.Controls.OBC.CDL.Reals.PIDWithReset conPID( final controllerType=controllerType, final Ti=Ti, final k=k, final Td=Td) "PID controller of pump speed"; Modelica.Blocks.Sources.Constant dpSetSca(final k=1) "Scaled differential pressure setpoint"; Modelica.Blocks.Math.Gain gai(k=1/dpSetPoi) "Gain for mesaured dp value"; Modelica.Blocks.Math.RealToBoolean twoPum(threshold=1.5) "Two pumps are on"; Modelica.Blocks.Math.Sum totPum(final nin=numPum) "Total number of pumps on"; Modelica.Blocks.Interfaces.BooleanInput on "On signal of the plant"; Modelica.Blocks.Logical.Or orRes "Or block for controller reset"; protected final parameter Integer numPum=2 "Number of chilled water pumps"; equation connect(pumStaCon.masFloPum,masFloPum); connect(conPID.y,pumStaCon.speSig); connect(pumStaCon.y,pumSpe.u1); connect(conPID.y,pumSpe[1].u2); connect(conPID.y,pumSpe[2].u2); connect(dpSetSca.y,conPID.u_s); connect(dpMea, gai.u); connect(gai.y, conPID.u_m); connect(pumStaCon.y, totPum.u); connect(totPum.y, twoPum.u); connect(pumSpe.y, y); connect(on, pumStaCon.on); connect(twoPum.y, orRes.u2); connect(on, orRes.u1); connect(orRes.y, conPID.trigger); end ChilledWaterPumpSpeed;

Buildings.DHC.Plants.Cooling.Controls.ChillerStage Buildings.DHC.Plants.Cooling.Controls.ChillerStage

Chiller staging controller for plants with two chillers of the same size

Buildings.DHC.Plants.Cooling.Controls.ChillerStage

Information

This model implements the staging control logic as follows:


It is assumed that both chillers have the same capacity of QChi_nominal.

Note: This model can be used for plants with two chillers with or without waterside econimizer (WSE). For plants with WSE, extra control logic on top of this model needs to be added.

State graph.

Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.WaterService side medium
TimetWai Waiting time [s]
PowerQChi_nominal Nominal cooling capacity (negative) [W]
PowerstaUpThr-0.8*QChi_nominalStage up load threshold(from one to two chillers) [W]
PowerstaDowThr-0.6*QChi_nominalStage down load threshold(from two to one chiller) [W]

Connectors

TypeNameDescription
replaceable package MediumService side medium
input BooleanInputonEnabling signal of the plant. True: chiller should be enabled
input RealInputTChiWatRetChilled water return temperature
input RealInputTChiWatSupChilled water supply temperature
input RealInputmFloChiWatChilled water mass flow rate
output BooleanOutputy[2]On/off signal for the chillers - false: off; true: on

Modelica definition

model ChillerStage "Chiller staging controller for plants with two chillers of the same size" replaceable package Medium=Buildings.Media.Water constrainedby Modelica.Media.Interfaces.PartialMedium "Service side medium"; parameter Modelica.Units.SI.Time tWai "Waiting time"; parameter Modelica.Units.SI.Power QChi_nominal(final max=0) "Nominal cooling capacity (negative)"; parameter Modelica.Units.SI.Power staUpThr(final min=0) = -0.8*QChi_nominal "Stage up load threshold(from one to two chillers)"; parameter Modelica.Units.SI.Power staDowThr(final min=0) = -0.6*QChi_nominal "Stage down load threshold(from two to one chiller)"; inner Modelica.StateGraph.StateGraphRoot stateGraphRoot "State graph root"; Modelica.Blocks.Interfaces.BooleanInput on "Enabling signal of the plant. True: chiller should be enabled"; Modelica.Blocks.Interfaces.RealInput TChiWatRet "Chilled water return temperature"; Modelica.Blocks.Interfaces.RealInput TChiWatSup "Chilled water supply temperature"; Modelica.Blocks.Interfaces.RealInput mFloChiWat "Chilled water mass flow rate"; Modelica.Blocks.Interfaces.BooleanOutput y[2] "On/off signal for the chillers - false: off; true: on"; Modelica.StateGraph.InitialStep off(nIn=1, nOut=1) "No cooling is demanded"; Modelica.StateGraph.StepWithSignal oneOn( nOut=2, nIn=2) "Status of one chiller on"; Modelica.StateGraph.StepWithSignal twoOn(nOut=1, nIn=1) "Status of two chillers on"; Modelica.StateGraph.TransitionWithSignal offToOne( enableTimer=true, waitTime=tWai) "Condition of transition from off to one chiller on"; Modelica.StateGraph.TransitionWithSignal oneToTwo( enableTimer=true, waitTime=tWai) "Condition of transition from one chiller to two chillers"; Modelica.StateGraph.TransitionWithSignal twoToOne( enableTimer=true, waitTime=tWai) "Condition of transion from two chillers to one chiller"; Modelica.StateGraph.TransitionWithSignal oneToOff( enableTimer=true, waitTime=tWai) "Condition of transition from one chiller to off"; Buildings.Controls.OBC.CDL.Reals.Hysteresis thrOneToTwo(uLow=-staDowThr/ QChi_nominal, uHigh=-staUpThr/QChi_nominal) "Threshold of turning two chillers on"; Modelica.Blocks.Logical.Not thrTwoToOne "Threshold of turning off the second chiller"; Modelica.Blocks.Math.Add dT( final k1=-1, final k2=+1) "Temperature difference"; Modelica.Blocks.Math.Product pro "Product"; Modelica.Blocks.Math.Gain plr(final k=cp_default/QChi_nominal) "Specific heat multiplier to calculate heat flow rate"; Buildings.Controls.OBC.CDL.Logical.Or Or "On signal for either chiller"; Modelica.Blocks.Logical.Not notOn "on switches to false"; Modelica.Blocks.Logical.Or TwoToOne "Conditions that turn off the second chiller"; protected final parameter Medium.ThermodynamicState sta_default=Medium.setState_pTX( T=Medium.T_default, p=Medium.p_default, X=Medium.X_default) "Medium state at default properties"; final parameter Modelica.Units.SI.SpecificHeatCapacity cp_default= Medium.specificHeatCapacityCp(sta_default) "Specific heat capacity of the fluid"; equation connect(off.outPort[1],offToOne.inPort); connect(oneToTwo.outPort,twoOn.inPort[1]); connect(twoToOne.outPort,oneOn.inPort[2]); connect(oneOn.outPort[2],oneToOff.inPort); connect(oneOn.outPort[1],oneToTwo.inPort); connect(oneToTwo.condition,thrOneToTwo.y); connect(dT.y,pro.u1); connect(plr.u, pro.y); connect(plr.y, thrOneToTwo.u); connect(dT.u1,TChiWatRet); connect(TChiWatSup,dT.u2); connect(pro.u2,mFloChiWat); connect(oneToTwo.condition, thrTwoToOne.u); connect(oneOn.active, Or.u1); connect(twoOn.active, Or.u2); connect(Or.y, y[1]); connect(twoOn.active, y[2]); connect(on, notOn.u); connect(twoOn.outPort[1],twoToOne.inPort); connect(offToOne.outPort,oneOn.inPort[1]); connect(oneToOff.outPort,off.inPort[1]); connect(on, offToOne.condition); connect(thrTwoToOne.y, TwoToOne.u2); connect(notOn.y, TwoToOne.u1); connect(TwoToOne.y, twoToOne.condition); connect(notOn.y, oneToOff.condition); end ChillerStage;

Buildings.DHC.Plants.Cooling.Controls.FlowControl Buildings.DHC.Plants.Cooling.Controls.FlowControl

This block controls the flow at the primary and secondary pumps

Buildings.DHC.Plants.Cooling.Controls.FlowControl

Information

This block implements a state graph to control the flows of the storage plant. It receives two tank status Boolean signals indicating that the tank is charged or empty. These two signals can be both false indicating an in-between state. The block can receive one of the following commands:

  1. Charge tank,
  2. No command, and
  3. Discharge tank.

The command to tank may be disregarded. For example, if the tank is receiving a discharge command but it is already empty, it will not discharge which would let warm return water directly into the supply side.

The system transitions among the following states:

Step Description Transition in Transition out
All Off
(Initial Step)
All off. This is the initial step. - -
Local Charging Charge the tank with the local chiller. "Charge tank" command
AND tank is not charged yet
AND chiller is enabled.
This transition takes priority
over the one below.1
The in-transition condition becomes false.
Remote Charging Charge the tank with the remote chiller. Same as above except that
the chiller is not enabled.
The in-transition condition becomes false.
Secondary Pump On Turn on the secondary pump.
This step is in parallel with the two below.2
The district has load AND
the additional conditions of
either step below become true.
Both steps below are no longer active (implicit).
Tank Producing The tank produces CHW to the district.
This step is in parallel with "secondary pump on".
The district has load AND
"Discharge tank" command AND
tank not empty.
This transition takes priority
over the one below.
To "chiller producing": The in-transition condition becomes false AND
The chiller is enabled.
This transition takes priority over the one below.
To initial step: No load OR the in-transition conditions
of "tank producing" and "chiller producing" are both false
(i.e. neither tank or chiller is available).
Chiller Producing The chiller produces CHW to the district.
This step is in parallel with "secondary pump on".
The district has load AND
the chiller is enabled.
To "tank producing": The condition for in-transition of
"tank producing" becomes true.
This transition takes priority over the one below.
To initial step: No load OR the in-transition conditions
of "tank producing" and "chiller producing" are both false.

Notes:

  1. Out-transitions from the same step have priorities. When the conditions of more than one of them become true, the transition connected by a connector with the lowest index in the array fires. For example, even when the in-transition condition of "chiller producing" becomes true, as long as the in-transition condition of "tank producing" is also true, the latter fires because of priority.
  2. Steps that are in parallel are and must be active at the same time. When "secondary pump on" is active, either "tank producing" or "chiller producing" is also active.

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

Parameters

TypeNameDefaultDescription
Nominal values
MassFlowRatemChi_flow_nominal Nominal mass flow rate of the chiller loop [kg/s]
MassFlowRatemTan_flow_nominal Nominal mass flow rate of the tank branch [kg/s]
Dynamics
Filter
Booleanuse_outFiltrue= true, if output is filtered with a 2nd order CriticalDamping filter

Connectors

TypeNameDescription
input IntegerInputcomCommand: 1 = charge tank, 2 = no command, 3 = discharge tank
input BooleanInputchiEnaStaChiller enable status, true if chiller is enabled
input BooleanInputhasLoaSet to true if there is a load
input RealInputyPumNormalized speed signal for the secondary pump [1]
output RealOutputyValValve normalized mass flow rate
output RealOutputmPriPum_flowPrimary pump mass flow rate [kg/s]
output RealOutputySecPumSecondary pump normalized speed [1]
input BooleanInputtanSta[2]Tank status - 1: is empty; 2: is charged; can be both false
output BooleanOutputisChaRemIs operated for remote charging

Modelica definition

block FlowControl "This block controls the flow at the primary and secondary pumps" extends Modelica.Blocks.Icons.Block; parameter Modelica.Units.SI.MassFlowRate mChi_flow_nominal "Nominal mass flow rate of the chiller loop"; parameter Modelica.Units.SI.MassFlowRate mTan_flow_nominal "Nominal mass flow rate of the tank branch"; parameter Boolean use_outFil=true "= true, if output is filtered with a 2nd order CriticalDamping filter"; Modelica.Blocks.Interfaces.IntegerInput com "Command: 1 = charge tank, 2 = no command, 3 = discharge tank"; Modelica.Blocks.Interfaces.BooleanInput chiEnaSta "Chiller enable status, true if chiller is enabled"; Modelica.Blocks.Interfaces.BooleanInput hasLoa "Set to true if there is a load"; Modelica.Blocks.Interfaces.RealInput yPum(final unit="1") "Normalized speed signal for the secondary pump"; Modelica.Blocks.Interfaces.RealOutput yVal "Valve normalized mass flow rate"; Modelica.Blocks.Interfaces.RealOutput mPriPum_flow(final unit="kg/s") "Primary pump mass flow rate"; Modelica.Blocks.Interfaces.RealOutput ySecPum(final unit="1") "Secondary pump normalized speed"; inner Modelica.StateGraph.StateGraphRoot stateGraphRoot "State graph root"; Modelica.StateGraph.InitialStep allOff(nOut=1, nIn=1) "Initial step, all off"; Modelica.StateGraph.Transition traChaLoc(condition=com == 1 and (not tanSta[2]) and chiEnaSta) "Transition: Charge tank command AND tank not charged AND chiller enabled"; Modelica.StateGraph.Step steChaLoc(nIn=1, nOut=1) "Step: Local charging"; Modelica.StateGraph.Transition traRes1(condition=not traChaLoc.condition) "Transition: Reset to initial step"; Modelica.StateGraph.Transition traChaRem(condition=com == 1 and (not tanSta[2]) and not chiEnaSta) "Transition: Charge tank command AND tank not charged AND chiller not enabled"; Modelica.StateGraph.Step steChaRem(nIn=1, nOut=1) "Step: Remote charging"; Modelica.StateGraph.Transition traRes2(condition=not traChaRem.condition) "Transition: Reset to initial step"; Modelica.StateGraph.Transition traProChi(condition=chiEnaSta) "Transition: Chiller enabled"; Modelica.StateGraph.Step steProChi(nIn=2, nOut=2) "Step: Chiller produces CHW"; Modelica.StateGraph.Transition traRes4(condition=not traPro.condition) "Transition: Reset to initial step"; Modelica.StateGraph.Transition traProTan(condition=com == 3 and (not tanSta[1])) "Transition: Tank commanded to discharge AND is not empty"; Modelica.StateGraph.Step steProTan(nIn=2, nOut=2) "Step: Tank produces CHW"; Modelica.StateGraph.Transition traRes3(condition=not traPro.condition) "Transition: Reset to initial step"; Modelica.Blocks.Sources.BooleanExpression expPriPumFlo( y=steChaLoc.active or steProChi.active) "Expression for local charging OR chiller output"; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal swiPriPum(realTrue= mChi_flow_nominal, realFalse=0) "Switch for primary pump flow"; Modelica.Blocks.Sources.BooleanExpression expSecPum(y=stePumSecOn.active) "Expression for tank output or chiller output"; Modelica.Blocks.Sources.BooleanExpression expVal(y=steChaRem.active) "Boolean expression for remotely charging the tank"; Modelica.StateGraph.Alternative alt(nBranches=3) "Alternative: Tank charging or plant outputting CHW"; Buildings.Controls.OBC.CDL.Reals.Switch swiSecPum "Switch for secondary pump flow"; Modelica.Blocks.Sources.Constant zer(final k=0) "Constant zero"; Buildings.Controls.OBC.CDL.Conversions.BooleanToReal swiVal(realTrue= mTan_flow_nominal, realFalse=0) "Switch for valve flow"; Modelica.Blocks.Interfaces.BooleanInput tanSta[2] "Tank status - 1: is empty; 2: is charged; can be both false"; Modelica.StateGraph.Step stePumSecOn(nOut=1, nIn=1) "Step: Secondary pump on"; Modelica.StateGraph.Transition traPro(condition=hasLoa and (traProTan.condition or traProChi.condition)) "Transition: Has load and the plant can produce CHW via either the chiller or the tank"; Modelica.StateGraph.Parallel parallel(nBranches=2) "Parallel states of the components in the primary and secondary loops"; Modelica.StateGraph.Transition traTanToChi(condition=(not traProTan.condition) and traProChi.condition) "Transition: Tank no longer available (empty or commanded off) AND chiller available"; Modelica.StateGraph.Alternative altTanCha1(nBranches=2) "Alternative: Tank charging locally or remotely"; Modelica.StateGraph.Step steRou1(nIn=1, nOut=1) "A step for routing only"; Modelica.StateGraph.Step steRou2(nIn=1, nOut=1) "A step for routing only"; Modelica.StateGraph.Transition traRou(final condition=true) "A routing transition, always true"; Modelica.StateGraph.Transition traChiToTan(condition=traProTan.condition) "Transition: Production priority handed to tank whenever possible"; Modelica.Blocks.Interfaces.BooleanOutput isChaRem "Is operated for remote charging"; Modelica.Blocks.Sources.BooleanExpression booleanExpression(y=steChaRem.active); equation connect(traChaLoc.outPort,steChaLoc. inPort[1]); connect(steChaLoc.outPort[1], traRes1.inPort); connect(traChaRem.outPort,steChaRem. inPort[1]); connect(steChaRem.outPort[1], traRes2.inPort); connect(traProChi.outPort,steProChi. inPort[1]); connect(traProTan.outPort,steProTan. inPort[1]); connect(expPriPumFlo.y, swiPriPum.u); connect(alt.inPort, allOff.outPort[1]); connect(alt.outPort, allOff.inPort[1]); connect(mPriPum_flow, swiPriPum.y); connect(expSecPum.y, swiSecPum.u2); connect(swiSecPum.u1, yPum); connect(ySecPum, swiSecPum.y); connect(zer.y, swiSecPum.u3); connect(swiVal.u, expVal.y); connect(swiVal.y, yVal); connect(traPro.outPort, parallel.inPort); connect(parallel.split[1], stePumSecOn.inPort[1]); connect(stePumSecOn.outPort[1], parallel.join[1]); connect(traTanToChi.outPort, steProChi.inPort[2]); connect(traProTan.inPort, altTanCha1.split[1]); connect(traRes3.outPort, altTanCha1.join[1]); connect(traProChi.inPort, altTanCha1.split[2]); connect(traRes4.outPort, altTanCha1.join[2]); connect(steRou1.outPort[1], altTanCha1.inPort); connect(altTanCha1.outPort,steRou2. inPort[1]); connect(steRou1.inPort[1], parallel.split[2]); connect(steRou2.outPort[1], parallel.join[2]); connect(parallel.outPort, traRou.inPort); connect(traChaLoc.inPort, alt.split[1]); connect(traChaRem.inPort, alt.split[2]); connect(traRes1.outPort, alt.join[1]); connect(traRes2.outPort, alt.join[2]); connect(traPro.inPort, alt.split[3]); connect(traRou.outPort, alt.join[3]); connect(booleanExpression.y, isChaRem); connect(traChiToTan.outPort, steProTan.inPort[2]); connect(steProChi.outPort[1], traChiToTan.inPort); connect(steProChi.outPort[2], traRes4.inPort); connect(steProTan.outPort[1], traTanToChi.inPort); connect(steProTan.outPort[2], traRes3.inPort); end FlowControl;

Buildings.DHC.Plants.Cooling.Controls.SelectMin Buildings.DHC.Plants.Cooling.Controls.SelectMin

Block that includes or excludes storage plant pressure signal for min

Buildings.DHC.Plants.Cooling.Controls.SelectMin

Information

This block finds the minimum value from pressure head signals. The signal from the storage plant is included only when the plant is in remote charging mode.

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

Connectors

TypeNameDescription
input RealInputdpUse[nin]Connector of Real input signals
input RealInputdpStoPlaConnector of Real input signals
input BooleanInputisChaRemThe storage plant is in remote charging mode
output RealOutputy 

Modelica definition

block SelectMin "Block that includes or excludes storage plant pressure signal for min" extends Modelica.Blocks.Icons.Block; parameter Integer nin "Number of input connections"; Buildings.Controls.OBC.CDL.Interfaces.RealInput dpUse[nin] "Connector of Real input signals"; Buildings.Controls.OBC.CDL.Interfaces.RealInput dpStoPla "Connector of Real input signals"; Modelica.Blocks.Interfaces.BooleanInput isChaRem "The storage plant is in remote charging mode"; Modelica.Blocks.Interfaces.RealOutput y; equation y = if isChaRem then min(min(dpUse),dpStoPla) else min(dpUse); end SelectMin;

Buildings.DHC.Plants.Cooling.Controls.TankStatus Buildings.DHC.Plants.Cooling.Controls.TankStatus

Returns the tank status from its temperature sensors

Buildings.DHC.Plants.Cooling.Controls.TankStatus

Information

This model outputs tank status signals using the temperatures at the CHW tank top and the tank bottom as input. The status has two separate boolean signals indicating whether the tank is charged or empty (of cooling). The two output signals can be both false, indicating an in-between state, but they can never both be true.

Parameters

TypeNameDefaultDescription
TemperatureTHig Higher threshold to consider the tank empty [K]
TemperatureTLow Lower threshold to consider the tank full [K]
TemperatureDifferencedTHys0.5Deadband for hysteresis [K]

Connectors

TypeNameDescription
input RealInputTTan[2]Temperatures at the tank 1: top; and 2: bottom [K]
output BooleanOutputy[2]Tank status - y[1]=true is empty; y[2] = true is charged; both false means partially charged

Modelica definition

block TankStatus "Returns the tank status from its temperature sensors" parameter Modelica.Units.SI.Temperature THig "Higher threshold to consider the tank empty"; parameter Modelica.Units.SI.Temperature TLow "Lower threshold to consider the tank full"; parameter Modelica.Units.SI.TemperatureDifference dTHys(min=0.1) = 0.5 "Deadband for hysteresis"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TTan[2]( each final quantity="Temperature", each final unit="K", each displayUnit="degC") "Temperatures at the tank 1: top; and 2: bottom"; Buildings.Controls.OBC.CDL.Reals.Hysteresis hysCha( final uLow=TLow, final uHigh=TLow + dTHys) "Hysteresis, tank charged"; Buildings.Controls.OBC.CDL.Reals.Hysteresis hysEmp( final uHigh=THig, final uLow=THig - dTHys) "Hysteresis, tank empty"; Buildings.Controls.OBC.CDL.Logical.Not not1 "Not block"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y[2] "Tank status - y[1]=true is empty; y[2] = true is charged; both false means partially charged"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant TTanTopChe( final k(final unit="K", displayUnit="degC") = THig) "Set point for top temperatuer of tank"; Buildings.Controls.OBC.CDL.Reals.Sources.Constant TTanBotChe( final k(final unit="K", displayUnit="degC") = TLow) "Set point for bottom temperature of tank"; Buildings.Controls.OBC.CDL.Reals.Greater gre "Test for temperature set points"; Buildings.Controls.OBC.CDL.Utilities.Assert assMes( message = "THig must be greater than TLow.") "Assertion if temperature set points are not correct"; equation connect(hysCha.y, not1.u); connect(TTan[1],hysCha. u); connect(TTan[2],hysEmp. u); connect(hysEmp.y, y[1]); connect(not1.y, y[2]); connect(TTanTopChe.y, gre.u1); connect(TTanBotChe.y, gre.u2); connect(gre.y, assMes.u); end TankStatus;