-
Notifications
You must be signed in to change notification settings - Fork 2
Description
I tried experimenting with generating a capture fraction map for recharge to visualize on a layer-by-layer basis what fraction of the applied recharge would be captured by a unit extraction rate at each active gridblock. I assumed that I could write a performance measure for recharge (which is a flux-type BC) and then visualize the capture fraction across the entire model by querying the "wel6_q" array and flipping its sign (sort of like the inverse of the adjoint state solution). So, for SP 1, TS 1, layer 5 (where the recharge is applied in the San Pedro example), I wrote the following perfmeas:
pm_fname = "rch_perfmeas.dat"
with open(os.path.join(ws,pm_fname),'w') as fpm:
rch_data = pd.DataFrame(m.rch.recharge.get_data()[0])
rch_data = rch_data.unstack().reset_index()
rch_data = rch_data.loc[rch_data[0]!=0].reset_index()
fpm.write("begin performance_measure rch_flux\n")
for i,r in rch_data.iterrows():
fpm.write("1 1 5 {0} {1} rch-1 direct 1.0 -1.0e+30\n".format(int(r.level_0+1),int(r.level_1+1)))
fpm.write("end performance_measure\n\n")
This resulted in a "NameError: name 'n' is not defined". In this case, my performance measure seems to be the adjoint state itself. Is there a way to get around this error? So far it seems that the adjoint state is always equivalent to a unit injection of water at each gridblock, and a flux performance measure can only be calculated with respect to "flux-exchange" packages, ie,: SFR, DRN, RIV, WEL, as opposed to RCH which is a flux, though not a flux-exchange package. Any ideas/clarification would be helpful.