Skip to content

Instantly share code, notes, and snippets.

@mitchute
Created January 31, 2022 22:59
Show Gist options
  • Save mitchute/151522d67cdc21058ac523881f4e7957 to your computer and use it in GitHub Desktop.
Save mitchute/151522d67cdc21058ac523881f4e7957 to your computer and use it in GitHub Desktop.
Radial-Numerical-Tests
from ghedt.peak_load_analysis_tool.borehole_heat_exchangers import SingleUTube
from ghedt.peak_load_analysis_tool.media import Pipe, Grout, Soil
from ghedt.peak_load_analysis_tool.radial_numerical_borehole import RadialNumericalBH
from pygfunction.boreholes import Borehole
from pygfunction.media import Fluid
def main():
# fluid
brine = "MPG"
brine_concentration = 0.2
fluid = Fluid(mixer=brine, percent=brine_concentration)
# borehole
r_b = 0.114 / 2
bh = Borehole(H=100, D=1, r_b=r_b, x=0, y=0, tilt=0, orientation=0)
# pipe
r_p_out = 0.03341 / 2
t_p = 0.002984
r_p_in = r_p_out - t_p
s_c_to_c = ((2 * r_b) - (4 * r_p_out)) / 3 + (2 * r_p_out) # center-to-center pipe spacing
pos_single = Pipe.place_pipes(s=s_c_to_c, r_out=r_p_out, n_pipes=1)
pipe = Pipe(pos=pos_single, r_in=r_p_in, r_out=r_p_out, s=s_c_to_c, eps=1e-6, k=0.3895, rhoCp=1.77e6)
# grout
grout = Grout(k=0.7743, rhoCp=3.90e6)
# soil
soil = Soil(k=2.5, rhoCp=2.5e6, ugt=10)
mass_flow_borehole = 0.001
single_u_tube = SingleUTube(mass_flow_borehole,
fluid,
bh,
pipe,
grout,
soil)
rnb = RadialNumericalBH(single_u_tube).calc_sts_g_functions()
pass
if __name__ == "__main__":
main()
@mitchute
Copy link
Author

@j-c-cook could you give me some pointers here?

Traceback (most recent call last):
  File "/Users/mmitchel/Projects/nrel-plant/ghe/test_sts_g_functions.py", line 46, in <module>
    main()
  File "/Users/mmitchel/Projects/nrel-plant/ghe/test_sts_g_functions.py", line 38, in main
    soil)
  File "/Users/mmitchel/Projects/ghedt/ghedt/peak_load_analysis_tool/borehole_heat_exchangers.py", line 128, in __init__
    self.grout.k, R_fp)
  File "/Users/mmitchel/Projects/nrel-plant/venv/lib/python3.7/site-packages/pygfunction/pipes.py", line 948, in __init__
    self._check_geometry()
  File "/Users/mmitchel/Projects/nrel-plant/venv/lib/python3.7/site-packages/pygfunction/pipes.py", line 816, in _check_geometry
    'borehole.'.format(i))
ValueError: Pipes must be entirely contained within the borehole. Pipe 0 is partly or entirely outside the borehole.

@mitchute
Copy link
Author

mitchute commented Feb 1, 2022

NM. Shank spacing, s, is the nearest pipe to pipe distance referenced from the pipe outside surfaces.

This note should be clarified.

https://github.com/j-c-cook/ghedt/blob/93d159c7e6b42e0583ff837da37f40437f73bc32/ghedt/peak_load_analysis_tool/media.py#L45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment