model ElectricChillerParallel
extends Modelica.Icons.Example;
package Medium=
Buildings.Media.Water
;
replaceable parameter Buildings.Fluid.Chillers.Data.ElectricEIR.ElectricEIRChiller_York_YT_1055kW_5_96COP_Vanes
perChi
;
parameter Modelica.Units.SI.MassFlowRate mCHW_flow_nominal=18.3
;
parameter Modelica.Units.SI.MassFlowRate mCW_flow_nominal=34.7
;
parameter Modelica.Units.SI.PressureDifference dpCHW_nominal=44.8*1000
;
parameter Modelica.Units.SI.PressureDifference dpCW_nominal=46.2*1000
;
parameter Modelica.Units.SI.Power QChi_nominal=mCHW_flow_nominal*4200*(6.67
- 18.56) ;
parameter Modelica.Units.SI.MassFlowRate mMin_flow=mCHW_flow_nominal*0.1
;
parameter Modelica.Units.SI.TemperatureDifference dTApp=3
;
parameter Modelica.Units.SI.Power PFan_nominal=5000 ;
parameter Modelica.Units.SI.Temperature TCHWSet=273.15 + 8
;
parameter Modelica.Units.SI.Time tWai=30 ;
parameter Buildings.Fluid.Movers.Data.Generic perCHWPum(
pressure=
Buildings.Fluid.Movers.BaseClasses.Characteristics.flowParameters(
V_flow=mCHW_flow_nominal/1000*{0.2,0.6,0.8,1.0},
dp=(dpCHW_nominal+18000+30000)*{1,0.8,0.6,0.2}))
;
parameter Buildings.Fluid.Movers.Data.Generic perCWPum(
pressure=
Buildings.Fluid.Movers.BaseClasses.Characteristics.flowParameters(
V_flow=mCW_flow_nominal/1000*{0.2,0.6,1.0,1.2},
dp=(2*dpCW_nominal+60000+6000)*{1,0.8,0.6,0.2}))
;
parameter Modelica.Units.SI.Pressure dpCHWPumVal_nominal=6000
;
parameter Modelica.Units.SI.Pressure dpCWPumVal_nominal=6000
;
parameter Modelica.Units.SI.PressureDifference dpCooTowVal_nominal=6000
;
replaceable Buildings.DHC.Plants.Cooling.ElectricChillerParallel pla(
perChi=perChi,
dTApp=dTApp,
perCHWPum=perCHWPum,
perCWPum=perCWPum,
mCHW_flow_nominal=mCHW_flow_nominal,
dpCHW_nominal=dpCHW_nominal,
QChi_nominal=QChi_nominal,
mMin_flow=mMin_flow,
mCW_flow_nominal=mCW_flow_nominal,
dpCW_nominal=dpCW_nominal,
TAirInWB_nominal=298.7,
TCW_nominal=308.15,
dT_nominal=5.56,
TMin=288.15,
PFan_nominal=PFan_nominal,
dpCooTowVal_nominal=dpCooTowVal_nominal,
dpCHWPumVal_nominal=dpCHWPumVal_nominal,
dpCWPumVal_nominal=dpCWPumVal_nominal,
tWai=tWai,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
;
Buildings.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(
final computeWetBulbTemperature=true,
filNam=
Modelica.Utilities.Files.loadResource(
"modelica://Buildings/Resources/weatherdata/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos"))
;
Modelica.Blocks.Sources.BooleanConstant on
;
Modelica.Blocks.Sources.Constant TCHWSupSet(
k=TCHWSet)
;
Fluid.MixingVolumes.MixingVolume vol(
nPorts=2,
redeclare package Medium=Medium,
m_flow_nominal=pla.numChi*mCHW_flow_nominal,
V=0.5,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
;
Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow fixHeaFlo(
T_ref=293.15)
;
Fluid.FixedResistances.PressureDrop res(
redeclare package Medium = Medium,
m_flow_nominal=pla.numChi*mCHW_flow_nominal,
dp_nominal(displayUnit="kPa") = 60000)
;
Modelica.Blocks.Sources.Sine loaVar(
amplitude=913865,
f=1/126900,
offset=913865,
startTime(displayUnit="h") = 21600) ;
equation
connect(fixHeaFlo.port,vol.heatPort);
connect(vol.ports[1], res.port_a);
connect(res.port_b, pla.port_aSerCoo);
connect(on.y,pla.on);
connect(weaDat.weaBus,pla.weaBus);
connect(fixHeaFlo.Q_flow,loaVar. y);
connect(pla.port_bSerCoo, vol.ports[2]);
connect(pla.TCHWSupSet, TCHWSupSet.y);
end ElectricChillerParallel;
The source blocks give the system the following operation schedule during
simulation:
model StoragePlantDualSource
extends Modelica.Icons.Example;
package Medium =
Buildings.Media.Water ;
parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=1
;
parameter Modelica.Units.SI.MassFlowRate mTan_flow_nominal=1
;
parameter Modelica.Units.SI.MassFlowRate mChi_flow_nominal=1
;
parameter Modelica.Units.SI.PressureDifference dp_nominal(
final displayUnit="Pa")=
300000
;
parameter Modelica.Units.SI.Temperature T_CHWR_nominal(
final displayUnit="degC")=
12+273.15
;
parameter Modelica.Units.SI.Temperature T_CHWS_nominal(
final displayUnit="degC")=
7+273.15
;
Buildings.Fluid.Sources.PropertySource_T chi1(
redeclare final package Medium = Medium,
final use_T_in=true) ;
Modelica.Blocks.Sources.Constant TSet1(k=T_CHWS_nominal)
;
Buildings.Fluid.Movers.Preconfigured.SpeedControlled_y pumSup1(
redeclare final package Medium = Medium,
final addPowerToMedium=false,
final m_flow_nominal=m_flow_nominal,
final dp_nominal=dp_nominal) ;
Buildings.Controls.Continuous.LimPID conPI_pumChi1(
final controllerType=Modelica.Blocks.Types.SimpleController.PI,
k=0.2,
Ti=10,
final reverseActing=true) ;
Buildings.DHC.Plants.Cooling.Controls.SelectMin selMin_dp(nin=3)
;
Buildings.DHC.Plants.Cooling.StoragePlant stoPla(
redeclare final package
Medium = Medium,
mTan_flow_nominal=mTan_flow_nominal,
mChi_flow_nominal=mChi_flow_nominal,
dpPum_nominal=dp_nominal,
dpVal_nominal=0.5*dp_nominal,
T_CHWS_nominal=T_CHWS_nominal,
T_CHWR_nominal=T_CHWR_nominal) ;
Buildings.Fluid.Sources.Boundary_pT bou(
p(
final displayUnit="Pa") = 101325 + dp_nominal,
redeclare final package Medium = Medium,
nPorts=1) ;
Buildings.Fluid.Sources.PropertySource_T chi2(
redeclare final package Medium = Medium,
final use_T_in=true) ;
Modelica.Blocks.Sources.Constant TSet2(
final k=T_CHWS_nominal)
;
Modelica.Blocks.Math.Gain gaiStoPla(
final k=1/stoPla.dpVal_nominal)
;
Buildings.DHC.Plants.Cooling.BaseClasses.IdealUser ideUse1(
redeclare final package Medium = Medium,
final m_flow_nominal=0.6*m_flow_nominal,
dp_nominal=0.2*dp_nominal,
final T_CHWR_nominal=T_CHWR_nominal) ;
Buildings.DHC.Plants.Cooling.BaseClasses.IdealUser ideUse2(
redeclare final package Medium = Medium,
final m_flow_nominal=0.65*m_flow_nominal,
dp_nominal=0.2*dp_nominal,
final T_CHWR_nominal=T_CHWR_nominal) ;
Buildings.DHC.Plants.Cooling.BaseClasses.IdealUser ideUse3(
redeclare final package Medium = Medium,
final m_flow_nominal=0.65*m_flow_nominal,
dp_nominal=0.2*dp_nominal,
final T_CHWR_nominal=T_CHWR_nominal) ;
Modelica.Blocks.Sources.Constant set_dpUse(
final k=1)
;
Modelica.Blocks.Sources.TimeTable mLoa1_flow(table=[0,0; 1800,0; 1800,ideUse1.m_flow_nominal;
7000,ideUse1.m_flow_nominal; 7000,0; 9000,0])
;
Modelica.Blocks.Sources.TimeTable mLoa2_flow(table=[0,0; 3500,0; 3500,ideUse2.m_flow_nominal;
6500,ideUse2.m_flow_nominal; 6500,0; 9000,0])
;
Modelica.Blocks.Sources.TimeTable mLoa3_flow(table=[0,0; 4500,0; 4500,ideUse3.m_flow_nominal;
6000,ideUse3.m_flow_nominal; 6000,0; 9000,0])
;
Modelica.Blocks.Math.Gain gaiUse1(
final k=1/ideUse1.dp_nominal)
;
Modelica.Blocks.Math.Gain gaiUse2(
final k=1/ideUse2.dp_nominal)
;
Modelica.Blocks.Math.Gain gaiUse3(
final k=1/ideUse3.dp_nominal)
;
Buildings.DHC.Plants.Cooling.BaseClasses.ParallelJunctions
parJunPla1(
redeclare final package Medium = Medium,
T1_start=T_CHWS_nominal,
T2_start=T_CHWR_nominal,
m_flow_nominal = 2*m_flow_nominal)
;
Buildings.DHC.Plants.Cooling.BaseClasses.ParallelJunctions
parJunUse2(
redeclare final package Medium = Medium,
T1_start=T_CHWR_nominal,
T2_start=T_CHWS_nominal,
m_flow_nominal = 2*m_flow_nominal)
;
Buildings.DHC.Plants.Cooling.BaseClasses.ParallelJunctions
parJunPla2(
redeclare final package Medium = Medium,
T1_start=T_CHWS_nominal,
T2_start=T_CHWR_nominal,
m_flow_nominal = 2*m_flow_nominal)
;
Buildings.DHC.Plants.Cooling.BaseClasses.ParallelPipes
parPipS1U1(
redeclare package Medium = Medium,
m_flow_nominal=m_flow_nominal,
dp_nominal=0.15*dp_nominal) ;
Buildings.DHC.Plants.Cooling.BaseClasses.ParallelPipes
parPipS1U2(
redeclare package Medium = Medium,
m_flow_nominal=2*m_flow_nominal,
dp_nominal=0.15*dp_nominal) ;
Buildings.DHC.Plants.Cooling.BaseClasses.ParallelPipes
parPipS2U2(
redeclare package Medium = Medium,
m_flow_nominal=2*m_flow_nominal,
dp_nominal=0.15*dp_nominal) ;
Buildings.DHC.Plants.Cooling.BaseClasses.ParallelPipes
parPipS2U3(
redeclare package Medium = Medium,
m_flow_nominal=m_flow_nominal,
dp_nominal=0.15*dp_nominal) ;
Modelica.Blocks.Routing.Multiplex muxDp(n=3) ;
Buildings.Controls.OBC.CDL.Reals.MultiMax mulMax_yVal_actual(nin=3)
;
Modelica.Blocks.Sources.IntegerTable com(table=[0,2; 200,1; 3000,2; 4000,3;
6000,2; 7500,1])
;
Modelica.Blocks.Sources.BooleanTable chiEnaSta(table={0,6000}, startValue=
false) ;
Buildings.Controls.OBC.CDL.Reals.Hysteresis hys_yVal_actual(uLow=0.05,
uHigh=0.5) ;
equation
connect(set_dpUse.y,conPI_pumChi1.u_s);
connect(mLoa1_flow.y, ideUse1.mPre_flow);
connect(mLoa2_flow.y, ideUse2.mPre_flow);
connect(mLoa3_flow.y, ideUse3.mPre_flow);
connect(ideUse1.dp, gaiUse1.u);
connect(ideUse2.dp, gaiUse2.u);
connect(ideUse3.dp, gaiUse3.u);
connect(parJunUse2.port_c2, ideUse2.port_a);
connect(ideUse2.port_b,parJunUse2.port_c1);
connect(parPipS1U1.port_b2, parJunPla1.port_a1);
connect(parJunPla1.port_b2, parPipS1U1.port_a1);
connect(parJunPla1.port_b1, parPipS1U2.port_a2);
connect(parPipS1U2.port_b2, parJunUse2.port_a2);
connect(parJunUse2.port_b1, parPipS1U2.port_a1);
connect(parPipS1U2.port_b1, parJunPla1.port_a2);
connect(parJunUse2.port_b2, parPipS2U2.port_a2);
connect(parPipS2U2.port_b1, parJunUse2.port_a1);
connect(parPipS2U2.port_a1, parJunPla2.port_b2);
connect(parJunPla2.port_a1, parPipS2U2.port_b2);
connect(parPipS2U3.port_a2, parJunPla2.port_b1);
connect(parJunPla2.port_a2, parPipS2U3.port_b1);
connect(gaiUse1.y, muxDp.u[1]);
connect(gaiUse2.y, muxDp.u[2]);
connect(gaiUse3.y, muxDp.u[3]);
connect(ideUse1.yVal_actual, mulMax_yVal_actual.u[1]);
connect(ideUse2.yVal_actual, mulMax_yVal_actual.u[2]);
connect(ideUse3.yVal_actual, mulMax_yVal_actual.u[3]);
connect(com.y, stoPla.com);
connect(chiEnaSta.y, stoPla.chiEnaSta);
connect(hys_yVal_actual.y, stoPla.hasLoa);
connect(pumSup1.port_b, parJunPla1.port_c1);
connect(conPI_pumChi1.y, pumSup1.y);
connect(conPI_pumChi1.y, stoPla.yPum);
connect(pumSup1.port_a, chi1.port_b);
connect(chi1.port_a, parJunPla1.port_c2);
connect(TSet1.y, chi1.T_in);
connect(TSet2.y, chi2.T_in);
connect(stoPla.port_b1, parJunPla2.port_c1);
connect(parJunPla2.port_c2, stoPla.port_a2);
connect(stoPla.port_b2, chi2.port_a);
connect(chi2.port_b, stoPla.port_a1);
connect(bou.ports[1], stoPla.port_a2);
connect(parPipS1U1.port_a2, ideUse1.port_a);
connect(ideUse1.port_b, parPipS1U1.port_b1);
connect(parPipS2U3.port_b2, ideUse3.port_a);
connect(parPipS2U3.port_a1, ideUse3.port_b);
connect(stoPla.dp, gaiStoPla.u);
connect(selMin_dp.y, conPI_pumChi1.u_m);
connect(gaiStoPla.y, selMin_dp.dpStoPla);
connect(stoPla.isChaRem, selMin_dp.isChaRem);
connect(muxDp.y, selMin_dp.dpUse[1:3]);
connect(mulMax_yVal_actual.y, hys_yVal_actual.u);
end StoragePlantDualSource;