Skip to content

Commit

Permalink
fix(lakpak_utils): fix telev and belev for horizontal connections (#1168
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jdhughes-usgs authored Aug 5, 2021
1 parent 73a4405 commit 08dfff9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
12 changes: 6 additions & 6 deletions autotest/t049_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ def test_modpath():
success, buff = mp.run_model(silent=False)
except:
success = False
assert success, (
"forward modpath model run did not terminate successfully"
)
assert (
success
), "forward modpath model run did not terminate successfully"

mpnam = "freybergmpp"
mpp = flopy.modpath.Modpath6(
Expand All @@ -106,9 +106,9 @@ def test_modpath():
success, buff = mpp.run_model(silent=False)
except:
success = False
assert success, (
"backward modpath model run did not terminate successfully"
)
assert (
success
), "backward modpath model run did not terminate successfully"

# load modpath output files
if run:
Expand Down
20 changes: 12 additions & 8 deletions flopy/mf6/utils/lakpak_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,44 +211,48 @@ def __structured_lake_connections(
# back face
if i > 0:
ci = (k, i - 1, j)
cit = (k + 1, i - 1, j)
if np.ma.is_masked(lake_map[ci]) and idomain[ci] > 0:
cellids.append(ci)
claktypes.append("horizontal")
belevs.append(elevations[k + 1, i, j])
televs.append(elevations[k, i, j])
belevs.append(elevations[cit])
televs.append(elevations[ci])
connlens.append(0.5 * dy[i - 1])
connwidths.append(dx[j])

# left face
if j > 0:
ci = (k, i, j - 1)
cit = (k + 1, i, j - 1)
if np.ma.is_masked(lake_map[ci]) and idomain[ci] > 0:
cellids.append(ci)
claktypes.append("horizontal")
belevs.append(elevations[k + 1, i, j])
televs.append(elevations[k, i, j])
belevs.append(elevations[cit])
televs.append(elevations[ci])
connlens.append(0.5 * dx[j - 1])
connwidths.append(dy[i])

# right face
if j < ncol - 1:
ci = (k, i, j + 1)
cit = (k + 1, i, j + 1)
if np.ma.is_masked(lake_map[ci]) and idomain[ci] > 0:
cellids.append(ci)
claktypes.append("horizontal")
belevs.append(elevations[k + 1, i, j])
televs.append(elevations[k, i, j])
belevs.append(elevations[cit])
televs.append(elevations[ci])
connlens.append(0.5 * dx[j + 1])
connwidths.append(dy[i])

# front face
if i < nrow - 1:
ci = (k, i + 1, j)
cit = (k + 1, i + 1, j)
if np.ma.is_masked(lake_map[ci]) and idomain[ci] > 0:
cellids.append(ci)
claktypes.append("horizontal")
belevs.append(elevations[k + 1, i, j])
televs.append(elevations[k, i, j])
belevs.append(elevations[cit])
televs.append(elevations[ci])
connlens.append(0.5 * dy[i + 1])
connwidths.append(dx[j])

Expand Down

0 comments on commit 08dfff9

Please sign in to comment.