flopy icon indicating copy to clipboard operation
flopy copied to clipboard

Linking MT3D-USGS to MODFLOW6 model

Open mattijn opened this issue 6 years ago • 10 comments

Hi all, new MODFLOW user here! According to the documentation of MF6 it is possible to link a MF6-model to a MT3D-USGS model as long as it is a regular grid:

The GWF Model described in this report does not support the following list of packages and capabilities.

  • Link to the MT3DMS Contaminant Transport Model (Zheng and others, 2001). However, MT3D- USGS can read the head and budget files created by MODFLOW 6, but only if the GWF Model uses the DIS Package. MT3D-USGS will not work with GWF output if the DISV or DISU Pack- ages are used.

Which is confirmed in the documentation of MT3D-USGS:

Notes on Notes on FT6 Option Starting with Version 1.1.0 [..] In order to use MT3D-USGS with MODFLOW 6 (Langevin and others, 2017), the user needs to ensure that the selected grid type in MODFLOW 6 is a regular MODFLOW grid consisting of layers, rows, and columns.

But when I try to connect the models using FloPy (reproducable notebook here) it seems not working:

Using:

flopy.mt3d.Mt3dms(
    modflowmodel=sim  
)

Gives the following error during the next function call of the BTN package:

#BTN file
icbund = idomain.copy()
icbund[0, 15, 15] = -1 #constant concentration

btn = flopy.mt3d.Mt3dBtn(
    model=mt_model, 
    sconc=0.0, 
    prsity=0.3, 
    thkmin=0.01, 
    munit='g', 
    icbund=icbund
)

Exception: BTN error. Required input is None, but no modflow model. If no modflow model is passed to Mt3dms, then values must be specified in the BTN constructor for: nlay, nrow, ncol, nper, laycon, delr, delc, htop, dz, perlen, nstp, and tsmult.

Changing the flopy.mt3d.Mt3dms() into:

flopy.mt3d.Mt3dms(
    modflowmodel=gwf  
)

Gives the following error during de flopy.mt3d.Mt3dBtn() call:

AttributeError: 'ModflowGwfdis' object has no attribute 'nper'

Changing the flopy.mt3d.Mt3dBtn() call into:

btn = flopy.mt3d.Mt3dBtn(
    model=mt_model, 
    sconc=0.0, 
    prsity=0.3, 
    thkmin=0.01, 
    munit='g', 
    icbund=icbund,
    nper=tdis.nper  # <--- from the time discretization package
)

results in the following error:

AttributeError: 'MFArray' object has no attribute 'get_value'

which is true since:

gwf.dis.delr.get_value()

is not existing. There exists a gwf.dis.delr.get_data() function, but not sure if that should be used.

Again, all is available in this notebook.

But it seems FloPy is not yet ready to integrate MF6 with MT3D-USGS? If so, what would be the best approach to make this possible?

mattijn avatar Jan 10 '20 22:01 mattijn

Sorry, and thanks for pointing this out @mattijn. Doesn't look like flopy is set up yet to link MODFLOW 6 with MT3D-USGS. We'll leave this open so it's on the list of things to implement. Maybe @emorway-usgs can look into this.

christianlangevin avatar Jan 11 '20 01:01 christianlangevin

@mattijn @langevin-usgs I'll have a look at this one. Please do leave it open

emorway-usgs avatar Jan 11 '20 14:01 emorway-usgs

@emorway-usgs do you think you will be able to address this prior to the code freeze on Thursday? If not would you give it the 3.3.2 milestone?

jdhughes-dev avatar Jun 23 '20 18:06 jdhughes-dev

@jdhughes-usgs It'll have to get pushed back to the next release. I won't be able to get to it this week.

emorway-usgs avatar Jun 23 '20 19:06 emorway-usgs

Is this function implemented at the moment? Or do we have to use the new transport package?

oscarfasanchez avatar Mar 10 '21 18:03 oscarfasanchez

Hello @oscarfasanchez, I still need to address issue #904 so that the mt3d class inside flopy can inherit the grid characteristics from the DIS package (there is no possibility of supporting DISU or DISV with MT3D-USGS). However, as you point out, it may be easier for you to use the GWT process that is now available in MF6. There are lots of examples detailing how to set up a transport model inside MF6 using flopy here. Click on the link for "MODFLOW 6 Examples - Jupyter Notebooks" and select from any of the examples with "gwt" in the list that follows to see example implementations.

emorway-usgs avatar Mar 10 '21 18:03 emorway-usgs

@emorway-usgs can this be closed?

jdhughes-dev avatar Aug 04 '21 22:08 jdhughes-dev

Did this ever get addressed? I'm running into the same problem trying to connect a MF6 model to a MT3D-USGS model. I'm running into a lot of numerical instability with the MF6 GWT process, which is why I'm giving MT3D-USGS a shot.

File "/modflow/lib/python3.9/site-packages/flopy/mt3d/mtbtn.py", line 252, in init self.setmodflowvars( File "/modflow/lib/python3.9/site-packages/flopy/mt3d/mtbtn.py", line 458, in setmodflowvars self.nper = mf.dis.nper AttributeError: 'ModflowGwfdis' object has no attribute 'nper'

MickeyRush avatar Jun 08 '22 16:06 MickeyRush

Hello @michelob23, this is still an issue. Does your MF6 simulation use any of the advanced packages? If so, then that would preclude the use of MT3D-USGS with MF6.

However, I would anticipate that the GWT process would be as stable as MT3D-USGS, unless maybe you want to use the MOC or HMOC methods?

emorway-usgs avatar Jun 08 '22 16:06 emorway-usgs

That's good to know! I'm using the MF6 MAW package so it sounds like I can't use MT3D-USGS. With the GWT process, I've been seeing oscillating solutions and negative concentrations at head boundaries (CHD) and at well cells (MAW), regardless of the advection weighting scheme, Flow Imbalance Correction, reducing time step lengths etc.

MickeyRush avatar Jun 08 '22 16:06 MickeyRush