I was attempting something along the following lines:
- Load existing model.
- Rename model and update working directory.
- Write model to new directory and run simulation.
I was hoping something along these lines would be possible and I managed to sort of get that working with e.g.:
sim = flopy.mf6.MFSimulation.load("mfsim.nam", sim_ws="./model")
gwf = sim.get_model("test")
# ...
# add/modify something in gwf model
# ...
sim.rename_all_packages("test2")
sim.set_sim_path("./model2")
sim.write_simulation()
sim.run_simulation()
This writes model input files to my new working directory with the new name I specified. The trouble is that the Simulation NAM-file still contains references to the old gwf model name, while all the files now have the new name. And the same goes for the GWF NAM-file. Is there a way to update the model name such that the nam-files point to the new file names and I can use sim.run_simulation() directly to run the new copy of the model?
I'm not sure if flopy + mf6 was designed to work this way, but figured I'd ask.
I was attempting something along the following lines:
I was hoping something along these lines would be possible and I managed to sort of get that working with e.g.:
This writes model input files to my new working directory with the new name I specified. The trouble is that the Simulation NAM-file still contains references to the old gwf model name, while all the files now have the new name. And the same goes for the GWF NAM-file. Is there a way to update the model name such that the nam-files point to the new file names and I can use
sim.run_simulation()directly to run the new copy of the model?I'm not sure if flopy + mf6 was designed to work this way, but figured I'd ask.