Buildings.DHC.Loads.BaseClasses.Controls

Package of control sequences for DHC systems

Information

This package contains control sequences used in district heating and cooling systems.

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

Package Content

Name Description
Buildings.DHC.Loads.BaseClasses.Controls.MixingValveControl MixingValveControl Mixing valve controller
Buildings.DHC.Loads.BaseClasses.Controls.Validation Validation Collection of validation models

Buildings.DHC.Loads.BaseClasses.Controls.MixingValveControl Buildings.DHC.Loads.BaseClasses.Controls.MixingValveControl

Mixing valve controller

Buildings.DHC.Loads.BaseClasses.Controls.MixingValveControl

Information


This model implements a generic controller for a three-way mixing valve. Three operating modes are supported:

See Buildings.DHC.Loads.BaseClasses.Controls.Validation.MixingValveControl for a simulation with change-over.

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

Parameters

TypeNameDefaultDescription
DistributionTypetypDisType_dis.HeatingWaterType of distribution system
Realk0.1Gain of controller [1]
TimeTi10Time constant of integrator block [s]

Connectors

TypeNameDescription
input RealInputTSupSetSupply temperature set point [K]
input IntegerInputmodChaOveOperating mode in change-over (1 for heating, 2 for cooling)
input RealInputTSupMesSupply temperature (measured) [K]
output RealOutputyValValve control signal [1]

Modelica definition

block MixingValveControl "Mixing valve controller" extends Modelica.Blocks.Icons.Block; import Type_dis=Buildings.DHC.Loads.BaseClasses.Types.DistributionType "Types of distribution system"; parameter Type_dis typDis=Type_dis.HeatingWater "Type of distribution system"; parameter Real k( final min=0, final unit="1")=0.1 "Gain of controller"; parameter Modelica.Units.SI.Time Ti(final min=Modelica.Constants.small) = 10 "Time constant of integrator block"; // IO CONNECTORS Modelica.Blocks.Interfaces.RealInput TSupSet( final unit="K", displayUnit="degC") "Supply temperature set point"; Modelica.Blocks.Interfaces.IntegerInput modChaOve if typDis == Type_dis.ChangeOver "Operating mode in change-over (1 for heating, 2 for cooling)"; Modelica.Blocks.Interfaces.RealInput TSupMes( final unit="K", displayUnit="degC") "Supply temperature (measured)"; Modelica.Blocks.Interfaces.RealOutput yVal( final unit="1") "Valve control signal"; // COMPONENTS Buildings.Controls.OBC.CDL.Reals.Sources.Constant zer( k=0) "Zero constant"; Modelica.Blocks.Math.IntegerToBoolean toBoo( threshold=2) if typDis == Type_dis.ChangeOver "Conversion to boolean (true if cooling mode)"; Buildings.Controls.OBC.CDL.Reals.PIDWithReset resConTSup( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI, final k=k, final Ti=Ti, final yMax=1, final yMin=-1, final reverseActing=true, final y_reset=0) if typDis == Type_dis.ChangeOver "PI controller tracking supply temperature"; Buildings.Controls.OBC.CDL.Reals.PID conTSup( controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI, final k=k, final Ti=Ti, final yMax=1, final yMin=-1, final reverseActing=true) if typDis <> Type_dis.ChangeOver "PI controller tracking supply temperature"; Buildings.Controls.OBC.CDL.Reals.Min negPar "Negative part of control signal"; Buildings.Controls.OBC.CDL.Reals.Max posPar "Positive part of control signal"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter opp(k=-1) "Opposite value"; Buildings.Controls.OBC.CDL.Reals.Switch swi "Logical switch"; Modelica.Blocks.Sources.BooleanExpression fixMod( final y=typDis == Type_dis.ChilledWater) if typDis <> Type_dis.ChangeOver "Fixed operating mode"; Buildings.Controls.OBC.CDL.Integers.Change cha if typDis == Type_dis.ChangeOver "Evaluate the integer input u to check if its value changes"; equation connect(modChaOve,toBoo.u); connect(toBoo.y,swi.u2); connect(fixMod.y,swi.u2); connect(resConTSup.y,posPar.u2); connect(zer.y,posPar.u1); connect(zer.y,negPar.u1); connect(resConTSup.y,negPar.u2); connect(negPar.y,opp.u); connect(resConTSup.u_s,TSupSet); connect(TSupMes,resConTSup.u_m); connect(swi.y,yVal); connect(modChaOve,cha.u); connect(cha.y,resConTSup.trigger); connect(opp.y,swi.u1); connect(posPar.y,swi.u3); connect(TSupSet,conTSup.u_s); connect(TSupMes,conTSup.u_m); connect(conTSup.y,negPar.u2); connect(conTSup.y,posPar.u2); end MixingValveControl;