Skip to content

Commit

Permalink
Fix construction of small U-shaped and box-shaped fields
Browse files Browse the repository at this point in the history
  • Loading branch information
MassimoCimmino committed Oct 21, 2017
1 parent 614d2fb commit 0b2d364
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions pygfunction/boreholes.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,14 @@ def U_shaped_field(N_1, N_2, B_1, B_2, H, D, r_b):
"""
borefield = []

for i in range(N_1):
borefield.append(Borehole(H, D, r_b, x=i*B_1, y=0.))
for j in range(1, N_2):
borefield.append(Borehole(H, D, r_b, x=0, y=j*B_2))
borefield.append(Borehole(H, D, r_b, x=(N_1-1)*B_1, y=j*B_2))
if N_1 > 2 and N_2 > 1:
for i in range(N_1):
borefield.append(Borehole(H, D, r_b, x=i*B_1, y=0.))
for j in range(1, N_2):
borefield.append(Borehole(H, D, r_b, x=0, y=j*B_2))
borefield.append(Borehole(H, D, r_b, x=(N_1-1)*B_1, y=j*B_2))
else:
borefield = rectangle_field(N_1, N_2, B_1, B_2, H, D, r_b)

return borefield

Expand Down Expand Up @@ -291,13 +294,17 @@ def box_shaped_field(N_1, N_2, B_1, B_2, H, D, r_b):
"""
borefield = []

for i in range(N_1):
borefield.append(Borehole(H, D, r_b, x=i*B_1, y=0.))
for j in range(1, N_2-1):
borefield.append(Borehole(H, D, r_b, x=0., y=j*B_2))
borefield.append(Borehole(H, D, r_b, x=(N_1-1)*B_1, y=j*B_2))
for i in range(N_1):
borefield.append(Borehole(H, D, r_b, x=i*B_1, y=(N_2-1)*B_2))

if N_1 > 2 and N_2 > 2:
for i in range(N_1):
borefield.append(Borehole(H, D, r_b, x=i*B_1, y=0.))
for j in range(1, N_2-1):
borefield.append(Borehole(H, D, r_b, x=0., y=j*B_2))
borefield.append(Borehole(H, D, r_b, x=(N_1-1)*B_1, y=j*B_2))
for i in range(N_1):
borefield.append(Borehole(H, D, r_b, x=i*B_1, y=(N_2-1)*B_2))
else:
borefield = rectangle_field(N_1, N_2, B_1, B_2, H, D, r_b)

return borefield

Expand Down

0 comments on commit 0b2d364

Please sign in to comment.