Skip to content

Commit ba43b7d

Browse files
committed
docs: Add demo for converting SFR2 to MODFLOW 6
1 parent 97fa789 commit ba43b7d

File tree

6 files changed

+533
-476
lines changed

6 files changed

+533
-476
lines changed

examples/Notebooks/SFRmaker_demo.ipynb

Lines changed: 265 additions & 285 deletions
Large diffs are not rendered by default.

examples/Notebooks/mf5to6.ipynb

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Converting a MODFLOW-2005 style SFR Package to MODFLOW 6\n",
8+
"\n",
9+
"Sometimes you may want to convert a MODFLOW-2005 or MODFLOW-NWT model to MODFLOW 6, but the USGS `mf5to6` converter fails on the SFR Package. This notebook demonstrates how to convert a MODFLOW-2005 (or MODFLOW-NWT) SFR Package input file to MODFLOW 6 using SFRmaker."
10+
]
11+
},
12+
{
13+
"cell_type": "code",
14+
"execution_count": null,
15+
"metadata": {},
16+
"outputs": [],
17+
"source": [
18+
"import flopy\n",
19+
"import sfrmaker\n",
20+
"\n",
21+
"# Load the model using Flopy\n",
22+
"model = flopy.modflow.Modflow.load('tf_with_sfr.nam', model_ws='../tylerforks/tylerforks')\n",
23+
"\n",
24+
"#Check that the SFR package was loaded\n",
25+
"model.get_package_list()"
26+
]
27+
},
28+
{
29+
"cell_type": "code",
30+
"execution_count": null,
31+
"metadata": {},
32+
"outputs": [],
33+
"source": [
34+
"# Instantiate an `Mf6SFR` object (with the Flopy MODFLOW-2005 style SFR instance)\n",
35+
"mf5to6 = sfrmaker.Mf6SFR(model.sfr)\n",
36+
"\n",
37+
"# Write the MODFLOW 6 SFR Package file\n",
38+
"mf5to6.write_file('tf_mf6.sfr')"
39+
]
40+
}
41+
],
42+
"metadata": {
43+
"kernelspec": {
44+
"display_name": "sfrmaker_ci",
45+
"language": "python",
46+
"name": "python3"
47+
},
48+
"language_info": {
49+
"codemirror_mode": {
50+
"name": "ipython",
51+
"version": 3
52+
},
53+
"file_extension": ".py",
54+
"mimetype": "text/x-python",
55+
"name": "python",
56+
"nbconvert_exporter": "python",
57+
"pygments_lexer": "ipython3",
58+
"version": "3.13.2"
59+
}
60+
},
61+
"nbformat": 4,
62+
"nbformat_minor": 2
63+
}
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)