mfsim.nam File not found

17 views
Skip to first unread message

Fatima Kastali

unread,
Nov 6, 2025, 2:49:17 AM (5 days ago) Nov 6
to mod...@googlegroups.com

Hi

I'm working on the model calibration using FloPy on Google Colab, but I’ve run into an issue with the MODFLOW 6 simulation.

I built the model in ModelMuse, and everything runs fine there—no errors. However, when I try to load the simulation into FloPy, I get a FileNotFoundError. The problem seems to be that ModelMuse saved the main simulation file as Steady6.mfsim.nam, while FloPy expects the file to be named exactly mfsim.nam. The content of the file is correct, but because of the filename, FloPy doesn't recognize or load it.

Have you ever encountered this issue? Any suggestions or workarounds would be greatly appreciated.

Let me know if you need further details.


Best,

MuhammadAbdullah Azzam

unread,
Nov 6, 2025, 4:04:40 AM (5 days ago) Nov 6
to mod...@googlegroups.com
Hi Fatima, 

Have you tried making a backup of your original name file and then renaming the `steady6.mfsim.nam` to `mfsim.nam` ?


--
This group was created in 2004 by Mr. C. P. Kumar, Former Scientist 'G', National Institute of Hydrology, Roorkee. Please visit his webpage at https://www.angelfire.com/nh/cpkumar/
---
You received this message because you are subscribed to the Google Groups "MODFLOW Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modflow+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/modflow/CA%2BtkeUKh_xzKgK0%2BJAdE%3D58nxvkr0oFqCPCm7XPi9gcqkJUgTQ%40mail.gmail.com.

Fatima Kastali

unread,
Nov 6, 2025, 5:41:22 AM (5 days ago) Nov 6
to mod...@googlegroups.com


Yes but initially I can see two files once I save my model one called already mfsim.nam and the second steady6.mfsim.nam so when I rename I get duplicated mfsim.nam and both are not correctly loaded!

Dr. Jagadeesh G

unread,
Nov 6, 2025, 5:41:33 AM (5 days ago) Nov 6
to mod...@googlegroups.com
Hi Fatima,

Regarding the `mfsim.nam` file not found error when using FloPy with models built in ModelMuse, I believe I have a solution for you.

When you initialize your `flopy.mf6.MFSimulation` object, you can specify the `name_file` argument. This argument allows you to point FloPy directly to the specific simulation name file that ModelMuse has generated, even if it's not named `mfsim.nam`.

For example, if ModelMuse saved your file as `Steady6.mfsim.nam`, you would initialize your simulation like this:

```python
import flopy

# Assuming your model workspace is 'my_model_folder'
sim = flopy.mf6.MFSimulation(sim_ws='my_model_folder', name_file='Steady6.mfsim.nam')
```

This should allow FloPy to correctly locate and load your simulation, bypassing the default expectation for a file named simply `mfsim.nam`.

I hope this helps resolve your issue\!

Best,
Jagadeesh


--

Richard Winston

unread,
Nov 6, 2025, 8:46:55 AM (5 days ago) Nov 6
to mod...@googlegroups.com
ModelMuse generates a batch file that renames your steady.mfsim.nam to mfsim.nam just before running MODFLOW. The reason it does this is to allow two or more simulations to exist in the same folder. For instance, if your ModelMuse file defines both flow and transport simulations, ModelMuse can create a batch file that runs the flow simulation followed by the transport simulation. You should be able to import your model into Flopy by renaming steady.mfsim.nam to mfsim.nam.

Reply all
Reply to author
Forward
0 new messages