modflowpy / flopy

A Python package to create, run, and post-process MODFLOW-based models.
https://flopy.readthedocs.io
Other
517 stars 313 forks source link

HeadObservation / ModflowHob #194

Closed bbuzz31 closed 7 years ago

bbuzz31 commented 7 years ago

Hi, With the latest updates to the HOB package I can no longer get write the .hob file. The first issues that arose were related to multiple rows/columns. In lines 302:364 it's trying to add a list to a string. I added [idx] to fix this problem. After changing this I still have issues. Please see below. Thanks for your time.

New:

# HOB package for  MODFLOW-2005, generated by Flopy.
         6         0         0        59     -9999
         1
HOBS                    1        27        21         5      0.00    0.2659   -0.1692    0.0000  # DATASET 3 - Observation 1
HOBS.1                  5    0.0000    1.8400                                                    # DATASET 6 - Observation 1.1
HOBS.2                  5    0.0000    1.4800                                                    # DATASET 6 - Observation 1.2
HOBS.3                  5    0.0000    2.5500                                                    # DATASET 6 - Observation 1.3
HOBS.4                  5    0.0000    1.9500                                                    # DATASET 6 - Observation 1.4
HOBS.5                  5    0.0000    1.5000                                                    # DATASET 6 - Observation 1.5
HOBS.6                  5    0.0000    0.9700                                                    # DATASET 6 - Observation 1.6

Original:

# HOB for MODFLOW, generated by Flopy.
         6         0         0       139         0
         1
C.8         1        27        21         1         1    0.2659   -0.1692      1.84
C.5         1        33        21         1         1    0.4357    0.1033      1.48
B.18         1        68        20         1         1   -0.3916    0.4411      2.55
C.3         1        13        28         1         1    0.1791   -0.4312      1.95
C.2         1        13        28         1         1    0.1751   -0.4298       1.5
B.22         1        51        29         1         1   0.08776   -0.2596      0.97
jdhughes-usgs commented 7 years ago

Don't know if you are using the latest develop version. More information on how you were calling hob would have been useful.

The way hob is used has changed since it was first brought into flopy. Now observation data is passed in using a list of HeadObservation instances. You would create a hob file with the latest development version using:

    # observation location 1 and associated timeseries data
    # only data that are within the simulation time are used
    tsd = [[1., 1.], [87163., 2.], [348649., 3.],
           [871621., 4.], [24439070., 5.], [24439072., 6.]]
    names = ['o1.1', 'o1.2', 'o1.3', 'o1.4', 'o1.5', 'o1.6']
    obs_data.append(flopy.modflow.HeadObservation(mf, layer=0, row=2, column=0,
                                                  time_series_data=tsd,
                                                  names=names, obsname='o1'))
    # observation location 2 and associated timeseries data
    tsd = [[0., 126.938], [87163., 126.904], [871621., 126.382],
           [871718.5943, 115.357], [871893.7713, 112.782]]
    names = ['o2.1', 'o2.2', 'o2.3', 'o2.4', 'o2.5']
    obs_data.append(flopy.modflow.HeadObservation(mf, layer=0, row=3, column=3,
                                                  time_series_data=tsd,
                                                  names=names, obsname='o2'))
    # create the hob object
    hob = flopy.modflow.ModflowHob(mf, iuhobsv=51, obs_data=obs_data,
                                   unitnumber=iuhob)

We have tested hob functionality with a load and a create test. Both of these model datasets were run to confirm that the model files ran with MODFLOW-2005.

Please send more detailed information if this does not address your hob issue.

bbuzz31 commented 7 years ago

I misunderstood how the new HeadObservation is used for multiple locations. Thanks very much for your help.

jdhughes-usgs commented 7 years ago

I will put together a Notebook that illustrates use of HOB, GAGE, and HYDMOD that should help people in the future. Hopefully I can get it done before the next release. Glad I could help.