Skip to content

Commit

Permalink
Merge pull request #234 from mitchute/minor-changes
Browse files Browse the repository at this point in the history
Minor changes
  • Loading branch information
MassimoCimmino authored Nov 11, 2022
2 parents 3799799 + 2cf5343 commit e942304
Show file tree
Hide file tree
Showing 32 changed files with 81 additions and 81 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
* [Issue 99](https://github.com/MassimoCimmino/pygfunction/issues/99) - Fixed an issue where `MultipleUTube._continuity_condition()` and `MultipleUTube._general_solution()` returned complex valued coefficient matrices.
* [Issue 130](https://github.com/MassimoCimmino/pygfunction/issues/130) - Fix incorrect initialization of variables `_mix_out` and `_mixing_m_flow` in `Network`.
* [Issue 155](https://github.com/MassimoCimmino/pygfunction/issues/155) - Fix incorrect initialization of variables in `Network` and `_BasePipe`. Stored variables are now initialized as `numpy.nan` instead of `numpy.empty`.
* [Issue 159](https://github.com/MassimoCimmino/pygfunction/issues/159) - Fix `segment_ratios` function in the `utilities` module to always expect 0 < `end_length_ratio` < 0.5, and allows for `nSegments=1` or `nSegments=2`. If 1<=`nSegments`<3 then the user is warned that the `end_length_ratio` parameter is being over-ridden.
* [Issue 159](https://github.com/MassimoCimmino/pygfunction/issues/159) - Fix `segment_ratios` function in the `utilities` module to always expect 0 < `end_length_ratio` < 0.5, and allows for `nSegments=1` or `nSegments=2`. If 1<=`nSegments`<3 then the user is warned that the `end_length_ratio` parameter is being over-ridden.

## Version 2.0.0 (2021-05-22)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ fluid temperatures in the boreholes for several U-tube pipe configurations.

*pygfunction* was developed and tested using Python 3.7. In addition, the
following packages are needed to run *pygfunction* and its examples:
- Coolprop (>= 6.4.1)
- matplotlib (>= 3.5.1),
- numpy (>= 1.21.5)
- scipy (>= 1.7.3)
- SecondaryCoolantProps (>= 1.1)

The documentation is generated using [Sphinx](http://www.sphinx-doc.org). The
following packages are needed to build the documentation:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/examples/bore_field_thermal_resistance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The following script evaluates the effective bore field thermal resistance
for fields of 1 to 5 series-connected boreholes with fluid flow rates ranging
from 0.01 kg/s ti 1.00 kg/s.

The script is located in:
The script is located in:
`pygfunction/examples/bore_field_thermal_resistance.py`

.. literalinclude:: ../../../examples/bore_field_thermal_resistance.py
Expand Down
2 changes: 1 addition & 1 deletion doc/source/examples/comparison_gfunction_solvers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ compared using the 'similarities' solver as a reference. This shows that
the 'equivalent' solver evaluates g-functions at a very high calculation
speed while maintaining reasonable accuracy.

The script is located in:
The script is located in:
`pygfunction/examples/comparison_gfunction_solvers.py`

.. literalinclude:: ../../../examples/comparison_gfunction_solvers.py
Expand Down
2 changes: 1 addition & 1 deletion doc/source/examples/comparison_load_aggregation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Bernier et al. [1]_.
The following script validates the load aggregation schemes with the exact
solution obtained from convolution in the Fourier domain (see ref. [4]_).

The script is located in:
The script is located in:
`pygfunction/examples/comparison_load_aggregation.py`

.. literalinclude:: ../../../examples/comparison_load_aggregation.py
Expand Down
2 changes: 1 addition & 1 deletion doc/source/examples/custom_bore_field.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function.
The following script generates a bore field with 5 boreholes. The field is
then plotted on a figure.

The script is located in:
The script is located in:
`pygfunction/examples/custom_bore_field.py`

.. literalinclude:: ../../../examples/custom_bore_field.py
Expand Down
2 changes: 1 addition & 1 deletion doc/source/examples/custom_bore_field_from_file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ text file.
The following script generates a bore field with 32 boreholes. The field is
then plotted on a figure.

The script is located in:
The script is located in:
`./pygfunction/examples/custom_bore_field_from_file.py`

.. literalinclude:: ../../../examples/custom_bore_field_from_file.py
Expand Down
2 changes: 1 addition & 1 deletion doc/source/examples/custom_borehole.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ top view of a borehole.
The following script generates boreholes with a single U-tube, a double U-tube (in series and
parallel configurations), and a coaxial borehole. The borehole cross-sections are then plotted.

The script is located in:
The script is located in:
`pygfunction/examples/custom_borehole.py`

.. literalinclude:: ../../../examples/custom_borehole.py
Expand Down
2 changes: 1 addition & 1 deletion doc/source/examples/equal_inlet_temperature.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fluid temperature is compared to the *g*-functions obtained using boundary
conditions of uniform heat extraction rate and of uniform borehole wall
temperature.

The script is located in:
The script is located in:
`pygfunction/examples/equal_inlet_temperature.py`

.. literalinclude:: ../../../examples/equal_inlet_temperature.py
Expand Down
4 changes: 2 additions & 2 deletions doc/source/examples/fluid_temperature.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ The g-function of a single borehole is first calculated. Then, the borehole wall
temperature variations are calculated using the load aggregation scheme of
Claesson and Javed [1]_. The time-variation of heat extraction rates is given by
the synthetic load profile of Bernier et al. [2]_. Three pipe configurations are
compared: (1) a single U-tube, using the model of Eskilson and Claesson
compared: (1) a single U-tube, using the model of Eskilson and Claesson
[3]_, (2) a double U-tube in parallel, using the model of Cimmino [4]_, and (3)
a double U-tube in series, using the model of Cimmino [4]_.

The script is located in:
The script is located in:
`pygfunction/examples/fluid_temperature.py`

.. literalinclude:: ../../../examples/fluid_temperature.py
Expand Down
4 changes: 2 additions & 2 deletions doc/source/examples/fluid_temperature_multiple_boreholes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ synthetic load profile of Bernier et al. [3]_. Predicted inlet and outlet fluid
temperatures of double U-tube boreholes are calculated using the model of
Cimmino [4]_.

The script is located in:
`pygfunction/examples/fluid_temperature.py`
The script is located in:
`pygfunction/examples/fluid_temperature_multiple_boreholes.py`

.. literalinclude:: ../../../examples/fluid_temperature_multiple_boreholes.py
:language: python
Expand Down
2 changes: 1 addition & 1 deletion doc/source/examples/inclined_boreholes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ The script is located in:
.. rubric:: References
.. [1] Claesson J, and Eskilson, P. (1987). Conductive heat extraction by
thermally interacting deep boreholes, in "Thermal analysis of heat
extraction boreholes". Ph.D. Thesis, University of Lund, Lund, Sweden.
extraction boreholes". Ph.D. Thesis, University of Lund, Lund, Sweden.
2 changes: 1 addition & 1 deletion doc/source/examples/load_aggregation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ the synthetic load profile of Bernier et al. [2]_.
The following script validates the load aggregation scheme with the exact
solution obtained from convolution in the Fourier domain (see ref. [3]_).

The script is located in:
The script is located in:
`pygfunction/examples/load_aggregation.py`

.. literalinclude:: ../../../examples/load_aggregation.py
Expand Down
2 changes: 1 addition & 1 deletion doc/source/examples/mixed_inlet_conditions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ different lengths. The *g*-function considering piping conections is compared to
the *g*-function obtained using a boundary condition of uniform borehole wall
temperature.

The script is located in:
The script is located in:
`pygfunction/examples/mixed_inlet_conditions.py`

.. literalinclude:: ../../../examples/mixed_inlet_conditions.py
Expand Down
2 changes: 1 addition & 1 deletion doc/source/examples/multiple_independent_Utubes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ independent U-tubes with different inlet fluid temperatures and different inlet
fluid mass flow rates. The resulting fluid temperature profiles are verified
against the fluid temeprature profiles presented by Cimmino [1]_.

The script is located in:
The script is located in:
`pygfunction/examples/multiple_independent_Utubes.py`

.. literalinclude:: ../../../examples/multiple_independent_Utubes.py
Expand Down
4 changes: 2 additions & 2 deletions doc/source/examples/multipole_temperature.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ temperatures of 1 degC are evaluated. The temperatures in and around the
borehole with 2 pipes are then calculated. Results are verified against the
results of Claesson and Hellstrom [1]_.

The script is located in:
The script is located in:
`pygfunction/examples/multipole_temperature.py`

.. literalinclude:: ../../../examples/multipole_temperature.py
Expand All @@ -27,4 +27,4 @@ The script is located in:
.. rubric:: References
.. [1] Claesson, J., & Hellstrom, G. (2011). Multipole method to calculate
borehole thermal resistances in a borehole heat exchanger. HVAC&R Research,
17(6), 895-911.
17(6), 895-911.
2 changes: 1 addition & 1 deletion doc/source/examples/regular_bore_field.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The following script generates rectangular, box-shaped, U-shaped and L-shaped
bore fields in a 4 x 3 configuration as well as a circular field of 8
boreholes. Each field is then plotted on a separate figure.

The script is located in:
The script is located in:
`pygfunction/examples/regular_bore_field.py`

.. literalinclude:: ../../../examples/regular_bore_field.py
Expand Down
4 changes: 2 additions & 2 deletions doc/source/examples/unequal_segments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Calculation of g-functions with unequal numbers of segments
***********************************************************

This example demonstrates the use of the :doc:`g-function <../modules/gfunction>` module
to calculate *g*-functions using a boundary condition of uniform and equal
to calculate *g*-functions using a boundary condition of uniform and equal
borehole wall temperature for all boreholes. The total rate of heat extraction
in the bore field is constant. The discretization along three of the boreholes is refined
for the calculation of the *g*-function and to draw the heat extraction rate profiles
Expand All @@ -14,7 +14,7 @@ along their lengths.
The following script generates the *g*-functions of a rectangular field of
6 x 4. *g*-Functions using equal and unequal numbers of segments are compared.

The script is located in:
The script is located in:
`pygfunction/examples/unequal_segments.py`

.. literalinclude:: ../../../examples/unequal_segments.py
Expand Down
4 changes: 2 additions & 2 deletions doc/source/examples/uniform_heat_extraction_rate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ Calculation of g-functions with uniform borehole heat extraction rates
**********************************************************************

This example demonstrates the use of the :doc:`g-function <../modules/gfunction>` module
to calculate *g*-functions using a boundary condition of uniform and equal
to calculate *g*-functions using a boundary condition of uniform and equal
heat extraction rate for all boreholes, constant in time.

The following script generates the *g*-functions of rectangular fields of
3 x 2, 6 x 4 and 10 x 10 boreholes. *g*-Functions are verified against the
*g*-functions presented by Cimmino and Bernier [1]_.

The script is located in:
The script is located in:
`pygfunction/examples/uniform_heat_extraction_rate.py`

.. literalinclude:: ../../../examples/uniform_heat_extraction_rate.py
Expand Down
4 changes: 2 additions & 2 deletions doc/source/examples/uniform_temperature.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ Calculation of g-functions with uniform borehole wall temperature
*****************************************************************

This example demonstrates the use of the :doc:`g-function <../modules/gfunction>` module
to calculate *g*-functions using a boundary condition of uniform and equal
to calculate *g*-functions using a boundary condition of uniform and equal
borehole wall temperature for all boreholes. The total rate of heat extraction
in the bore field is constant.

The following script generates the *g*-functions of rectangular fields of
3 x 2, 6 x 4 and 10 x 10 boreholes. *g*-Functions are verified against the
*g*-functions presented by Cimmino and Bernier [1]_.

The script is located in:
The script is located in:
`pygfunction/examples/uniform_temperature.py`

.. literalinclude:: ../../../examples/uniform_temperature.py
Expand Down
2 changes: 1 addition & 1 deletion doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ analytical solutions.

.. toctree::
:maxdepth: 2

install
citing
modules
Expand Down
2 changes: 1 addition & 1 deletion doc/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Setting up pygfunction
**********************

*pygfunction* uses Python 3.7, along with the following packages:
- Coolprop (>= 6.4.1)
- matplotlib (>= 3.5.1),
- numpy (>= 1.21.5)
- scipy (>= 1.7.3)
- SecondaryCoolantProps (>= 1.1)

*pygfunction*'s- documentation is built using:
- sphinx (>= 4.4.0)
Expand Down
22 changes: 11 additions & 11 deletions doc/source/nomenclature.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,37 @@ Nomenclature

.. toctree::
:maxdepth: 2


Geometry
==================

Parameters in the table below are related to the definition of borehole
and pipe geometries.
.. csv-table::

.. csv-table::
:file: nomenclature_tables/geometry.csv
:widths: 30, 30, 70
:header-rows: 1

Fluid properties
===================

Parameters in the table below are related to the evaluation of fluid
thermal properties in the :doc:`media <modules/media>` module.
.. csv-table::
:file: nomenclature_tables/fluid_properties.csv

.. csv-table::
:file: nomenclature_tables/fluid_properties.csv
:widths: 30, 30, 70
:header-rows: 1

Heat transfer
===================

Parameters in the table below are used throughout **pygfunction** for the
calculation of heat transfer in geothermal bore fields.
.. csv-table::
:file: nomenclature_tables/heat_transfer.csv

.. csv-table::
:file: nomenclature_tables/heat_transfer.csv
:widths: 30, 30, 70
:header-rows: 1
4 changes: 2 additions & 2 deletions examples/inclined_boreholes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
configuration presented by Claesson and Eskilson (1987) and the second
field corresponds to the configuration comprised of 8 boreholes in a
circle.
Claesson J, and Eskilson, P. (1987). Conductive heat extraction by
thermally interacting deep boreholes, in "Thermal analysis of heat
extraction boreholes". Ph.D. Thesis, University of Lund, Lund, Sweden.
extraction boreholes". Ph.D. Thesis, University of Lund, Lund, Sweden.
"""

import pygfunction as gt
Expand Down
6 changes: 3 additions & 3 deletions pygfunction/boreholes.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ class _EquivalentBorehole(object):
Direction (in radians) of the tilt of the borehole.
nBoreholes : int
Number of boreholes represented by the equivalent borehole.
References
----------
.. [#EqBorehole-PriCim2021] Prieto, C., & Cimmino, M., 2021. Thermal
Expand Down Expand Up @@ -485,7 +485,7 @@ def unique_distance(self, target, disTol=0.01):
dis.append(np.mean(all_dis[j0:]))
wDis.append(nDis-j0)
j0 = j1

return np.array(dis), np.array(wDis)

def _segment_edges(self, nSegments, segment_ratios=None):
Expand Down Expand Up @@ -1237,7 +1237,7 @@ def visualize_field(
np.array([borehole.D, z_H]),
'k-')


if viewTop and view3D:
plt.tight_layout(rect=[0, 0.0, 0.90, 1.0])
else:
Expand Down
14 changes: 7 additions & 7 deletions pygfunction/gfunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -1730,7 +1730,7 @@ def temporal_superposition(self, h_ij, Q_reconstructed):
Q_reconstructed[:,1:] - Q_reconstructed[:,0:-1]), axis=1)[:,::-1]
# Borehole wall temperature
T_b0 = np.einsum('ijk,jk', h_ij[:,:,:nt], dQ)

return T_b0

def load_history_reconstruction(self, time, Q_b):
Expand Down Expand Up @@ -2073,7 +2073,7 @@ def _thermal_response_factors_borehole_to_self(self, time, alpha):
dis = np.maximum(
np.sqrt((x[i_segment] - x[j_segment])**2 + (y[i_segment] - y[j_segment])**2),
r_b[i_segment])
# FlS solution
# FLS solution
if np.all([b.is_vertical() for b in self.boreholes]):
h = finite_line_source_vectorized(
time, alpha,
Expand All @@ -2090,7 +2090,7 @@ def _thermal_response_factors_borehole_to_self(self, time, alpha):
tilt[j_segment], orientation[j_segment], M=self.mQuad,
approximation=self.approximate_FLS, N=self.nFLS)
return h, i_segment, j_segment



class _Similarities(_BaseSolver):
Expand Down Expand Up @@ -2969,7 +2969,7 @@ def _find_axial_borehole_pairs(self, boreholes):
# If no similar pairs are known, append the groups
else:
borehole_to_borehole.append([(i, j)])

else:
# Outputs for a single borehole
if boreholes[0].is_vertical:
Expand Down Expand Up @@ -3529,7 +3529,7 @@ def initialize(self, disTol=0.01, tol=1.0e-6, kClusters=1, **kwargs):
self.nBoreSegments = [self.nBoreSegments[0]] * self.nEqBoreholes
self.segment_ratios = [self.segment_ratios[0]] * self.nEqBoreholes
self.boreSegments = self.borehole_segments()
self._i0Segments = [sum(self.nBoreSegments[0:i])
self._i0Segments = [sum(self.nBoreSegments[0:i])
for i in range(self.nEqBoreholes)]
self._i1Segments = [sum(self.nBoreSegments[0:(i + 1)])
for i in range(self.nEqBoreholes)]
Expand Down Expand Up @@ -3727,7 +3727,7 @@ def find_groups(self, tol=1e-6):
self.clusters = range(self.nBoreholes)
# Overwrite boreholes with equivalent boreholes
self.boreholes = [_EquivalentBorehole(
[borehole
[borehole
for borehole, cluster in zip(self.boreholes, self.clusters)
if cluster==i])
for i in range(self.nEqBoreholes)]
Expand Down Expand Up @@ -3998,7 +3998,7 @@ def _find_unique_boreholes(self, boreholes):
else:
# If no similar boreholes are known, append the groups
unique_boreholes.append([i])

return unique_boreholes

def _find_unique_distances(self, dis, indices):
Expand Down
Loading

0 comments on commit e942304

Please sign in to comment.