diff --git a/IBPSA/Fluid/Chillers/ModularReversible/Validation/BaseClasses/PartialChillerComparison.mo b/IBPSA/Fluid/Chillers/ModularReversible/Validation/BaseClasses/PartialChillerComparison.mo index fe3aad6430..e1fb8d8db6 100644 --- a/IBPSA/Fluid/Chillers/ModularReversible/Validation/BaseClasses/PartialChillerComparison.mo +++ b/IBPSA/Fluid/Chillers/ModularReversible/Validation/BaseClasses/PartialChillerComparison.mo @@ -1,5 +1,5 @@ within IBPSA.Fluid.Chillers.ModularReversible.Validation.BaseClasses; -model PartialChillerComparison +partial model PartialChillerComparison "Partial model to allow chiller model comparison" package Medium1 = IBPSA.Media.Water "Medium model"; package Medium2 = IBPSA.Media.Water "Medium model"; diff --git a/IBPSA/Fluid/Chillers/ModularReversible/Validation/BaseClasses/PartialModularComparison.mo b/IBPSA/Fluid/Chillers/ModularReversible/Validation/BaseClasses/PartialModularComparison.mo index ccb2fac87b..806ef30c28 100644 --- a/IBPSA/Fluid/Chillers/ModularReversible/Validation/BaseClasses/PartialModularComparison.mo +++ b/IBPSA/Fluid/Chillers/ModularReversible/Validation/BaseClasses/PartialModularComparison.mo @@ -1,5 +1,5 @@ within IBPSA.Fluid.Chillers.ModularReversible.Validation.BaseClasses; -model PartialModularComparison +partial model PartialModularComparison "Partial model for comparison to Carnot_y" extends BaseClasses.PartialChillerComparison( m1_flow_nominal=chi.mCon_flow_nominal, @@ -39,7 +39,7 @@ model PartialModularComparison final TCon_start=T1_start, final TEva_start=T2_start, final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) - "Carnot chiller" + "Modular chiller model" annotation (Placement(transformation(extent={{-10,-12},{10,12}}))); equation diff --git a/IBPSA/Fluid/Chillers/ModularReversible/Validation/Carnot_y.mo b/IBPSA/Fluid/Chillers/ModularReversible/Validation/Carnot_y.mo index 388629b1bc..6594f8e503 100644 --- a/IBPSA/Fluid/Chillers/ModularReversible/Validation/Carnot_y.mo +++ b/IBPSA/Fluid/Chillers/ModularReversible/Validation/Carnot_y.mo @@ -42,7 +42,7 @@ equation annotation (Line(points={{-14,9},{-14,50},{-39,50}}, color={0,0,127})); annotation (experiment(Tolerance=1e-6, StopTime=3600), -__Dymola_Commands(file="modelica://IBPSA/Resources/Scripts/Dymola/Fluid/Chillers/Examples/Carnot_y.mos" +__Dymola_Commands(file="modelica://IBPSA/Resources/Scripts/Dymola/Fluid/Chillers/ModularReversible/Validation/Carnot_y.mos" "Simulate and plot"), Documentation(revisions="
+Partial model which is based on + +IBPSA.Fluid.HeatPumps.Examples.Carnot_y +to validate the modular reversible models by means of +comparison to the +IBPSA.Fluid.HeatPumps.Carnot_y model. +
+")); +end PartialComparison; diff --git a/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/Comparative/BaseClasses/PartialModularComparison.mo b/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/Comparative/BaseClasses/PartialModularComparison.mo new file mode 100644 index 0000000000..1e66868bba --- /dev/null +++ b/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/Comparative/BaseClasses/PartialModularComparison.mo @@ -0,0 +1,72 @@ +within IBPSA.Fluid.HeatPumps.ModularReversible.Validation.Comparative.BaseClasses; +partial model PartialModularComparison + "Partial model for comparison to Carnot_y" + extends PartialComparison( + m1_flow_nominal=heaPum.mCon_flow_nominal, + m2_flow_nominal=heaPum.mEva_flow_nominal, + sou1(nPorts=1), + sin2(nPorts=1), + sou2(nPorts=1), + sin1(nPorts=1)); + + IBPSA.Fluid.HeatPumps.ModularReversible.ModularReversible heaPum( + redeclare final package MediumCon = Medium1, + redeclare final package MediumEva = Medium2, + QUse_flow_nominal=QUse_nominal, + final y_nominal=1, + final cpCon=4184, + final cpEva=4184, + redeclare final model RefrigerantCycleInertia = + IBPSA.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.Inertias.NoInertia, + + final use_rev=false, + final use_intSafCtr=false, + final tauCon=tau1, + final TCon_nominal=TCon_nominal, + final dTCon_nominal=dTCon_nominal, + final dpCon_nominal=dp1_nominal, + final use_conCap=false, + final CCon=0, + final GConOut=0, + final GConIns=0, + final tauEva=tau2, + final TEva_nominal=TEva_nominal, + final dTEva_nominal=dTEva_nominal, + final dpEva_nominal=dp2_nominal, + final use_evaCap=false, + final CEva=0, + final GEvaOut=0, + final GEvaIns=0, + final TCon_start=T1_start, + final TEva_start=T2_start, + final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) + "Modular heat pump model" + annotation (Placement(transformation(extent={{-10,-12},{10,12}}))); + +equation + connect(heaPum.port_a1, sou1.ports[1]) + annotation (Line(points={{-10,6},{-40,6}}, color={0,127,255})); + connect(heaPum.port_b2, sin2.ports[1]) annotation (Line(points={{-10,-6},{-32,-6}, + {-32,-30},{-40,-30}}, color={0,127,255})); + connect(heaPum.port_a2, sou2.ports[1]) + annotation (Line(points={{10,-6},{40,-6}}, color={0,127,255})); + connect(heaPum.port_b1, sin1.ports[1]) + annotation (Line(points={{10,6},{36,6},{36,30},{60,30}}, color={0,127,255})); + connect(heaPum.ySet, uCom.y) annotation (Line(points={{-11.6,2},{-11.6,8},{-32, + 8},{-32,50},{-39,50}}, color={0,0,127})); + + annotation ( + Documentation(revisions=" ++Partial model to have consitent parameterization of the +modular reversible model approaches. +
+")); +end PartialModularComparison; diff --git a/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/Comparative/BaseClasses/package.mo b/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/Comparative/BaseClasses/package.mo new file mode 100644 index 0000000000..bdd73890ec --- /dev/null +++ b/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/Comparative/BaseClasses/package.mo @@ -0,0 +1,10 @@ +within IBPSA.Fluid.HeatPumps.ModularReversible.Validation.Comparative; +package BaseClasses "Package with partial validation models" +extends Modelica.Icons.BasesPackage; + +annotation (preferredView="info", Documentation(info=" ++This package contains partial models for comparative validation. +
+")); +end BaseClasses; diff --git a/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/Comparative/BaseClasses/package.order b/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/Comparative/BaseClasses/package.order new file mode 100644 index 0000000000..15bbc82f11 --- /dev/null +++ b/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/Comparative/BaseClasses/package.order @@ -0,0 +1,2 @@ +PartialComparison +PartialModularComparison diff --git a/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/Comparative/Carnot_y.mo b/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/Comparative/Carnot_y.mo new file mode 100644 index 0000000000..a1588a6cee --- /dev/null +++ b/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/Comparative/Carnot_y.mo @@ -0,0 +1,61 @@ +within IBPSA.Fluid.HeatPumps.ModularReversible.Validation.Comparative; +model Carnot_y "Example using the Carnot_y model approach" + extends BaseClasses.PartialComparison( + m1_flow_nominal=heaPum.m1_flow_nominal, + m2_flow_nominal=heaPum.m2_flow_nominal, + sin2(nPorts=1), + sou2(nPorts=1), + sin1(nPorts=1), + sou1(nPorts=1)); + extends Modelica.Icons.Example; + IBPSA.Fluid.HeatPumps.Carnot_y heaPum( + redeclare package Medium1 = Medium1, + redeclare package Medium2 = Medium2, + etaCarnot_nominal=etaCarnot_nominal, + TCon_nominal=TCon_nominal, + TEva_nominal=TEva_nominal, + tau1=tau1, + tau2=tau2, + P_nominal=QUse_nominal/heaPum.COP_nominal, + dTEva_nominal=-dTEva_nominal, + dTCon_nominal=dTCon_nominal, + use_eta_Carnot_nominal=false, + dp1_nominal=dp1_nominal, + dp2_nominal=dp2_nominal, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + show_T=true, + T1_start=T1_start, + T2_start=T2_start) "Heat pump model" + annotation (Placement(transformation(extent={{-12,-10},{8,10}}))); + +equation + connect(sin2.ports[1], heaPum.port_b2) annotation (Line(points={{-40,-30},{-16, + -30},{-16,-6},{-12,-6}}, color={0,127,255})); + connect(heaPum.port_a2, sou2.ports[1]) + annotation (Line(points={{8,-6},{40,-6}}, color={0,127,255})); + connect(heaPum.port_b1, sin1.ports[1]) + annotation (Line(points={{8,6},{36,6},{36,30},{60,30}}, color={0,127,255})); + connect(heaPum.port_a1, sou1.ports[1]) + annotation (Line(points={{-12,6},{-40,6}}, color={0,127,255})); + connect(heaPum.y, uCom.y) + annotation (Line(points={{-14,9},{-14,50},{-39,50}}, color={0,0,127})); + + annotation (experiment(Tolerance=1e-6, StopTime=3600), + __Dymola_Commands(file="modelica://IBPSA/Resources/Scripts/Dymola/Fluid/HeatPumps/ModularReversible/Validation/Comparative/Carnot_y.mos" + "Simulate and plot"), + Documentation(revisions=" ++Validation case for +IBPSA.Fluid.Chillers.Carnot_y, duplicate of the example + +IBPSA.Fluid.Chillers.Examples.Carnot_y. +
+")); +end Carnot_y; diff --git a/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/Comparative/ConstantQualityGrade.mo b/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/Comparative/ConstantQualityGrade.mo new file mode 100644 index 0000000000..22a161da55 --- /dev/null +++ b/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/Comparative/ConstantQualityGrade.mo @@ -0,0 +1,29 @@ +within IBPSA.Fluid.HeatPumps.ModularReversible.Validation.Comparative; +model ConstantQualityGrade + "Validation case for modular carnot approach" + extends BaseClasses.PartialModularComparison(heaPum(redeclare model + RefrigerantCycleHeatPumpHeating = + IBPSA.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.ConstantQualityGrade + ( + useAirForCon=false, + useAirForEva=false, + quaGra=etaCarnot_nominal))); + extends Modelica.Icons.Example; + + annotation (experiment(Tolerance=1e-6, StopTime=3600), +__Dymola_Commands(file="modelica://IBPSA/Resources/Scripts/Dymola/Fluid/HeatPumps/ModularReversible/Validation/Comparative/ConstantQualityGrade.mos" + "Simulate and plot"), + Documentation(revisions=" ++Validation case for +IBPSA.Fluid.Chillers.ModularReversible.RefrigerantCycle.ConstantQualityGrade. +
+")); +end ConstantQualityGrade; diff --git a/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/Comparative/TableData2D.mo b/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/Comparative/TableData2D.mo new file mode 100644 index 0000000000..5d32a9f006 --- /dev/null +++ b/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/Comparative/TableData2D.mo @@ -0,0 +1,42 @@ +within IBPSA.Fluid.HeatPumps.ModularReversible.Validation.Comparative; +model TableData2D "Validation case for table data approach" + extends BaseClasses.PartialModularComparison( + TEva_nominal=TEvaIn_nominal, + TCon_nominal=TConIn_nominal, + heaPum(redeclare model RefrigerantCycleHeatPumpHeating = + IBPSA.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.TableData2D ( + datTab( + tabPEle=[0,288.15,298.15; 293.15,14122.8,14122.8; 303.15,14122.8, + 14122.8], + mCon_flow_nominal=m1_flow_nominal, + mEva_flow_nominal=m2_flow_nominal, + dpCon_nominal=0, + dpEva_nominal=0, + devIde="CarnotTableData", + use_TEvaOutForTab=false, + use_TConOutForTab=false, + tabQCon_flow=[0,288.15,298.15; 293.15,49622.5,0; 303.15,44122.8, + 50343.6], + tabUppBou=[273.15,273.15; 273.15,273.15], + use_TEvaOutForOpeEnv=false, + use_TConOutForOpeEnv=false)))); + + extends Modelica.Icons.Example; + + annotation (experiment(Tolerance=1e-6, StopTime=3600), +__Dymola_Commands(file="modelica://IBPSA/Resources/Scripts/Dymola/Fluid/HeatPumps/ModularReversible/Validation/Comparative/TableData2D.mos" + "Simulate and plot"), + Documentation(revisions=" ++Validation case for +IBPSA.Fluid.Chillers.ModularReversible.RefrigerantCycle.TableData2D. +
+")); +end TableData2D; diff --git a/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/Comparative/package.mo b/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/Comparative/package.mo new file mode 100644 index 0000000000..3563218a5a --- /dev/null +++ b/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/Comparative/package.mo @@ -0,0 +1,13 @@ +within IBPSA.Fluid.HeatPumps.ModularReversible.Validation; +package Comparative "Package for comparative model validation" + extends Modelica.Icons.ExamplesPackage; + +annotation (preferredView="info", Documentation(info=" ++This package contains models that validate the modular reversible chiller models +using comparative validation against the carnot model: + +IBPSA.Fluid.Chillers.Examples.Carnot_y +
+")); +end Comparative; diff --git a/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/Comparative/package.order b/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/Comparative/package.order new file mode 100644 index 0000000000..56708c112b --- /dev/null +++ b/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/Comparative/package.order @@ -0,0 +1,4 @@ +Carnot_y +ConstantQualityGrade +TableData2D +BaseClasses diff --git a/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/package.order b/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/package.order index f80d9428b0..e30ea89b87 100644 --- a/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/package.order +++ b/IBPSA/Fluid/HeatPumps/ModularReversible/Validation/package.order @@ -1,3 +1,4 @@ CarnotConstantQuality TableData2D +Comparative BaseClasses diff --git a/IBPSA/Resources/Scripts/Dymola/Fluid/HeatPumps/ModularReversible/Validation/Comparative/Carnot_y.mos b/IBPSA/Resources/Scripts/Dymola/Fluid/HeatPumps/ModularReversible/Validation/Comparative/Carnot_y.mos new file mode 100644 index 0000000000..b4558d9eb6 --- /dev/null +++ b/IBPSA/Resources/Scripts/Dymola/Fluid/HeatPumps/ModularReversible/Validation/Comparative/Carnot_y.mos @@ -0,0 +1,5 @@ +simulateModel("IBPSA.Fluid.HeatPumps.ModularReversible.Validation.Comparative.Carnot_y", tolerance=1e-6, stopTime=3600, method="CVode", resultFile="HeatPump_Carnot_y"); +createPlot(id=2, position={75, 70, 1210, 980}, y={"heaPum.sta_a1.T", "heaPum.sta_b1.T", "heaPum.sta_a2.T", "heaPum.sta_b2.T"}, range={0.0, 3600.0, 5.0, 40.0}, grid=true, filename="HeatPump_Carnot_y.mat", colors={{28,108,200}, {238,46,47}, {0,140,72}, {180,56,148}}); +createPlot(id=2, position={75, 70, 1210, 240}, y={"heaPum.QEva_flow", "heaPum.QCon_flow", "heaPum.P"}, range={0.0, 3600.0, -200000.0, 300000.0}, grid=true, subPlot=2, colors={{28,108,200}, {238,46,47}, {0,140,72}}); +createPlot(id=2, position={75, 70, 1210, 241}, y={"heaPum.dp1", "heaPum.dp2"}, range={0.0, 3600.0, 0.0, 14000.0}, grid=true, subPlot=3, colors={{28,108,200}, {238,46,47}}); +createPlot(id=2, position={75, 70, 1210, 240}, y={"heaPum.COP_nominal", "heaPum.COP"}, range={0.0, 3600.0, 3.0, 10.0}, grid=true, subPlot=4, colors={{28,108,200}, {238,46,47}}); diff --git a/IBPSA/Resources/Scripts/Dymola/Fluid/HeatPumps/ModularReversible/Validation/Comparative/ConstantQualityGrade.mos b/IBPSA/Resources/Scripts/Dymola/Fluid/HeatPumps/ModularReversible/Validation/Comparative/ConstantQualityGrade.mos new file mode 100644 index 0000000000..9e9bd6f19d --- /dev/null +++ b/IBPSA/Resources/Scripts/Dymola/Fluid/HeatPumps/ModularReversible/Validation/Comparative/ConstantQualityGrade.mos @@ -0,0 +1,5 @@ +simulateModel("IBPSA.Fluid.HeatPumps.ModularReversible.Validation.Comparative.ConstantQualityGrade", tolerance=1e-6, stopTime=3600, method="CVode", resultFile="HeatPump_ConstantQualityGrade"); +createPlot(id=2, position={75, 70, 1210, 980}, y={"heaPum.refCyc.sigBus.TConInMea", "heaPum.refCyc.sigBus.TConOutMea", "heaPum.refCyc.sigBus.TEvaInMea", "heaPum.refCyc.sigBus.TEvaOutMea"}, range={0.0, 3600.0, 5.0, 40.0}, grid=true, filename="HeatPump_ConstantQualityGrade.mat", colors={{28,108,200}, {238,46,47}, {0,140,72}, {180,56,148}}); +createPlot(id=2, position={75, 70, 1210, 240}, y={"heaPum.refCyc.QEva_flow", "heaPum.refCyc.QCon_flow", "heaPum.refCyc.PEle"}, range={0.0, 3600.0, -200000.0, 300000.0}, grid=true, subPlot=2, colors={{28,108,200}, {238,46,47}, {0,140,72}}); +createPlot(id=2, position={75, 70, 1210, 241}, y={"heaPum.dp1", "heaPum.dp2"}, range={0.0, 3600.0, 0.0, 14000.0}, grid=true, subPlot=3, colors={{28,108,200}, {238,46,47}}); +createPlot(id=2, position={75, 70, 1210, 240}, y={"heaPum.refCyc.refCycheaPumCoo.COP_nominal", "heaPum.refCyc.refCycheaPumCoo.reaEtaCarEff.y", "heaPum.refCyc.sigBus.COP"}, range={0.0, 3600.0, 3.0, 10.0}, grid=true, subPlot=4, colors={{28,108,200}, {0,140,72}, {238,46,47}}); diff --git a/IBPSA/Resources/Scripts/Dymola/Fluid/HeatPumps/ModularReversible/Validation/Comparative/TableData2D.mos b/IBPSA/Resources/Scripts/Dymola/Fluid/HeatPumps/ModularReversible/Validation/Comparative/TableData2D.mos new file mode 100644 index 0000000000..bc79a3f0fa --- /dev/null +++ b/IBPSA/Resources/Scripts/Dymola/Fluid/HeatPumps/ModularReversible/Validation/Comparative/TableData2D.mos @@ -0,0 +1,5 @@ +simulateModel("IBPSA.Fluid.HeatPumps.ModularReversible.Validation.Comparative.TableData2D", tolerance=1e-6, stopTime=3600, method="CVode", resultFile="HeatPump_TableData2D"); +createPlot(id=2, position={75, 70, 1210, 980}, y={"heaPum.refCyc.sigBus.TConInMea", "heaPum.refCyc.sigBus.TConOutMea", "heaPum.refCyc.sigBus.TEvaInMea", "heaPum.refCyc.sigBus.TEvaOutMea"}, range={0.0, 3600.0, 5.0, 40.0}, grid=true, filename="HeatPump_TableData2D.mat", colors={{28,108,200}, {238,46,47}, {0,140,72}, {180,56,148}}); +createPlot(id=2, position={75, 70, 1210, 240}, y={"heaPum.refCyc.QEva_flow", "heaPum.refCyc.QCon_flow", "heaPum.refCyc.PEle"}, range={0.0, 3600.0, -200000.0, 300000.0}, grid=true, subPlot=2, colors={{28,108,200}, {238,46,47}, {0,140,72}}); +createPlot(id=2, position={75, 70, 1210, 241}, y={"heaPum.dp1", "heaPum.dp2"}, range={0.0, 3600.0, 0.0, 14000.0}, grid=true, subPlot=3, colors={{28,108,200}, {238,46,47}}); +createPlot(id=2, position={75, 70, 1210, 240}, y={"heaPum.refCyc.sigBus.COP"}, range={0.0, 3600.0, 3.0, 10.0}, grid=true, subPlot=4, colors={{238,46,47}});