Skip to content

Commit

Permalink
Revised documentation. Removed defaults for h, length, rMax
Browse files Browse the repository at this point in the history
  • Loading branch information
mwetter committed Sep 22, 2023
1 parent ac8bbdc commit c4bad4e
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 38 deletions.
6 changes: 4 additions & 2 deletions IBPSA/Fluid/Geothermal/Aquifer/Examples/CoolingOffice.mo
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ model CoolingOffice
Q_flow_nominal=QCoo_flow_nominal) "Heat exchanger"
annotation (Placement(transformation(extent={{-10,54},{10,74}})));
Modelica.Blocks.Sources.Constant uPum(k=1) "Pump control signal"
annotation (Placement(transformation(extent={{-60,-14},{-40,6}})));
annotation (Placement(transformation(extent={{-60,-20},{-40,0}})));
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,
nVol=80,
h=20,
length=40,
rMax=500,
TCoo_start=285.15,
THot_start=285.15,
Expand All @@ -44,7 +45,8 @@ equation
connect(bou.ports[1], hea.port_a) annotation (Line(points={{-60,30},{-20,30},
{-20,64},{-10,64}}, color={0,127,255}));
connect(uPum.y, aquWel.u)
annotation (Line(points={{-39,-4},{-12,-4}}, color={0,0,127}));
annotation (Line(points={{-39,-10},{-26,-10},{-26,-10},{-12,-10}},
color={0,0,127}));
annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(
coordinateSystem(preserveAspectRatio=false)),
experiment(StopTime=7776000,Tolerance=1e-6),
Expand Down
75 changes: 49 additions & 26 deletions IBPSA/Fluid/Geothermal/Aquifer/MultiWell.mo
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ model MultiWell "Model of a single well for aquifer thermal energy storage"
choice(redeclare package Medium = IBPSA.Media.Water "Water")));
parameter Integer nVol(min=1)=10 "Number of control volumes used in discretization" annotation (
Dialog(group="Subsurface"));
parameter Modelica.Units.SI.Height h=200 "Aquifer thickness";
parameter Modelica.Units.SI.Height length=40
parameter Modelica.Units.SI.Height h "Aquifer thickness";
parameter Modelica.Units.SI.Height length
"Length of one well, used to compute pressure drop";
parameter Real nPai=1 "Number of paired wells";
parameter Modelica.Units.SI.Radius rWB=0.1 "Wellbore radius" annotation (
Dialog(group="Subsurface"));
parameter Modelica.Units.SI.Radius rMax=2400 "Domain radius" annotation (
parameter Modelica.Units.SI.Radius rMax "Domain radius" annotation (
Dialog(group="Subsurface"));
parameter Real griFac(min=1) = 1.15 "Grid factor for spacing" annotation (
Dialog(group="Subsurface"));
Expand Down Expand Up @@ -47,8 +47,8 @@ model MultiWell "Model of a single well for aquifer thermal energy storage"
final max=1,
final unit="1")
"Pump control input (-1: extract from hot well, +1: extract from cold well, 0: off)"
annotation (Placement(transformation(extent={{-140,30},{-100,70}}),
iconTransformation(extent={{-140,30},{-100,70}})));
annotation (Placement(transformation(extent={{-140,-20},{-100,20}}),
iconTransformation(extent={{-140,-20},{-100,20}})));

Modelica.Fluid.Interfaces.FluidPort_a port_Col(
redeclare final package Medium = Medium) "Fluid connector" annotation (Placement(transformation(extent={
Expand Down Expand Up @@ -301,12 +301,15 @@ equation
color={191,0,0}));
connect(theResHot.port_a, volHot.heatPort) annotation (Line(points={{40,-80},{30,-80},{30,-20},{40,-20}},
color={191,0,0}));
connect(powCoo.port_a, volCoo[1].ports[1]) annotation (Line(points={{-80,-40},{-80,-54},{-48,-54},{-48,-30}},
connect(powCoo.port_a, volCoo[1].ports[1]) annotation (Line(points={{-80,-40},
{-80,-54},{-49,-54},{-49,-30}},
color={0,127,255}));
connect(powHot.port_a, volHot[1].ports[1]) annotation (Line(points={{80,-40},{80,-54},{48,-54},{48,-30}},
connect(powHot.port_a, volHot[1].ports[1]) annotation (Line(points={{80,-40},{
80,-54},{49,-54},{49,-30}},
color={0,127,255}));
connect(volCoo[nVol].ports[2], volHot[nVol].ports[2]) annotation (Line(points={{-52,-30},{-48,-30},{-48,-42},{52,-42},
{52,-30}}, color={0,127,255}));
connect(volCoo[nVol].ports[2], volHot[nVol].ports[2]) annotation (Line(points={{-51,-30},
{-48,-30},{-48,-42},{51,-42},{51,-30}},
color={0,127,255}));
connect(powCoo.port_b,pumCol. port_a)
annotation (Line(points={{-80,-20},{-80,-10}},
color={0,127,255}));
Expand All @@ -320,8 +323,10 @@ equation
connect(limCoo.y, pumCol.y) annotation (Line(points={{-39,30},{-30,30},{-30,0},{-68,0}}, color={0,0,127}));
connect(gaiCon.y, limHot.u) annotation (Line(points={{13,30},{28,30}}, color={0,0,127}));
connect(limHot.y, pumHot.y) annotation (Line(points={{51,30},{60,30},{60,0},{68,0}}, color={0,0,127}));
connect(gaiCon.u, u) annotation (Line(points={{-10,30},{-20,30},{-20,50},{-120,50}}, color={0,0,127}));
connect(limCoo.u, u) annotation (Line(points={{-62,30},{-68,30},{-68,50},{-120,50}}, color={0,0,127}));
connect(gaiCon.u, u) annotation (Line(points={{-10,30},{-20,30},{-20,50},{-98,
50},{-98,0},{-120,0}}, color={0,0,127}));
connect(limCoo.u, u) annotation (Line(points={{-62,30},{-68,30},{-68,50},{-98,
50},{-98,0},{-120,0}}, color={0,0,127}));
connect(resCoo.port_b, mulCoo.port_a) annotation (Line(points={{-80,40},{-80,60}}, color={0,127,255}));
connect(mulCoo.port_b, port_Col) annotation (Line(points={{-80,80},{-80,90},{-60,90},{-60,100}}, color={0,127,255}));
connect(mulHot.port_b, port_Hot) annotation (Line(points={{80,80},{80,88},{60,88},{60,100}}, color={0,127,255}));
Expand Down Expand Up @@ -382,18 +387,18 @@ equation
fillColor={182,12,18},
fillPattern=FillPattern.Solid),
Text(
extent={{-140,104},{-110,80}},
extent={{-140,46},{-110,22}},
textColor={0,0,127},
textString="uPum")}), Diagram(
coordinateSystem(preserveAspectRatio=false)),
defaultComponentName="aquWel",
Documentation(info="<html>
<p>
This model simulates aquifer thermal energy storage, using one or multiple instances of cold and hot wells.
This model simulates aquifer thermal energy storage, using one or multiple pairs of cold and hot wells.
</p>
<p>
To calculate aquifer temperature at different locations over time, the model applies
theoretical principles of water flow and heat transfer phenomena. The model is based on
physical principles of water flow and heat transfer phenomena. The model is based on
the partial differential equation (PDE) for 1D conductive-convective transient
radial heat transport in porous media
</p>
Expand All @@ -417,19 +422,24 @@ the second term describes the fluid flow.
<p>
The pressure losses in the aquifer are calculated using the Darcy's law
<p align=\"center\" style=\"font-style:italic;\">
&#916;p = &#7745; g &frasl; (2 &#960; K h ln(rMax &frasl; rWB))
&#916;p = &#7745; g &frasl; (2 &#960; K h ln(rMax &frasl; rWB)),
</p>
where <i>&#7745;</i> is the water mass flow rate, <i>g</i> is the gravitational acceleration, <i>K</i> is the hydraulic conductivity, <i>h</i> is the thickness of the aquifer,
<i>rMax</i> is the domain radius and <i>rWB</i> is the well radius. The pressure losses in the wells are calculated using
<a href=\"modelica://Modelica.Fluid.Pipes.BaseClasses.WallFriction.Detailed.pressureLoss_m_flow\">Modelica.Fluid.Pipes.BaseClasses.WallFriction.Detailed.pressureLoss_m_flow</a>.
where <i>&#7745;</i> is the water mass flow rate, <i>g</i> is the gravitational acceleration,
<i>K</i> is the hydraulic conductivity, <i>h</i> is the thickness of the aquifer,
<i>rMax</i> is the domain radius and <i>rWB</i> is the well radius.
The pressure losses in the wells are calculated using
<a href=\"modelica://Modelica.Fluid.Pipes.BaseClasses.WallFriction.Detailed.pressureLoss_m_flow\">
Modelica.Fluid.Pipes.BaseClasses.WallFriction.Detailed.pressureLoss_m_flow</a>.
</p>
<h4>Spatial discretization</h4>
<p>
To discretize the conductive-convective equation, the domain is divided into a series
of thermal capacitances and thermal resistances along the radial direction. The
implementation uses an array of
<a href=\"modelica://Modelica.Thermal.HeatTransfer.Components.HeatCapacitor\">Modelica.Thermal.HeatTransfer.Components.HeatCapacitor</a>
and <a href=\"modelica://Modelica.Thermal.HeatTransfer.Components.ThermalResistor\">Modelica.Thermal.HeatTransfer.Components.ThermalResistor</a>
<a href=\"modelica://Modelica.Thermal.HeatTransfer.Components.HeatCapacitor\">
Modelica.Thermal.HeatTransfer.Components.HeatCapacitor</a>
and <a href=\"modelica://Modelica.Thermal.HeatTransfer.Components.ThermalResistor\">
Modelica.Thermal.HeatTransfer.Components.ThermalResistor</a>.
Fluid flow was modelled by adding a series of fluid volumes, which are connected
to the thermal capacitances via heat ports. The fluid stream was developed using
the model <a href=\"modelica://IBPSA.Fluid.MixingVolumes.MixingVolume\">IBPSA.Fluid.MixingVolumes.MixingVolume</a>.
Expand All @@ -440,18 +450,31 @@ The geometric representation of the model is illustrated in the figure below.
</p>
<h4>Typical use and important parameters</h4>
<p>
By default, the component consists of a single pair of wells: one cold well and one warm well. The number of paired wells can be increased by modifing the parameters <code>nPai</code>.
The effect is a proportional increase of thermal capacity.
By default, the component consists of a single pair of wells: one cold well and one warm well.
The number of paired wells can be increased by modifing the parameters <code>nPai</code>.
The effect is a proportional increase of thermal capacity, and the mass flow rate at <code>port_a</code>
and <code>port_b</code> is equally distributed to the pairs of well, thus
all pairs have the same mass flow rates and temperatures, and the quantities
at the fluid ports is for all well combined, as is the electricity consumption <code>PTot</code>
for the well pumps.
</p>
<p>
To ensure conservation of energy, the wells are connected via fluid ports. To avoid thermal interferences, make sure that the aquifer domain radius <code>rMax</code> is large enough for your specific use case.
To ensure conservation of energy, the wells are connected via fluid ports.
To avoid thermal interferences, make sure that the aquifer domain radius
<code>rMax</code> is large enough for your specific use case.
</p>
<p>
Circulation pumps are included in the model and they can be controlled by acting on the input connector. The input must vary between [1,-1]. A positive value will circulate water
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).
Circulation pumps are included in the model and they can be controlled by acting on the input connector.
The input must vary between <i>[1, -1]</i>.
A positive value will circulate water
clockwise (from <code>port_Hot</code> to <code>port_Col</code>, thus
extraction from the cold well and injection into the warm well).
A negative value will circulate water anticlockwise.
</p>
<p>
The temperature values in the warm and cold aquifers can be accessed using <code>TAquHot</code> and <code>TAquCol</code>. These temperatures correspond to the temperatures of each thermal capacitance
The temperature values in the warm and cold aquifers can be accessed using
<code>TAquHot</code> and <code>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>rVol</code>.
</p>
</html>", revisions="<html>
Expand Down
10 changes: 6 additions & 4 deletions IBPSA/Fluid/Geothermal/Aquifer/Validation/NumberWells.mo
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ model NumberWells
redeclare package Medium = IBPSA.Media.Water,
nVol=50,
h=10,
length=200,
rMax=2400,
THot_start=303.15,
TGroCoo=273.15,
TGroHot=303.15,
Expand Down Expand Up @@ -42,10 +44,10 @@ equation
{-16,-20},{-4,-20},{-4,-40}}, color={0,127,255}));
connect(aquWel1.port_Col, aquWel1.port_Hot) annotation (Line(points={{-16,40},
{-16,60},{-4,60},{-4,40}}, color={0,127,255}));
connect(bou.ports[1], aquWel1.port_Hot) annotation (Line(points={{40,2},{6,2},{6,60},{-4,60},{-4,40}},
color={0,127,255}));
connect(bou.ports[2], aquWel2.port_Hot) annotation (Line(points={{40,-2},{26,-2},{26,0},{6,0},{6,-20},{-4,-20},{-4,-40}},
color={0,127,255}));
connect(bou.ports[1], aquWel1.port_Hot) annotation (Line(points={{40,-1},{6,-1},
{6,60},{-4,60},{-4,40}}, color={0,127,255}));
connect(bou.ports[2], aquWel2.port_Hot) annotation (Line(points={{40,1},{26,1},
{26,0},{6,0},{6,-20},{-4,-20},{-4,-40}}, color={0,127,255}));
connect(cheEqu.u1, temWel1.y) annotation (Line(points={{58,76},{46,76},{46,82},
{41,82}}, color={0,0,127}));
connect(cheEqu.u2, temWel2.y) annotation (Line(points={{58,64},{46,64},{46,50},
Expand Down
6 changes: 4 additions & 2 deletions IBPSA/Fluid/Geothermal/Aquifer/Validation/SimulationTest.mo
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ model SimulationTest
redeclare package Medium = IBPSA.Media.Water,
nVol=232,
h=200,
length=40,
rMax=2400,
griFac=1.1,
TCoo_start=307.15,
THot_start=393.15,
Expand All @@ -22,14 +24,14 @@ model SimulationTest
Modelica.Blocks.Sources.CombiTimeTable uPum(table=[0.0,-1; 86400*120,-1; 86400
*120,0; 86400*180,0; 86400*180,1; 86400*300,1; 86400*300,0])
"Pump control signal"
annotation (Placement(transformation(extent={{-80,26},{-60,46}})));
annotation (Placement(transformation(extent={{-80,20},{-60,40}})));
equation
connect(aquWel.port_Col, aquWel.port_Hot) annotation (Line(points={{-16,40},{
-16,60},{-4,60},{-4,40}}, color={0,127,255}));
connect(bou.ports[1], aquWel.port_Hot)
annotation (Line(points={{40,60},{-4,60},{-4,40}}, color={0,127,255}));
connect(uPum.y[1], aquWel.u)
annotation (Line(points={{-59,36},{-22,36}}, color={0,0,127}));
annotation (Line(points={{-59,30},{-22,30}}, color={0,0,127}));
annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(
coordinateSystem(preserveAspectRatio=false)),
experiment(StopTime=31536000, Tolerance=1e-6),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ statistics-simulation=
"numerical Jacobians": "0"
}
time=[0e+00, 7.776e+06]
aquWel.heaCapHot[50].T=[2.851499938964844e+02, 2.851499938964844e+02, 2.851499938964844e+02, 2.851502990722656e+02, 2.851534423828125e+02, 2.851678771972656e+02, 2.852070617675781e+02, 2.852838745117188e+02, 2.854053649902344e+02, 2.855707702636719e+02, 2.85773193359375e+02, 2.860020446777344e+02, 2.862460327148438e+02, 2.864948120117188e+02, 2.867401428222656e+02, 2.869757690429688e+02, 2.871974487304688e+02, 2.874027404785156e+02, 2.875905456542969e+02, 2.877608032226562e+02, 2.879140625e+02, 2.880512084960938e+02, 2.881732177734375e+02, 2.882815856933594e+02, 2.883774108886719e+02, 2.884623718261719e+02, 2.885373840332031e+02, 2.886037902832031e+02, 2.886623840332031e+02, 2.887142028808594e+02, 2.887601013183594e+02, 2.888005676269531e+02, 2.888365173339844e+02, 2.888684387207031e+02, 2.88896728515625e+02, 2.889219055175781e+02, 2.889443359375e+02, 2.889642944335938e+02, 2.889820861816406e+02, 2.889979248046875e+02, 2.890120849609375e+02, 2.890247192382812e+02, 2.890360107421875e+02, 2.89046142578125e+02, 2.890552673339844e+02, 2.890634765625e+02, 2.890708923339844e+02, 2.8907763671875e+02, 2.89083740234375e+02, 2.890892639160156e+02, 2.890942993164062e+02, 2.890989379882812e+02, 2.891031494140625e+02, 2.891069946289062e+02, 2.891105041503906e+02, 2.891136169433594e+02, 2.891165771484375e+02, 2.891192626953125e+02, 2.891217346191406e+02, 2.891239318847656e+02, 2.891258850097656e+02, 2.891277465820312e+02, 2.891294860839844e+02, 2.891310424804688e+02, 2.891324462890625e+02, 2.891337280273438e+02, 2.891349182128906e+02, 2.891360168457031e+02, 2.891370544433594e+02, 2.891379699707031e+02, 2.891388549804688e+02, 2.891396789550781e+02, 2.891404418945312e+02, 2.891411437988281e+02, 2.891417846679688e+02, 2.891424255371094e+02, 2.891429748535156e+02, 2.891435241699219e+02, 2.891440124511719e+02, 2.891444702148438e+02, 2.891449279785156e+02, 2.891453552246094e+02, 2.891457214355469e+02, 2.891460876464844e+02, 2.891464538574219e+02, 2.891467590332031e+02, 2.891470336914062e+02, 2.891473083496094e+02, 2.891475830078125e+02, 2.891478271484375e+02, 2.891480712890625e+02, 2.891482849121094e+02, 2.891484680175781e+02, 2.891486511230469e+02, 2.891488342285156e+02, 2.891489868164062e+02, 2.891491394042969e+02, 2.891492919921875e+02, 2.891494445800781e+02, 2.891495666503906e+02, 2.891496887207031e+02]
aquWel.TAquHot[50]=[2.851499938964844e+02, 2.851499938964844e+02, 2.851499938964844e+02, 2.851502990722656e+02, 2.851534423828125e+02, 2.851678771972656e+02, 2.852070617675781e+02, 2.852838745117188e+02, 2.854053649902344e+02, 2.855707702636719e+02, 2.85773193359375e+02, 2.860020446777344e+02, 2.862460327148438e+02, 2.864948120117188e+02, 2.867401428222656e+02, 2.869757690429688e+02, 2.871974487304688e+02, 2.874027404785156e+02, 2.875905456542969e+02, 2.877608032226562e+02, 2.879140625e+02, 2.880512084960938e+02, 2.881732177734375e+02, 2.882815856933594e+02, 2.883774108886719e+02, 2.884623718261719e+02, 2.885373840332031e+02, 2.886037902832031e+02, 2.886623840332031e+02, 2.887142028808594e+02, 2.887601013183594e+02, 2.888005676269531e+02, 2.888365173339844e+02, 2.888684387207031e+02, 2.88896728515625e+02, 2.889219055175781e+02, 2.889443359375e+02, 2.889642944335938e+02, 2.889820861816406e+02, 2.889979248046875e+02, 2.890120849609375e+02, 2.890247192382812e+02, 2.890360107421875e+02, 2.89046142578125e+02, 2.890552673339844e+02, 2.890634765625e+02, 2.890708923339844e+02, 2.8907763671875e+02, 2.89083740234375e+02, 2.890892639160156e+02, 2.890942993164062e+02, 2.890989379882812e+02, 2.891031494140625e+02, 2.891069946289062e+02, 2.891105041503906e+02, 2.891136169433594e+02, 2.891165771484375e+02, 2.891192626953125e+02, 2.891217346191406e+02, 2.891239318847656e+02, 2.891258850097656e+02, 2.891277465820312e+02, 2.891294860839844e+02, 2.891310424804688e+02, 2.891324462890625e+02, 2.891337280273438e+02, 2.891349182128906e+02, 2.891360168457031e+02, 2.891370544433594e+02, 2.891379699707031e+02, 2.891388549804688e+02, 2.891396789550781e+02, 2.891404418945312e+02, 2.891411437988281e+02, 2.891417846679688e+02, 2.891424255371094e+02, 2.891429748535156e+02, 2.891435241699219e+02, 2.891440124511719e+02, 2.891444702148438e+02, 2.891449279785156e+02, 2.891453552246094e+02, 2.891457214355469e+02, 2.891460876464844e+02, 2.891464538574219e+02, 2.891467590332031e+02, 2.891470336914062e+02, 2.891473083496094e+02, 2.891475830078125e+02, 2.891478271484375e+02, 2.891480712890625e+02, 2.891482849121094e+02, 2.891484680175781e+02, 2.891486511230469e+02, 2.891488342285156e+02, 2.891489868164062e+02, 2.891491394042969e+02, 2.891492919921875e+02, 2.891494445800781e+02, 2.891495666503906e+02, 2.891496887207031e+02]
Loading

0 comments on commit c4bad4e

Please sign in to comment.