Buildings.Experimental.DHC.Plants.Cooling.Examples

Example models integrating multiple components

Information

This package contains advanced examples illustrating the use of the models in Buildings.Experimental.DHC.Plants.Cooling.

Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

Package Content

Name Description
Buildings.Experimental.DHC.Plants.Cooling.Examples.ElectricChillerParallel ElectricChillerParallel Example to test the chiller cooling plant
Buildings.Experimental.DHC.Plants.Cooling.Examples.StoragePlantDualSource StoragePlantDualSource Idealised district system model with two sources and three users

Buildings.Experimental.DHC.Plants.Cooling.Examples.ElectricChillerParallel Buildings.Experimental.DHC.Plants.Cooling.Examples.ElectricChillerParallel

Example to test the chiller cooling plant

Buildings.Experimental.DHC.Plants.Cooling.Examples.ElectricChillerParallel

Information

This model validates the district central cooling plant implemented in Buildings.Experimental.DHC.Plants.Cooling.ElectricChillerParallel.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
ElectricEIRChiller_York_YT_1055kW_5_96COP_VanesperChiredeclare parameter Building...Performance data of chiller
MassFlowRatemCHW_flow_nominal18.3Nominal chilled water mass flow rate [kg/s]
MassFlowRatemCW_flow_nominal34.7Nominal condenser water mass flow rate [kg/s]
PressureDifferencedpCHW_nominal44.8*1000Nominal chilled water side pressure [Pa]
PressureDifferencedpCW_nominal46.2*1000Nominal condenser water side pressure [Pa]
PowerQChi_nominalmCHW_flow_nominal*4200*(6.67...Nominal cooling capaciaty (Negative means cooling) [W]
MassFlowRatemMin_flowmCHW_flow_nominal*0.1Minimum mass flow rate of single chiller [kg/s]
TemperatureDifferencedTApp3Approach temperature [K]
PowerPFan_nominal5000Fan power [W]
TemperatureTCHWSet273.15 + 8Chilled water temperature setpoint [K]
TimetWai30Waiting time [s]
GenericperCHWPumperCHWPum(pressure=Buildings...Performance data for chilled water pumps
GenericperCWPumperCWPum(pressure=Buildings....Performance data for condenser water pumps
PressuredpCHWPumVal_nominal6000Nominal pressure drop of chilled water pump valve [Pa]
PressuredpCWPumVal_nominal6000Nominal pressure drop of chilled water pump valve [Pa]
PressureDifferencedpCooTowVal_nominal6000Nominal pressure difference of the cooling tower valve [Pa]
ElectricChillerParallelplapla(perChi=perChi, dTApp=dTA...District cooling plant

Modelica definition

model ElectricChillerParallel "Example to test the chiller cooling plant" extends Modelica.Icons.Example; package Medium=Buildings.Media.Water "Medium model for water"; // chiller and cooling tower replaceable parameter Buildings.Fluid.Chillers.Data.ElectricEIR.ElectricEIRChiller_York_YT_1055kW_5_96COP_Vanes perChi "Performance data of chiller"; parameter Modelica.Units.SI.MassFlowRate mCHW_flow_nominal=18.3 "Nominal chilled water mass flow rate"; parameter Modelica.Units.SI.MassFlowRate mCW_flow_nominal=34.7 "Nominal condenser water mass flow rate"; parameter Modelica.Units.SI.PressureDifference dpCHW_nominal=44.8*1000 "Nominal chilled water side pressure"; parameter Modelica.Units.SI.PressureDifference dpCW_nominal=46.2*1000 "Nominal condenser water side pressure"; parameter Modelica.Units.SI.Power QChi_nominal=mCHW_flow_nominal*4200*(6.67 - 18.56) "Nominal cooling capaciaty (Negative means cooling)"; parameter Modelica.Units.SI.MassFlowRate mMin_flow=mCHW_flow_nominal*0.1 "Minimum mass flow rate of single chiller"; parameter Modelica.Units.SI.TemperatureDifference dTApp=3 "Approach temperature"; parameter Modelica.Units.SI.Power PFan_nominal=5000 "Fan power"; // control settings parameter Modelica.Units.SI.Temperature TCHWSet=273.15 + 8 "Chilled water temperature setpoint"; parameter Modelica.Units.SI.Time tWai=30 "Waiting time"; // pumps 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})) "Performance data for chilled water pumps"; 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})) "Performance data for condenser water pumps"; parameter Modelica.Units.SI.Pressure dpCHWPumVal_nominal=6000 "Nominal pressure drop of chilled water pump valve"; parameter Modelica.Units.SI.Pressure dpCWPumVal_nominal=6000 "Nominal pressure drop of chilled water pump valve"; parameter Modelica.Units.SI.PressureDifference dpCooTowVal_nominal=6000 "Nominal pressure difference of the cooling tower valve"; replaceable Buildings.Experimental.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) "District cooling plant"; 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")) "Weather data"; Modelica.Blocks.Sources.BooleanConstant on "On signal of the plant"; Modelica.Blocks.Sources.Constant TCHWSupSet( k=TCHWSet) "Chilled water supply temperature setpoint"; 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) "Mixing volume"; Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow fixHeaFlo( T_ref=293.15) "Fixed heat flow rate"; Fluid.FixedResistances.PressureDrop res( redeclare package Medium = Medium, m_flow_nominal=pla.numChi*mCHW_flow_nominal, dp_nominal(displayUnit="kPa") = 60000) "Flow resistance"; Modelica.Blocks.Sources.Sine loaVar( amplitude=913865, f=1/126900, offset=913865, startTime(displayUnit="h") = 21600) "Variable demand load"; 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;

Buildings.Experimental.DHC.Plants.Cooling.Examples.StoragePlantDualSource Buildings.Experimental.DHC.Plants.Cooling.Examples.StoragePlantDualSource

Idealised district system model with two sources and three users

Buildings.Experimental.DHC.Plants.Cooling.Examples.StoragePlantDualSource

Information

The modelled system is described in the documentation of Buildings.Experimental.DHC.Plants.Cooling.StoragePlant.

The source blocks give the system the following operation schedule during simulation:

Implementation

The chiller is implemented as an ideal temperature source using Buildings.Fluid.Sources.PropertySource_T. Its outlet temperature is always at the prescribed value.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
MassFlowRatem_flow_nominal1Nominal mass flow rate, slightly larger than needed by one user load [kg/s]
PressureDifferencedp_nominal300000Nominal pressure difference [Pa]
TemperatureT_CHWR_nominal12 + 273.15Nominal temperature of CHW return [K]
TemperatureT_CHWS_nominal7 + 273.15Nominal temperature of CHW supply [K]
Nominal values
MassFlowRatemTan_flow_nominal1Nominal mass flow rate for CHW tank branch [kg/s]
MassFlowRatemChi_flow_nominal1Nominal mass flow rate for CHW chiller branch [kg/s]

Modelica definition

model StoragePlantDualSource "Idealised district system model with two sources and three users" extends Modelica.Icons.Example; package Medium = Buildings.Media.Water "Medium model for CHW"; parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=1 "Nominal mass flow rate, slightly larger than needed by one user load"; parameter Modelica.Units.SI.MassFlowRate mTan_flow_nominal=1 "Nominal mass flow rate for CHW tank branch"; parameter Modelica.Units.SI.MassFlowRate mChi_flow_nominal=1 "Nominal mass flow rate for CHW chiller branch"; parameter Modelica.Units.SI.PressureDifference dp_nominal( final displayUnit="Pa")= 300000 "Nominal pressure difference"; parameter Modelica.Units.SI.Temperature T_CHWR_nominal( final displayUnit="degC")= 12+273.15 "Nominal temperature of CHW return"; parameter Modelica.Units.SI.Temperature T_CHWS_nominal( final displayUnit="degC")= 7+273.15 "Nominal temperature of CHW supply"; // First plant: chiller only Buildings.Fluid.Sources.PropertySource_T chi1( redeclare final package Medium = Medium, final use_T_in=true) "Chiller 1 represented by an ideal temperature source"; Modelica.Blocks.Sources.Constant TSet1(k=T_CHWS_nominal) "Constant CHW leaving temperature"; 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) "CHW supply pump for chi1"; Buildings.Controls.Continuous.LimPID conPI_pumChi1( final controllerType=Modelica.Blocks.Types.SimpleController.PI, k=0.2, Ti=10, final reverseActing=true) "PI controller"; Buildings.Experimental.DHC.Plants.Cooling.Controls.SelectMin selMin_dp(nin=3) "Min of pressure heads with the signal from storage plant optionally used"; // Second plant: chiller and tank Buildings.Experimental.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) "Storage plant"; Buildings.Fluid.Sources.Boundary_pT bou( p(final displayUnit="Pa") = 101325 + dp_nominal, redeclare final package Medium = Medium, nPorts=1) "Pressure boundary"; Buildings.Fluid.Sources.PropertySource_T chi2( redeclare final package Medium = Medium, final use_T_in=true) "Chiller represented by an ideal temperature source"; Modelica.Blocks.Sources.Constant TSet2(final k=T_CHWS_nominal) "Constant CHW leaving temperature"; Modelica.Blocks.Math.Gain gaiStoPla(final k=1/stoPla.dpVal_nominal) "Gain to normalise dp measurement"; // Users Buildings.Experimental.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) "Ideal user"; Buildings.Experimental.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) "Ideal user"; Buildings.Experimental.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) "Ideal user"; Modelica.Blocks.Sources.Constant set_dpUse(final k=1) "Normalized consumer differential pressure setpoint"; 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]) "Cooling load of user 1 represented by flow rate"; 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]) "Cooling load of user 2 represented by flow rate"; 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]) "Cooling load of user 3 represented by flow rate"; Modelica.Blocks.Math.Gain gaiUse1(final k=1/ideUse1.dp_nominal) "Gain to normalise dp measurement"; Modelica.Blocks.Math.Gain gaiUse2(final k=1/ideUse2.dp_nominal) "Gain to normalise dp measurement"; Modelica.Blocks.Math.Gain gaiUse3(final k=1/ideUse3.dp_nominal) "Gain to normalise dp measurement"; // District pipe network Buildings.Experimental.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) "Parallel junctions for breaking algebraic loops"; Buildings.Experimental.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) "Parallel junctions for breaking algebraic loops"; Buildings.Experimental.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) "Parallel junctions for breaking algebraic loops"; Buildings.Experimental.DHC.Plants.Cooling.BaseClasses.ParallelPipes parPipS1U1( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, dp_nominal=0.15*dp_nominal) "Parallel pipes"; Buildings.Experimental.DHC.Plants.Cooling.BaseClasses.ParallelPipes parPipS1U2( redeclare package Medium = Medium, m_flow_nominal=2*m_flow_nominal, dp_nominal=0.15*dp_nominal) "Parallel pipes"; Buildings.Experimental.DHC.Plants.Cooling.BaseClasses.ParallelPipes parPipS2U2( redeclare package Medium = Medium, m_flow_nominal=2*m_flow_nominal, dp_nominal=0.15*dp_nominal) "Parallel pipes"; Buildings.Experimental.DHC.Plants.Cooling.BaseClasses.ParallelPipes parPipS2U3( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, dp_nominal=0.15*dp_nominal) "Parallel pipes"; Modelica.Blocks.Routing.Multiplex muxDp(n=3) "Multiplexer block for routing"; Buildings.Controls.OBC.CDL.Reals.MultiMax mulMax_yVal_actual(nin=3) "Position of the most open user control valve"; Modelica.Blocks.Sources.IntegerTable com(table=[0,2; 200,1; 3000,2; 4000,3; 6000,2; 7500,1]) "Command: 1 = charge tank, 2 = no command, 3 = discharge from tank"; Modelica.Blocks.Sources.BooleanTable chiEnaSta(table={0,6000}, startValue= false) "Chiller enable status, true if chiller is enabled"; Buildings.Controls.OBC.CDL.Reals.Hysteresis hys_yVal_actual(uLow=0.05, uHigh=0.5) "Hysteresis for user control valve position"; 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;