Skip to content

Commit

Permalink
docs: update release notes (#1636)
Browse files Browse the repository at this point in the history
* add description of the bug fixed by PR #1633
* extend test_gwf_sfr_inactive autotest to reactivate sfr reaches after inactivating 3 of 6 reaches
* update test_gwf_sfr_inactive autotest test description
  • Loading branch information
jdhughes-usgs authored Feb 20, 2024
1 parent 075fb12 commit b50f2a4
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 19 deletions.
62 changes: 48 additions & 14 deletions autotest/test_gwf_sfr_inactive.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
# test based on issue 1585 fix
"""
This test inactivation of SFR reaches during a simulation.
The test is based on the example provided with issue 1585,
which resulted in a divide by zero error when reaches were
inactivated in the second stress period.
The test has 6 sfr reaches that are not connected to the
groundwater model.
Reaches
1 -o- 2 -o- 3 -o- 4 -o- 5 -o- 6
Test parameters:
1. initially all reaches are active
2. in the 2nd stress period reaches 4, 5, and 6 are
inactivated
3. in the 3rd stress period reach 4 is reactivated
4. in the 4th stress period reach 5 is reactivated
5. in the 5th stress period reach 6 is reactivated
The test evaluates OUTFLOW and EXT-OUTFLOW for reaches
3, 4, 5, and 6 against expected values.
"""

import flopy
import numpy as np
import pytest
Expand All @@ -12,7 +36,7 @@
def build_models(idx, test):
# static model data
# temporal discretization
nper = 2
nper = 5
tdis_rc = []
for _ in range(nper):
tdis_rc.append((1.0, 1, 1.0))
Expand Down Expand Up @@ -188,16 +212,22 @@ def build_models(idx, test):
[4, "status", "inactive"],
[5, "status", "inactive"],
],
2: [
[3, "status", "active"],
],
3: [
[4, "status", "active"],
],
4: [
[5, "status", "active"],
],
}

sfr_dict = {
f"{paktest}_obs.csv": [
("r3_out", "outflow", (2,)),
("r3_ext", "ext-outflow", (2,)),
("r6_out", "outflow", (5,)),
("r6_ext", "ext-outflow", (5,)),
]
}
sfr_obs = []
for i in range(2, 6):
sfr_obs.append((f"r{i + 1}_out", "outflow", (i,)))
sfr_obs.append((f"r{i + 1}_ext", "ext-outflow", (i,)))
sfr_dict = {f"{paktest}_obs.csv": sfr_obs}
sfr = flopy.mf6.ModflowGwfsfr(
gwf,
print_stage=True,
Expand All @@ -224,10 +254,14 @@ def check_output(idx, test):
print("Checking sfr outflow and external outflow")
obs_values = flopy.utils.Mf6Obs(test.workspace / f"{paktest}_obs.csv")
test_values = {
"R3_OUT": [-1.0, 0.0],
"R3_EXT": [0.0, -1.0],
"R6_OUT": [0.0, 0.0],
"R6_EXT": [-1.0, 0.0],
"R3_OUT": [-1.0, 0.0, -1.0, -1.0, -1.0],
"R3_EXT": [0.0, -1.0, 0.0, 0.0, 0.0],
"R6_OUT": [0.0, 0.0, 0.0, 0.0, 0.0],
"R6_EXT": [-1.0, 0.0, 0.0, 0.0, -1.0],
"R4_OUT": [-1.0, 0.0, 0.0, -1.0, -1.0],
"R4_EXT": [0.0, 0.0, -1.0, 0.0, 0.0],
"R5_OUT": [-1.0, 0.0, 0.0, 0.0, -1.0],
"R5_EXT": [0.0, 0.0, 0.0, -1.0, 0.0],
}
for key, value in test_values.items():
assert np.array_equal(
Expand Down
10 changes: 5 additions & 5 deletions doc/ReleaseNotes/develop.tex
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
% \item xxx
%\end{itemize}

%\textbf{\underline{BUG FIXES AND OTHER CHANGES TO EXISTING FUNCTIONALITY}} \\
\textbf{\underline{BUG FIXES AND OTHER CHANGES TO EXISTING FUNCTIONALITY}} \\
%\underline{BASIC FUNCTIONALITY}
%\begin{itemize}
% \item xxx
Expand All @@ -39,12 +39,12 @@
% \item xxx
%\end{itemize}

%\underline{ADVANCED STRESS PACKAGES}
%\begin{itemize}
% \item
\underline{ADVANCED STRESS PACKAGES}
\begin{itemize}
\item A divide by zero error would occur in the Streamflow Routing package when reaches were deactivated during a simulation. This bug was fixed by checking if the downstream reach is inactive before calculating the flow to the downstream reach.
% \item xxx
% \item xxx
%\end{itemize}
\end{itemize}

%\underline{SOLUTION}
%\begin{itemize}
Expand Down

0 comments on commit b50f2a4

Please sign in to comment.