You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(maw): activate and deactivate individual well connections - #2914
Adds a CONNECTION_STATUS setting to the MAW PERIOD block that activates or deactivates an individual well-aquifer connection during a simulation, so that a well that is backplugged or deepened can be represented; connection data is specified once for the maximum extent of the well and a connection that is sealed off, or not yet drilled, is given a status of INACTIVE. A connection is simulated only if both the well and the connection are active, so an INACTIVE well suspends all of its connections without changing their individual settings. At least one connection of a well must be ACTIVE; an error asks for STATUS INACTIVE when every connection is deactivated. MAW and CONDUCTANCE observations of an inactive connection are reported as DNODATA, and a connection that is not simulated, because it or its well is inactive, has no wetted area, so MWE does not conduct heat through it; previously an inactive well continued to conduct heat through its connections. A BOTTOM setting is also added, which raises the bottom elevation of a well that has been filled so that it stops yielding water at the elevation of the fill.
Checklist of items for pull request
Replaced section above with description of pull request
Added new test or modified an existing test
Ran ruff on new and modified python scripts in .doc, autotests, doc, distribution, pymake, and utils subdirectories.
Formatted new and modified Fortran source files with fprettify
Example: well 1 has three connections, specified in the CONNECTIONDATA block for the full depth of the well. The deepest connection is sealed off in period 2, as for a backplugged well, and reopened in period 4.
BEGIN period 1
1 rate -100.0
END period 1
BEGIN period 2
1 connection_status 3 inactive
END period 2
BEGIN period 3
1 status inactive
END period 3
BEGIN period 4
1 status active
1 connection_status 3 active
END period 4
A connection keeps its setting until it is changed, so connection 3 stays inactive in later periods.
STATUS INACTIVE in period 3 suspends every connection. In period 4, STATUS ACTIVE (or CONSTANT) restores the connection settings in effect before period 3, so connection 3 would still be inactive if it were not also reactivated.
Deactivating every connection of a well is an error; STATUS INACTIVE is used instead.
With flopy, the same settings are period data rows (well and connection numbers are zero-based):
Connection data for a multi-aquifer well applied to the whole simulation,
so a well that is backplugged or deepened while a simulation is running
could not be represented.
A new CONNECTION_STATUS setting in the PERIOD block activates or
deactivates an individual well-aquifer connection. Connection data is
specified once for the maximum extent of the well, and a connection that
is sealed off, or that represents a part of the well that has not been
drilled, is given a status of INACTIVE. An inactive connection does not
exchange water with its groundwater cell and is written to the budget
file with its cell number and a flow rate of zero.
A connection is simulated only if both the well and the connection are
active, so an INACTIVE well suspends all of its connections without
changing their individual settings and the previous settings are used
again when the well is made ACTIVE.
A BOTTOM setting is also added, which changes the bottom elevation of a
well so that a well that has been filled stops yielding water at the
elevation of the fill. BOTTOM does not change the amount of water
released from well storage for a given change in head, which is set by
the well radius.
A well with every connection set INACTIVE through CONNECTION_STATUS has no
connection to the aquifer and is better expressed as an inactive well, so
the stress period data is now checked and an error asks for STATUS INACTIVE
instead. The input guide states the rule, and that connection settings are
kept when a well is made CONSTANT as well as ACTIVE.
Tests cover the error, and a connection that stays inactive when the well
is made INACTIVE and then CONSTANT.
MAW and CONDUCTANCE observations of an inactive connection were reported as
zero, while every observation of an inactive well is DNODATA. They are now
DNODATA as well, so an observation distinguishes a connection that is not
simulated from one with no flow. The input guide describes the behavior and
corrects "LAK" to "MAW" in the MAW observation description.
The wetted area MAW reports with each connection's flow was computed from
the screen geometry whether or not the connection was simulated, so MWE
kept conducting heat through a connection that had been deactivated, and
through every connection of an inactive well. A connection that is not
simulated, because it or its well is inactive, now has no wetted area.
Add GWE/MWE and GWT/MWT tests that deactivate a connection and then the
well, checking that no heat is conducted and no mass exchanged through a
connection that is not simulated.
BOTTOM was checked when its row was read, against the head and the
connections active at that point, so raising the bottom while deactivating a
deeper connection in the same period succeeded or failed depending on the
order of the rows; WELL_HEAD was checked against the bottom in the same
way. Both are now checked once every setting for the period has been
applied. The connection status is read before ICON is validated, so the
echoed input does not show the previous row's value, and the release note
states that the well STATUS must be set to INACTIVE.
Tests cover BOTTOM with CONNECTION_STATUS in both orders, a BOTTOM above an
active connection, and a BOTTOM above the head in the well.
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🟡 Changes recommended
Reactivated connections can bypass the new bottom constraint, and related diagnostics do not consistently exclude inactive connections or reflect final period state.
Filter inactive connections from over-demand calculation
src/Model/GroundWaterFlow/gwf-maw.f90:4738
The over-demand calculation in maw_cc still sums every connection (lines 3198–3214) and does not apply this inactive-connection guard. An inactive high-head/high-conductance connection can therefore inflate qmax and suppress the diagnostic that an active well is requesting more water than its simulated connections can supply. Apply the same iboundconn filter in that loop.
…period
The screen-bottom check ran only for wells whose BOTTOM was set that period,
so a connection reactivated after the bottom was raised above its screen
bottom was accepted. Every active connection is now checked after each
period's settings are applied. The HEAD_LIMIT warning is evaluated at the
same point when BOTTOM or HEAD_LIMIT changes, so raising BOTTOM above an
existing head limit warns regardless of the order of the settings, and the
over-demand check in maw_cc skips inactive connections.
Tests cover reactivating a connection below a raised bottom and raising
BOTTOM above an existing HEAD_LIMIT.
Validate well head when switching to CONSTANT status
src/Model/GroundWaterFlow/gwf-maw.f90:2351
When a period sets STATUS CONSTANT without WELL_HEAD, this check still uses the previous simulated xnewpak. maw_ad subsequently resets the constant head to the PACKAGEDATA STRT/stored well_head (lines 2606–2610), so a BOTTOM can be accepted even though the actual constant head is below it. The same gap occurs when BOTTOM was raised earlier and a later period switches the well to CONSTANT. Validate well_head whenever the final status is CONSTANT, and add a regression case using CONSTANT without an explicit WELL_HEAD.
A CONSTANT well holds its head at the stored WELL_HEAD, or at STRT when none
was given, but a raised BOTTOM was compared with the last simulated head, so
a well made CONSTANT without a WELL_HEAD could be accepted with its constant
head below the bottom. The well head of every CONSTANT well is now checked
against the bottom after each period's settings, and only wells that are not
CONSTANT are checked against the simulated head.
A test makes a well CONSTANT without a WELL_HEAD after raising BOTTOM above
its stored well head.
)
This reverts commit 022ac72 (#2914), so the CONNECTION_STATUS and
BOTTOM options of the MAW PERIOD block are not in the 6.8.2 release. The
MAW, MWT, and MWE connection status tests and the release note go with
them.
The MWE case of the advanced transport API test from #3079 used the MWE
connection status model, so it now uses the MWE conduction model.
jdhughes-dev
added a commit
to jdhughes-dev/modflow6
that referenced
this pull request
Oct 28, 2026
…well
The wetted area of each connection that MAW writes to the budget for MWE
was calculated whatever the well status, so a well made INACTIVE kept
conducting heat with the aquifer. The wetted area of an inactive well is
now zero.
This is the part of MODFLOW-ORG#2914 that fixes existing behavior; MODFLOW-ORG#3089 removes
MODFLOW-ORG#2914 from 6.8.2.
…well (#3091)
The wetted area of each connection that MAW writes to the budget for MWE
was calculated whatever the well status, so a well made INACTIVE kept
conducting heat with the aquifer. The wetted area of an inactive well is
now zero.
This is the part of #2914 that fixes existing behavior; #3089 removes
#2914 from 6.8.2.
jdhughes-dev
added a commit
to jdhughes-dev/modflow6
that referenced
this pull request
Oct 31, 2026
Restores MODFLOW-ORG#2914, which was removed from develop for the 6.8.2 release.
Connection data for a multi-aquifer well applied to the whole simulation,
so a well that is backplugged or deepened while a simulation is running
could not be represented. A new CONNECTION_STATUS setting in the PERIOD
block activates or deactivates an individual well-aquifer connection, and
a new BOTTOM setting changes the bottom elevation of the well.
jdhughes-dev
added a commit
to jdhughes-dev/modflow6
that referenced
this pull request
Nov 16, 2026
Restores MODFLOW-ORG#2914, which was removed from develop for the 6.8.2 release.
Connection data for a multi-aquifer well applied to the whole simulation,
so a well that is backplugged or deepened while a simulation is running
could not be represented. A new CONNECTION_STATUS setting in the PERIOD
block activates or deactivates an individual well-aquifer connection, and
a new BOTTOM setting changes the bottom elevation of the well.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a CONNECTION_STATUS setting to the MAW PERIOD block that activates or deactivates an individual well-aquifer connection during a simulation, so that a well that is backplugged or deepened can be represented; connection data is specified once for the maximum extent of the well and a connection that is sealed off, or not yet drilled, is given a status of INACTIVE. A connection is simulated only if both the well and the connection are active, so an INACTIVE well suspends all of its connections without changing their individual settings. At least one connection of a well must be ACTIVE; an error asks for STATUS INACTIVE when every connection is deactivated. MAW and CONDUCTANCE observations of an inactive connection are reported as DNODATA, and a connection that is not simulated, because it or its well is inactive, has no wetted area, so MWE does not conduct heat through it; previously an inactive well continued to conduct heat through its connections. A BOTTOM setting is also added, which raises the bottom elevation of a well that has been filled so that it stops yielding water at the elevation of the fill.
Checklist of items for pull request
ruffon new and modified python scripts in .doc, autotests, doc, distribution, pymake, and utils subdirectories.fprettifyFor additional information see instructions for contributing and instructions for developing.