Buildings.Experimental.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.Experimental.DHC.Loads.BaseClasses.Controls.MixingValveControl MixingValveControl Mixing valve controller
Buildings.Experimental.DHC.Loads.BaseClasses.Controls.Validation Validation Collection of validation models

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

Mixing valve controller

Buildings.Experimental.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.Experimental.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.Experimental.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.Continuous.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.Continuous.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.Continuous.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.Continuous.Min negPar "Negative part of control signal"; Buildings.Controls.OBC.CDL.Continuous.Max posPar "Positive part of control signal"; Buildings.Controls.OBC.CDL.Continuous.MultiplyByParameter opp(k=-1) "Opposite value"; Buildings.Controls.OBC.CDL.Continuous.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;