Skip to content

Commit

Permalink
fix(vsc): issue error if VSC used in GWF-GWF model (#1090)
Browse files Browse the repository at this point in the history
* update release notes
* issue error if more than one VSC6/BUY6 package active
* convert to lower case error messages
  • Loading branch information
langevin-usgs authored Nov 29, 2022
1 parent 1ed8668 commit 98ddcd8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
5 changes: 4 additions & 1 deletion doc/ReleaseNotes/ReleaseNotes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ \section{Changes Introduced in this Release}

\underline{NEW FUNCTIONALITY}
\begin{itemize}
\item A new Viscosity (VSC) package for the Groundwater Flow (GWF) Model is introduced in this release. The effects of viscosity are accounted for by updates to intercell conductance, as well as the conductance between the aquifer and head-dependent boundaries, based on simulated concentrations and\/or temperatures. The VSC Package is activated by specifying ``VSC6'' as the file type in a GWF name file. Changes to the code and input may be required in the future in response to user needs and testing. Implementation details for the VSC Package are described in the Supplemental Technical Information guide, which is included with the MODFLOW 6 distribution.
\item A new Viscosity (VSC) package for the Groundwater Flow (GWF) Model is introduced in this release. The effects of viscosity are accounted for by updates to intercell conductance, as well as the conductance between the aquifer and head-dependent boundaries, based on simulated concentrations and\/or temperatures. The VSC Package is activated by specifying ``VSC6'' as the file type in a GWF name file. Changes to the code and input may be required in the future in response to user needs and testing. Implementation details for the VSC Package are described in the Supplemental Technical Information guide, which is included with the MODFLOW 6 distribution. For this first implementation, the VSC Package cannot be used for a GWF Model that is connected to another GWF Model with a GWF-GWF Exchange.
% \item xxx
% \item xxx
\end{itemize}
Expand Down Expand Up @@ -291,6 +291,9 @@ \section{Known Issues and Incompatibilities}
\item
The Time-Variable Hydraulic Conductivity (TVK) Package is incompatible with the Horizontal Flow Barrier (HFB) Package if the TVK Package is used to change hydraulic properties of cells near horizontal flow barriers.

\item
If a GWF-GWF Exchange is active, then neither of the connected GWF Models can have an active Viscosity (VSC) Package.

\end{enumerate}

In addition to the issues shown here, a comprehensive and up-to-date list is available under the issues tab at \url{https://github.com/MODFLOW-USGS/modflow6}.
Expand Down
10 changes: 10 additions & 0 deletions src/Exchange/GwfGwfExchange.f90
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,16 @@ subroutine validate_exchange(this)
call store_error(errmsg, terminate=.TRUE.)
end if

! If viscosity is on in either model, then terminate with an
! error as viscosity package doesn't work yet with exchanges.
if (this%gwfmodel1%npf%invsc /= 0 .or. &
this%gwfmodel2%npf%invsc /= 0) then
write (errmsg, '(3a)') 'GWF-GWF exchange ', trim(this%name), &
' requires that the Viscosity Package is inactive'// &
' in both of the connected models.'
call store_error(errmsg, terminate=.TRUE.)
end if

end subroutine validate_exchange

!> @ brief Add connections
Expand Down
17 changes: 9 additions & 8 deletions src/Model/GroundWaterFlow/gwf3.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1486,31 +1486,32 @@ subroutine ftype_check(this, namefile_obj, indis)
! -- local
character(len=LINELENGTH) :: errmsg
integer(I4B) :: i, iu
character(len=LENFTYPE), dimension(11) :: nodupftype = &
character(len=LENFTYPE), dimension(13) :: nodupftype = &
(/'DIS6 ', 'DISU6', 'DISV6', &
'IC6 ', 'OC6 ', 'NPF6 ', &
'STO6 ', 'MVR6 ', 'HFB6 ', &
'GNC6 ', 'OBS6 '/)
'GNC6 ', 'BUY6 ', 'VSC6 ', &
'OBS6 '/)
! ------------------------------------------------------------------------------
!
! -- Check for IC8, DIS(u), and NPF. Stop if not present.
if (this%inic == 0) then
write (errmsg, '(1x,a)') &
'ERROR. INITIAL CONDITIONS (IC6) PACKAGE NOT SPECIFIED.'
'Initial Conditions (IC6) package not specified.'
call store_error(errmsg)
end if
if (indis == 0) then
write (errmsg, '(1x,a)') &
'ERROR. DISCRETIZATION (DIS6, DISV6, or DISU6) PACKAGE NOT SPECIFIED.'
'Discretization (DIS6, DISV6, or DISU6) Package not specified.'
call store_error(errmsg)
end if
if (this%innpf == 0) then
write (errmsg, '(1x,a)') &
'ERROR. NODE PROPERTY FLOW (NPF6) PACKAGE NOT SPECIFIED.'
'Node Property Flow (NPF6) Package not specified.'
call store_error(errmsg)
end if
if (count_errors() > 0) then
write (errmsg, '(1x,a)') 'ERROR. REQUIRED PACKAGE(S) NOT SPECIFIED.'
write (errmsg, '(1x,a)') 'One or more required package(s) not specified.'
call store_error(errmsg)
end if
!
Expand All @@ -1520,8 +1521,8 @@ subroutine ftype_check(this, namefile_obj, indis)
call namefile_obj%get_unitnumber(trim(nodupftype(i)), iu, 0)
if (iu > 0) then
write (errmsg, '(1x, a, a, a)') &
'DUPLICATE ENTRIES FOR FTYPE ', trim(nodupftype(i)), &
' NOT ALLOWED FOR GWF MODEL.'
'Duplicate entries for FTYPE ', trim(nodupftype(i)), &
' not allowed for GWF Model.'
call store_error(errmsg)
end if
end do
Expand Down

0 comments on commit 98ddcd8

Please sign in to comment.