0

I am using MODFLOW-NWT using FloPy to model groundwater system. I am aiming to extract the water heads for each kper (stress period). I used this code (below) to read all heads,but not sure how to save each heads for each period and calculate the mean value as a function of space.

hds_file = "hist.bhd"
hds = bf.HeadFile(hds_file,text='head', precision='single')
print(hds)

for k in range(348):
    kper = k
    times = hds.get_times()
    head = hds.get_data(totim=times[k])   

    print(head)

I am expecting to save the heads for each stress period and how to calculate the average as a fuction of space for each model node (cell).

Dima
  • 1
  • 3
  • When you print `head`, what does it show? – jared Jun 15 '23 at 04:13
  • array like this, all stress periods: [[[1. 1. 1. ... 1. 1. 1.] [1. 1. 1. ... 1. 1. 1.] [1. 1. 1. ... 1. 1. 1.] ... [1. 1. 1. ... 1. 1. 1.] [1. 1. 1. ... 1. 1. 1.] [1. 1. 1. ... 1. 1. 1.]]] [[[1. 1. 1. ... 1. 1. 1.] [1. 1. 1. ... 1. 1. 1.] [1. 1. 1. ... 1. 1. 1.] ... [1. 1. 1. ... 1. 1. 1.] [1. 1. 1. ... 1. 1. 1.] [1. 1. 1. ... 1. 1. 1.]]] [[[1. 1. 1. ... 1. 1. 1.] [1. 1. 1. ... 1. 1. 1.] [1. 1. 1. ... 1. 1. 1.] ... [1. 1. 1. ... 1. 1. 1.] – Dima Jun 15 '23 at 07:00
  • Is that a 3D array? Do you know what each dimension represents? – jared Jun 15 '23 at 07:02
  • Yes, it is, each array 154 rows* 110 columns – Dima Jun 16 '23 at 00:28
  • But what do they represent? – jared Jun 16 '23 at 03:09
  • It's water levels across modflow model. Each cell has unique value. – Dima Jun 17 '23 at 04:20

0 Answers0