Package with example of DX cooling coil models
Information
This package contains examples that use air source DX heating and cooling coil models.
Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).
Package Content
Name |
Description |
MultiStage
|
Test model for multi stage DX cooling coil |
SingleSpeed
|
Test model for single speed cooling DX coil |
SpaceCooling
|
Space cooling with DX coils |
VariableSpeed
|
Test model for variable speed DX coil |
PerformanceCurves
|
Package with several performance curves |
Test model for multi stage DX cooling coil
Information
This is a test model for
Buildings.Fluid.DXSystems.Cooling.AirSource.MultiStage.
The model has open-loop control and time-varying input conditions.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
MassFlowRate | m_flow_nominal | datCoi.sta[datCoi.nSta].nomV... | Nominal mass flow rate [kg/s] |
PressureDifference | dp_nominal | 1000 | Pressure drop at m_flow_nominal [Pa] |
DXCoil | datCoi | datCoi(nSta=4, sta={Building... | Coil data |
Modelica definition
model MultiStage
extends Modelica.Icons.Example;
package Medium =
Buildings.Media.Air
;
parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=datCoi.sta[datCoi.nSta].nomVal.m_flow_nominal
;
parameter Modelica.Units.SI.PressureDifference dp_nominal=1000
;
Buildings.Fluid.DXSystems.Cooling.AirSource.MultiStage mulStaDX(
redeclare package Medium = Medium,
final dp_nominal=dp_nominal,
final datCoi=datCoi,
final T_start=datCoi.sta[1].nomVal.TEvaIn_nominal,
final show_T=true,
final from_dp=true,
final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
;
Buildings.Fluid.Sources.Boundary_pT sin(
redeclare package Medium = Medium,
final nPorts=1,
final p(displayUnit="Pa") = 101325,
final T=293.15)
;
Buildings.Fluid.Sources.Boundary_pT sou(
redeclare package Medium = Medium,
final nPorts=1,
final p(displayUnit="Pa") = 101325 + dp_nominal,
final use_T_in=true,
final use_p_in=true,
final T=299.85)
;
Modelica.Blocks.Sources.Ramp TEvaIn(
final duration=600,
final startTime=2400,
final height=-5,
final offset=273.15 + 23)
;
Modelica.Blocks.Sources.Ramp p(
final duration=600,
final startTime=600,
final height=dp_nominal,
final offset=101325)
;
parameter Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.DXCoil
datCoi(
nSta=4,
sta={
Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.BaseClasses.Stage(
spe=900/60,
nomVal=
Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.BaseClasses.NominalValues(
Q_flow_nominal=-12000,
COP_nominal=3,
SHR_nominal=0.8,
m_flow_nominal=0.9),
perCur=
Buildings.Fluid.DXSystems.Cooling.AirSource.Examples.PerformanceCurves.Curve_I()),
Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.BaseClasses.Stage(
spe=1200/60,
nomVal=
Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.BaseClasses.NominalValues(
Q_flow_nominal=-18000,
COP_nominal=3,
SHR_nominal=0.8,
m_flow_nominal=1.2),
perCur=
Buildings.Fluid.DXSystems.Cooling.AirSource.Examples.PerformanceCurves.Curve_I()),
Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.BaseClasses.Stage(
spe=1800/60,
nomVal=
Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.BaseClasses.NominalValues(
Q_flow_nominal=-21000,
COP_nominal=3,
SHR_nominal=0.8,
m_flow_nominal=1.5),
perCur=
Buildings.Fluid.DXSystems.Cooling.AirSource.Examples.PerformanceCurves.Curve_II()),
Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.BaseClasses.Stage(
spe=2400/60,
nomVal=
Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.BaseClasses.NominalValues(
Q_flow_nominal=-30000,
COP_nominal=3,
SHR_nominal=0.8,
m_flow_nominal=1.8),
perCur=
Buildings.Fluid.DXSystems.Cooling.AirSource.Examples.PerformanceCurves.Curve_III())})
;
Modelica.Blocks.Sources.IntegerTable speRat(
final table=[0.0,0.0;
900,1;
1800,4;
2700,3;
3600,2])
;
Modelica.Blocks.Sources.Constant TConIn(
final k=273.15 + 25)
;
equation
connect(sou.ports[1], mulStaDX.port_a);
connect(mulStaDX.port_b, sin.ports[1]);
connect(TEvaIn.y, sou.T_in);
connect(p.y, sou.p_in);
connect(speRat.y, mulStaDX.stage);
connect(TConIn.y, mulStaDX.TOut);
end MultiStage;
Test model for single speed cooling DX coil
Information
This is a test model for
Buildings.Fluid.DXSystems.Cooling.AirSource.SingleSpeed.
The model has open-loop control and time-varying input conditions.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
MassFlowRate | m_flow_nominal | datCoi.sta[datCoi.nSta].nomV... | Nominal mass flow rate [kg/s] |
PressureDifference | dp_nominal | 1000 | Pressure drop at m_flow_nominal [Pa] |
DXCoil | datCoi | datCoi(sta={Buildings.Fluid.... | Coil data |
Modelica definition
model SingleSpeed
extends Modelica.Icons.Example;
package Medium =
Buildings.Media.Air
;
parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=datCoi.sta[datCoi.nSta].nomVal.m_flow_nominal
;
parameter Modelica.Units.SI.PressureDifference dp_nominal=1000
;
parameter Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.DXCoil
datCoi(
sta={
Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.BaseClasses.Stage(
spe=1800/60,
nomVal=
Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.BaseClasses.NominalValues(
Q_flow_nominal=-21000,
COP_nominal=3,
SHR_nominal=0.8,
m_flow_nominal=1.5),
perCur=
Buildings.Fluid.DXSystems.Cooling.AirSource.Examples.PerformanceCurves.Curve_II())},
nSta=1)
;
Buildings.Fluid.DXSystems.Cooling.AirSource.SingleSpeed
sinSpeDX(
redeclare package Medium = Medium,
final dp_nominal=dp_nominal,
final datCoi=datCoi,
final T_start=datCoi.sta[1].nomVal.TEvaIn_nominal,
final show_T=true,
final from_dp=true,
final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
;
Buildings.Fluid.Sources.Boundary_pT sin(
redeclare package Medium = Medium,
final p(displayUnit="Pa") = 101325,
final nPorts=1,
final T=303.15)
;
Buildings.Fluid.Sources.Boundary_pT sou(
redeclare package Medium = Medium,
p(displayUnit="Pa") = 101325 + dp_nominal,
final use_T_in=true,
final nPorts=1,
final use_p_in=true,
final T=299.85)
;
Modelica.Blocks.Sources.BooleanStep onOff(
final startTime=600)
;
Modelica.Blocks.Sources.Ramp TEvaIn(
final duration=600,
final startTime=2400,
final height=-5,
final offset=273.15 + 23)
;
Modelica.Blocks.Sources.Ramp p(
final duration=600,
final startTime=600,
final height=dp_nominal,
final offset=101325)
;
Modelica.Blocks.Sources.Constant TConIn(
final k=273.15 + 25)
;
equation
connect(TEvaIn.y, sou.T_in);
connect(onOff.y, sinSpeDX.on);
connect(sou.ports[1], sinSpeDX.port_a);
connect(sinSpeDX.port_b, sin.ports[1]);
connect(p.y, sou.p_in);
connect(TConIn.y, sinSpeDX.TOut);
end SingleSpeed;
Space cooling with DX coils
Information
This model illustrates the use of the air source DX coil models with
single speed compressor, multi-stage compressor, and variable
speed compressor.
The three systems all have the same simple model for a room,
and the same HVAC components, except for the coil.
The top system has a DX coil with single speed compressor
and on/off control with dead-band.
The middle system has a DX coil with two stages, each
representing a different compressor speed.
The bottom system has a DX coil with variable speed control
for the compressor.
All coils are controlled based on the respective room air temperature.
The plot below shows how room air temperatures and humidity levels
are controlled with the respective coils.
The single speed coil has the highest room air humidity level because
during its off-time, water that accumulated on the coil evaporates
into the air stream.
This effect is smaller for the coil with two compressor stages
and for the coil with variable compressor speed, as both of these coils
switch off less frequent.
Implementation
The model is based on
Buildings.Examples.Tutorial.SpaceCooling.System3.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
replaceable package Medium | Buildings.Media.Air | Fluid medium for the model |
Volume | V | 6*10*3 | Room volume [m3] |
Real | eps | 0.8 | Heat recovery effectiveness |
Temperature | TASup_nominal | 273.15 + 18 | Nominal air temperature supplied to room [K] |
Temperature | TRooSet | 273.15 + 24 | Nominal room air temperature [K] |
Temperature | TOut_nominal | 273.15 + 30 | Design outlet air temperature [K] |
Temperature | THeaRecLvg | TOut_nominal - eps*(TOut_nom... | Air temperature leaving the heat recovery [K] |
HeatFlowRate | QRooInt_flow | 1000 | Internal heat gains of the room [W] |
HeatFlowRate | QRooC_flow_nominal | -QRooInt_flow - 10E3/30*(TOu... | Nominal cooling load of the room [W] |
MassFlowRate | mA_flow_nominal | 1.3*QRooC_flow_nominal/1006/... | Nominal air mass flow rate, increased by factor 1.3 to allow for recovery after temperature setback [kg/s] |
TemperatureDifference | dTFan | 2 | Estimated temperature raise across fan that needs to be made up by the cooling coil [K] |
HeatFlowRate | QCoiC_flow_nominal | (QRooC_flow_nominal + mA_flo... | Cooling load of coil, taking into account economizer, and increased due to latent heat removal [W] |
DXCoil | datCoi | datCoi(sta={Buildings.Fluid.... | Data record for single-speed coil |
DXCoil | datCoiMulSpe | datCoiMulSpe(nSta=2, sta={Bu... | Coil data multi-stage and variable speed cooling coils |
Connectors
Type | Name | Description |
replaceable package Medium | Fluid medium for the model |
Bus | weaBus | Weather bus |
Modelica definition
model SpaceCooling
extends Modelica.Icons.Example;
replaceable package Medium =
Buildings.Media.Air
;
parameter Modelica.Units.SI.Volume V=6*10*3
;
parameter Real eps = 0.8
;
parameter Modelica.Units.SI.Temperature TASup_nominal=273.15 + 18
;
parameter Modelica.Units.SI.Temperature TRooSet=273.15 + 24
;
parameter Modelica.Units.SI.Temperature TOut_nominal=273.15 + 30
;
parameter Modelica.Units.SI.Temperature THeaRecLvg=TOut_nominal - eps*(
TOut_nominal - TRooSet) ;
parameter Modelica.Units.SI.HeatFlowRate QRooInt_flow=1000
;
parameter Modelica.Units.SI.HeatFlowRate QRooC_flow_nominal=
-QRooInt_flow - 10E3/30*(TOut_nominal - TRooSet)
;
parameter Modelica.Units.SI.MassFlowRate mA_flow_nominal=
1.3*QRooC_flow_nominal/1006/(TASup_nominal - TRooSet)
;
parameter Modelica.Units.SI.TemperatureDifference dTFan=2
;
parameter Modelica.Units.SI.HeatFlowRate QCoiC_flow_nominal=
(QRooC_flow_nominal + mA_flow_nominal*(TASup_nominal - THeaRecLvg - dTFan)*1006)
;
parameter Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.DXCoil
datCoi(
sta={
Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.BaseClasses.Stage(
spe=1800/60,
nomVal=
Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.BaseClasses.NominalValues(
Q_flow_nominal=QCoiC_flow_nominal,
COP_nominal=3,
SHR_nominal=0.7,
m_flow_nominal=mA_flow_nominal),
perCur=
Buildings.Fluid.DXSystems.Cooling.AirSource.Examples.PerformanceCurves.Curve_I())},
nSta=1)
;
parameter Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.DXCoil
datCoiMulSpe(
nSta=2,
sta={
Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.BaseClasses.Stage(
spe=900/60,
nomVal=
Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.BaseClasses.NominalValues(
Q_flow_nominal=QCoiC_flow_nominal*900/2400,
COP_nominal=3,
SHR_nominal=0.7,
m_flow_nominal=mA_flow_nominal*900/2400),
perCur=
Buildings.Fluid.DXSystems.Cooling.AirSource.Examples.PerformanceCurves.Curve_I()),
Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.BaseClasses.Stage(
spe=2400/60,
nomVal=
Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.BaseClasses.NominalValues(
Q_flow_nominal=QCoiC_flow_nominal,
COP_nominal=3,
SHR_nominal=0.7,
m_flow_nominal=mA_flow_nominal),
perCur=
Buildings.Fluid.DXSystems.Cooling.AirSource.Examples.PerformanceCurves.Curve_I())})
;
Buildings.Fluid.Movers.FlowControlled_m_flow fan(
redeclare package Medium =
Medium,
final m_flow_nominal=mA_flow_nominal,
final energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState)
;
Buildings.Fluid.HeatExchangers.ConstantEffectiveness hex(
redeclare package Medium1 =
Medium,
redeclare package Medium2 =
Medium,
final m1_flow_nominal=mA_flow_nominal,
final m2_flow_nominal=mA_flow_nominal,
final dp1_nominal=200,
final dp2_nominal=200,
final eps=eps)
;
Buildings.Fluid.Sources.Outside out(
final nPorts=6,
redeclare package Medium =
Medium)
;
BoundaryConditions.WeatherData.ReaderTMY3 weaDat(
final pAtmSou=Buildings.BoundaryConditions.Types.DataSource.Parameter,
final TDryBul=TOut_nominal,
final filNam=
Modelica.Utilities.Files.loadResource("modelica://Buildings/Resources/weatherdata/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.mos"),
final TDryBulSou=Buildings.BoundaryConditions.Types.DataSource.File)
;
BoundaryConditions.WeatherData.Bus weaBus
;
Modelica.Blocks.Sources.Constant mAir_flow(
final k=mA_flow_nominal)
;
Buildings.Fluid.Sensors.TemperatureTwoPort senTemHXEvaOut(
redeclare package Medium =
Medium,
final m_flow_nominal=mA_flow_nominal)
;
Buildings.Fluid.Sensors.TemperatureTwoPort senTemSupAir(
redeclare package Medium =
Medium,
final m_flow_nominal=mA_flow_nominal)
;
Modelica.Blocks.Logical.OnOffController con(
final bandwidth=1,
final pre_y_start=true)
;
Modelica.Blocks.Sources.Constant TRooSetPoi(
final k=TRooSet)
;
Buildings.Fluid.DXSystems.Cooling.AirSource.SingleSpeed
sinSpeDX(
redeclare package Medium =
Medium,
final datCoi=datCoi,
final dp_nominal=400,
final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
;
SimpleRoom rooSinSpe(
redeclare package Medium =
Medium,
final nPorts=2,
final QRooInt_flow=QRooInt_flow,
final mA_flow_nominal=mA_flow_nominal)
;
Buildings.Fluid.Movers.FlowControlled_m_flow fan1(
redeclare package Medium =
Medium,
final m_flow_nominal=mA_flow_nominal,
final energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState)
;
Buildings.Fluid.HeatExchangers.ConstantEffectiveness hex1(
redeclare package Medium1 =
Medium,
redeclare package Medium2 =
Medium,
final m1_flow_nominal=mA_flow_nominal,
final m2_flow_nominal=mA_flow_nominal,
final dp1_nominal=200,
final dp2_nominal=200,
final eps=eps)
;
Buildings.Fluid.Sensors.TemperatureTwoPort senTemHXEvaOut1(
redeclare package Medium =
Medium,
final m_flow_nominal=mA_flow_nominal)
;
Buildings.Fluid.Sensors.TemperatureTwoPort senTemSupAir1(
redeclare package Medium =
Medium,
final m_flow_nominal=mA_flow_nominal)
;
Buildings.Fluid.DXSystems.Cooling.AirSource.MultiStage mulStaDX(
redeclare package Medium =
Medium,
final dp_nominal=400,
final datCoi=datCoiMulSpe,
final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
;
SimpleRoom rooMulSpe(
redeclare package Medium =
Medium,
final nPorts=2,
final QRooInt_flow=QRooInt_flow,
final mA_flow_nominal=mA_flow_nominal)
;
ControllerTwoStage
mulSpeCon
;
SimpleRoom rooVarSpe(
redeclare package Medium =
Medium,
final nPorts=2,
final QRooInt_flow=QRooInt_flow,
final mA_flow_nominal=mA_flow_nominal)
;
Buildings.Fluid.Movers.FlowControlled_m_flow fan2(
redeclare package Medium =
Medium,
final m_flow_nominal=mA_flow_nominal,
final energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState)
;
Buildings.Fluid.Sensors.TemperatureTwoPort senTemSupAir2(
redeclare package Medium =
Medium,
final m_flow_nominal=mA_flow_nominal)
;
Buildings.Fluid.DXSystems.Cooling.AirSource.VariableSpeed
varSpeDX(
redeclare package Medium =
Medium,
final dp_nominal=400,
final datCoi=datCoiMulSpe,
final minSpeRat=0.2,
final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
;
Buildings.Fluid.Sensors.TemperatureTwoPort senTemHXEvaOut2(
redeclare package Medium =
Medium,
final m_flow_nominal=mA_flow_nominal)
;
Buildings.Fluid.HeatExchangers.ConstantEffectiveness hex2(
redeclare package Medium1 =
Medium,
redeclare package Medium2 =
Medium,
final m1_flow_nominal=mA_flow_nominal,
final m2_flow_nominal=mA_flow_nominal,
final dp1_nominal=200,
final dp2_nominal=200,
final eps=eps)
;
Modelica.Blocks.Continuous.Integrator sinSpePow(
y(
final unit="J"))
;
Modelica.Blocks.Continuous.Integrator mulSpePow(
y(
final unit="J"))
;
Modelica.Blocks.Continuous.Integrator varSpePow(
y(
final unit="J"))
;
Modelica.Blocks.Logical.Not not1
;
Buildings.Controls.Continuous.LimPID conVarSpe(
final controllerType=Modelica.Blocks.Types.SimpleController.P,
final Ti=1,
final Td=1,
final reverseActing=false)
;
equation
connect(out.ports[1], hex.port_a1);
connect(out.ports[2], hex.port_b2);
connect(weaDat.weaBus, out.weaBus);
connect(weaDat.weaBus, weaBus);
connect(fan.m_flow_in, mAir_flow.y);
connect(hex.port_b1, senTemHXEvaOut.port_a);
connect(senTemSupAir.port_b, fan.port_a);
connect(senTemHXEvaOut.port_b, sinSpeDX.port_a);
connect(sinSpeDX.port_b, senTemSupAir.port_a);
public
model SimpleRoom
replaceable package Medium =
Modelica.Media.Interfaces.PartialMedium
;
parameter Integer nPorts=0
;
final parameter Modelica.Units.SI.Volume V=6*10*3
;
parameter Modelica.Units.SI.HeatFlowRate QRooInt_flow
;
parameter Modelica.Units.SI.MassFlowRate mA_flow_nominal
;
Modelica.Blocks.Interfaces.RealInput TOutDryBul
;
Modelica.Blocks.Interfaces.RealOutput TRoo(
final unit="K")
;
Modelica.Fluid.Vessels.BaseClasses.VesselFluidPorts_b ports[nPorts](
redeclare each package Medium =
Medium)
;
Buildings.Fluid.MixingVolumes.MixingVolume vol(
redeclare package Medium =
Medium,
final m_flow_nominal=mA_flow_nominal,
final V=V,
final nPorts=2,
final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
;
Modelica.Thermal.HeatTransfer.Components.ThermalConductor theCon(
final G=10000/30,
final port_a(T(start=Medium.T_default)))
;
Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TOut(
port(
T(
final start=Medium.T_default)))
;
Modelica.Thermal.HeatTransfer.Sources.FixedHeatFlow preHea(
final Q_flow=QRooInt_flow)
;
Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor senTemRoo
;
Modelica.Thermal.HeatTransfer.Components.HeatCapacitor heaCap(
final C=2*V*1.2*1006)
;
equation
connect(theCon.port_b,vol. heatPort);
connect(preHea.port,vol. heatPort);
connect(TOut.port,theCon. port_a);
connect(vol.heatPort,senTemRoo. port);
connect(heaCap.port,vol. heatPort);
connect(TRoo, senTemRoo.T);
connect(ports, vol.ports);
connect(TOut.T, TOutDryBul);
end SimpleRoom;
equation
connect(sinSpeDX.TOut, weaBus.TDryBul);
connect(fan.port_b, rooSinSpe.ports[1]);
connect(rooSinSpe.ports[2], hex.port_a2);
connect(hex1.port_b1, senTemHXEvaOut1.port_a);
connect(senTemSupAir1.port_b, fan1.port_a);
connect(senTemHXEvaOut1.port_b, mulStaDX.port_a);
connect(mulStaDX.port_b, senTemSupAir1.port_a);
connect(mulStaDX.TOut, weaBus.TDryBul);
connect(fan1.port_b, rooMulSpe.ports[1]);
connect(rooMulSpe.ports[2], hex1.port_a2);
connect(rooMulSpe.TOutDryBul, weaBus.TDryBul);
public
model ControllerTwoStage
extends Buildings.BaseClasses.BaseIcon;
parameter Real bandwidth=1
;
Modelica.Blocks.Logical.OnOffController con1(
final bandwidth=bandwidth/2,
final pre_y_start=true)
;
Modelica.Blocks.Logical.OnOffController con2(
final bandwidth=bandwidth/2,
final pre_y_start=true)
;
Modelica.Blocks.Interfaces.RealInput u
;
Modelica.Blocks.Interfaces.RealInput reference
;
Modelica.Blocks.Math.Add add(
final k2=-1)
;
Modelica.Blocks.Sources.Constant const(
final k=bandwidth/2)
;
Modelica.Blocks.Math.Add add1
;
Modelica.Blocks.MathInteger.MultiSwitch multiSwitch1(
final expr={2,1},
final y_default=0,
final use_pre_as_default=false,
final nu=2)
;
Modelica.Blocks.Interfaces.IntegerOutput stage
;
Modelica.Blocks.Logical.Not not1
;
Modelica.Blocks.Logical.Not not2
;
equation
connect(con1.reference, reference);
connect(const.y, add.u2);
connect(const.y, add1.u1);
connect(add.u1, u);
connect(add1.u2, u);
connect(add.y, con1.u);
connect(add1.y, con2.u);
connect(reference, con2.reference);
connect(multiSwitch1.y, stage);
connect(not2.y, multiSwitch1.u[1]);
connect(not1.y, multiSwitch1.u[2]);
connect(con1.y, not1.u);
connect(con2.y, not2.u);
end ControllerTwoStage;
equation
connect(mulSpeCon.stage, mulStaDX.stage);
connect(rooVarSpe.TOutDryBul, weaBus.TDryBul);
connect(senTemSupAir2.port_b,fan2. port_a);
connect(varSpeDX.port_b, senTemSupAir2.port_a);
connect(senTemHXEvaOut2.port_b, varSpeDX.port_a);
connect(varSpeDX.TOut, weaBus.TDryBul);
connect(hex2.port_b1,senTemHXEvaOut2. port_a);
connect(out.ports[3], hex1.port_a1);
connect(out.ports[4], hex1.port_b2);
connect(out.ports[5], hex2.port_a1);
connect(out.ports[6], hex2.port_b2);
connect(fan2.port_b, rooVarSpe.ports[1]);
connect(rooVarSpe.ports[2], hex2.port_a2);
connect(mAir_flow.y, fan1.m_flow_in);
connect(mAir_flow.y, fan2.m_flow_in);
connect(rooSinSpe.TOutDryBul, weaBus.TDryBul);
connect(sinSpePow.u, sinSpeDX.P);
connect(mulSpePow.u, mulStaDX.P);
connect(varSpeDX.P, varSpePow.u);
connect(TRooSetPoi.y, con.reference);
connect(rooSinSpe.TRoo, con.u);
connect(not1.u, con.y);
connect(not1.y, sinSpeDX.on);
connect(mulSpeCon.reference, TRooSetPoi.y);
connect(rooMulSpe.TRoo, mulSpeCon.u);
connect(TRooSetPoi.y, conVarSpe.u_s);
connect(conVarSpe.u_m, rooVarSpe.TRoo);
connect(conVarSpe.y, varSpeDX.speRat);
end SpaceCooling;
Test model for variable speed DX coil
Information
This is a test model for
Buildings.Fluid.DXSystems.Cooling.AirSource.VariableSpeed.
The model has open-loop control and time-varying input conditions.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
MassFlowRate | m_flow_nominal | datCoi.sta[datCoi.nSta].nomV... | Nominal mass flow rate [kg/s] |
PressureDifference | dp_nominal | 1000 | Pressure drop at m_flow_nominal [Pa] |
DXCoil | datCoi | datCoi(nSta=4, sta={Building... | Coil data |
Modelica definition
model VariableSpeed
extends Modelica.Icons.Example;
package Medium =
Buildings.Media.Air
;
parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=datCoi.sta[datCoi.nSta].nomVal.m_flow_nominal
;
parameter Modelica.Units.SI.PressureDifference dp_nominal=1000
;
parameter Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.DXCoil
datCoi(
nSta=4,
sta={
Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.BaseClasses.Stage(
spe=900/60,
nomVal=
Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.BaseClasses.NominalValues(
Q_flow_nominal=-12000,
COP_nominal=3,
SHR_nominal=0.8,
m_flow_nominal=0.9),
perCur=
Buildings.Fluid.DXSystems.Cooling.AirSource.Examples.PerformanceCurves.Curve_I()),
Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.BaseClasses.Stage(
spe=1200/60,
nomVal=
Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.BaseClasses.NominalValues(
Q_flow_nominal=-18000,
COP_nominal=3,
SHR_nominal=0.8,
m_flow_nominal=1.2),
perCur=
Buildings.Fluid.DXSystems.Cooling.AirSource.Examples.PerformanceCurves.Curve_I()),
Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.BaseClasses.Stage(
spe=1800/60,
nomVal=
Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.BaseClasses.NominalValues(
Q_flow_nominal=-21000,
COP_nominal=3,
SHR_nominal=0.8,
m_flow_nominal=1.5),
perCur=
Buildings.Fluid.DXSystems.Cooling.AirSource.Examples.PerformanceCurves.Curve_II()),
Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.BaseClasses.Stage(
spe=2400/60,
nomVal=
Buildings.Fluid.DXSystems.Cooling.AirSource.Data.Generic.BaseClasses.NominalValues(
Q_flow_nominal=-30000,
COP_nominal=3,
SHR_nominal=0.8,
m_flow_nominal=1.8),
perCur=
Buildings.Fluid.DXSystems.Cooling.AirSource.Examples.PerformanceCurves.Curve_III())})
;
Buildings.Fluid.DXSystems.Cooling.AirSource.VariableSpeed
varSpeDX(
redeclare package Medium = Medium,
final dp_nominal=dp_nominal,
final datCoi=datCoi,
final minSpeRat=datCoi.minSpeRat,
final T_start=datCoi.sta[1].nomVal.TEvaIn_nominal,
final from_dp=true,
final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
;
Buildings.Fluid.Sources.Boundary_pT sin(
redeclare package Medium = Medium,
final nPorts=1,
final p = 101325,
final T=293.15)
;
Buildings.Fluid.Sources.Boundary_pT sou(
redeclare package Medium = Medium,
final nPorts=1,
final p = 101325 + dp_nominal,
final use_T_in=true,
final use_p_in=true,
final T=299.85)
;
Modelica.Blocks.Sources.Ramp TEvaIn(
final duration=600,
final startTime=900,
final height=5,
final offset=273.15 + 20)
;
Modelica.Blocks.Sources.TimeTable speRat(
final table=[0.0,0.0;
100,0.0;
900,0.2;
1800,0.8;
2700,0.75;
3600,0.75])
;
Modelica.Blocks.Sources.Ramp p(
final duration=600,
final height=dp_nominal,
final offset=101325,
final startTime=100)
;
Modelica.Blocks.Sources.Constant TConIn(
final k=273.15 + 25)
;
equation
connect(sou.ports[1], varSpeDX.port_a);
connect(varSpeDX.port_b, sin.ports[1]);
connect(TEvaIn.y, sou.T_in);
connect(speRat.y, varSpeDX.speRat);
connect(p.y, sou.p_in);
connect(varSpeDX.TOut, TConIn.y);
end VariableSpeed;
Simple model of a room
Parameters
Type | Name | Default | Description |
replaceable package Medium | Modelica.Media.Interfaces.Pa... | Medium in the room |
HeatFlowRate | QRooInt_flow | | Internal heat gains of the room [W] |
MassFlowRate | mA_flow_nominal | | Nominal air mass flow rate [kg/s] |
Connectors
Type | Name | Description |
replaceable package Medium | Medium in the room |
input RealInput | TOutDryBul | Outdoor drybulb temperature |
output RealOutput | TRoo | Room temperature [K] |
VesselFluidPorts_b | ports[nPorts] | Port for inlet air into and exhaust air from the zone |
Modelica definition
model SimpleRoom
replaceable package Medium =
Modelica.Media.Interfaces.PartialMedium
;
parameter Integer nPorts=0
;
final parameter Modelica.Units.SI.Volume V=6*10*3
;
parameter Modelica.Units.SI.HeatFlowRate QRooInt_flow
;
parameter Modelica.Units.SI.MassFlowRate mA_flow_nominal
;
Modelica.Blocks.Interfaces.RealInput TOutDryBul
;
Modelica.Blocks.Interfaces.RealOutput TRoo(
final unit="K")
;
Modelica.Fluid.Vessels.BaseClasses.VesselFluidPorts_b ports[nPorts](
redeclare each package Medium =
Medium)
;
Buildings.Fluid.MixingVolumes.MixingVolume vol(
redeclare package Medium =
Medium,
final m_flow_nominal=mA_flow_nominal,
final V=V,
final nPorts=2,
final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
;
Modelica.Thermal.HeatTransfer.Components.ThermalConductor theCon(
final G=10000/30,
final port_a(T(start=Medium.T_default)))
;
Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature TOut(
port(
T(
final start=Medium.T_default)))
;
Modelica.Thermal.HeatTransfer.Sources.FixedHeatFlow preHea(
final Q_flow=QRooInt_flow)
;
Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor senTemRoo
;
Modelica.Thermal.HeatTransfer.Components.HeatCapacitor heaCap(
final C=2*V*1.2*1006)
;
equation
connect(theCon.port_b,vol. heatPort);
connect(preHea.port,vol. heatPort);
connect(TOut.port,theCon. port_a);
connect(vol.heatPort,senTemRoo. port);
connect(heaCap.port,vol. heatPort);
connect(TRoo, senTemRoo.T);
connect(ports, vol.ports);
connect(TOut.T, TOutDryBul);
end SimpleRoom;
Controller for two stage coil
Information
Extends from Buildings.BaseClasses.BaseIcon (Base icon).
Parameters
Type | Name | Default | Description |
Real | bandwidth | 1 | Bandwidth around reference signal |
Connectors
Type | Name | Description |
input RealInput | u | Measured signal |
input RealInput | reference | Connector of Real input signal used as reference signal |
output IntegerOutput | stage | Coil stage control signal |
Modelica definition
model ControllerTwoStage
extends Buildings.BaseClasses.BaseIcon;
parameter Real bandwidth=1
;
Modelica.Blocks.Logical.OnOffController con1(
final bandwidth=bandwidth/2,
final pre_y_start=true)
;
Modelica.Blocks.Logical.OnOffController con2(
final bandwidth=bandwidth/2,
final pre_y_start=true)
;
Modelica.Blocks.Interfaces.RealInput u
;
Modelica.Blocks.Interfaces.RealInput reference
;
Modelica.Blocks.Math.Add add(
final k2=-1)
;
Modelica.Blocks.Sources.Constant const(
final k=bandwidth/2)
;
Modelica.Blocks.Math.Add add1
;
Modelica.Blocks.MathInteger.MultiSwitch multiSwitch1(
final expr={2,1},
final y_default=0,
final use_pre_as_default=false,
final nu=2)
;
Modelica.Blocks.Interfaces.IntegerOutput stage
;
Modelica.Blocks.Logical.Not not1
;
Modelica.Blocks.Logical.Not not2
;
equation
connect(con1.reference, reference);
connect(const.y, add.u2);
connect(const.y, add1.u1);
connect(add.u1, u);
connect(add1.u2, u);
connect(add.y, con1.u);
connect(add1.y, con2.u);
connect(reference, con2.reference);
connect(multiSwitch1.y, stage);
connect(not2.y, multiSwitch1.u[1]);
connect(not1.y, multiSwitch1.u[2]);
connect(con1.y, not1.u);
connect(con2.y, not2.u);
end ControllerTwoStage;