Skip to content

Commit

Permalink
feat(MVE): adding support for energy mover package
Browse files Browse the repository at this point in the history
  • Loading branch information
emorway-usgs committed Apr 17, 2024
1 parent 94ba5b9 commit 9a2515a
Show file tree
Hide file tree
Showing 17 changed files with 1,134 additions and 109 deletions.
872 changes: 872 additions & 0 deletions autotest/test_gwe_mve.py

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions autotest/test_gwe_uze00.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,8 @@ def build_models(idx, test):
ath1=dispersivity,
ktw=0.5918 * 86400,
kts=0.2700 * 86400,
pname="DSP",
filename=f"{gwename}.dsp",
pname="CND",
filename=f"{gwename}.cnd",
)

# Instantiating MODFLOW 6 transport mass storage package
Expand All @@ -353,8 +353,8 @@ def build_models(idx, test):
cps=760.0,
rhos=1500.0,
packagedata=[cpw, rhow, lhv],
pname="MST",
filename=f"{gwename}.mst",
pname="EST",
filename=f"{gwename}.est",
)

# Instantiating MODFLOW 6 constant temperature boundary condition at
Expand Down
4 changes: 4 additions & 0 deletions doc/mf6io/gwe/gwe.tex
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ \subsection{Unsaturated-Zone Energy Transport (UZE) Package}
\subsection{Flow Model Interface (FMI) Package}
\input{gwe/fmi}

\newpage
\subsection{Mover Energy Transport (MVE) Package}
\input{gwe/mve}

\newpage
\subsection{Groundwater Energy Transport (GWE) Exchange}
\input{gwe/gwe-gwe}
Expand Down
18 changes: 18 additions & 0 deletions doc/mf6io/gwe/mve.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Mover Energy Transport (MVE) Package information is read from the file that is specified by ``MVE6'' as the file type. Only one MVE Package can be specified for a GWE model.

The MVE Package is used to route thermal energy according to flows from the GWF Water Mover (MVR) Package. The MVE Package must be activated by the user if the MVR Package is active in the corresponding the GWF Model. Flows from the GWF MVR Package must be available to the GWE model either through activation of a GWF-GWE Exchange or through specification of ``GWFMOVER'' in the PACKAGEDATA block of the GWE FMI Package.

\vspace{5mm}
\subsubsection{Structure of Blocks}
\lstinputlisting[style=blockdefinition]{./mf6ivar/tex/gwe-mve-options.dat}

\vspace{5mm}
\subsubsection{Explanation of Variables}
\begin{description}
\input{./mf6ivar/tex/gwe-mve-desc.tex}
\end{description}

\vspace{5mm}
\subsubsection{Example Input File}
\lstinputlisting[style=inputfile]{./mf6ivar/examples/gwe-mve-example.dat}

106 changes: 106 additions & 0 deletions doc/mf6io/mf6ivar/dfn/gwe-mve.dfn
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# --------------------- gwe mve options ---------------------
# flopy subpackage mve_filerecord mve perioddata perioddata
# flopy parent_name_type parent_model_or_package MFModel/MFPackage

block options
name print_input
type keyword
reader urword
optional true
longname print input to listing file
description REPLACE print_input {'{#1}': 'mover'}

block options
name print_flows
type keyword
reader urword
optional true
longname print calculated flows to listing file
description REPLACE print_flows {'{#1}': 'lake'}

block options
name save_flows
type keyword
reader urword
optional true
longname save lake flows to budget file
description REPLACE save_flows {'{#1}': 'lake'}

block options
name budget_filerecord
type record budget fileout budgetfile
shape
reader urword
tagged true
optional true
longname
description

block options
name budget
type keyword
shape
in_record true
reader urword
tagged true
optional false
longname budget keyword
description keyword to specify that record corresponds to the budget.

block options
name fileout
type keyword
shape
in_record true
reader urword
tagged true
optional false
longname file keyword
description keyword to specify that an output filename is expected next.

block options
name budgetfile
type string
preserve_case true
shape
in_record true
reader urword
tagged false
optional false
longname file keyword
description name of the binary output file to write budget information.

block options
name budgetcsv_filerecord
type record budgetcsv fileout budgetcsvfile
shape
reader urword
tagged true
optional true
longname
description

block options
name budgetcsv
type keyword
shape
in_record true
reader urword
tagged true
optional false
longname budget keyword
description keyword to specify that record corresponds to the budget CSV.

block options
name budgetcsvfile
type string
preserve_case true
shape
in_record true
reader urword
tagged false
optional false
longname file keyword
description name of the comma-separated value (CSV) output file to write budget summary information. A budget summary record will be written to this file for each time step of the simulation.


6 changes: 6 additions & 0 deletions doc/mf6io/mf6ivar/examples/gwe-mve-example.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
BEGIN OPTIONS
PRINT_INPUT
PRINT_FLOWS
SAVE_FLOWS
BUDGET FILEOUT mygwemodel.mve.bud
END OPTIONS
8 changes: 8 additions & 0 deletions doc/mf6io/mf6ivar/md/mf6ivar.md
Original file line number Diff line number Diff line change
Expand Up @@ -1367,6 +1367,14 @@
| GWE | LKE | PERIOD | AUXILIARY | KEYWORD | keyword for specifying auxiliary variable. |
| GWE | LKE | PERIOD | AUXNAME | STRING | name for the auxiliary variable to be assigned AUXVAL. AUXNAME must match one of the auxiliary variable names defined in the OPTIONS block. If AUXNAME does not match one of the auxiliary variable names defined in the OPTIONS block the data are ignored. |
| GWE | LKE | PERIOD | AUXVAL | DOUBLE PRECISION | value for the auxiliary variable. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. |
| GWE | MVE | OPTIONS | PRINT_INPUT | KEYWORD | keyword to indicate that the list of mover information will be written to the listing file immediately after it is read. |
| GWE | MVE | OPTIONS | PRINT_FLOWS | KEYWORD | keyword to indicate that the list of lake flow rates will be printed to the listing file for every stress period time step in which ``BUDGET PRINT'' is specified in Output Control. If there is no Output Control option and ``PRINT\_FLOWS'' is specified, then flow rates are printed for the last time step of each stress period. |
| GWE | MVE | OPTIONS | SAVE_FLOWS | KEYWORD | keyword to indicate that lake flow terms will be written to the file specified with ``BUDGET FILEOUT'' in Output Control. |
| GWE | MVE | OPTIONS | BUDGET | KEYWORD | keyword to specify that record corresponds to the budget. |
| GWE | MVE | OPTIONS | FILEOUT | KEYWORD | keyword to specify that an output filename is expected next. |
| GWE | MVE | OPTIONS | BUDGETFILE | STRING | name of the binary output file to write budget information. |
| GWE | MVE | OPTIONS | BUDGETCSV | KEYWORD | keyword to specify that record corresponds to the budget CSV. |
| GWE | MVE | OPTIONS | BUDGETCSVFILE | STRING | name of the comma-separated value (CSV) output file to write budget summary information. A budget summary record will be written to this file for each time step of the simulation. |
| GWE | MWE | OPTIONS | FLOW_PACKAGE_NAME | STRING | keyword to specify the name of the corresponding flow package. If not specified, then the corresponding flow package must have the same name as this advanced transport package (the name associated with this package in the GWE name file). |
| GWE | MWE | OPTIONS | AUXILIARY | STRING (NAUX) | defines an array of one or more auxiliary variable names. There is no limit on the number of auxiliary variables that can be provided on this line; however, lists of information provided in subsequent blocks must have a column of data for each auxiliary variable name defined here. The number of auxiliary variables detected on this line determines the value for naux. Comments cannot be provided anywhere on this line as they will be interpreted as auxiliary variable names. Auxiliary variables may not be used by the package, but they will be available for use by other parts of the program. The program will terminate with an error if auxiliary variables are specified on more than one line in the options block. |
| GWE | MWE | OPTIONS | FLOW_PACKAGE_AUXILIARY_NAME | STRING | keyword to specify the name of an auxiliary variable in the corresponding flow package. If specified, then the simulated temperatures from this advanced transport package will be copied into the auxiliary variable specified with this name. Note that the flow package must have an auxiliary variable with this name or the program will terminate with an error. If the flows for this advanced transport package are read from a file, then this option will have no effect. |
Expand Down
1 change: 1 addition & 0 deletions doc/mf6io/mf6ivar/mf6ivar.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@ def write_appendix(texdir, allblocks):
"gwe-est",
"gwe-ic",
"gwe-lke",
"gwe-mve",
"gwe-mwe",
"gwe-nam",
"gwe-oc",
Expand Down
2 changes: 2 additions & 0 deletions doc/mf6io/mf6ivar/tex/appendixA.tex
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@
GWE & LKE & PACKAGEDATA & yes \\
GWE & LKE & PERIOD & yes \\
\hline
GWE & MVE & OPTIONS & yes \\
\hline
GWE & MWE & OPTIONS & yes \\
GWE & MWE & PACKAGEDATA & yes \\
GWE & MWE & PERIOD & yes \\
Expand Down
23 changes: 23 additions & 0 deletions doc/mf6io/mf6ivar/tex/gwe-mve-desc.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
% DO NOT MODIFY THIS FILE DIRECTLY. IT IS CREATED BY mf6ivar.py

\item \textbf{Block: OPTIONS}

\begin{description}
\item \texttt{PRINT\_INPUT}---keyword to indicate that the list of mover information will be written to the listing file immediately after it is read.

\item \texttt{PRINT\_FLOWS}---keyword to indicate that the list of lake flow rates will be printed to the listing file for every stress period time step in which ``BUDGET PRINT'' is specified in Output Control. If there is no Output Control option and ``PRINT\_FLOWS'' is specified, then flow rates are printed for the last time step of each stress period.

\item \texttt{SAVE\_FLOWS}---keyword to indicate that lake flow terms will be written to the file specified with ``BUDGET FILEOUT'' in Output Control.

\item \texttt{BUDGET}---keyword to specify that record corresponds to the budget.

\item \texttt{FILEOUT}---keyword to specify that an output filename is expected next.

\item \texttt{budgetfile}---name of the binary output file to write budget information.

\item \texttt{BUDGETCSV}---keyword to specify that record corresponds to the budget CSV.

\item \texttt{budgetcsvfile}---name of the comma-separated value (CSV) output file to write budget summary information. A budget summary record will be written to this file for each time step of the simulation.

\end{description}

7 changes: 7 additions & 0 deletions doc/mf6io/mf6ivar/tex/gwe-mve-options.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
BEGIN OPTIONS
[PRINT_INPUT]
[PRINT_FLOWS]
[SAVE_FLOWS]
[BUDGET FILEOUT <budgetfile>]
[BUDGETCSV FILEOUT <budgetcsvfile>]
END OPTIONS
2 changes: 1 addition & 1 deletion src/Exchange/exg-gwegwe.f90
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ subroutine read_mvt(this, iout)
! for gwtmodel1 so that a call to save flows has an associated dis
! object.
call mvt_cr(this%mvt, this%name, this%inmvt, iout, this%gwemodel1%fmi, &
this%gwemodel1%eqnsclfac, &
this%gwemodel1%eqnsclfac, this%gwemodel1%depvartype, &
gwfmodelname1=this%gwfmodelname1, &
gwfmodelname2=this%gwfmodelname2, &
fmi2=this%gwemodel2%fmi)
Expand Down
2 changes: 1 addition & 1 deletion src/Exchange/exg-gwtgwt.f90
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ subroutine read_mvt(this, iout)
! for gwtmodel1 so that a call to save flows has an associated dis
! object.
call mvt_cr(this%mvt, this%name, this%inmvt, iout, this%gwtmodel1%fmi, &
this%gwtmodel1%eqnsclfac, &
this%gwtmodel1%eqnsclfac, this%gwtmodel1%depvartype, &
gwfmodelname1=this%gwfmodelname1, &
gwfmodelname2=this%gwfmodelname2, &
fmi2=this%gwtmodel2%fmi)
Expand Down
2 changes: 1 addition & 1 deletion src/Model/GroundWaterEnergy/gwe.f90
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ module GweModule
character(len=LENPACKAGETYPE), dimension(GWE_NBASEPKG) :: GWE_BASEPKG
data GWE_BASEPKG/'DIS6 ', 'DISV6', 'DISU6', ' ', ' ', & ! 5
&'IC6 ', 'FMI6 ', 'EST6 ', 'ADV6 ', ' ', & ! 10
&'CND6 ', 'SSM6 ', 'MVT6 ', 'OC6 ', ' ', & ! 15
&'CND6 ', 'SSM6 ', 'MVE6 ', 'OC6 ', ' ', & ! 15
&'OBS6 ', ' ', ' ', ' ', ' ', & ! 20
&30*' '/ ! 50

Expand Down
Loading

0 comments on commit 9a2515a

Please sign in to comment.