Skip to main content

A g-function calculator for Python

Project description

pygfunction: A g-function calculator for Python

Build Status DOI

What is pygfunction?

pygfunction is a Python module for the calculation of thermal response factors, or g-functions, for fields of geothermal boreholes. g-functions form the basis of many simulation and sizing programs for geothermal heat pump systems. g-Functions are superimposed in time to predict fluid and ground temperatures in these systems.

At its core, pygfunction relies on the analytical finite line source solution to evaluate the thermal interference between boreholes in the same bore field. This allows for the very fast calculation of g-functions, even for very large bore fields with hundreds of boreholes.

Using pygfunction, g-functions can be calculated for any bore field configuration (i.e. arbitrarily positionned in space), including fields of boreholes with individually different lengths and radiuses. For regular fields of boreholes of equal size, setting-up the calculation of the g-function is as simple as a few lines of code. For example, the code for the calculation of the g-function of a 10 x 10 square array of boreholes (100 boreholes total):

import pygfunction as gt
import numpy as np
time = np.array([(i+1)*3600. for i in range(24)]) # Calculate hourly for one day
boreField = gt.boreholes.rectangle_field(N_1=10, N_2=10, B_1=7.5, B_2=7.5, H=150., D=4., r_b=0.075)
gFunc = gt.gfunction.gFunction(boreField, alpha=1.0e-6, time=time)
gFunc.visualize_g_function()

Once the g-function is evaluated, pygfunction provides tools to predict borehole temperature variations (using load aggregation methods) and to evaluate fluid temperatures in the boreholes for several U-tube pipe configurations.

Requirements

pygfunction was developed and tested using Python 3.6. In addition, the following packages are needed to run pygfunction and its examples:

  • Coolprop (>=6.4.1)
  • matplotlib (>= 3.3.4),
  • numpy (>= 1.19.2)
  • scipy (>= 1.6.2)

The documentation is generated using Sphinx. The following packages are needed to build the documentation:

  • sphinx (>= 3.5.4)
  • numpydoc (>= 1.1.0)

Quick start

Users - Download pip and install the latest release:

pip install pygfunction

Alternatively, download the latest release and run the installation script:

python setup.py install

Developers - To get the latest version of the code, you can download the repository from github or clone the project in a local directory using git:

git clone https://github.com/MassimoCimmino/pygfunction.git

Once pygfunction is copied to a local directory, you can verify that it is working properly by running the examples in pygfunction/examples/.

Documentation

pygfunction's documentation is hosted on ReadTheDocs.

License

pygfunction is licensed under the terms of the 3-clause BSD-license. See pygfunction license.

Contributing to pygfunction

You can report bugs and propose enhancements on the issue tracker.

To contribute code to pygfunction, follow the contribution workflow.

Contributors

All Contributors


Massimo Cimmino

💻 📖 💡 :rocket: 🤔 🚧 👀

Jack Cook

💻 💡 🤔

This project follows the all-contributors specification. Contributions of any kind welcome!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygfunction-2.0.0.tar.gz (74.4 kB view details)

Uploaded Source

Built Distribution

pygfunction-2.0.0-py3-none-any.whl (90.8 kB view details)

Uploaded Python 3

File details

Details for the file pygfunction-2.0.0.tar.gz.

File metadata

  • Download URL: pygfunction-2.0.0.tar.gz
  • Upload date:
  • Size: 74.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.6

File hashes

Hashes for pygfunction-2.0.0.tar.gz
Algorithm Hash digest
SHA256 d43e011a0456d7e2a98cf5111e472bd969666b4e247d7093146df9b3ee2c181c
MD5 8d73f13b4a6f20c8de056b9f97e5bd6c
BLAKE2b-256 8af48e25a95b130d2c50ea6cf8e0aa67ead1d0e13f8cf72762b20524ac4b5e70

See more details on using hashes here.

Provenance

File details

Details for the file pygfunction-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: pygfunction-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 90.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.6

File hashes

Hashes for pygfunction-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 18a734dfc920b46b523f7b777ff09098d76de7a8d60d126150a9e1c25c8ccd21
MD5 d593e3144919f1a9c998ce13d2de899f
BLAKE2b-256 c8e31ac630020a83df658e02ad2a00d6ef30b4ae948acb8aba9dd3b89ad2c2e4

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page