Git Product home page Git Product logo

ghedt's Introduction

Hello ๐Ÿ‘‹ Use the drop down arrows to learn more about the open-source work I've been apart of.
Controller Area Network bus
Ground heat exchangers
  • pygfunction served as the backbone for a first of kind ground heat exchanger design tool, ghedt.
  • cpgfunctionEP has been integrated into EnergyPlus as a third party application.
  • cpgfunction was used to compute g-functions on a high performance computing cluster (HPCC).

(Refer to my masters thesis for a more detailed discussion.)

ghedt's People

Contributors

j-c-cook avatar mitchute avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ghedt's Issues

Reduce size of package to increase portability

The gif in the README file is 756 KB and the atlanta loads file that is stored in two locations is 96 KB. The goal of this issue is to reduce the size of the package so that when compressed it will be less than 20 MB.

Showcase the more advanced search routines in examples

The higher level Design API is currently capable of the near-square, rectangular, bi-rectangular and bi-zoned search routines. However, Cook (2021) showcased more advanced capabilities of ghedt such as the bi-rectangular design routine with no-drilling zones (section 4.4.4 pages 143-146) and the bi-uniform polygonal constrained rectangular search with no-drilling zones (section 4.4.5, pages 146-148). While ghedt can currently perform the more advanced routines, the Design object will do much of the heavy lifting.

The purpose for this issue is to increase the functionality of the Design object to handle the even more advanced routines.

find_near_square.py

Running examples/Design/find_near_square.py is throwing me an AttributeError for length_of_side on line 132. It seems like everything is in order to me, inside of utilities.py but the error is there, nonetheless.
File ".\find_near_square.py", line 132, in main length = dt.utilities.length_of_side(number_of_boreholes, B) AttributeError: module 'ghedt.utilities' has no attribute 'length_of_side'

Add API to Design object for modification of the max near-square size

Initially upon running Clg-10pct.csv in the near_square.py design example file, I got the following message:

ValueError: Based on the loads provided, the excess temperatures for the minimum and maximum number of boreholes falls above 0. This means that the loads are "astronomical" or that the higher end of the domain needs to contain more boreholes. Consider increasing the available land area, or decreasing the minimum allowable borehole spacing.

This error was correct. A new issue needs to address the fact that the Design interface has a hard coded 1x1 to 32x32 range for the near_square search in the following lines:

ghedt/ghedt/design.py

Lines 39 to 42 in 2a1238e

if routine == 'near-square':
self.coordinates_domain = \
dt.domains.square_and_near_square(
1, 32, self.geometric_constraints.B)

After modifying the 32 to be 64 I could get the program to throw the error @mitchute mentions (He may be using a routine that allows him to define a land area, or perhaps he did the same thing using the near-square search). A new issue will need to address this hard-coded value.

Originally posted by @j-c-cook in #79 (comment)

Add set_shank functionality and further clarify what shank spacing is in ghedt

The following function needs to be completed. The function will set the shank spacing based on A, B or C options defined in Paul's MS thesis.

ghedt/ghedt/utilities.py

Lines 58 to 68 in 93d159c

# TODO: Add `set_shank` functionality to utilities.py
# def set_shank(configuration: str, rb: float, r_in: float, r_out: float):
# raise ValueError('This function is incomplete.')
# if configuration == 'A':
# a = 1
# elif configuration == 'B':
# a = 1
# elif configuration == 'C':
# a = 1
# else:
# raise ValueError('Only configurations A, B, or C are valid.')

@mitchute mentions that the shank spacing s value in ghedt should be further clarified:

https://gist.github.com/mitchute/151522d67cdc21058ac523881f4e7957?permalink_comment_id=4049526#gistcomment-4049526

Determining borehole spacing for RowWise

# Use the distance between the first pair of coordinates as the B-spacing
    x_0, y_0 = coordinates[0]
    if len(coordinates) == 1:
        # Set the spacing to be the borehole radius if there's just one borehole
        B = copy.deepcopy(rb)
    elif len(coordinates) > 1:
        x_1, y_1 = coordinates[1]
        B = max(rb, np.sqrt((x_1 - x_0)**2 + (y_1 - y_0)**2))
    else:
        raise ValueError('The coordinates_domain needs to contain a positive'
                         'number of (x, y) pairs.')

Add design from file function

For ghedt to integrate into the online techno-economic tool, there needs to be a design_from_file() function. The GHEDT input file should contain a version number.

module 'pygfunction.utilities' has no attribute 'segment_ratios'

Traceback (most recent call last):
File "..................................................................................................../ghedt/examples/Design/find_bi_zoned_rectangle.py", line 230, in
main()
File "..................................................................................................../ghedt/examples/Design/find_bi_zoned_rectangle.py", line 151, in main
bisection_search = design_single_u_tube.find_design(disp=True)
File "....................................................................................................\ghedt\design.py", line 85, in find_design
bisection_search = dt.search_routines.BisectionZD(
File "....................................................................................................\ghedt\search_routines.py", line 261, in init
Bisection1D.init(
File "....................................................................................................\ghedt\search_routines.py", line 44, in init
g_function = dt.gfunction.compute_live_g_function(
File "....................................................................................................\ghedt\gfunction.py", line 92, in compute_live_g_function
gfunc = calculate_g_function(
File "....................................................................................................\ghedt\gfunction.py", line 44, in calculate_g_function
segment_ratios = gt.utilities.segment_ratios(
AttributeError: module 'pygfunction.utilities' has no attribute 'segment_ratios'

Interpolation Out-of-range Error

When running the attached loads, I'm seeing an interpolation out-of-range error in perform_current_month_simulation function, here:

f = scipy.interpolate.interp1d(dT_fluid_pk, hour_time)

Calling from the Bisection1D search routine, and setting a breakpoint at line 440 of that function, I'm seeing

max(dT_fluid_pk) = 12.208312117009044
dT_fluid_nm_max = 27.59003818526601
min(dT_fluid_pk) = 0.0

Thus causing the out-of-bounds interpolation error. It's unclear currently what the underlying issue is.

image

4509.csv

GHEDT SHA: 92ec5de

Peak Heating and Cooling Load Occurring on Different Days in First Month Cause Crash

See the following load profiles which are very similar. Clg-0pct.csv has zero cooling load in the first month, while Clg-10pct has a relatively small cooling load in the first month. A plot of the first and last day of the year for these loads is shown below.

Screen Shot 2022-01-19 at 4 04 51 PM

GHEDT will compute a size for Clg-0pct.csv; however, it will crash for Clg-10pct. Tracing the issue through the code - initially, I found that the natural log of a negative value was attempting to be compted here:

g_values = g(np.log((_time * 3600.) / ts))

However, continuing to trace back to the origin of the issue, we find that negative first hours for the peak heating and cooling loads are being computed here:

first_hour_heating_peak = firstmonthhour(i) + (
self.monthly_peak_hl_day[i] - 1) * 24 + 12 - \
(self.monthly_peak_hl_duration[
i] / 2)
last_hour_heating_peak = first_hour_heating_peak + \
self.monthly_peak_hl_duration[i]
first_hour_cooling_peak = firstmonthhour(i) + (
self.monthly_peak_cl_day[i] - 1) * 24 + 12 - \
self.monthly_peak_cl_duration[
i] / 2
last_hour_cooling_peak = first_hour_cooling_peak + \
self.monthly_peak_cl_duration[i]

I suspect that this is due to issues related to adding the last day of the year on to the beginning of the simulation for cases when the peak load occurs at the beginning of the simulaiton. Perhaps a workaround is to just make sure that these peak hours never go negative?

GHEDT SHA: 2a1238e

Load Profiles
Clg-0pct.csv
Clg-10pct.csv

Touch up issue 84

@mitchute I realized I kind of like your check better for abs(diff) < tol since the maximum of the month should be in the 48-hour period so that only wouldn't be true when the max is from the first 24 hours that is the last day of the previous month (and would always be larger than the current months max if its the max of the 48-hour).

Originally posted by @j-c-cook in #90 (comment)

Change PLATs handling for peak load on first day and first year of simulation

Also, I think we may have talked about this day-ahead load picking before - but if not, I just want to make sure you're not doing that for the actual first day of the simulation. We really do not have load history before the beginning of the simulation, so in that case, it doesn't make sense to wrap the end of the year back onto the front of the simulation.

You may have already figured that out, but it was in my mind, so I thought I'd get it out here.

Originally posted by @mitchute in #84 (comment)

min/max temperature query

Is it possible to automatically select a configuration based on the minimum/maximum temperature after steady-state e.g 25 years?

Implement an integer golden section search for the second BisectionZD search

The nested zoned rectangular search currently requires an exhaustive search once the domain of interest is selected. Depending on the size of the domain, this exhaustive search for a minimum could take longer than what was presented in Cook 2021. A way to overcome the exhaustive search for the minimum is to implement an integer golden section search for the minima.

Increase coverage of testing

The goal of this issue is to incorporate adequate testing of ghedt and subsequent packages (PLAT). Implementing tests based on examples in my thesis (Cook 2021) will suffice.

Add ORNL output for single U-tube

ghedt is utilized in an online website to quantify economic benefits for utilizing ground heat exchangers. This package can utilize a single U-tube, multiple U-tubes or a coaxial tube borehole heat exchangers from pygfunction. The online techno-economic tool uses EnergyPlus for simulating the g-functions. EnergyPlus can only accept input for a single U-tube. Therefore, the equivalent single U-tube will be exported for ORNL.

Change grout from thermal property to Grout object

The thermal property object contains thermal conductivity k and volumetric heat capacity rhoCp instances. The grout variables used throughout the program and examples were previously pointed at the ThermalProperty object. However, a Grout dedicated object that simply inherits from ThermalProperty has now been created. The purpose of this issue is to redefine all grout variables (modules and examples) to point to the Grout object.

Fix numpy warning during design process

The issue is resolved, but I am getting the following runtime warning:

RuntimeWarning: invalid value encountered in log g_values = g(np.log((_time * 3600.) / ts))

This warning has no effect on the determination of a field.

Originally posted by @j-c-cook in #80 (comment)

Add CI/CD that can be used on a public repository

Adequate testing is important for maintaining the integrity of the repository. Local Github runners (on personal PC's) aren't recommended for use in public repositories due to the security threat they pose. Travis CI/CD claims to have been free since 2011. However, IMO the best option is to setup a machine that has a virtual environment with all three platforms.

MassimoCimmino/pygfunction#180 (comment)

Enhance the Design API to accept the simulation method used in searching for fields

The design interface does not currently allow the user to define the method. Therefore, the default of hybrid is utilized when searching for a field. This did not occur to me until I recommended that the hourly method be used to determine a field while a bug was being fixed. I have always used hourly to validate hybrid and will just setup a ghe and simulate it.

This enhancement is a matter of modifying the API in a few places.

Originally posted by @j-c-cook in #84 (comment)

Add common design interface

The design module will utilize the domain.py and the search_routine.py modules. A common design interface will be created.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.