Flopy MF6 Plotting specific discharge in cross-section view

441 Views Asked by At

How to plot discharge vectors in cross-section view in Flopy MF6?

I know this plots for plan view:

quiver = mapview.plot_specific_discharge(spdis[0])

I tried to get specific discharge using the following code but got error:

AttributeError: module 'flopy.utils.postprocessing' has no attribute 'get_specific_discharge'

Code:

hds_file = os.path.join(workspace, headfile)
hds = flopy.utils.binaryfile.HeadFile(hds_file)

cbb_file = os.path.join(workspace, budgetfile)
cbb = flopy.utils.CellBudgetFile(fname, precision='double')

q = flopy.utils.postprocessing.get_specific_discharge(gwf,cbb_file, precision='single', kstpkper=(0,1),
                                                  hdsfile=hds_file, position='centers')
1

There are 1 best solutions below

0
On

For me (using mf6) plotting specific discharge on cross sections works like this:

Reading the cbc output:

    cbcdobj = flopy.utils.binaryfile.CellBudgetFile(path, precision='double', verbose=True)
    SPDIS = cbcdobj.get_data(kstpkper=kstpkper, text='DATA-SPDIS')[0]

You might need to use 'verbose=False' and 'precision=single' when using mf2005.

Then the cross section:

    cros_mp=flopy.plot.PlotCrossSection(model=gwf, line={'row': 200})  
    cros_mp.plot_specific_discharge(SPDIS) 

Remark that plotting specific discharges on an irregular cross section ('line', not 'row' nor 'column') is not possible.