Deleting Package Data #1683
cmurray219
started this conversation in
General
Replies: 1 comment 1 reply
-
you can use the sim = flopy.mf6.MFSimulation.load()
gwf = sim.get_model("my_model_name")
gwf.remove_package("CHD") |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm unable to find a function that will remove/delete/overwrite an existing package in MF6. Can someone point me to the right function?
I am importing an existing model using:
sim=flopy.mf6.MFSimulation.load()
I successfully made some changes to hydraulic conductivity in the NPF package by simply creating a new instance of the package as:
I get a warning that "Package with type npf already exists. Replacing existing package." which is exactly what I want.
The problem is that I also want to adjust some specified heads in the CHDpackage. I do the following:
It correctly creates the new CHD package, but it also keeps the existing one. (I guess having multiple CHD packages is allowed, unlike having multiple NPF packages.) So there are two CHD packages. When I run the code again, there are 3, and so on. I'm going to put this in a loop and run a whole array of head and hydraulic conductivity sets, so I can't have it adding new CHD packages every time. I need either a function to delete the original CHD package after I've copied out the information I need or a setting/parameter to force it to overwrite like the NPF package.
Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions