Skip to content

Commit 97758f9

Browse files
authored
Merge pull request #256 from MODFLOW-USGS/develop
Release
2 parents 5a5a28b + 4d5b4d3 commit 97758f9

12 files changed

+59
-47
lines changed

.github/workflows/ex-rtd.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ jobs:
157157
run: python ci_create_examples_rst.py
158158

159159
- name: Upload artifacts
160-
uses: actions/upload-artifact@v3
160+
uses: actions/upload-artifact@v4
161161
with:
162162
name: rtd-files-for-${{ needs.set_options.outputs.sha }}
163163
path: |

.github/workflows/ex-workflow.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
shell: python
108108

109109
- name: Upload zipfile
110-
uses: actions/upload-artifact@v3
110+
uses: actions/upload-artifact@v4
111111
with:
112112
name: ${{ env.DISTNAME }}.zip
113113
path: modflow6-examples/${{ env.DISTNAME }}.zip
@@ -201,7 +201,7 @@ jobs:
201201

202202
- name: Upload PDF document
203203
if: matrix.python == '3.9'
204-
uses: actions/upload-artifact@v3
204+
uses: actions/upload-artifact@v4
205205
with:
206206
name: ${{ env.DISTNAME}}.pdf
207207
path: modflow6-examples/${{ env.DISTNAME }}.pdf
@@ -222,13 +222,13 @@ jobs:
222222
format: MM/DD/YYYY HH:mm
223223

224224
- name: Download ${{ env.DISTNAME }}.pdf
225-
uses: actions/download-artifact@v3
225+
uses: actions/download-artifact@v4.1.7
226226
with:
227227
name: ${{ env.DISTNAME }}.pdf
228228
path: ${{ env.TAG }}
229229

230230
- name: Download ${{ env.DISTNAME }}.zip
231-
uses: actions/download-artifact@v3
231+
uses: actions/download-artifact@v4.1.7
232232
with:
233233
name: ${{ env.DISTNAME }}.zip
234234
path: ${{ env.TAG }}

doc/sections/ex-gwt-mt3dms-p01.tex

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ \subsection{Example description}
1010

1111
All four model scenarios have 101 columns, 1 row, and 1 layer. The first and last columns use constant-head boundaries to simulate steady flow in confined conditions. Because the analytical solution assumes an infinite 1-dimensional flow field, the last column is set far enough from the source to avoid interfering with the final solution after 2,000 days. Initially, the model domain is devoid of solute; however, the first column uses a constant concentration boundary condition to ensure that water entering the simulation has a unit concentration of 1. Additional model parameters are shown in table~\ref{tab:ex-gwt-mt3dms-p01-01}.
1212

13+
For these simulations, all \mf and MT3DMS simulations use the upstream-weighted finite-difference scheme for representing solute advection.
14+
1315
% add 2nd static parameter value table
1416
\input{../tables/ex-gwt-mt3dms-p01-01}
1517

1618
% for examples without scenarios
1719
\subsection{Example Results}
1820

19-
Currently no options are available with \mf for simulating solute transport using particle tracking methods [referred to as Method of Characteristics (MOC) in the MT3DMS manual \cite{zheng1999mt3dms}. Thus, the \mf solution is compared to an MT3DMS solution that uses the third-order total variation diminishing (TVD) option for solving the advection-only problem rather than invoking one of the MOC options available within MT3DMS. Owing to different approaches between the two codes, namely TVD scheme of MT3DMS and the second-order approach of \mf, differences between the two solutions and reflected in figure~\ref{fig:ex-gwt-mt3dms-p01a} are expected. However, the differences are within acceptable tolerances.
20-
21-
The comparison of the MT3DMS and\mf solutions for problem 1a, an advection dominated problem, represents an end-member test as the migrating concentration front is sharp (i.e., discontinuous). In technical terms, the grid Peclet number is infinity for this problem ($P_e$ = $v\Delta x/D_{xx}$ = $\Delta x$/$\alpha_L$ = $\infty$).
21+
The comparison of the MT3DMS and \mf solutions for problem 1a, an advection dominated problem, represents an end-member test as the migrating concentration front is sharp. Results for both the \mf and MT3DMS results are shown in figure~\ref{fig:ex-gwt-mt3dms-p01a}. The grid Peclet number is infinity for this problem ($P_e$ = $v\Delta x/D_{xx}$ = $\Delta x$/$\alpha_L$ = $\infty$). Though not shown here, this advection-only problem can also be represented with the TVD schemes in both \mf and MT3DMS. For this particular problem, the TVD scheme in MT3DMS (called the ULTIMATE scheme) is better able to minimize numerical dispersion than the TVD scheme in \mf.
2222

2323
% a figure
2424
\begin{StandardFigure}

scripts/ex-gwe-barends.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
# NOTE: In the current example, ncol is specified as 250. If users prefer,
3838
# this value may be increased to 500, 1,000, or more for a more refined
3939
# solution. Currently, ncol is kept low for faster run times.
40-
# -
40+
4141

4242
# +
4343
import os
@@ -105,9 +105,9 @@
105105

106106

107107
# delr is a calculated value based on the number of desired columns
108-
assert (
109-
L / ncol % 1 == 0
110-
), "reconsider specification of NCOL such that length of the simulation divided by NCOL results in an even number value"
108+
assert L / ncol % 1 == 0, (
109+
"reconsider specification of NCOL such that length of the simulation divided by NCOL results in an even number value"
110+
)
111111
delr = L / ncol # Width along the row ($m$)
112112

113113
# Calculated values

scripts/ex-gwe-radial.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def create_outer_ring_of_ctrl_vols(outer_v, verts, iverts, xc, yc, ivt, idx):
183183
# For each outer point, create a new ivert
184184
# Starts at 9 o'clock and proceeds counter-clockwise
185185
# As such, 'pt3' will be used by the subsequent iverts
186-
# However, 'pt4' will be re-used by each subseqeuent ivert
186+
# However, 'pt4' will be reused by each subseqeuent ivert
187187
pt3_id = pt3_rad = pt3_ang = None
188188
for ii in np.arange(len(outer_v) - 1):
189189
# Create all the points involved
@@ -381,9 +381,9 @@ def generate_control_volumes(basedata, verts, flat_list, idx, silent=True):
381381
if xchk == id:
382382
xcoll.append(subvertx[num])
383383
ycoll.append(subverty[num])
384-
assert (
385-
len(xcoll) == 2
386-
), "Should only be two points touching the well bore"
384+
assert len(xcoll) == 2, (
385+
"Should only be two points touching the well bore"
386+
)
387387

388388
# was getting divide by zero error in MF6 when putting the
389389
# centroid right on the line connecting the two points that

scripts/ex-gwf-csub-p02.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ def build_models(
199199
opth = f"{name}.csub.obs"
200200
csub_csv = opth + ".csv"
201201
obs = [
202-
("tcomp", "interbed-compaction", "ib1"),
203-
("sk", "sk", "ib1"),
202+
("tcomp", "interbed-compaction", (0,)),
203+
("sk", "sk", (0,)),
204204
("qtop", "delay-flowtop", (0,)),
205205
("qbot", "delay-flowbot", (0,)),
206206
]

scripts/ex-gwf-csub-p03.py

+21-8
Original file line numberDiff line numberDiff line change
@@ -507,10 +507,19 @@ def build_models(
507507
opth = f"{name}.csub.obs"
508508
csub_csv = opth + ".csv"
509509
obs = [
510-
("cunit", "interbed-compaction", "cunit"),
511-
("aquitard", "interbed-compaction", "aquitard"),
512-
("nodelay", "interbed-compaction", "nodelay"),
513-
("delay", "interbed-compaction", "delay"),
510+
("cunit1", "interbed-compaction", (0,)),
511+
("cunit2", "interbed-compaction", (1,)),
512+
("cunit3", "interbed-compaction", (2,)),
513+
("aquitard6", "interbed-compaction", (5,)),
514+
("aquitard7", "interbed-compaction", (6,)),
515+
("aquitard8", "interbed-compaction", (7,)),
516+
("nodelay4", "interbed-compaction", (3,)),
517+
("nodelay5", "interbed-compaction", (4,)),
518+
("nodelay9", "interbed-compaction", (8,)),
519+
("nodelay10", "interbed-compaction", (9,)),
520+
("delay11", "interbed-compaction", (10,)),
521+
("delay12", "interbed-compaction", (11,)),
522+
("delay13", "interbed-compaction", (12,)),
514523
("es14", "estress-cell", (nlay - 1, 0, 0)),
515524
]
516525
for k in (1, 2, 3, 4, 6, 7, 8, 9, 11, 13):
@@ -719,7 +728,7 @@ def get_obs_dataframe(file_name, hash):
719728
known_hash=f"md5:{hash}",
720729
)
721730
df = pd.read_csv(fpath, index_col=0)
722-
df.index = pd.to_datetime(df.index.values)
731+
df.index = pd.to_datetime(df.index.values, format="%m/%d/%y")
723732
df.rename({"mean": "observed"}, inplace=True, axis=1)
724733
return df
725734

@@ -793,7 +802,9 @@ def process_csub_obs(fpth):
793802
# transfer data from temporary storage
794803
for key in pcomp:
795804
if key != "TOTAL" and key != "SKELETAL":
796-
v[key] = tdata[key].copy()
805+
for obs_key in tdata.dtype.names:
806+
if key in obs_key:
807+
v[key] += tdata[obs_key]
797808

798809
# calculate skeletal
799810
for key in tdata.dtype.names[1:]:
@@ -1144,6 +1155,8 @@ def plot_calibration(silent=True):
11441155
name = list(parameters.keys())[1]
11451156
fpath = os.path.join(workspace, name, f"{name}.csub.obs.csv")
11461157
df_sim = get_sim_dataframe(fpath)
1158+
for key in pcomp:
1159+
df_sim[key] = df_sim[list(df_sim.filter(regex=key))].sum(axis=1)
11471160
df_sim.rename({"TOTAL": "simulated"}, inplace=True, axis=1)
11481161

11491162
fname = "boundary_heads.csv"
@@ -1198,7 +1211,7 @@ def plot_calibration(silent=True):
11981211
ix0 = df_sim.index.get_loc("1992-10-01 12:00:00")
11991212

12001213
# get initial simulated compaction
1201-
cstart = df_sim.simulated[ix0]
1214+
cstart = df_sim.simulated.iloc[ix0]
12021215

12031216
# cut off initial portion of simulated compaction
12041217
df_sim_pc = df_sim[ix0:].copy()
@@ -1372,7 +1385,7 @@ def plot_calibration(silent=True):
13721385
else:
13731386
dxc = 0.001
13741387
dyc = 1
1375-
xc = df_iobs_pc.observed[ixc]
1388+
xc = df_iobs_pc.observed.iloc[ixc]
13761389
yc = es_obs[ixc]
13771390
styles.add_annotation(
13781391
ax=ax,

scripts/ex-gwf-csub-p04.py

+15-13
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,14 @@
142142
# Create interbed package data
143143
icsubno = 0
144144
csub_pakdata = []
145+
boundname_dict = {}
145146
for i in range(nrow):
146147
for j in range(ncol):
147148
if ib[i, j] < 1 or (i, j) in chd_locs:
148149
continue
149150
for k in range(nlay):
150151
boundname = f"{k + 1:02d}_{i + 1:02d}_{j + 1:02d}"
152+
boundname_dict[boundname] = (icsubno,)
151153
ib_lst = [
152154
icsubno,
153155
(k, i, j),
@@ -262,14 +264,14 @@ def build_models():
262264
opth = f"{sim_name}.csub.obs"
263265
csub_csv = opth + ".csv"
264266
obs = [
265-
("w1l1", "interbed-compaction", "01_09_10"),
266-
("w1l2", "interbed-compaction", "02_09_10"),
267-
("w1l3", "interbed-compaction", "03_09_10"),
268-
("w1l4", "interbed-compaction", "04_09_10"),
269-
("w2l1", "interbed-compaction", "01_12_07"),
270-
("w2l2", "interbed-compaction", "02_12_07"),
271-
("w2l3", "interbed-compaction", "03_12_07"),
272-
("w2l4", "interbed-compaction", "04_12_07"),
267+
("w1l1", "interbed-compaction", boundname_dict["01_09_10"]),
268+
("w1l2", "interbed-compaction", boundname_dict["02_09_10"]),
269+
("w1l3", "interbed-compaction", boundname_dict["03_09_10"]),
270+
("w1l4", "interbed-compaction", boundname_dict["04_09_10"]),
271+
("w2l1", "interbed-compaction", boundname_dict["01_12_07"]),
272+
("w2l2", "interbed-compaction", boundname_dict["02_12_07"]),
273+
("w2l3", "interbed-compaction", boundname_dict["03_12_07"]),
274+
("w2l4", "interbed-compaction", boundname_dict["04_12_07"]),
273275
("s1l1", "coarse-compaction", (0, 8, 9)),
274276
("s1l2", "coarse-compaction", (1, 8, 9)),
275277
("s1l3", "coarse-compaction", (2, 8, 9)),
@@ -302,13 +304,13 @@ def build_models():
302304
("sk1l2", "ske-cell", (1, 8, 9)),
303305
("sk2l4", "ske-cell", (3, 11, 6)),
304306
("t1l2", "theta", (1, 8, 9)),
305-
("w1qie", "elastic-csub", "02_09_10"),
306-
("w1qii", "inelastic-csub", "02_09_10"),
307+
("w1qie", "elastic-csub", boundname_dict["02_09_10"]),
308+
("w1qii", "inelastic-csub", boundname_dict["02_09_10"]),
307309
("w1qaq", "coarse-csub", (1, 8, 9)),
308310
("w1qt", "csub-cell", (1, 8, 9)),
309311
("w1wc", "wcomp-csub-cell", (1, 8, 9)),
310-
("w2qie", "elastic-csub", "04_12_07"),
311-
("w2qii", "inelastic-csub", "04_12_07"),
312+
("w2qie", "elastic-csub", boundname_dict["04_12_07"]),
313+
("w2qii", "inelastic-csub", boundname_dict["04_12_07"]),
312314
("w2qaq", "coarse-csub", (3, 11, 6)),
313315
("w2qt ", "csub-cell", (3, 11, 6)),
314316
("w2wc", "wcomp-csub-cell", (3, 11, 6)),
@@ -821,7 +823,7 @@ def plot_results(sim, silent=True):
821823

822824

823825
# +
824-
def scenario(silent=True):
826+
def scenario(silent=False):
825827
sim = build_models()
826828
if write:
827829
write_models(sim, silent=silent)

scripts/ex-gwf-curvilinear-90.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1276,8 +1276,7 @@ def get_grid(self, name="__main__"):
12761276
def add_grid(self, name, grid):
12771277
if name == "" or name == "__main__":
12781278
raise RuntimeError(
1279-
"\nDisvGridMerger.add_grid:\n"
1280-
'name = "" or "__main__"\nis not allowed.'
1279+
'\nDisvGridMerger.add_grid:\nname = "" or "__main__"\nis not allowed.'
12811280
)
12821281
if isinstance(grid, DisvPropertyContainer):
12831282
grid = grid.copy()

scripts/ex-gwf-curvilinear.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1276,8 +1276,7 @@ def get_grid(self, name="__main__"):
12761276
def add_grid(self, name, grid):
12771277
if name == "" or name == "__main__":
12781278
raise RuntimeError(
1279-
"\nDisvGridMerger.add_grid:\n"
1280-
'name = "" or "__main__"\nis not allowed.'
1279+
'\nDisvGridMerger.add_grid:\nname = "" or "__main__"\nis not allowed.'
12811280
)
12821281
if isinstance(grid, DisvPropertyContainer):
12831282
grid = grid.copy()

scripts/ex-gwf-radial.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ def drawdown_times(
632632
for stp, ts in enumerate(ts_list):
633633
if show_progress:
634634
print(
635-
f"Solving {stp+1:4d} of {nstp}; time = {self.ts2time(ts, r)}",
635+
f"Solving {stp + 1:4d} of {nstp}; time = {self.ts2time(ts, r)}",
636636
end="",
637637
)
638638

@@ -727,7 +727,7 @@ def drawdown_times(
727727
"up to:\n"
728728
f" {bessel_roots0} * 2^bessel_loop_limit\nwhere:\n"
729729
" bessel_loop_limit = {bessel_loop_limit}\n"
730-
f"resulting in {1024*2**bessel_loop_limit} roots evaluated, "
730+
f"resulting in {1024 * 2**bessel_loop_limit} roots evaluated, "
731731
"with the last root being {root}\n"
732732
f"(That is, the Neuman integral was solved form 0 to {root})\n\n"
733733
"You can either ignore this warning\n"

scripts/ex-gwt-mt3dms-p01.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
ibound[0, 0, -1] = -1
128128

129129
# Set some static transport related model parameter values
130-
mixelm = 0 # TVD
130+
mixelm = 0 # upstream
131131
rhob = 0.25
132132
sp2 = 0.0 # red, but not used in this problem
133133
sconc = np.zeros((nlay, nrow, ncol), dtype=float)
@@ -168,7 +168,6 @@ def build_models(
168168
dispersivity=0.0,
169169
retardation=0.0,
170170
decay=0.0,
171-
mixelm=0,
172171
silent=False,
173172
):
174173
mt3d_ws = os.path.join(workspace, sim_name, "mt3d")

0 commit comments

Comments
 (0)