From e525a26bdb3001aad54903ca3086353492aac48d Mon Sep 17 00:00:00 2001 From: Michael Wetter Date: Wed, 18 Oct 2023 13:57:31 -0700 Subject: [PATCH] Formatted model --- .../Aquifer/Examples/CoolingOffice.mo | 8 +++++--- IBPSA/Fluid/Geothermal/Aquifer/MultiWell.mo | 6 +++--- .../Aquifer/Validation/NumberWells.mo | 20 +++++++++++++------ .../Aquifer/Validation/SimulationTest.mo | 7 +++++-- 4 files changed, 27 insertions(+), 14 deletions(-) diff --git a/IBPSA/Fluid/Geothermal/Aquifer/Examples/CoolingOffice.mo b/IBPSA/Fluid/Geothermal/Aquifer/Examples/CoolingOffice.mo index 8880de23e3..898dfc69d9 100644 --- a/IBPSA/Fluid/Geothermal/Aquifer/Examples/CoolingOffice.mo +++ b/IBPSA/Fluid/Geothermal/Aquifer/Examples/CoolingOffice.mo @@ -1,6 +1,8 @@ within IBPSA.Fluid.Geothermal.Aquifer.Examples; model CoolingOffice extends Modelica.Icons.Example; + package Medium = IBPSA.Media.Water "Medium model"; + parameter Modelica.Units.SI.HeatFlowRate QCoo_flow_nominal=30000 "Cooling power"; parameter Modelica.Units.SI.TemperatureDifference deltaT=4 "Temperature difference at heat exchanger"; @@ -9,7 +11,7 @@ model CoolingOffice QCoo_flow_nominal/(deltaT*cpWat) "Nominal water mass flow rate"; HeatExchangers.HeaterCooler_u hea( - redeclare package Medium = IBPSA.Media.Water, + redeclare package Medium = Medium, m_flow_nominal=mWat_flow_nominal, dp_nominal=100, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, @@ -20,7 +22,7 @@ model CoolingOffice Modelica.Blocks.Sources.Constant uHea(k=1) "Heat load control signal" annotation (Placement(transformation(extent={{-60,60},{-40,80}}))); MultiWell aquWel( - redeclare package Medium = IBPSA.Media.Water, + redeclare package Medium = Medium, nVol=80, h=20, d=1000, @@ -33,7 +35,7 @@ model CoolingOffice "Acquifer well" annotation (Placement(transformation(extent={{-10,-20},{10,0}}))); Sources.Boundary_pT bou( - redeclare package Medium = IBPSA.Media.Water, + redeclare package Medium = Medium, nPorts=1) "Pressure boundary condition" annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); equation connect(uHea.y, hea.u) diff --git a/IBPSA/Fluid/Geothermal/Aquifer/MultiWell.mo b/IBPSA/Fluid/Geothermal/Aquifer/MultiWell.mo index 53fb54df55..7cca44be2c 100644 --- a/IBPSA/Fluid/Geothermal/Aquifer/MultiWell.mo +++ b/IBPSA/Fluid/Geothermal/Aquifer/MultiWell.mo @@ -244,9 +244,9 @@ protected Modelica.Blocks.Math.Gain gaiPum(final k=nPai) "Gain used to scale the pump electrical power" annotation (Placement(transformation(extent={{80,30},{100,50}}))); initial equation - assert(rWB < rMax, "Error: Model requires rWB < rMax"); - assert(0 < rWB, "Error: Model requires 0 < rWB"); - assert(rMax <= d/2, "Error: Model requires rMax <= d/2"); + assert(rWB < rMax, "In " + getInstanceName() + ": Require rWB < rMax"); + assert(0 < rWB, "In " + getInstanceName() + ": Require 0 < rWB"); + assert(rMax <= d/2, "In " + getInstanceName() + ": Require rMax <= d/2"); cAqu=aquDat.dSoi*aquDat.cSoi*(1-aquDat.phi); kVol=kWat*aquDat.phi+aquDat.kSoi*(1-aquDat.phi); diff --git a/IBPSA/Fluid/Geothermal/Aquifer/Validation/NumberWells.mo b/IBPSA/Fluid/Geothermal/Aquifer/Validation/NumberWells.mo index 1b7551c440..deae8b6ce7 100644 --- a/IBPSA/Fluid/Geothermal/Aquifer/Validation/NumberWells.mo +++ b/IBPSA/Fluid/Geothermal/Aquifer/Validation/NumberWells.mo @@ -3,6 +3,8 @@ model NumberWells "Test model for aquifer thermal energy storage with multiple wells" extends Modelica.Icons.Example; + package Medium = IBPSA.Media.Water "Medium model"; + model MyWell = MultiWell ( redeclare package Medium = IBPSA.Media.Water, nVol=50, @@ -20,20 +22,26 @@ model NumberWells "ATES with one pair of wells" annotation (Placement(transformation(extent={{-20,20},{0,40}}))); MyWell aquWel2( - d=4800, nPai=2, m_flow_nominal=0.2) - "ATES with two pairs of wells" + d=4800, + nPai=2, + m_flow_nominal=0.2) + "ATES with two pairs of wells" annotation (Placement(transformation(extent={{-20,-60},{0,-40}}))); Modelica.Blocks.Sources.Constant uPum(k=1) "Pump control signal" annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); - Sources.Boundary_pT bou(redeclare package Medium = IBPSA.Media.Water, nPorts=2) "Sink" + Sources.Boundary_pT bou( + redeclare package Medium = Medium, + nPorts=2) "Sink" annotation (Placement(transformation(extent={{60,-10},{40,10}}))); - Modelica.Blocks.Sources.RealExpression temWel1(y=aquWel1.TAquHot[10]) + Modelica.Blocks.Sources.RealExpression temWel1( + y=aquWel1.TAquHot[10]) "Temperature output from aquifer model with one pair of wells" annotation (Placement(transformation(extent={{20,72},{40,92}}))); - Modelica.Blocks.Sources.RealExpression temWel2(y=aquWel2.TAquHot[10]) + Modelica.Blocks.Sources.RealExpression temWel2( + y=aquWel2.TAquHot[10]) "Temperature output from aquifer model with two pairs of wells" annotation (Placement(transformation(extent={{20,40},{40,60}}))); - Utilities.Diagnostics.CheckEquality cheEqu + Utilities.Diagnostics.CheckEquality cheEqu "Assertion that checks for equality of results" annotation (Placement(transformation(extent={{60,60},{80,80}}))); equation diff --git a/IBPSA/Fluid/Geothermal/Aquifer/Validation/SimulationTest.mo b/IBPSA/Fluid/Geothermal/Aquifer/Validation/SimulationTest.mo index 0751dded42..d3f045564a 100644 --- a/IBPSA/Fluid/Geothermal/Aquifer/Validation/SimulationTest.mo +++ b/IBPSA/Fluid/Geothermal/Aquifer/Validation/SimulationTest.mo @@ -2,8 +2,11 @@ within IBPSA.Fluid.Geothermal.Aquifer.Validation; model SimulationTest "Test model for aquifer thermal energy storage in comparison with other geothermal simulators" extends Modelica.Icons.Example; + + package Medium = IBPSA.Media.Water "Medium model"; + MultiWell aquWel( - redeclare package Medium = IBPSA.Media.Water, + redeclare package Medium = Medium, nVol=232, h=200, d=4800, @@ -18,7 +21,7 @@ model SimulationTest dpExt_nominal=0) "Aquifer wells" annotation (Placement(transformation(extent={{-20,20},{0,40}}))); Sources.Boundary_pT bou( - redeclare package Medium = IBPSA.Media.Water, + redeclare package Medium = Medium, nPorts=1) "Boundary condition for pressure" annotation (Placement(transformation(extent={{60,50},{40,70}}))); Modelica.Blocks.Sources.CombiTimeTable uPum(table=[0.0,-1; 86400*120,-1; 86400