Replies: 3 comments 14 replies
-
Now figure out that the negative terms are OUT and positive terms are IN. Then did my own zone budget in flopy for the usg model and got a consistent result with the budget summary in the model list file. I also used the usgbud2smp.exe from PEST gw data utilities to process the cbb file and the results are the same as what I got in Python. Here is the problem when I use zonbudusg.exe: we literally apply 100% of rainfall to a mine void but the result shows it receives 0 recharge throughout the model run. Also if I add the recharge in all zones together (which covers the entire model), the number doesn't match what is reported in the model list file. When compared my result with the result from zonbudusg.exe (downloaded from USGS), all other terms are the same (storage, ghb, riv, drn, wel) except rch and evt. I realized that rch and evt have a different data structure in cbc file from other boundary package flow terms. What I did was, the first array in rch is the nodes that receive recharge (basically the top cells for each column in the usg model, and their global node number are input to the model as IRCH) and the second array in rch are the flow into that node. But why the two arrays are not zipped as other packages such as ghb, riv and wel? Is there something wrong with this processing? If I am correct, then there could be something wrong with zonbudusg.exe... Looking forward to someone from the development team clarifying the RCH and EVT packages in usg model. Also, if we use NRCHOP=3, then IRCH is omitted, then in what order we should put the RECH array into the model? @cnicol-gwlogic would you be able to look at my question? |
Beta Was this translation helpful? Give feedback.
-
Re: "if we use NRCHOP=3, then IRCH is omitted, then in what order we should put the RECH array into the model" - if you look at the mfusg recharge package code, you'll see that for unstructured grids, NRCHOP = 3 means you apply recharge only to the top layer (i.e. layer 1). So the rech array is layer 1 nodes long. If layer 1 does not cover the entire model, I wouldn't use this option unless that is what you want to do (no recharge to layers other than layer 1). From memory, NRCHOP = 1 is the same. I always use 2. Re: getting a recarray dataset from the recharge / evt cbb arrays for doing your zonebudget checks, you could try something along these lines (note irch is one-based, not zero-based; flopy cbb tools don't seem to convert these, but you can do that if you want): import flopy.utils.binaryfile as bf
import numpy as np
cbb = bf.CellBudgetFile('dubv1tr01.cbc')
#print(cbb.list_records())
rec = cbb.get_data(text='RECHARGE')
#print(rec)
print(cbb.get_times())
print(cbb.get_kstpkper())
print('ntimes in cbc: ', len(rec))
print(rec[0][0].shape, rec[0][0].min(), rec[0][0].max(), rec[0][0].dtype)
print(rec[0][1].shape, rec[0][1].min(), rec[0][1].max(), rec[0][1].dtype)
# example recarray of kper1 recharge
kper1_data = np.rec.fromarrays(
[rec[0][0].flatten(), rec[0][1].flatten()],
dtype=[('irch','i'),('rech','f8')]
)
print(kper1_data)
print(kper1_data['rech'])
print(kper1_data['irch'])
# example recarray of all kpers' recharge
totims = [
np.array(
[totim] * rec[kperkstp_index][1].shape[1])
for kperkstp_index,totim in enumerate(cbb.get_times())
]
irch = [
rec[kperkstp_index][0].flatten()
for kperkstp_index,totim in enumerate(cbb.get_times())
]
rech = [
rec[kperkstp_index][1].flatten()
for kperkstp_index,totim in enumerate(cbb.get_times())
]
kper_data = np.rec.fromarrays(
[np.concatenate(totims),
np.concatenate(irch),
np.concatenate(rech)],
dtype=[('totim',float), ('irch',int),('rech',float)])
print(kper_data)
print(kper_data['totim'], kper_data['totim'].shape)
print(kper_data['irch'], kper_data['irch'].shape)
print(kper_data['rech'], kper_data['rech'].shape) Re: your zonbudusg.exe differences - do you have any zones == 0? I seem to recall these being ignored (I could be wrong on that though). I doubt there is something randomly wrong like this with zonbudusg.exe. Maybe try a run with all nodes set to zone 1 or somethng and see if you get any differences. |
Beta Was this translation helpful? Give feedback.
-
I've been following this discussion a bit while on vacation. The USGS repository for MODFLOW-USG is located here. It sounds like you may have identified a bug in zonbudusg, which we should fix. If you had a simple flopy script that could set up a MODFLOW-USG simulation and/or if you could provide the MODFLOW-USG and zonbudusg input files as an attachment to a new issue on the MODFLOW-USG repository, we could work on a fix. |
Beta Was this translation helpful? Give feedback.
-
I am using bf.CellBudgetFile to read the cbb file from a usg model and do a zonebudget in python. The current zonbudusg.exe I have produces a weird result and I want to cross check.
Most of the functions in CellBudgetFile work as expected for the usg model except get_ts(). There is an index error but I don't have to use this function.
Another issue is, so far I can only get net flow from the binary file, which is fine for RCH, EVT, WEL but not enough for storage, ghb, riv and some other flow terms. For these I need both in and out. Any help will be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions