This package contains examples for the use of models that can be found in Buildings.Examples.ChillerPlant.BaseClasses.Controls.
Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).
Name | Description |
---|---|
ChillerSwitch | Test model for ChillerSwtich |
ChillerSetPointControl | Test model for chiller setpoint control using TrimAndResponse and LinearPieceWiseTwo |
KMinusU | Test model for KMinusU |
LinearPiecewiseTwo | Test model for LinearPiecewiseTwo |
RequestCounter | Test model for RequestCounter |
TrimAndRespond | Test model for TrimAndRespond |
WSEControl | Test model for WSEControl |
ZeroOrderHold | Test model for ZeroOrderHold |
model ChillerSwitch "Test model for ChillerSwtich" extends Modelica.Icons.Example;Modelica.Blocks.Sources.Sine TSet( freqHz=0.0002, offset=12, amplitude=8); Modelica.Blocks.Sources.Sine CHWST( freqHz=0.0001, amplitude=5, offset=15); Buildings.Examples.ChillerPlant.BaseClasses.Controls.ChillerSwitch chiSwi( deaBan(displayUnit="K") = 3); equationconnect(TSet.y, chiSwi.TSet); connect(CHWST.y, chiSwi.chiCHWST); end ChillerSwitch;
Type | Name | Default | Description |
---|---|---|---|
MassFlowRate | mAir_flow_nominal | 61.6*2 | Nominal mass flow rate at fan [kg/s] |
Real | COPc_nominal | 3 | Chiller COP |
MassFlowRate | mCHW_flow_nominal | 15.2 | Nominal mass flow rate at chilled water [kg/s] |
MassFlowRate | mCW_flow_nominal | mCHW_flow_nominal/COPc_nomin... | Nominal mass flow rate at condenser water [kg/s] |
Real | QRoo | 100 |
model ChillerSetPointControl "Test model for chiller setpoint control using TrimAndResponse and LinearPieceWiseTwo" extends Modelica.Icons.Example; package Medium1 = Buildings.Media.ConstantPropertyLiquidWater; package Medium2 = Buildings.Media.ConstantPropertyLiquidWater; package MediumAir = Buildings.Media.GasesPTDecoupled.SimpleAir "Medium model"; parameter Modelica.SIunits.MassFlowRate mAir_flow_nominal=61.6*2 "Nominal mass flow rate at fan"; parameter Real COPc_nominal=3 "Chiller COP"; parameter Modelica.SIunits.MassFlowRate mCHW_flow_nominal=15.2 "Nominal mass flow rate at chilled water"; parameter Modelica.SIunits.MassFlowRate mCW_flow_nominal=mCHW_flow_nominal/ COPc_nominal*(COPc_nominal + 1) "Nominal mass flow rate at condenser water"; parameter Real QRoo=100;Buildings.Examples.ChillerPlant.BaseClasses.Controls.TrimAndRespond triAndRes( yEqu0=0.1, yMax=1, yMin=0, nActDec=0, nActInc=1, n=1, uTri=0.8, tSam=120, yDec=-0.03, yInc=0.03); Buildings.Examples.ChillerPlant.BaseClasses.Controls.LinearPiecewiseTwo linPieTwo( x0=0, x2=1, y20=273.15 + 12.78, y21=273.15 + 7.22, x1=0.5, y10=0.1, y11=1); Buildings.Fluid.Chillers.ElectricEIR chi( dp1_nominal=6000, redeclare package Medium1 = Medium1, redeclare package Medium2 = Medium2, m1_flow_nominal=mCW_flow_nominal, m2_flow_nominal=mCHW_flow_nominal, dp2_nominal=3000, per=Buildings.Fluid.Chillers.Data.ElectricEIR.ElectricEIRChiller_York_YK_1881kW_6_53COP_Vanes(), m1_flow(fixed=true, start=mCW_flow_nominal), m2_flow(fixed=true, start=mCHW_flow_nominal), energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial, massDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial); Buildings.Fluid.HeatExchangers.ConstantEffectiveness coi( redeclare package Medium1 = Medium2, m1_flow_nominal=mCHW_flow_nominal, dp1_nominal=3000, dp2_nominal=3000, redeclare package Medium2 = MediumAir, m2_flow_nominal=mAir_flow_nominal, eps=1.0); Buildings.Fluid.Sources.FixedBoundary sin1(redeclare package Medium = Medium1, nPorts=1); Buildings.Fluid.Sources.MassFlowSource_T sou1( redeclare package Medium = Medium1, nPorts=1, use_T_in=false, m_flow=mCW_flow_nominal, T=283.15); inner Modelica.Fluid.System system; Modelica.Blocks.Sources.Constant const(k=273.15 + 20); Buildings.Controls.Continuous.LimPID limPID( reverseAction=true, y_start=1, yMin=0, k=10, Ti=0.01, Td=10); Buildings.Fluid.Sensors.TemperatureTwoPort TRet( redeclare package Medium = MediumAir, m_flow_nominal=999); Buildings.Fluid.Movers.FlowMachine_m_flow pum( m_flow_nominal=1.2*mCHW_flow_nominal, dp(start=40474), redeclare package Medium = Medium2, init=Modelica.Blocks.Types.Init.NoInit) "Chilled water pump"; Buildings.Fluid.Storage.ExpansionVessel expVesChi(VTot=1, redeclare package Medium = Medium2); Modelica.Blocks.Sources.BooleanConstant booleanConstant1(k=true); Modelica.Blocks.Math.Gain gain(k=mCHW_flow_nominal); Buildings.Fluid.Sources.MassFlowSource_T sou2( use_T_in=true, redeclare package Medium = MediumAir, m_flow=mAir_flow_nominal, T=291.15, nPorts=1); Buildings.Fluid.Sources.FixedBoundary sin2(redeclare package Medium = MediumAir, nPorts=1); Modelica.Blocks.Sources.Sine sine( amplitude=5, offset=273.15 + 25, freqHz=1/20000); Modelica.Blocks.Continuous.FirstOrder firstOrder1(y_start=273.15 + 10, T=chi.tau1 /2); Buildings.Fluid.Sensors.TemperatureTwoPort TSup( redeclare package Medium = MediumAir, m_flow_nominal=999); equationconnect(sou1.ports[1], chi.port_a1); connect(coi.port_a1, chi.port_b2); connect(TRet.T, limPID.u_m); connect(chi.port_a2, pum.port_b); connect(pum.port_a, coi.port_b1); connect(chi.port_a2, expVesChi.port_a); connect(booleanConstant1.y, chi.on); connect(gain.y, pum.m_flow_in); connect(sou2.T_in, sine.y); connect(chi.port_b1, sin1.ports[1]); connect(triAndRes.y, linPieTwo.u); connect(limPID.y, triAndRes.u[1]); connect(const.y, limPID.u_s); connect(TRet.port_b, coi.port_b2); connect(TRet.port_a, sin2.ports[1]); connect(linPieTwo.y[2], firstOrder1.u); connect(firstOrder1.y, chi.TSet); connect(coi.port_a2, TSup.port_a); connect(TSup.port_b, sou2.ports[1]); connect(booleanConstant1.y, triAndRes.sta); connect(linPieTwo.y[1], gain.u); end ChillerSetPointControl;
model KMinusU "Test model for KMinusU" extends Modelica.Icons.Example;Modelica.Blocks.Sources.Sine pulse( freqHz=0.001, amplitude=0.5, offset=0.5, phase=-1.5707963267949); Buildings.Examples.ChillerPlant.BaseClasses.Controls.KMinusU kMinU(k=1); equationconnect(pulse.y, kMinU.u); end KMinusU;
model LinearPiecewiseTwo "Test model for LinearPiecewiseTwo" extends Modelica.Icons.Example;Modelica.Blocks.Sources.Sine pulse( freqHz=0.001, amplitude=0.5, offset=0.5, phase=-1.5707963267949); Buildings.Examples.ChillerPlant.BaseClasses.Controls.LinearPiecewiseTwo linPieTwo( x0=0, x1=0.5, x2=1, y10=5, y11=15, y20=55, y21=42); equationconnect(pulse.y, linPieTwo.u); end LinearPiecewiseTwo;
model RequestCounter "Test model for RequestCounter" extends Modelica.Icons.Example;Buildings.Examples.ChillerPlant.BaseClasses.Controls.RequestCounter reqCou( nAct=3, uTri=0.8); Modelica.Blocks.Sources.Constant act3(k=0.95); Modelica.Blocks.Sources.Pulse act1(period=10); Modelica.Blocks.Sources.Sine act2(freqHz=0.3, offset=1); equationconnect(act1.y, reqCou.uAct[1]); connect(act2.y, reqCou.uAct[2]); connect(act3.y, reqCou.uAct[3]); end RequestCounter;
model TrimAndRespond "Test model for TrimAndRespond" extends Modelica.Icons.Example;Modelica.Blocks.Sources.Sine act3(freqHz=0.002, offset=0.2); Modelica.Blocks.Sources.Pulse act1(period=500); Modelica.Blocks.Sources.Sine act2(freqHz=0.001, offset=0.3); Buildings.Examples.ChillerPlant.BaseClasses.Controls.TrimAndRespond triAndRes( n=3, uTri=0.9, yEqu0=0.1, yMax=1, yMin=0, nActDec=0, nActInc=1, yDec=-0.01, yInc=0.02, tSam=20); Modelica.Blocks.Sources.BooleanPulse equSta(width=50, period=5000); equationconnect(act1.y, triAndRes.u[1]); connect(act2.y, triAndRes.u[2]); connect(act3.y, triAndRes.u[3]); connect(triAndRes.sta, equSta.y); end TrimAndRespond;
model WSEControl "Test model for WSEControl" extends Modelica.Icons.Example;Modelica.Blocks.Sources.Pulse wseCHWST( period=300, amplitude=15, offset=273.15 + 5) "WSE chilled water supply temperature"; Modelica.Blocks.Sources.Constant wseCWST(k=273.15 + 10) "WSE condenser water supply temperature"; Buildings.Examples.ChillerPlant.BaseClasses.Controls.WSEControl wseCon; Modelica.Blocks.Sources.Constant TWetBub(k=273.15 + 5) "Wet bulb temperature"; Modelica.Blocks.Sources.Constant TTowApp(k=5) "Cooling tower approach"; equationconnect(TWetBub.y, wseCon.TWetBul); connect(TTowApp.y, wseCon.towTApp); connect(wseCHWST.y, wseCon.wseCHWST); connect(wseCWST.y, wseCon.wseCWST); end WSEControl;
model ZeroOrderHold "Test model for ZeroOrderHold" extends Modelica.Icons.Example;Buildings.Examples.ChillerPlant.BaseClasses.Controls.ZeroOrderHold zeoOrdHol( samplePeriod=50); Modelica.Blocks.Sources.BooleanPulse booPul(period=200); equationconnect(booPul.y, zeoOrdHol.u); end ZeroOrderHold;