Collection of models that validate the chiller models
Information
This package contains models that validate the chiller models.
The examples plot various outputs, which have been verified against
analytical solutions. These model outputs are stored as reference data to
allow continuous validation whenever models in the library change.
Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).
Package Content
Name |
Description |
Carnot_TEva_2ndLaw
|
Test model to verify that the 2nd law is not violated |
Carnot_TEva_HighTemperature
|
Test model for Carnot_TEva with high evaporator temperature |
Carnot_TEva_LimitedCapacity
|
Test model for Carnot_TEva with limited heating capacity |
Carnot_TEva_etaPL
|
Test model for the part load efficiency curve with evaporator leaving temperature as input signal |
Carnot_TEva_reverseFlow
|
Test model for chiller based on Carnot efficiency and evaporator outlet temperature control signal |
Carnot_y_etaPL
|
Test model for the part load efficiency curve with compressor speed as input signal |
Test model to verify that the 2nd law is not violated
Information
This example verifies that the 2nd law of thermodynamics is not violated
despite of a very small temperature lift.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
TemperatureDifference | dTEva_nominal | -4 | Temperature difference evaporator outlet-inlet [K] |
TemperatureDifference | dTCon_nominal | 4 | Temperature difference condenser outlet-inlet [K] |
Real | COPc_nominal | 3 | Chiller COP |
HeatFlowRate | QEva_flow_nominal | -100E3 | Evaporator heat flow rate [W] |
Modelica definition
model Carnot_TEva_2ndLaw
extends Modelica.Icons.Example;
package Medium =
Annex60.Media.Water ;
parameter Modelica.SIunits.TemperatureDifference dTEva_nominal=-4
;
parameter Modelica.SIunits.TemperatureDifference dTCon_nominal=4
;
parameter Real COPc_nominal = 3 ;
parameter Modelica.SIunits.HeatFlowRate QEva_flow_nominal = -100E3
;
final parameter Modelica.SIunits.MassFlowRate m2_flow_nominal=
QEva_flow_nominal/dTEva_nominal/4200
;
final parameter Modelica.SIunits.MassFlowRate m1_flow_nominal=
-m2_flow_nominal/dTCon_nominal*dTEva_nominal
;
Modelica.Blocks.Sources.Constant TEvaIn(k=273.15 + 20)
;
Modelica.Blocks.Sources.Constant dTEva(k=dTEva_nominal)
;
Modelica.Blocks.Math.Add TSetEvaLvg
;
Modelica.Blocks.Sources.Ramp dTConEva(
duration=1,
offset=25,
height=-25)
;
Modelica.Blocks.Math.Add TConIn ;
Chiller chi_b(
redeclare final package Medium1 = Medium,
redeclare final package Medium2 = Medium,
final dTEva_nominal=dTEva_nominal,
final dTCon_nominal=dTCon_nominal,
final QEva_flow_nominal=QEva_flow_nominal,
final m2_flow_nominal=m2_flow_nominal,
final m1_flow_nominal=m1_flow_nominal)
;
protected
model Chiller
replaceable package Medium1 =
Modelica.Media.Interfaces.PartialMedium
;
replaceable package Medium2 =
Modelica.Media.Interfaces.PartialMedium
;
parameter Modelica.SIunits.TemperatureDifference dTEva_nominal
;
parameter Modelica.SIunits.TemperatureDifference dTCon_nominal
;
parameter Modelica.SIunits.HeatFlowRate QEva_flow_nominal
;
parameter Modelica.SIunits.MassFlowRate m1_flow_nominal
;
parameter Modelica.SIunits.MassFlowRate m2_flow_nominal
;
Annex60.Fluid.Sources.MassFlowSource_T sou1(
redeclare package Medium =
Medium1,
nPorts=1,
use_m_flow_in=false,
use_T_in=true,
m_flow=m1_flow_nominal)
;
Annex60.Fluid.Sources.FixedBoundary sin1(
redeclare package Medium =
Medium2, nPorts=1)
;
Annex60.Fluid.Chillers.Carnot_TEva chi(
redeclare package Medium1 =
Medium1,
redeclare package Medium2 =
Medium2,
dTEva_nominal=dTEva_nominal,
dTCon_nominal=dTCon_nominal,
m2_flow_nominal=m2_flow_nominal,
show_T=true,
QEva_flow_nominal=QEva_flow_nominal,
allowFlowReversal1=false,
allowFlowReversal2=false,
etaCarnot_nominal=0.3,
dp1_nominal=0,
dp2_nominal=0,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState,
use_eta_Carnot_nominal=true) ;
Annex60.Fluid.Sources.MassFlowSource_T sou2(
redeclare package Medium =
Medium2,
m_flow=m2_flow_nominal,
use_T_in=true,
T=293.15,
nPorts=1) ;
Annex60.Fluid.Sensors.EntropyFlowRate S_a1(
redeclare package Medium =
Medium1,
m_flow_nominal=m1_flow_nominal,
tau=0) ;
Annex60.Fluid.Sensors.EntropyFlowRate S_a2(
redeclare package Medium =
Medium1,
m_flow_nominal=m1_flow_nominal,
tau=0) ;
Annex60.Fluid.Sensors.EntropyFlowRate S_a3(
redeclare package Medium =
Medium1,
m_flow_nominal=m1_flow_nominal,
tau=0) ;
Annex60.Fluid.Sensors.EntropyFlowRate S_a4(
redeclare package Medium =
Medium1,
m_flow_nominal=m1_flow_nominal,
tau=0) ;
Annex60.Fluid.Sources.FixedBoundary sin2(
redeclare package Medium =
Medium2, nPorts=1)
;
Modelica.Blocks.Math.Add SIn_flow
;
Modelica.Blocks.Math.Add SOut_flow
;
Modelica.Blocks.Math.Add dS_flow(k1=-1)
;
Modelica.Blocks.Interfaces.RealInput TSetEvaLea(unit="K")
;
Modelica.Blocks.Interfaces.RealOutput SGen_flow ;
Modelica.Blocks.Interfaces.RealInput TConIn(
final unit="K", displayUnit=
"degC") ;
Modelica.Blocks.Interfaces.RealInput TEvaIn(
final unit="K", displayUnit=
"degC") ;
equation
assert(SGen_flow > 0, "Entropy generated is zero or negative, which violates the 2nd law.
This is because the model is configured to use the inlet temperatures
to compute the Carnot efficiency, which can lead to non-physical results.",
level = AssertionLevel.warning);
connect(SIn_flow.y, dS_flow.u1);
connect(sin1.ports[1],S_a2. port_b);
connect(sou1.ports[1],S_a1. port_a);
connect(S_a1.port_b,chi. port_a1);
connect(chi.port_b1,S_a4. port_a);
connect(S_a4.port_b,sin2. ports[1]);
connect(S_a3.port_a,sou2. ports[1]);
connect(S_a2.port_a,chi. port_b2);
connect(S_a3.port_b,chi. port_a2);
connect(S_a4.S_flow,SOut_flow. u2);
connect(S_a2.S_flow,SOut_flow. u1);
connect(S_a3.S_flow,SIn_flow. u2);
connect(S_a1.S_flow,SIn_flow. u1);
connect(SOut_flow.y,dS_flow. u2);
connect(TSetEvaLea, chi.TSet);
connect(SGen_flow, dS_flow.y);
connect(TConIn, sou1.T_in);
connect(TEvaIn, sou2.T_in);
end Chiller;
equation
connect(TSetEvaLvg.u1, TEvaIn.y);
connect(dTEva.y, TSetEvaLvg.u2);
connect(TSetEvaLvg.y, TConIn.u1);
connect(dTConEva.y, TConIn.u2);
connect(TEvaIn.y, chi_b.TEvaIn);
connect(TSetEvaLvg.y, chi_b.TSetEvaLea);
connect(chi_b.TConIn, TConIn.y);
end Carnot_TEva_2ndLaw;
Test model for Carnot_TEva with high evaporator temperature
Information
This example extends from
Annex60.Fluid.Chillers.Examples.Carnot_TEva
but increases the set point for the leaving evaporator temperature
to be above its inlet temperature, in which case the model provides no cooling.
Towards the end of the simulation, the inlet temperature of the evaporator is increased
to be above the condenser temperature. In this domain, the model requires cooling
again. While this is not a meaningful operating point for the model, the example
verifies that it robustly simulates this regime.
Extends from Examples.Carnot_TEva (Test model for chiller based on Carnot efficiency and evaporator outlet temperature control signal).
Parameters
Type | Name | Default | Description |
TemperatureDifference | dTEva_nominal | -10 | Temperature difference evaporator outlet-inlet [K] |
TemperatureDifference | dTCon_nominal | 10 | Temperature difference condenser outlet-inlet [K] |
Real | COPc_nominal | 3 | Chiller COP |
HeatFlowRate | QEva_flow_nominal | -100E3 | Evaporator heat flow rate [W] |
MassFlowRate | m2_flow_nominal | QEva_flow_nominal/dTEva_nomi... | Nominal mass flow rate at chilled water side [kg/s] |
Modelica definition
model Carnot_TEva_HighTemperature
extends Examples.Carnot_TEva(TEvaLvg(height=34), sou2(use_T_in=true));
Modelica.Blocks.Sources.Ramp TEvaEnt(
startTime=3000,
height=38,
offset=273.15 + 22,
duration=60) ;
equation
connect(TEvaEnt.y, sou2.T_in);
end Carnot_TEva_HighTemperature;
Test model for Carnot_TEva with limited heating capacity
Information
This example extends from
Annex60.Fluid.Chillers.Examples.Carnot_TEva
but limits the cooling capacity.
Extends from Examples.Carnot_TEva (Test model for chiller based on Carnot efficiency and evaporator outlet temperature control signal).
Parameters
Type | Name | Default | Description |
TemperatureDifference | dTEva_nominal | -10 | Temperature difference evaporator outlet-inlet [K] |
TemperatureDifference | dTCon_nominal | 10 | Temperature difference condenser outlet-inlet [K] |
Real | COPc_nominal | 3 | Chiller COP |
HeatFlowRate | QEva_flow_nominal | -100E3 | Evaporator heat flow rate [W] |
MassFlowRate | m2_flow_nominal | QEva_flow_nominal/dTEva_nomi... | Nominal mass flow rate at chilled water side [kg/s] |
Modelica definition
model Carnot_TEva_LimitedCapacity
extends Examples.Carnot_TEva(
chi(QEva_flow_min=-100000));
end Carnot_TEva_LimitedCapacity;
Test model for the part load efficiency curve with evaporator leaving temperature as input signal
Information
This example extends from
Annex60.Fluid.Chillers.Examples.Carnot_TEva
but has a part load efficiency that varies with the load.
Extends from Examples.Carnot_TEva (Test model for chiller based on Carnot efficiency and evaporator outlet temperature control signal).
Parameters
Type | Name | Default | Description |
TemperatureDifference | dTEva_nominal | -10 | Temperature difference evaporator outlet-inlet [K] |
TemperatureDifference | dTCon_nominal | 10 | Temperature difference condenser outlet-inlet [K] |
Real | COPc_nominal | 3 | Chiller COP |
HeatFlowRate | QEva_flow_nominal | -100E3 | Evaporator heat flow rate [W] |
MassFlowRate | m2_flow_nominal | QEva_flow_nominal/dTEva_nomi... | Nominal mass flow rate at chilled water side [kg/s] |
Modelica definition
model Carnot_TEva_etaPL
extends Examples.Carnot_TEva(
chi(a={0.7,0.3},
QEva_flow_min=-100000));
end Carnot_TEva_etaPL;
Test model for chiller based on Carnot efficiency and evaporator outlet temperature control signal
Information
Example that simulates a chiller whose efficiency is scaled based on the
Carnot cycle.
The chiller takes as an input the evaporator leaving water temperature.
The condenser mass flow rate is computed in such a way that it has
a temperature difference equal to dTEva_nominal
.
This example checks the correct behavior if a mass flow rate attains zero.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
TemperatureDifference | dTEva_nominal | -10 | Temperature difference evaporator inlet-outlet [K] |
TemperatureDifference | dTCon_nominal | 10 | Temperature difference condenser outlet-inlet [K] |
Real | COPc_nominal | 3 | Chiller COP |
HeatFlowRate | QEva_flow_nominal | -100E3 | Evaporator heat flow rate [W] |
MassFlowRate | m2_flow_nominal | QEva_flow_nominal/dTEva_nomi... | Nominal mass flow rate at chilled water side [kg/s] |
MassFlowRate | m1_flow_nominal | m2_flow_nominal*(COPc_nomina... | Nominal mass flow rate at condenser water wide [kg/s] |
Modelica definition
model Carnot_TEva_reverseFlow
extends Modelica.Icons.Example;
package Medium1 =
Annex60.Media.Water ;
package Medium2 =
Annex60.Media.Water ;
parameter Modelica.SIunits.TemperatureDifference dTEva_nominal=-10
;
parameter Modelica.SIunits.TemperatureDifference dTCon_nominal=10
;
parameter Real COPc_nominal = 3 ;
parameter Modelica.SIunits.HeatFlowRate QEva_flow_nominal = -100E3
;
parameter Modelica.SIunits.MassFlowRate m2_flow_nominal=
QEva_flow_nominal/dTEva_nominal/4200
;
parameter Modelica.SIunits.MassFlowRate m1_flow_nominal=
m2_flow_nominal*(COPc_nominal+1)/COPc_nominal
;
Annex60.Fluid.Chillers.Carnot_TEva chi(
redeclare package Medium1 = Medium1,
redeclare package Medium2 = Medium2,
dTEva_nominal=dTEva_nominal,
dTCon_nominal=dTCon_nominal,
use_eta_Carnot_nominal=true,
etaCarnot_nominal=0.3,
m1_flow_nominal=m1_flow_nominal,
m2_flow_nominal=m2_flow_nominal,
show_T=true,
QEva_flow_nominal=QEva_flow_nominal,
allowFlowReversal1=true,
allowFlowReversal2=true,
dp1_nominal=6000,
dp2_nominal=6000) ;
Annex60.Fluid.Sources.MassFlowSource_T sou1(nPorts=1,
redeclare package Medium = Medium1,
m_flow=m1_flow_nominal,
use_T_in=false,
use_m_flow_in=true,
T=298.15);
Annex60.Fluid.Sources.MassFlowSource_T sou2(nPorts=1,
redeclare package Medium = Medium2,
m_flow=m2_flow_nominal,
use_T_in=false,
use_m_flow_in=true,
T=295.15);
Annex60.Fluid.Sources.FixedBoundary sin1(
redeclare package Medium = Medium1,
nPorts=1);
Annex60.Fluid.Sources.FixedBoundary sin2(nPorts=1,
redeclare package Medium = Medium2);
Modelica.Blocks.Sources.Constant
TEvaLvg(k=273.15 + 10)
;
Modelica.Blocks.Math.Gain mCon_flow(k=-1/cp1_default/dTEva_nominal)
;
Modelica.Blocks.Math.Add QCon_flow(k2=-1) ;
final parameter Modelica.SIunits.SpecificHeatCapacity cp1_default=
Medium1.specificHeatCapacityCp(
Medium1.setState_pTX(
Medium1.p_default,
Medium1.T_default,
Medium1.X_default))
;
Modelica.Blocks.Sources.Ramp mEva_flow(
duration=60,
startTime=1800,
height=-2*m2_flow_nominal,
offset=m2_flow_nominal) ;
equation
connect(sou1.ports[1], chi.port_a1);
connect(sou2.ports[1], chi.port_a2);
connect(sin2.ports[1], chi.port_b2);
connect(TEvaLvg.y, chi.TSet);
connect(chi.P, QCon_flow.u1);
connect(chi.QEva_flow, QCon_flow.u2);
connect(QCon_flow.y, mCon_flow.u);
connect(mCon_flow.y, sou1.m_flow_in);
connect(chi.port_b1, sin1.ports[1]);
connect(mEva_flow.y, sou2.m_flow_in);
end Carnot_TEva_reverseFlow;
Test model for the part load efficiency curve with compressor speed as input signal
Information
This example extends from
Annex60.Fluid.Chillers.Examples.Carnot_y
but uses a part load efficiency curve that is different from 1.
Extends from Examples.Carnot_y (Test model for chiller based on Carnot_y efficiency).
Parameters
Type | Name | Default | Description |
Power | P_nominal | 10E3 | Nominal compressor power (at y=1) [W] |
TemperatureDifference | dTEva_nominal | -10 | Temperature difference evaporator outlet-inlet [K] |
TemperatureDifference | dTCon_nominal | 10 | Temperature difference condenser outlet-inlet [K] |
Real | COPc_nominal | 3 | Chiller COP |
MassFlowRate | m2_flow_nominal | -P_nominal*COPc_nominal/dTEv... | Nominal mass flow rate at chilled water side [kg/s] |
MassFlowRate | m1_flow_nominal | m2_flow_nominal*(COPc_nomina... | Nominal mass flow rate at condenser water wide [kg/s] |
Modelica definition
model Carnot_y_etaPL
extends Examples.Carnot_y(chi(a={0.7,0.3}));
end Carnot_y_etaPL;
Subsystem model with the chiller
Parameters
Type | Name | Default | Description |
replaceable package Medium1 | Modelica.Media.Interfaces.Pa... | Medium model |
replaceable package Medium2 | Modelica.Media.Interfaces.Pa... | Medium model |
TemperatureDifference | dTEva_nominal | | Temperature difference evaporator outlet-inlet [K] |
TemperatureDifference | dTCon_nominal | | Temperature difference condenser outlet-inlet [K] |
HeatFlowRate | QEva_flow_nominal | | Evaporator heat flow rate [W] |
MassFlowRate | m1_flow_nominal | | Nominal mass flow rate at condeser water side [kg/s] |
MassFlowRate | m2_flow_nominal | | Nominal mass flow rate at chilled water side [kg/s] |
Connectors
Type | Name | Description |
replaceable package Medium1 | Medium model |
replaceable package Medium2 | Medium model |
input RealInput | TSetEvaLea | Set point for evaporator leaving temperature [K] |
output RealOutput | SGen_flow | Entropy generated |
input RealInput | TConIn | Condenser inlet temperature [K] |
input RealInput | TEvaIn | Evaporator inlet temperature [K] |
Modelica definition
model Chiller
replaceable package Medium1 =
Modelica.Media.Interfaces.PartialMedium
;
replaceable package Medium2 =
Modelica.Media.Interfaces.PartialMedium
;
parameter Modelica.SIunits.TemperatureDifference dTEva_nominal
;
parameter Modelica.SIunits.TemperatureDifference dTCon_nominal
;
parameter Modelica.SIunits.HeatFlowRate QEva_flow_nominal
;
parameter Modelica.SIunits.MassFlowRate m1_flow_nominal
;
parameter Modelica.SIunits.MassFlowRate m2_flow_nominal
;
Annex60.Fluid.Sources.MassFlowSource_T sou1(
redeclare package Medium =
Medium1,
nPorts=1,
use_m_flow_in=false,
use_T_in=true,
m_flow=m1_flow_nominal)
;
Annex60.Fluid.Sources.FixedBoundary sin1(
redeclare package Medium =
Medium2, nPorts=1)
;
Annex60.Fluid.Chillers.Carnot_TEva chi(
redeclare package Medium1 =
Medium1,
redeclare package Medium2 =
Medium2,
dTEva_nominal=dTEva_nominal,
dTCon_nominal=dTCon_nominal,
m2_flow_nominal=m2_flow_nominal,
show_T=true,
QEva_flow_nominal=QEva_flow_nominal,
allowFlowReversal1=false,
allowFlowReversal2=false,
etaCarnot_nominal=0.3,
dp1_nominal=0,
dp2_nominal=0,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState,
use_eta_Carnot_nominal=true) ;
Annex60.Fluid.Sources.MassFlowSource_T sou2(
redeclare package Medium =
Medium2,
m_flow=m2_flow_nominal,
use_T_in=true,
T=293.15,
nPorts=1) ;
Annex60.Fluid.Sensors.EntropyFlowRate S_a1(
redeclare package Medium =
Medium1,
m_flow_nominal=m1_flow_nominal,
tau=0) ;
Annex60.Fluid.Sensors.EntropyFlowRate S_a2(
redeclare package Medium =
Medium1,
m_flow_nominal=m1_flow_nominal,
tau=0) ;
Annex60.Fluid.Sensors.EntropyFlowRate S_a3(
redeclare package Medium =
Medium1,
m_flow_nominal=m1_flow_nominal,
tau=0) ;
Annex60.Fluid.Sensors.EntropyFlowRate S_a4(
redeclare package Medium =
Medium1,
m_flow_nominal=m1_flow_nominal,
tau=0) ;
Annex60.Fluid.Sources.FixedBoundary sin2(
redeclare package Medium =
Medium2, nPorts=1)
;
Modelica.Blocks.Math.Add SIn_flow
;
Modelica.Blocks.Math.Add SOut_flow
;
Modelica.Blocks.Math.Add dS_flow(k1=-1)
;
Modelica.Blocks.Interfaces.RealInput TSetEvaLea(unit="K")
;
Modelica.Blocks.Interfaces.RealOutput SGen_flow ;
Modelica.Blocks.Interfaces.RealInput TConIn(
final unit="K", displayUnit=
"degC") ;
Modelica.Blocks.Interfaces.RealInput TEvaIn(
final unit="K", displayUnit=
"degC") ;
equation
assert(SGen_flow > 0, "Entropy generated is zero or negative, which violates the 2nd law.
This is because the model is configured to use the inlet temperatures
to compute the Carnot efficiency, which can lead to non-physical results.",
level = AssertionLevel.warning);
connect(SIn_flow.y, dS_flow.u1);
connect(sin1.ports[1],S_a2. port_b);
connect(sou1.ports[1],S_a1. port_a);
connect(S_a1.port_b,chi. port_a1);
connect(chi.port_b1,S_a4. port_a);
connect(S_a4.port_b,sin2. ports[1]);
connect(S_a3.port_a,sou2. ports[1]);
connect(S_a2.port_a,chi. port_b2);
connect(S_a3.port_b,chi. port_a2);
connect(S_a4.S_flow,SOut_flow. u2);
connect(S_a2.S_flow,SOut_flow. u1);
connect(S_a3.S_flow,SIn_flow. u2);
connect(S_a1.S_flow,SIn_flow. u1);
connect(SOut_flow.y,dS_flow. u2);
connect(TSetEvaLea, chi.TSet);
connect(SGen_flow, dS_flow.y);
connect(TConIn, sou1.T_in);
connect(TEvaIn, sou2.T_in);
end Chiller;
http://iea-annex60.org