Package: pygfunction
pygfunction: A g-function calculator for PythonWhat ispygfunction?pygfunctionis a Python module for the calculation of thermal response
factors, org-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,pygfunctionrelies 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 ofg-functions, even for very large
bore fields with hundreds of boreholes.Usingpygfunction,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 theg-function is
as simple as a few lines of code. For example, the code for the calculation of
theg-function of a 10 x 10 square array of boreholes (100 boreholes
total):importpygfunctionasgtimportnumpyasnptime=np.array([(i+1)*3600.foriinrange(24)])# Calculate hourly for one dayboreField=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 theg-function is evaluated,pygfunctionprovides tools to predict
borehole temperature variations (using load aggregation methods) and to evaluate
fluid temperatures in the boreholes for several U-tube pipe configurations.Requirementspygfunctionwas developed and tested using Python 3.7. In addition, the
following packages are needed to runpygfunctionand its examples:matplotlib (>= 3.5.1),numpy (>= 1.21.5)scipy (>= 1.7.3)SecondaryCoolantProps (>= 1.1)The documentation is generated usingSphinx. The
following packages are needed to build the documentation:sphinx (>= 4.4.0)numpydoc (>= 1.2.0)Quick startUsers-Download pipand install the latest release:pip install pygfunctionAlternatively,download the latest releaseand run the installation script:pip install .Developers- To get the latest version of the code, you candownload the
repository from githubor clone
the project in a local directory using git:git clone https://github.com/MassimoCimmino/pygfunction.gitInstallpygfunctionin development mode (this requirespip >= 21.1):pip install --editable .Oncepygfunctionis copied to a local directory, you can verify that it is
working properly by running the examples inpygfunction/examples/.Documentationpygfunction's documentation is hosted onReadTheDocs.Licensepygfunctionis licensed under the terms of the 3-clause BSD-license.
Seepygfunction license.Contributing topygfunctionYou can report bugs and propose enhancements on theissue tracker.To contribute code topygfunction, follow thecontribution workflow.ContributorsMassimo Cimmino💻📖💡:rocket:🤔🚧👀Jack Cook💻💡🤔📖Matt Mitchell💻🤔This project follows theall-contributorsspecification. 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.