pygfunction icon indicating copy to clipboard operation
pygfunction copied to clipboard

uniformly distributed field

Open icupeiro opened this issue 4 years ago • 2 comments

A method for a uniformly distributed field (filled circular or hexagonal, in the same way as the DST model) is missing.

A very raw implementation done by one of my students is shown in the method below

def circularField(N_b,B,H,D,r_b):

  coo = np.array([[0,0]])
  a = 6
  B2 = B
  counter = 0
  shift=0
  for i in range(N_b-1):
      i = i+1
      counter = counter + 1
      if counter > a:
          a = a+6
          B2 = B2 + B
          #shift = shift + 2*np.pi/3.
          counter = 0
      coo = np.append(coo, np.array([[B2*np.sin(2*np.pi*counter/a+shift),B2*np.cos(2*np.pi*counter/a+shift)]]),0)

  field = [gt.boreholes.Borehole(H, D, r_b, x, y) for (x, y) in coo]
    
  return field

However, such implementation seems to result in a singular system of equations.

See this interactive example design script. to reproduce the problem.

icupeiro avatar Feb 19 '21 08:02 icupeiro

Boreholes 8 and 20 are superimposed in your code. See below.

Figure_1

I added a task to #33 to check for valid borefield layouts for the calculation.

MassimoCimmino avatar Feb 20 '21 19:02 MassimoCimmino

solved by changing counter = 0 to counter = 1 within the if statement. The final method would look like:

def circularField(N_b,B,H,D,r_b):

  coo = np.array([[0,0]])     # Firstt borehole placed in the center
  a = 6
  B2 = B
  counter = 0
  for i in range(N_b-1):
      i = i+1
      counter = counter + 1
      if counter > a:
          a = a+6
          B2 = B2 + B
          counter = 1
      coo = np.append(coo, np.array([[B2*np.sin(2*np.pi*counter/a),B2*np.cos(2*np.pi*counter/a)]]),0)

  field = [gt.boreholes.Borehole(H, D, r_b, x, y) for (x, y) in coo]
    
  return field

icupeiro avatar Feb 22 '21 09:02 icupeiro