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,
uTri=0.8,
yDec=-0.03,
yInc=0.03,
samplePeriod=120);
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(
V_start=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);
equation
connect(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(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(linPieTwo.y[1], gain.u);
connect(limPID.y, triAndRes.u);
connect(triAndRes.y, linPieTwo.u);
end ChillerSetPointControl;