Skip to content

Commit

Permalink
rework nominal condition approach for reversible operation, fix minor…
Browse files Browse the repository at this point in the history
… concerns by Antoine
  • Loading branch information
FWuellhorst committed Feb 29, 2024
1 parent c445e0a commit adc727d
Show file tree
Hide file tree
Showing 31 changed files with 230 additions and 272 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ model LargeScaleWaterToWater
IBPSA.Fluid.Chillers.ModularReversible.Data.TableData2D.EN14511.Carrier30XWP1012_1MW
datTab,
redeclare IBPSA.Fluid.HeatPumps.ModularReversible.Controls.Safety.Data.Wuellhorst2021
safCtrParEurNor,
safCtrPar,
redeclare package MediumCon = MediumCon,
redeclare package MediumEva = MediumEva,
QCoo_flow_nominal=-1000000,
TCon_nominal=313.15,
TConCoo_nominal=313.15,
dpCon_nominal(displayUnit="Pa") = 6000,
TEva_nominal=278.15,
TEvaCoo_nominal=278.15,
dpEva_nominal(displayUnit="Pa") = 6000,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
"Large scale water to water chiller"
Expand Down Expand Up @@ -61,19 +61,19 @@ model LargeScaleWaterToWater
annotation (Placement(transformation(extent={{52,-40},{72,-20}})));
equation
connect(souCon.ports[1], chi.port_a1) annotation (Line(
points={{-40,16},{-20,16},{-20,15},{-5.55112e-16,15}},
points={{-40,16},{-20,16},{-20,16},{-5.55112e-16,16}},
color={0,127,255},
smooth=Smooth.None));
connect(souEva.ports[1], chi.port_a2) annotation (Line(
points={{40,4},{30,4},{30,5},{20,5}},
points={{40,4},{30,4},{30,4},{20,4}},
color={0,127,255},
smooth=Smooth.None));
connect(chi.port_b1, sinCon.ports[1]) annotation (Line(
points={{20,15},{30,15},{30,40},{60,40}},
points={{20,16},{30,16},{30,40},{60,40}},
color={0,127,255},
smooth=Smooth.None));
connect(sinEva.ports[1], chi.port_b2) annotation (Line(
points={{-40,-20},{-10,-20},{-10,5},{-5.55112e-16,5}},
points={{-40,-20},{-10,-20},{-10,4},{-5.55112e-16,4}},
color={0,127,255},
smooth=Smooth.None));
connect(TConIn.y, souCon.T_in) annotation (Line(
Expand All @@ -84,8 +84,8 @@ equation
points={{73,-30},{80,-30},{80,8},{62,8}},
color={0,0,127},
smooth=Smooth.None));
connect(ySet.y, chi.ySet) annotation (Line(points={{-39,60},{-16,60},{-16,
11.6667},{-1.6,11.6667}}, color={0,0,127}));
connect(ySet.y, chi.ySet) annotation (Line(points={{-39,60},{-16,60},{-16,12},{-1.2,
12}}, color={0,0,127}));
annotation (experiment(Tolerance=1e-6, StopTime=3600),
__Dymola_Commands(file="modelica://IBPSA/Resources/Scripts/Dymola/Fluid/Chillers/ModularReversible/Examples/LargeScaleWaterToWater.mos"
"Simulate and plot"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ model ModularReversible
redeclare
IBPSA.Fluid.HeatPumps.ModularReversible.Controls.Safety.Data.Wuellhorst2021
safCtrPar(minOffTime=100, use_opeEnv=false),
TCon_nominal=313.15,
TConCoo_nominal=313.15,
dpCon_nominal(displayUnit="Pa") = 6000,
use_conCap=false,
CCon=0,
GConOut=0,
GConIns=0,
TEva_nominal=278.15,
TEvaCoo_nominal=278.15,
dTEva_nominal=5,
dTCon_nominal=5,
dpEva_nominal(displayUnit="Pa") = 6000,
Expand Down Expand Up @@ -89,19 +89,19 @@ model ModularReversible
annotation (Placement(transformation(extent={{-60,-60},{-40,-40}})));
equation
connect(souCon.ports[1], chi.port_a1) annotation (Line(
points={{-40,16},{-20,16},{-20,16},{-5.55112e-16,16}},
points={{-40,16},{0,16}},
color={0,127,255},
smooth=Smooth.None));
connect(souEva.ports[1], chi.port_a2) annotation (Line(
points={{40,4},{30,4},{30,4},{20,4}},
points={{40,4},{20,4}},
color={0,127,255},
smooth=Smooth.None));
connect(chi.port_b1, sinCon.ports[1]) annotation (Line(
points={{20,16},{30,16},{30,40},{60,40}},
color={0,127,255},
smooth=Smooth.None));
connect(sinEva.ports[1], chi.port_b2) annotation (Line(
points={{-40,-20},{-10,-20},{-10,4},{-5.55112e-16,4}},
points={{-40,-20},{-10,-20},{-10,4},{0,4}},
color={0,127,255},
smooth=Smooth.None));
connect(TConIn.y, souCon.T_in) annotation (Line(
Expand All @@ -112,10 +112,10 @@ equation
points={{75,-30},{80,-30},{80,8},{62,8}},
color={0,0,127},
smooth=Smooth.None));
connect(ySet.y, chi.ySet) annotation (Line(points={{-39,60},{-16,60},{-16,12},{-1.2,
12}}, color={0,0,127}));
connect(chiCoo.y, chi.coo) annotation (Line(points={{-39,-50},{-22,-50},{-22,7.9},
{-1.1,7.9}}, color={255,0,255}));
connect(ySet.y, chi.ySet) annotation (Line(points={{-39,60},{-16,60},{-16,12},{
-1.2,12}}, color={0,0,127}));
connect(chiCoo.y, chi.coo) annotation (Line(points={{-39,-50},{-22,-50},{-22,
7.9},{-1.1,7.9}}, color={255,0,255}));
annotation (experiment(Tolerance=1e-6, StopTime=3600),
__Dymola_Commands(file="modelica://IBPSA/Resources/Scripts/Dymola/Fluid/Chillers/ModularReversible/Examples/ModularReversible.mos"
"Simulate and plot"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ model ReversibleCarnotWithLosses
use_maxCycRat=false,
tabUppHea=[263.15,313.15; 333.15,313.15],
tabLowCoo=[263.15,283.15; 333.15,283.15],
use_TUseSidOut=true),
TCon_nominal=313.15,
use_TEvaOutCoo=true),
TConCoo_nominal=313.15,
dpCon_nominal(displayUnit="Pa") = 6000,
use_conCap=false,
CCon=0,
GConOut=0,
GConIns=0,
TEva_nominal=278.15,
TEvaCoo_nominal=278.15,
dTEva_nominal(displayUnit="K") = 10,
dTCon_nominal(displayUnit="K") = 5,
dpEva_nominal(displayUnit="Pa") = 6000,
Expand All @@ -33,7 +33,9 @@ model ReversibleCarnotWithLosses
GEvaIns=0,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
show_T=true,
QHea_flow_nominal=40000)
QHea_flow_nominal=40000,
TConHea_nominal=293.15,
TEvaHea_nominal=303.15)
"Chiller instance with reversbile Carnot approach"
annotation (Placement(transformation(extent={{0,0},{20,20}})));
IBPSA.Fluid.Sources.MassFlowSource_T souCon(
Expand Down
23 changes: 9 additions & 14 deletions IBPSA/Fluid/Chillers/ModularReversible/LargeScaleWaterToWater.mo
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
within IBPSA.Fluid.Chillers.ModularReversible;
model LargeScaleWaterToWater "Large scale water to water chiller"
extends ModularReversible(
final safCtrPar=safCtrParEurNor,
dpEva_nominal=datTab.dpEva_nominal*scaFac^2,
dpCon_nominal=datTab.dpCon_nominal*scaFac^2,
final dTEva_nominal=-QCoo_flow_nominal/cpEva/mEva_flow_nominal,
Expand All @@ -16,6 +15,14 @@ model LargeScaleWaterToWater "Large scale water to water chiller"
final GConOut=0,
final CCon=0,
final use_conCap=false,
redeclare replaceable
IBPSA.Fluid.HeatPumps.ModularReversible.Controls.Safety.Data.Wuellhorst2021 safCtrPar
constrainedby
IBPSA.Fluid.HeatPumps.ModularReversible.Controls.Safety.Data.Generic(
final tabUppHea=datTab.tabLowBou,
final tabLowCoo=datTab.tabLowBou,
final use_TEvaOutCoo=datTab.use_TEvaOutForOpeEnv,
final use_TConOutCoo=datTab.use_TConOutForOpeEnv),
redeclare model RefrigerantCycleInertia =
IBPSA.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.Inertias.NoInertia,
redeclare model RefrigerantCycleChillerHeating =
Expand All @@ -31,6 +38,7 @@ model LargeScaleWaterToWater "Large scale water to water chiller"
final mEva_flow_nominal=autCalMasEva_flow,
final tauCon=autCalVCon*rhoCon/autCalMasCon_flow,
final tauEva=autCalVEva*rhoEva/autCalMasEva_flow);
final parameter Real scaFac=refCyc.refCycChiCoo.scaFac "Scaling factor of chiller";

extends IBPSA.Fluid.HeatPumps.ModularReversible.BaseClasses.LargeScaleWaterToWaterDeclarations(
final autCalMasCon_flow=max(5E-5*abs(QCoo_flow_nominal) + 0.3161, autCalMMin_flow),
Expand All @@ -42,19 +50,6 @@ model LargeScaleWaterToWater "Large scale water to water chiller"
datTab constrainedby Data.TableData2D.Generic "Data Table of Chiller"
annotation (choicesAllMatching=true,
Placement(transformation(extent={{42,12},{58,28}})));
// Upper boundary has no influence as use_rev=false.
// Thus, setting tabUppHea to tabLowBou
replaceable parameter
IBPSA.Fluid.HeatPumps.ModularReversible.Controls.Safety.Data.Wuellhorst2021
safCtrParEurNor constrainedby
IBPSA.Fluid.HeatPumps.ModularReversible.Controls.Safety.Data.Generic(
final tabUppHea=datTab.tabLowBou,
final tabLowCoo=datTab.tabLowBou,
final use_TUseSidOut=datTab.use_TEvaOutForOpeEnv,
final use_TAmbSidOut=datTab.use_TConOutForOpeEnv) "Safety control parameters"
annotation (Dialog(enable=use_intSafCtr, group="Safety control"),
choicesAllMatching=true,
Placement(transformation(extent={{72,12},{88,28}})));

annotation (Documentation(info="<html>
<p>
Expand Down
42 changes: 21 additions & 21 deletions IBPSA/Fluid/Chillers/ModularReversible/ModularReversible.mo
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ model ModularReversible
final PEle_nominal=refCyc.refCycChiCoo.PEle_nominal,
mEva_flow_nominal=-QCoo_flow_nominal/(dTEva_nominal*cpEva),
mCon_flow_nominal=(PEle_nominal - QCoo_flow_nominal)/(dTCon_nominal*cpCon),
final scaFac=refCyc.refCycChiCoo.scaFac,
use_rev=true,
redeclare IBPSA.Fluid.Chillers.ModularReversible.BaseClasses.RefrigerantCycle refCyc(
redeclare model RefrigerantCycleChillerCooling =
Expand All @@ -24,46 +23,47 @@ model ModularReversible
annotation(Dialog(group="Nominal condition"));
parameter Modelica.Units.SI.HeatFlowRate QHea_flow_nominal=0
"Nominal heating capacity"
annotation(Dialog(group="Nominal condition", enable=use_rev));
annotation(Dialog(group="Nominal condition - Heating", enable=use_rev));

replaceable model RefrigerantCycleChillerCooling =
IBPSA.Fluid.Chillers.ModularReversible.RefrigerantCycle.BaseClasses.PartialChillerCycle
(PEle_nominal=0,
QCooNoSca_flow_nominal=0)
(PEle_nominal=0)
constrainedby
IBPSA.Fluid.Chillers.ModularReversible.RefrigerantCycle.BaseClasses.PartialChillerCycle(
final useInChi=true,
final TCon_nominal=TConCoo_nominal,
final TEva_nominal=TEvaCoo_nominal,
final QCoo_flow_nominal=QCoo_flow_nominal,
final TCon_nominal=TCon_nominal,
final TEva_nominal=TEva_nominal,
final dTCon_nominal=dTCon_nominal,
final dTEva_nominal=dTEva_nominal,
final mCon_flow_nominal=mCon_flow_nominal,
final mEva_flow_nominal=mEva_flow_nominal,
final cpCon=cpCon,
final cpEva=cpEva,
final y_nominal=y_nominal)
final cpEva=cpEva)
"Refrigerant cycle module for the cooling mode"
annotation (choicesAllMatching=true);

replaceable model RefrigerantCycleChillerHeating =
IBPSA.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.NoHeating
(PEle_nominal=PEle_nominal)
constrainedby
IBPSA.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.PartialHeatPumpCycle(
final useInHeaPum=false,
final TCon_nominal=TEvaHea_nominal,
final TEva_nominal=TConHea_nominal,
final QHea_flow_nominal=QHea_flow_nominal,
final PEle_nominal=refCyc.refCycChiCoo.PEle_nominal,
final TCon_nominal=TCon_nominal,
final TEva_nominal=TEva_nominal,
final dTCon_nominal=dTCon_nominal,
final dTEva_nominal=dTEva_nominal,
final mCon_flow_nominal=mCon_flow_nominal,
final mEva_flow_nominal=mEva_flow_nominal,
final cpCon=cpCon,
final cpEva=cpEva,
final y_nominal=y_nominal)
final cpEva=cpEva)
"Refrigerant cycle module for the heating mode"
annotation (Dialog(enable=use_rev),choicesAllMatching=true);
parameter Modelica.Units.SI.Temperature TConCoo_nominal
"Nominal temperature at secondary condenser side in cooling mode"
annotation(Dialog(enable=use_rev, group="Nominal condition"));
parameter Modelica.Units.SI.Temperature TEvaCoo_nominal
"Nominal temperature at secondary evaporator side in cooling mode"
annotation(Dialog(enable=use_rev, group="Nominal condition"));
parameter Modelica.Units.SI.Temperature TConHea_nominal=TConCoo_nominal
"Nominal temperature at secondary condenser side in heating mode"
annotation (Dialog(group="Nominal condition - Heating"));
parameter Modelica.Units.SI.Temperature TEvaHea_nominal=TEvaCoo_nominal
"Nominal temperature at secondary evaporator side in heating mode"
annotation (Dialog(group="Nominal condition - Heating"));

Modelica.Blocks.Interfaces.BooleanInput coo if not use_busConOnl and use_rev
"=true for cooling, =false for heating"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,15 @@ within IBPSA.Fluid.Chillers.ModularReversible.RefrigerantCycle.BaseClasses;
model NoCooling
"Placeholder to disable cooling"
extends PartialChillerCycle(
TEva_nominal=273.15,
TCon_nominal=273.15,
cpEva=4184,
cpCon=4184,
PEle_nominal=0,
redeclare final
IBPSA.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.Frosting.NoFrosting
iceFacCal,
datSou="",
QCooNoSca_flow_nominal=1,
scaFac=0,
mEva_flow_nominal=1,
mCon_flow_nominal=1,
dTEva_nominal=0,
dTCon_nominal=0,
TEva_nominal=273.15,
TCon_nominal=273.15,
QCoo_flow_nominal=0);

Modelica.Blocks.Sources.Constant const(final k=0) "Zero energy flows"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@ within IBPSA.Fluid.Chillers.ModularReversible.RefrigerantCycle.BaseClasses;
partial model PartialChillerCycle
"Partial model of refrigerant cycle used for chiller applications"
extends
IBPSA.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.PartialRefrigerantCycle(
scaFac=QCoo_flow_nominal/QCooNoSca_flow_nominal);
IBPSA.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.PartialRefrigerantCycle;
parameter Modelica.Units.SI.HeatFlowRate QCoo_flow_nominal
"Nominal cooling capacity"
annotation (Dialog(group="Nominal condition"));
parameter Modelica.Units.SI.HeatFlowRate QCooNoSca_flow_nominal
"Unscaled nominal cooling capacity "
annotation (Dialog(group="Nominal condition"));
parameter Boolean useInChi
"=false to indicate that this model is used as a heat pump";
equation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ model ConstantCarnotEffectiveness "Carnot EER with a constant Carnot effectivene
extends
IBPSA.Fluid.Chillers.ModularReversible.RefrigerantCycle.BaseClasses.PartialChillerCycle(
useInChi=true,
PEle_nominal=-QCoo_flow_nominal/EER_nominal/y_nominal,
QCooNoSca_flow_nominal=QCoo_flow_nominal,
PEle_nominal=-QCoo_flow_nominal/EER_nominal,
datSou="ConstantCarnotEffectiveness");
extends
IBPSA.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.PartialCarnot(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,33 @@ model TableData2D
extends
IBPSA.Fluid.Chillers.ModularReversible.RefrigerantCycle.BaseClasses.PartialChillerCycle(
final datSou=datTab.devIde,
mEva_flow_nominal=datTab.mEva_flow_nominal*scaFac,
mCon_flow_nominal=datTab.mCon_flow_nominal*scaFac,
PEle_nominal=Modelica.Blocks.Tables.Internal.getTable2DValueNoDer2(
tabIdePEle,
TEva_nominal,
TCon_nominal) * scaFac * y_nominal,
QCooNoSca_flow_nominal=
Modelica.Blocks.Tables.Internal.getTable2DValueNoDer2(
tabIdeQUse_flow,
TEva_nominal,
TCon_nominal) * y_nominal);
TCon_nominal) * scaFac);
extends
IBPSA.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses.PartialTableData2D(
final useInRevDev=not useInChi,
final use_TConOutForTab=datTab.use_TConOutForTab,
final use_TEvaOutForTab=datTab.use_TEvaOutForTab,
tabQUse_flow(final table=datTab.tabQEva_flow),
tabPEle(final table=datTab.tabPEle),
scaFac=QCoo_flow_nominal/QCooNoSca_flow_nominal,
mEva_flow_nominal=datTab.mEva_flow_nominal*scaFac,
mCon_flow_nominal=datTab.mCon_flow_nominal*scaFac,
final valTabQEva_flow = {{-tabQUse_flow.table[j, i] for i in 2:numCol} for j in 2:numRow},
final valTabQCon_flow = valTabQEva_flow .+ valTabPEle,
final mCon_flow_nominal_internal=mCon_flow_nominal,
final mEva_flow_nominal_internal=mEva_flow_nominal,
final mCon_flow_max=max(valTabQCon_flow) * scaFac / cpCon / dTMin,
final mCon_flow_min=min(valTabQCon_flow) * scaFac / cpCon / dTMax,
final mEva_flow_min=min(valTabQEva_flow) * scaFac / cpEva / dTMax,
final mEva_flow_max=max(valTabQEva_flow) * scaFac / cpEva / dTMin,
constScaFac(final k=scaFac));
final mEva_flow_max=max(valTabQEva_flow) * scaFac / cpEva / dTMin);
parameter Modelica.Units.SI.HeatFlowRate QCooNoSca_flow_nominal=
Modelica.Blocks.Tables.Internal.getTable2DValueNoDer2(
tabIdeQUse_flow,
TEva_nominal,
TCon_nominal)
"Unscaled nominal cooling capacity "
annotation (Dialog(group="Nominal condition"));
replaceable parameter IBPSA.Fluid.Chillers.ModularReversible.Data.TableData2D.Generic datTab
"Data Table of Chiller" annotation (choicesAllMatching=true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ within IBPSA.Fluid.Chillers.ModularReversible;
model ReversibleCarnotWithLosses
"Reversible chiller using Carnot approach with losses (frost, heat, inertia)"
extends IBPSA.Fluid.Chillers.ModularReversible.ModularReversible(
QHea_flow_nominal=PEle_nominal*refCyc.refCycChiHea.COP_nominal,
redeclare model RefrigerantCycleChillerHeating =
IBPSA.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.ConstantCarnotEffectiveness
(
PEle_nominal=PEle_nominal,
redeclare
IBPSA.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.Frosting.NoFrosting
iceFacCal,
Expand Down Expand Up @@ -33,11 +35,11 @@ model ReversibleCarnotWithLosses
parameter Modelica.Units.SI.TemperatureDifference TAppCon_nominal=if
cpCon < 1500 then 5 else 2
"Temperature difference between refrigerant and working fluid outlet in condenser"
annotation(Dialog(group="Nominal condition - Condenser"));
annotation(Dialog(group="Nominal condition"));
parameter Modelica.Units.SI.TemperatureDifference TAppEva_nominal=if
cpEva < 1500 then 5 else 2
"Temperature difference between refrigerant and working fluid outlet in evaporator"
annotation(Dialog(group="Nominal condition - Evaporator"));
annotation(Dialog(group="Nominal condition"));
parameter Modelica.Units.SI.Time refIneTimCon = 300
"Refrigerant cycle inertia time constant for first order delay"
annotation(Dialog(group="Refrigerant cycle inertia"));
Expand Down
Loading

0 comments on commit adc727d

Please sign in to comment.