Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

turning off mf6 stress package with auxiliary variable not working #1080

Closed
dbrakenhoff opened this issue Mar 17, 2021 · 1 comment
Closed
Assignees

Comments

@dbrakenhoff
Copy link
Contributor

Not sure if this is an issue or if I might be missing something, but I'm having trouble turning off a stress package (GHB in this case).

The mf6 input/output manual states:

To turnoff all of the stresses for a stress period, a PERIOD block must be specified with no entries.

I tried doing that with flopy, but the following code creates a GHB package with a None entry in the period block for Period 6. This causes an error when MF6 encounters that None entry. My model is actually a variable density model with salinity, hence the concentration variable.

import flopy

sim = flopy.mf6.MFSimulation(exe_name="mf6")

nper = 10
pd = [(1, 1, 1)] * nper

tdis = flopy.mf6.ModflowTdis(sim, nper=nper, perioddata=pd)
ims = flopy.mf6.ModflowIms(sim)
gwf = flopy.mf6.ModflowGwf(sim)
dis = flopy.mf6.ModflowGwfdis(gwf)
npf = flopy.mf6.ModflowGwfnpf(gwf)
ic = flopy.mf6.ModflowGwfic(gwf)

spd = {
    0: [[(0, 1, 1), 1.0, 100.0, 0.0],
        [(0, 0, 0), 1.0, 100.0, 0.0]],
    5: [()]
}

ghb = flopy.mf6.ModflowGwfghb(gwf, stress_period_data=spd,
                              auxiliary=["CONCENTRATION"])

sim.write_simulation()
sim.run_simulation()

I've been able to establish that this does not happen when the auxiliary variable is not added. In that case the period block for stress period 6 is empty.

I also tried entering an empty rec-array, but that still yields a period block with a "None" entry:

empty = flopy.mf6.ModflowGwfghb.stress_period_data.empty(
    gwf, aux_vars=["CONCENTRATION"])[0]
spd2 = {
    0: [[(0, 1, 1), 1.0, 100.0, 0.0],
        [(0, 0, 0), 1.0, 100.0, 0.0]],
    5: empty
}

Thanks in advance for taking a look!

@spaulins-usgs
Copy link
Contributor

@dbrakenhoff Confirm that this is a problem. I have a fix though I am going to run a few more tests to verify that it fixes all cases before I submit a PR tomorrow morning. If you want the fix now it is in the mfdatalist.py file on my fork here:

https://github.com/scottrp/flopy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants