modflow6 icon indicating copy to clipboard operation
modflow6 copied to clipboard

Using MAW and VSC together divides flow wrong

Open cmurray219 opened this issue 6 months ago • 4 comments

Describe the bug I have a simulation with a flow model, TDS transport model and temperature transport model. Density dependence is included using the BUY package. When I run with MAW and VSC, the flows to each cell intersecting the screen do not make sense given the transmissivity of each layer. If I turn off VSC, it works as expected. If I switch to WEL (dividing the flows myself based on transmissivity) I can run with or without VSC and get a reasonable result. I think VSC is impacting the way MAW divides flows among the cells.

To reproduce Steps to reproduce the behavior:

  1. Unzip and open the attached Jupyter Notebook.
  2. Set the working directory in the second code cell for your system.
  3. Run the notebook. There are notes, explanations and postprocessing throughout.

Expected behavior The Jupyter Notebook contains a simplified version of the model. The model is run 4 times with slight changes each time:

  1. using WEL but not VSC. Here flows to each layer are specified using transmissivity.
  2. using MAW but not VSC. Here MAW determines the flows to each layer.
  3. using MAW with VSC. Here MAW should be determining the flows to each layer, but it is not dividing the flows in a reasonable way.
  4. using WEL with VSC. Here flows to each layer are specified using transmissivity.

I would expect all four models to have similar results as far as how much water enters/exits the model through each MAW cell. As it is, models 1, 2, and 4 appear to have identical results (33% of the flow enters/exits through layer 1, with 13% each in layers 2-6. But in model 3, 100% of the flow exchange is in layers 5 and 6. A small difference would be reasonable, but this difference is too large to be the result of viscosity differences across the screen.

Viscosity output I have set the viscosity_filerecord parameter to set the model to output the viscosity for each output timestep. I have not been able to figure out how to extract that data using flopy. (The .output attribute doesn't seem to have a viscosity function. I tried using flopy.utils.HeadFile since it is supposed to have the same format as a head file, but got an EOF error. Can you tell me how to do this?) However, I managed to get it imported to GMS and there are some minor differences in viscosity between Model 3 and Model 4. Principally, Model 4 moves off the starting condition sooner than Model 3. See the screenshot of time plots for one column of cells below. These are for cell (50, 27).

Image

Units conversion I have considered that the viscosity package parameters are wrong. The units are hairy. I have checked them and I believe they are correct. Here's my unit conversion:

Image

Environment

  • Windows 11
  • MODFLOW 6 version 6.6.1

VSC with MAW.zip

cmurray219 avatar May 14 '25 19:05 cmurray219

Hello @cmurray219, thanks for reporting this and thanks for providing a reproducible example problem for us to test with. Our team will have a look to see if we can't figure out what's going on.

emorway-usgs avatar May 14 '25 21:05 emorway-usgs

@cmurray219 thanks again for providing the notebook, which has been very helpful, and we apologize for the delay. We believe we've identified a bug in MAW responsible for its behavior with VSC, and we're testing a fix.

aprovost-usgs avatar Jun 12 '25 13:06 aprovost-usgs

Thanks for the update. Please let me know if your fix works and when it is incorporated into a release version.

cmurray219 avatar Jun 12 '25 17:06 cmurray219

@cmurray219 we've implemented a fix that gets rid of the anomalous behavior in your Model 3 - it now gives the kind of flows you'd expect. We'll consult with @emorway-usgs regarding some other questions we have about that part of the code when we have the opportunity. In the meantime, you'll be able to try out our fix after it's gone through tonight's nightly build. @wpbonelli can help you if you're unfamiliar with how to access that. If you do start working with that version, please let us know how it performs. Thanks again for the tests you set up for us, and for your patience.

aprovost-usgs avatar Jun 13 '25 22:06 aprovost-usgs

seems like this can be closed, @cmurray219 please reopen if I'm wrong here.

wpbonelli avatar Sep 10 '25 08:09 wpbonelli