pygfunction


Namepygfunction JSON
Version 2.2.2 PyPI version JSON
download
home_pagehttps://github.com/MassimoCimmino/pygfunction
SummaryA g-function calculator for Python
upload_time2023-01-09 21:55:12
maintainer
docs_urlNone
authorMassimo Cimmino
requires_python>=3.7
licenseBSD 3-Clause License
keywords geothermal ground-source ground heat exchangers
VCS
bugtrack_url
requirements numpy scipy matplotlib SecondaryCoolantProps
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pygfunction: A g-function calculator for Python

[![Tests](https://github.com/MassimoCimmino/pygfunction/actions/workflows/test.yml/badge.svg)](https://github.com/MassimoCimmino/pygfunction/actions/workflows/test.yml)
[![DOI](https://zenodo.org/badge/100305705.svg)](https://zenodo.org/badge/latestdoi/100305705)

## 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):

```python
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.7. In addition, the
following packages are needed to run *pygfunction* and its examples:
- 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:
- sphinx (>= 4.4.0)
- numpydoc (>= 1.2.0)


## Quick start

**Users** - [Download pip](https://pip.pypa.io/en/latest/) and install the latest release:

```
pip install pygfunction
```

Alternatively, [download the latest release](https://github.com/MassimoCimmino/pygfunction/releases) and run the installation script:

```
pip install .
```

**Developers** - To get the latest version of the code, you can [download the
repository from github](https://github.com/MassimoCimmino/pygfunction) or clone
the project in a local directory using git:

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

Install *pygfunction* in development mode (this requires `pip >= 21.1`):
```
pip install --editable .
```

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](https://pygfunction.readthedocs.io).


## License

*pygfunction* is licensed under the terms of the 3-clause BSD-license.
See [pygfunction license](LICENSE.md).


## Contributing to *pygfunction*

You can report bugs and propose enhancements on the
[issue tracker](https://github.com/MassimoCimmino/pygfunction/issues).

To contribute code to *pygfunction*, follow the
[contribution workflow](CONTRIBUTING.md).


## Contributors

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
  <tbody>
    <tr>
      <td align="center"><a href="https://www.polymtl.ca/expertises/en/cimmino-massimo"><img src="https://avatars.githubusercontent.com/u/23085996?v=4?s=100" width="100px;" alt="Massimo Cimmino"/><br /><sub><b>Massimo Cimmino</b></sub></a><br /><a href="https://github.com/MassimoCimmino/pygfunction/commits?author=MassimoCimmino" title="Code">💻</a> <a href="https://github.com/MassimoCimmino/pygfunction/commits?author=MassimoCimmino" title="Documentation">📖</a> <a href="#example-MassimoCimmino" title="Examples">💡</a> <a href="http://www.ibpsa.org/proceedings/eSimPapers/2018/2-3-A-4.pdf" title="Founder">:rocket:</a> <a href="#ideas-MassimoCimmino" title="Ideas, Planning, & Feedback">🤔</a> <a href="#maintenance-MassimoCimmino" title="Maintenance">🚧</a> <a href="https://github.com/MassimoCimmino/pygfunction/pulls?q=is%3Apr+reviewed-by%3AMassimoCimmino" title="Reviewed Pull Requests">👀</a></td>
      <td align="center"><a href="https://github.com/j-c-cook"><img src="https://avatars.githubusercontent.com/u/39248734?v=4?s=100" width="100px;" alt="Jack Cook"/><br /><sub><b>Jack Cook</b></sub></a><br /><a href="https://github.com/MassimoCimmino/pygfunction/commits?author=j-c-cook" title="Code">💻</a> <a href="#example-j-c-cook" title="Examples">💡</a> <a href="#ideas-j-c-cook" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/MassimoCimmino/pygfunction/commits?author=j-c-cook" title="Documentation">📖</a></td>
      <td align="center"><a href="https://github.com/mitchute"><img src="https://avatars.githubusercontent.com/u/2985979?v=4?s=100" width="100px;" alt="Matt Mitchell"/><br /><sub><b>Matt Mitchell</b></sub></a><br /><a href="https://github.com/MassimoCimmino/pygfunction/commits?author=mitchute" title="Code">💻</a> <a href="#ideas-mitchute" title="Ideas, Planning, & Feedback">🤔</a></td>
    </tr>
  </tbody>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!


Copyright (c) 2017-2023, Massimo Cimmino
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

* Neither the name of pygfunction nor the names of its
  contributors may be used to endorse or promote products derived from
  this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/MassimoCimmino/pygfunction",
    "name": "pygfunction",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "Geothermal,Ground-source,Ground heat exchangers",
    "author": "Massimo Cimmino",
    "author_email": "massimo.cimmino@polymtl.ca",
    "download_url": "https://files.pythonhosted.org/packages/6c/10/0da615eae833ecaf58664f935694a88c7c3b79e54b0f8f87e4e48a8acb77/pygfunction-2.2.2.tar.gz",
    "platform": null,
    "description": "# pygfunction: A g-function calculator for Python\n\n[![Tests](https://github.com/MassimoCimmino/pygfunction/actions/workflows/test.yml/badge.svg)](https://github.com/MassimoCimmino/pygfunction/actions/workflows/test.yml)\n[![DOI](https://zenodo.org/badge/100305705.svg)](https://zenodo.org/badge/latestdoi/100305705)\n\n## What is *pygfunction*?\n\n*pygfunction* is a Python module for the calculation of thermal response\nfactors, or *g*-functions, for fields of geothermal boreholes. *g*-functions\nform the basis of many simulation and sizing programs for geothermal heat pump\nsystems. *g*-Functions are superimposed in time to predict fluid and ground\ntemperatures in these systems.\n\nAt its core, *pygfunction* relies on the analytical finite line source solution\nto evaluate the thermal interference between boreholes in the same bore field.\nThis allows for the very fast calculation of *g*-functions, even for very large\nbore fields with hundreds of boreholes.\n\nUsing *pygfunction*, *g*-functions can be calculated for any bore field\nconfiguration (i.e. arbitrarily positionned in space), including fields of\nboreholes with individually different lengths and radiuses. For regular fields\nof boreholes of equal size, setting-up the calculation of the *g*-function is\nas simple as a few lines of code. For example, the code for the calculation of\nthe *g*-function of a 10 x 10 square array of boreholes (100 boreholes\ntotal):\n\n```python\nimport pygfunction as gt\nimport numpy as np\ntime = np.array([(i+1)*3600. for i in range(24)]) # Calculate hourly for one day\nboreField = 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)\ngFunc = gt.gfunction.gFunction(boreField, alpha=1.0e-6, time=time)\ngFunc.visualize_g_function()\n```\n\nOnce the *g*-function is evaluated, *pygfunction* provides tools to predict\nborehole temperature variations (using load aggregation methods) and to evaluate\nfluid temperatures in the boreholes for several U-tube pipe configurations.\n\n\n## Requirements\n\n*pygfunction* was developed and tested using Python 3.7. In addition, the\nfollowing packages are needed to run *pygfunction* and its examples:\n- matplotlib (>= 3.5.1),\n- numpy (>= 1.21.5)\n- scipy (>= 1.7.3)\n- SecondaryCoolantProps (>= 1.1)\n\nThe documentation is generated using [Sphinx](http://www.sphinx-doc.org). The\nfollowing packages are needed to build the documentation:\n- sphinx (>= 4.4.0)\n- numpydoc (>= 1.2.0)\n\n\n## Quick start\n\n**Users** - [Download pip](https://pip.pypa.io/en/latest/) and install the latest release:\n\n```\npip install pygfunction\n```\n\nAlternatively, [download the latest release](https://github.com/MassimoCimmino/pygfunction/releases) and run the installation script:\n\n```\npip install .\n```\n\n**Developers** - To get the latest version of the code, you can [download the\nrepository from github](https://github.com/MassimoCimmino/pygfunction) or clone\nthe project in a local directory using git:\n\n```\ngit clone https://github.com/MassimoCimmino/pygfunction.git\n```\n\nInstall *pygfunction* in development mode (this requires `pip >= 21.1`):\n```\npip install --editable .\n```\n\nOnce *pygfunction* is copied to a local directory, you can verify that it is\nworking properly by running the examples in `pygfunction/examples/`.\n\n\n## Documentation\n\n*pygfunction*'s documentation is hosted on\n[ReadTheDocs](https://pygfunction.readthedocs.io).\n\n\n## License\n\n*pygfunction* is licensed under the terms of the 3-clause BSD-license.\nSee [pygfunction license](LICENSE.md).\n\n\n## Contributing to *pygfunction*\n\nYou can report bugs and propose enhancements on the\n[issue tracker](https://github.com/MassimoCimmino/pygfunction/issues).\n\nTo contribute code to *pygfunction*, follow the\n[contribution workflow](CONTRIBUTING.md).\n\n\n## Contributors\n\n<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->\n[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)\n<!-- ALL-CONTRIBUTORS-BADGE:END -->\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<table>\n  <tbody>\n    <tr>\n      <td align=\"center\"><a href=\"https://www.polymtl.ca/expertises/en/cimmino-massimo\"><img src=\"https://avatars.githubusercontent.com/u/23085996?v=4?s=100\" width=\"100px;\" alt=\"Massimo Cimmino\"/><br /><sub><b>Massimo Cimmino</b></sub></a><br /><a href=\"https://github.com/MassimoCimmino/pygfunction/commits?author=MassimoCimmino\" title=\"Code\">\ud83d\udcbb</a> <a href=\"https://github.com/MassimoCimmino/pygfunction/commits?author=MassimoCimmino\" title=\"Documentation\">\ud83d\udcd6</a> <a href=\"#example-MassimoCimmino\" title=\"Examples\">\ud83d\udca1</a> <a href=\"http://www.ibpsa.org/proceedings/eSimPapers/2018/2-3-A-4.pdf\" title=\"Founder\">:rocket:</a> <a href=\"#ideas-MassimoCimmino\" title=\"Ideas, Planning, & Feedback\">\ud83e\udd14</a> <a href=\"#maintenance-MassimoCimmino\" title=\"Maintenance\">\ud83d\udea7</a> <a href=\"https://github.com/MassimoCimmino/pygfunction/pulls?q=is%3Apr+reviewed-by%3AMassimoCimmino\" title=\"Reviewed Pull Requests\">\ud83d\udc40</a></td>\n      <td align=\"center\"><a href=\"https://github.com/j-c-cook\"><img src=\"https://avatars.githubusercontent.com/u/39248734?v=4?s=100\" width=\"100px;\" alt=\"Jack Cook\"/><br /><sub><b>Jack Cook</b></sub></a><br /><a href=\"https://github.com/MassimoCimmino/pygfunction/commits?author=j-c-cook\" title=\"Code\">\ud83d\udcbb</a> <a href=\"#example-j-c-cook\" title=\"Examples\">\ud83d\udca1</a> <a href=\"#ideas-j-c-cook\" title=\"Ideas, Planning, & Feedback\">\ud83e\udd14</a> <a href=\"https://github.com/MassimoCimmino/pygfunction/commits?author=j-c-cook\" title=\"Documentation\">\ud83d\udcd6</a></td>\n      <td align=\"center\"><a href=\"https://github.com/mitchute\"><img src=\"https://avatars.githubusercontent.com/u/2985979?v=4?s=100\" width=\"100px;\" alt=\"Matt Mitchell\"/><br /><sub><b>Matt Mitchell</b></sub></a><br /><a href=\"https://github.com/MassimoCimmino/pygfunction/commits?author=mitchute\" title=\"Code\">\ud83d\udcbb</a> <a href=\"#ideas-mitchute\" title=\"Ideas, Planning, & Feedback\">\ud83e\udd14</a></td>\n    </tr>\n  </tbody>\n</table>\n\n<!-- markdownlint-restore -->\n<!-- prettier-ignore-end -->\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n\nCopyright (c) 2017-2023, Massimo Cimmino\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n\n* Neither the name of pygfunction nor the names of its\n  contributors may be used to endorse or promote products derived from\n  this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License",
    "summary": "A g-function calculator for Python",
    "version": "2.2.2",
    "split_keywords": [
        "geothermal",
        "ground-source",
        "ground heat exchangers"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "115c8403d53f9bbb9aac7a34cbaec04a66f571cd70763d662c4ebc04b31efae7",
                "md5": "4e00939bb5aed38240e49be0f7f7056e",
                "sha256": "c4dc6219ae5e45d1bff99970ea109fbfcba15563a48a802146144a4a948fff1d"
            },
            "downloads": -1,
            "filename": "pygfunction-2.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4e00939bb5aed38240e49be0f7f7056e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 90067,
            "upload_time": "2023-01-09T21:55:06",
            "upload_time_iso_8601": "2023-01-09T21:55:06.197095Z",
            "url": "https://files.pythonhosted.org/packages/11/5c/8403d53f9bbb9aac7a34cbaec04a66f571cd70763d662c4ebc04b31efae7/pygfunction-2.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6c100da615eae833ecaf58664f935694a88c7c3b79e54b0f8f87e4e48a8acb77",
                "md5": "73d5b5ddf3ff68669f21c82e7697f2a7",
                "sha256": "adae94b396f891a66858b0df683382a262a6e08bfed0df5e1f12df5293e1c74a"
            },
            "downloads": -1,
            "filename": "pygfunction-2.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "73d5b5ddf3ff68669f21c82e7697f2a7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 100081,
            "upload_time": "2023-01-09T21:55:12",
            "upload_time_iso_8601": "2023-01-09T21:55:12.851808Z",
            "url": "https://files.pythonhosted.org/packages/6c/10/0da615eae833ecaf58664f935694a88c7c3b79e54b0f8f87e4e48a8acb77/pygfunction-2.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-09 21:55:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "MassimoCimmino",
    "github_project": "pygfunction",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "numpy",
            "specs": []
        },
        {
            "name": "scipy",
            "specs": []
        },
        {
            "name": "matplotlib",
            "specs": []
        },
        {
            "name": "SecondaryCoolantProps",
            "specs": []
        }
    ],
    "tox": true,
    "lcname": "pygfunction"
}
        
Elapsed time: 0.06435s