Skip to content

Commit

Permalink
Added a temperature array to output aquifer temperatures
Browse files Browse the repository at this point in the history
  • Loading branch information
amaccarini committed Aug 23, 2023
1 parent 8aa43fc commit 75980e1
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 42 deletions.
1 change: 1 addition & 0 deletions IBPSA/Fluid/Geothermal/Aquifer/Examples/CoolingOffice.mo
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ model CoolingOffice
redeclare package Medium = IBPSA.Media.Water,
nVol=80,
h=20,
rMax=500,
TCoo_start=285.15,
THot_start=285.15,
aquDat=IBPSA.Fluid.Geothermal.Aquifer.Data.Rock(),
Expand Down
88 changes: 48 additions & 40 deletions IBPSA/Fluid/Geothermal/Aquifer/MultiWell.mo
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,18 @@ model MultiWell "Model of a single well for aquifer thermal energy storage"
parameter Modelica.Units.SI.MassFlowRate m_flow_nominal "Nominal mass flow rate" annotation (
Dialog(group="Hydraulic circuit"));
parameter Modelica.Units.SI.PressureDifference dpAquifer_nominal(displayUnit=
"Pa") "Pressure drop at nominal mass flow rate in the aquifer"
annotation (
"Pa") "Pressure drop at nominal mass flow rate in the aquifer" annotation (
Dialog(group="Hydraulic circuit"));
parameter Modelica.Units.SI.PressureDifference dpWell_nominal(displayUnit="Pa")
"Pressure drop at nominal mass flow rate in the well" annotation (
Dialog(group="Hydraulic circuit"));
parameter Modelica.Units.SI.PressureDifference dpExt_nominal(displayUnit="Pa")
"Pressure drop at nominal mass flow rate in the above-surface system (used to size the head of the well pump)" annotation (
Dialog(group="Hydraulic circuit"));
parameter Modelica.Units.SI.Radius rC[nVol](each fixed=false)
"Radius to the center of the i-th domain";
Modelica.Units.SI.Temperature TAquHot[nVol];
Modelica.Units.SI.Temperature TAquCol[nVol];

Modelica.Blocks.Interfaces.RealInput u(
final min=-1,
Expand Down Expand Up @@ -73,25 +76,6 @@ model MultiWell "Model of a single well for aquifer thermal energy storage"
rotation=90,
origin={80,20})));

IBPSA.Fluid.MixingVolumes.MixingVolume volCoo[nVol](
redeclare final package Medium = Medium,
each final T_start=TCoo_start,
each final m_flow_nominal=m_flow_nominal,
final V=VWat*nCoo,
each nPorts=2)
"Array of fluid volumes representing the fluid flow in the cold side of the aquifer"
annotation (Placement(transformation(extent={{-40,-10},{-60,10}})));

Modelica.Thermal.HeatTransfer.Components.HeatCapacitor heaCapCoo[nVol](
C=C*nCoo,
each T(start=TCoo_start, fixed=true))
"Array of thermal capacitor in the cold side of the aquifer"
annotation (Placement(transformation(extent={{-22,-60},{-2,-40}})));
Modelica.Thermal.HeatTransfer.Components.ThermalResistor theResCoo[nVol](
R=R/nCoo)
"Array of thermal resistances in the cold side of the aquifer"
annotation (Placement(transformation(extent={{-40,-70},{-60,-50}})));

Airflow.Multizone.Point_m_flow powCoo(
redeclare final package Medium = Medium,
m=1,
Expand All @@ -103,23 +87,6 @@ model MultiWell "Model of a single well for aquifer thermal energy storage"
rotation=-90,
origin={-80,-10})));

MixingVolumes.MixingVolume volHot[nVol](
redeclare final package Medium = Medium,
each T_start=THot_start,
each m_flow_nominal=m_flow_nominal,
V=VWat*nHot,
each nPorts=2)
"Array of fluid volumes representing the fluid flow in the warm side of the aquifer"
annotation (Placement(transformation(extent={{40,-10},{60,10}})));
Modelica.Thermal.HeatTransfer.Components.HeatCapacitor heaCapHot[nVol](
C=C*nHot,
each T(start=THot_start, fixed=true))
"Array of thermal capacitor in the warm side of the aquifer"
annotation (Placement(transformation(extent={{22,-60},{2,-40}})));
Modelica.Thermal.HeatTransfer.Components.ThermalResistor theResHot[nVol](
R=R/nHot)
"Array of thermal resistances in the warm side of the aquifer"
annotation (Placement(transformation(extent={{40,-70},{60,-50}})));
FixedResistances.PressureDrop resCoo(
redeclare final package Medium = Medium,
final m_flow_nominal=m_flow_nominal,
Expand Down Expand Up @@ -152,8 +119,6 @@ model MultiWell "Model of a single well for aquifer thermal energy storage"
protected
parameter Modelica.Units.SI.Radius r[nVol + 1](each fixed=false)
"Radius to the boundary of the i-th domain";
parameter Modelica.Units.SI.Radius rC[nVol](each fixed=false)
"Radius to the center of the i-th domain";
parameter Modelica.Units.SI.SpecificHeatCapacity cpWat(fixed=false)
"Water specific heat capacity";
parameter Modelica.Units.SI.Density rhoWat(fixed=false)
Expand All @@ -171,6 +136,43 @@ protected
parameter Real kVol(each fixed=false)
"Heat conductivity normalized with volume";

IBPSA.Fluid.MixingVolumes.MixingVolume volCoo[nVol](
redeclare final package Medium = Medium,
each final T_start=TCoo_start,
each final m_flow_nominal=m_flow_nominal,
final V=VWat*nCoo,
each nPorts=2)
"Array of fluid volumes representing the fluid flow in the cold side of the aquifer"
annotation (Placement(transformation(extent={{-40,-10},{-60,10}})));

Modelica.Thermal.HeatTransfer.Components.HeatCapacitor heaCapCoo[nVol](
C=C*nCoo,
each T(start=TCoo_start, fixed=true))
"Array of thermal capacitor in the cold side of the aquifer"
annotation (Placement(transformation(extent={{-22,-60},{-2,-40}})));
Modelica.Thermal.HeatTransfer.Components.ThermalResistor theResCoo[nVol](
R=R/nCoo)
"Array of thermal resistances in the cold side of the aquifer"
annotation (Placement(transformation(extent={{-40,-70},{-60,-50}})));

MixingVolumes.MixingVolume volHot[nVol](
redeclare final package Medium = Medium,
each T_start=THot_start,
each m_flow_nominal=m_flow_nominal,
V=VWat*nHot,
each nPorts=2)
"Array of fluid volumes representing the fluid flow in the warm side of the aquifer"
annotation (Placement(transformation(extent={{40,-10},{60,10}})));
Modelica.Thermal.HeatTransfer.Components.HeatCapacitor heaCapHot[nVol](
C=C*nHot,
each T(start=THot_start, fixed=true))
"Array of thermal capacitor in the warm side of the aquifer"
annotation (Placement(transformation(extent={{22,-60},{2,-40}})));
Modelica.Thermal.HeatTransfer.Components.ThermalResistor theResHot[nVol](
R=R/nHot)
"Array of thermal resistances in the warm side of the aquifer"
annotation (Placement(transformation(extent={{40,-70},{60,-50}})));

Modelica.Thermal.HeatTransfer.Sources.FixedTemperature groTemCoo(
final T=TGroCoo)
"Boundary condition ground temperature in the cold side of the aquifer"
Expand Down Expand Up @@ -234,6 +236,8 @@ initial equation
end for;

equation
TAquHot=heaCapHot.T;
TAquCol=heaCapCoo.T;
if nVol > 1 then
for i in 1:(nVol - 1) loop
connect(volCoo[i].ports[2], volCoo[i + 1].ports[1]);
Expand Down Expand Up @@ -415,6 +419,10 @@ Circulation pumps are included in the model and they can be controlled by acting
clockwise (extraction from the cold well and injection into the warm well). A negative value will circulate water anticlockwise (extraction from the warm well and injection into the cold well).
</p>
<p>
The temperature values in the warm and cold aquifers can be accessed using <code>TAquHot</code> and c<ode>TAquCol</code>. These temperatures correspond to the temperatures of each thermal capacitance
in the discretized domain. The location of the thermal capacitance is expressed by <code>rC<code>.
</p>
<p>
The nominal pressure drops in the circuit must be selected according to the figure below.
</p>
<p align=\"center\">
Expand Down
4 changes: 2 additions & 2 deletions IBPSA/Fluid/Geothermal/Aquifer/Validation/NumberWells.mo
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ model NumberWells
annotation (Placement(transformation(extent={{-80,-10},{-60,10}})));
Sources.Boundary_pT bou(redeclare package Medium = IBPSA.Media.Water, nPorts=2) "Sink"
annotation (Placement(transformation(extent={{60,-10},{40,10}})));
Modelica.Blocks.Sources.RealExpression temWel1(y=aquWel1.heaCapHot[10].T)
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.heaCapHot[10].T)
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
Expand Down

0 comments on commit 75980e1

Please sign in to comment.