Skip to content

Commit

Permalink
feat(rct): renamed SRB to RCT, and created IMD Package (#68)
Browse files Browse the repository at this point in the history
* feat(GwtSrbModule): created new sorption package for transport model

First crack at the sorption package.  The GwtSrbModule has been implemented, but has not yet been added to the gwt model.  The source compiles and existing tests run and pass so the new code doesn't break anything.

* feat(GwtSrbModule) : finished up much of the Sorption Package structure

Sorption package is up and running and has a test, input instructions, and flopy support.  Right now it only has equilibrium-control linear sorption.  Should also add Freundlich, Langmuir and the nonequilibrium options that are in MT3D.  And what about dual-domain?  Does that go here?  And there may still be a question about the volume that should be used for calculating sorption.  Right now, we are using Vcell, but this might need another look.  Also still need to add and test observations.

* test(GwtSrbModule): removed a hard coded assert False

Removed a statement that was left in by accident.

* docs(readme): fix directory name

* fix(GwfModule): fix to apply ptc to problems with the STO package

Fix to apply ptc during steady-state stress periods to models using
the Newton-Raphson formulation and including the STO package.
Previously ptc was only applied to models using the Newton-Raphson
formulation and no STO package - this is not the intended behaviour.
Also migrated DEV_NO_PTC option to NO_PTC option. Added autotest
(test_gwf_ptc01) that tests that the same results are achieved for
problems with and without the STO packages (this test is identical to
MODFLOW-NWT Problem 3 - low recharge).

closes #47

* refactor(pre-commit.py): use OrderdedDict to load and write code.json

Updated the code.json writer to use an ordered dictionary so that the order is always the same.  This will minimize the number of changes that appear in the changelog due to ordering changes that do not change content.

* refactor(InputOutputModule): refactor dclosetest (#49)

Refactor dclosetest and replace with IS_SAME in GenericUtilities.
Convert IS_SAME to logical function and allow passing of evaluation
value (eps). If eps is not passed then DSAME is used. Modified calls
to dclosetest to IS_SAME but did not pass an eps value (unlike what
was done previously). All tests pass so current tests are not sensitive
to a passed eps value. Need to monitor this for timeseries functionality
which used dclosetest.

* refactor(pre-commit.py): use OrderdedDict to load and write code.json (#50)

Updated the code.json writer to use an ordered dictionary so that the order is always the same.  This will minimize the number of changes that appear in the changelog due to ordering changes that do not change content.

* perf(GwfModule): improvements to ptc (#53)

Small improvements to ptc to reduce the ptcdel value loaded on the
diagonal.

* fix(GwfGwfExchangeModule): specific discharge not updated correctly for LGR

The sign for the face normal needed to be flipped for model 2 so that specific discharge would be calculated correctly.  Added a test to make sure that the velocities are correct.  Addresses #51.

* fix(GwfGwfExchangeModule): specific discharge not updated correctly for LGR

Updated the release notes and added some docstrings to the autotest.

* fix(ObsModule): implemented non-advancing output (#55)

Modified the pbservation process to use non-advancing output instead of
fixed length strings when writing ascii output. The previous use of
fixed length strings resulted in truncation of ascii observation output
when the product of user-specified digits + 7 and the number of
observations exceeded 5000.

Closes #54

* fix(GwfGwfExchangeModule): correct specific discharge calculation for LGR (#56)

* refactor(pre-commit.py): use OrderdedDict to load and write code.json

Updated the code.json writer to use an ordered dictionary so that the order is always the same.  This will minimize the number of changes that appear in the changelog due to ordering changes that do not change content.

* fix(GwfGwfExchangeModule): specific discharge not updated correctly for LGR

The sign for the face normal needed to be flipped for model 2 so that specific discharge would be calculated correctly.  Added a test to make sure that the velocities are correct.  Addresses #51.

* fix(GwfGwfExchangeModule): specific discharge not updated correctly for LGR

Updated the release notes and added some docstrings to the autotest.

* docs(dfn): fix 3 dfn typos (#59)

- `double` → `double precision`
- `valid_values` → `valid`
- `in_record = false` → `in_record false`

* docs(mf6ivar): readme.md needed a description of the valid keyword

* docs(mf6ivar): readme.md updated to include valid keyword (#60)

* refactor(pre-commit.py): use OrderdedDict to load and write code.json

Updated the code.json writer to use an ordered dictionary so that the order is always the same.  This will minimize the number of changes that appear in the changelog due to ordering changes that do not change content.

* fix(GwfGwfExchangeModule): specific discharge not updated correctly for LGR

The sign for the face normal needed to be flipped for model 2 so that specific discharge would be calculated correctly.  Added a test to make sure that the velocities are correct.  Addresses #51.

* fix(GwfGwfExchangeModule): specific discharge not updated correctly for LGR

Updated the release notes and added some docstrings to the autotest.

* docs(mf6ivar): readme.md needed a description of the valid keyword

* fix(ssm): added trap for case where flows are not available to transport model

* feat(gwt): first and zero order reactions implemented plus other minor changes

Also added additional checks to make sure that ssm is used if there are sources/sinks in the model; fixed a problem with pointers in the dispersion package (we need to revisit the memory manager for the mem_setptr case because the underlying mt object isn't being updated if a pointer is reset.

* Corrected misspelling of execution in the release notes.

* docs(releasenotes): corrected spelling error in release notes (#64)

* refactor(pre-commit.py): use OrderdedDict to load and write code.json

Updated the code.json writer to use an ordered dictionary so that the order is always the same.  This will minimize the number of changes that appear in the changelog due to ordering changes that do not change content.

* fix(GwfGwfExchangeModule): specific discharge not updated correctly for LGR

The sign for the face normal needed to be flipped for model 2 so that specific discharge would be calculated correctly.  Added a test to make sure that the velocities are correct.  Addresses #51.

* fix(GwfGwfExchangeModule): specific discharge not updated correctly for LGR

Updated the release notes and added some docstrings to the autotest.

* docs(mf6ivar): readme.md needed a description of the valid keyword

* Corrected misspelling of execution in the release notes.

* Cleanup on reactions in preparation for getting dual domain into the code.

* fix(rct): fixed porosity error in sorbtion equation

* feat(srb): dual domain formulate is implemented but results are wrong and budget not implemented yet

* feat(srb): dual domain mass transfer working now including budget

Still need to break the budget into the individual components, not just the transfer to the immobile domain

* feat(imd): first commit of immobile domain package (IMD)

By making the IMD Package a BndType Package, users can add as many immobile domains as desired.  This means that triple porosity systems can be simulated by specifying two immobile domain packages.  Or the user can specify n number of IMD Packages.  Still more to do.  Need ability to output immobile domain concentration.  Need to refactor the Reactions Package to remove the immobile domain capability.  Need to update the definition files and add one for IMD.  Need to add tests.

* feat(imd): added printing of an immobile domain budget to the listing file

* feat(rct): changed SRB to RCT and added dfn for IMD Package

* feat(rct): added source file for reaction package
  • Loading branch information
langevin-usgs committed Dec 27, 2018
1 parent 6582582 commit 608142a
Show file tree
Hide file tree
Showing 42 changed files with 2,823 additions and 713 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

## Automated Testing Status on Travis-CI

### Version 6.0.3 transport — build 106
### Version 6.0.3 transport — build 149
[![Build Status](https://travis-ci.org/MODFLOW-USGS/modflow6.svg?branch=transport)](https://travis-ci.org/MODFLOW-USGS/modflow6)

## Introduction
Expand All @@ -31,7 +31,7 @@ MODFLOW 6 is the latest core version of MODFLOW. It synthesizes many of the capa

#### ***Software/Code citation for MODFLOW 6:***

[Langevin, C.D., Hughes, J.D., Banta, E.R., Provost, A.M., Niswonger, R.G., and Panday, Sorab, 2018, MODFLOW 6 Modular Hydrologic Model version 6.0.3 — transport: U.S. Geological Survey Software Release, 01 October 2018, https://doi.org/10.5066/F76Q1VQV](https://doi.org/10.5066/F76Q1VQV)
[Langevin, C.D., Hughes, J.D., Banta, E.R., Provost, A.M., Niswonger, R.G., and Panday, Sorab, 2018, MODFLOW 6 Modular Hydrologic Model version 6.0.3 — transport: U.S. Geological Survey Software Release, 27 December 2018, https://doi.org/10.5066/F76Q1VQV](https://doi.org/10.5066/F76Q1VQV)


## Instructions for building definition files for new packages
Expand Down
5 changes: 2 additions & 3 deletions autotest/test_gwt_dsp01.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,8 @@ def get_model(idx, dir):
fname='{}.sto'.format(gwtname))

# sources
#sourcerecarray = [('WEL-1', 1, 'CONCENTRATION')]
#ssm = flopy.mf6.ModflowGwtssm(gwt, sources=sourcerecarray,
# fname='{}.ssm'.format(gwtname))
ssm = flopy.mf6.ModflowGwtssm(gwt, sources=[[]],
fname='{}.ssm'.format(gwtname))

# output control
oc = flopy.mf6.ModflowGwtoc(gwt,
Expand Down
4 changes: 4 additions & 0 deletions autotest/test_gwt_dsp02.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ def get_model(idx, dir):
save_flows=False,
pname='CNC-1')

# sources
ssm = flopy.mf6.ModflowGwtssm(gwt, sources=[[]],
fname='{}.ssm'.format(gwtname))

# output control
oc = flopy.mf6.ModflowGwtoc(gwt,
budget_filerecord='{}.cbc'.format(gwtname),
Expand Down
4 changes: 4 additions & 0 deletions autotest/test_gwt_dsp03.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ def get_model(idx, dir):
save_flows=False,
pname='CNC-1')

# sources
ssm = flopy.mf6.ModflowGwtssm(gwt, sources=[[]],
fname='{}.ssm'.format(gwtname))

# output control
oc = flopy.mf6.ModflowGwtoc(gwt,
budget_filerecord='{}.cbc'.format(gwtname),
Expand Down
5 changes: 2 additions & 3 deletions autotest/test_gwt_dsp04.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,8 @@ def get_model(idx, dir):
fname='{}.sto'.format(gwtname))

# sources
#sourcerecarray = [('WEL-1', 1, 'CONCENTRATION')]
#ssm = flopy.mf6.ModflowGwtssm(gwt, sources=sourcerecarray,
# fname='{}.ssm'.format(gwtname))
ssm = flopy.mf6.ModflowGwtssm(gwt, sources=[[]],
fname='{}.ssm'.format(gwtname))

# output control
oc = flopy.mf6.ModflowGwtoc(gwt,
Expand Down
14 changes: 9 additions & 5 deletions autotest/test_gwt_srb01.py → autotest/test_gwt_rct01.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Test the GWT Sorption (SRB) Package by running a ...
Test the GWT Sorption (RCT) Package by running a ...
"""
import os
Expand All @@ -25,7 +25,7 @@
from framework import testing_framework
from simulation import Simulation

ex = ['srb01', 'srb02']
ex = ['rct01', 'rct02']
distcoef = [0., 1.]
exdirs = []
for s in ex:
Expand Down Expand Up @@ -177,17 +177,21 @@ def build_models():
sto = flopy.mf6.ModflowGwtsto(gwt, porosity=sy,
fname='{}.sto'.format(gwtname))

# storage
srb = flopy.mf6.ModflowGwtsrb(gwt, rhob=1., srconc=0.,
# sorbtion
rct = flopy.mf6.ModflowGwtrct(gwt, sorbtion=True, rhob=1.,
distcoef=distcoef[idx],
fname='{}.srb'.format(gwtname))
fname='{}.rct'.format(gwtname))

# mass loading source
srcdict = {0: [[(0, 0, 0), 1.0]]}
cnc = flopy.mf6.ModflowGwtsrc(gwt, stress_period_data=srcdict,
save_flows=False,
pname='SRC-1')

# sources
ssm = flopy.mf6.ModflowGwtssm(gwt, sources=[[]],
fname='{}.ssm'.format(gwtname))

# output control
oc = flopy.mf6.ModflowGwtoc(gwt,
budget_filerecord='{}.cbc'.format(gwtname),
Expand Down
5 changes: 2 additions & 3 deletions autotest/test_gwt_src01.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,8 @@ def get_model(idx, dir):
fname='{}.sto'.format(gwtname))

# sources
#sourcerecarray = [('WEL-1', 1, 'CONCENTRATION')]
#ssm = flopy.mf6.ModflowGwtssm(gwt, sources=sourcerecarray,
# fname='{}.ssm'.format(gwtname))
ssm = flopy.mf6.ModflowGwtssm(gwt, sources=[[]],
fname='{}.ssm'.format(gwtname))

# output control
oc = flopy.mf6.ModflowGwtoc(gwt,
Expand Down
6 changes: 3 additions & 3 deletions code.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"email": "langevin@usgs.gov"
},
"vcs": "git",
"version": "6.0.3.106",
"version": "6.0.3.149",
"date": {
"metadataLastUpdated": "2018-10-01"
"metadataLastUpdated": "2018-12-27"
},
"organization": "U.S. Geological Survey",
"permissions": {
Expand All @@ -35,4 +35,4 @@
"homepageURL": "https://code.usgs.gov/usgs/modflow/modflow6/",
"disclaimerURL": "https://code.usgs.gov/usgs/modflow/modflow6/blob/master/DISCLAIMER.md"
}
]
]
2 changes: 1 addition & 1 deletion doc/ReleaseNotes/ReleaseNotes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ \section{Distribution File}
It is recommended that no user files are kept in the \modflowversion~directory structure. If you do plan to put your own files in the \modflowversion~directory structure, do so only by creating additional subdirectories.

% -------------------------------------------------
\section{Installation and Executation}
\section{Installation and Execution}
There is no installation of MODFLOW 6 other than the requirement that \modflowversion.zip must be unzipped into a location where it can be accessed.

To make the executable versions of MODFLOW 6 accessible from any directory, the directory containing the executables should be included in the PATH environment variable. Also, if a prior release of MODFLOW 6 is installed on your system, the directory containing the executables for the prior release should be removed from the PATH environment variable.
Expand Down
8 changes: 6 additions & 2 deletions doc/mf6io/gwt/gwt.tex
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ \subsection{Storage (STO) Package}
\input{gwt/sto}

\newpage
\subsection{Sorption (SRB) Package}
\input{gwt/srb}
\subsection{Reactions (RCT) Package}
\input{gwt/rct}

\newpage
\subsection{Immobile Domain (IMD) Package}
\input{gwt/imd}

\newpage
\subsection{Constant Concentration (CNC) Package}
Expand Down
17 changes: 17 additions & 0 deletions doc/mf6io/gwt/imd.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Immobile Domain (IMD) Package information is read from the file that is specified by ``IMD6'' as the file type. Any number of IMD Packages can be specified for a single GWT model. This allows the user to specify triple porosity systems, or systems with as many immobile domains as necessary.

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

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

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

3 changes: 2 additions & 1 deletion doc/mf6io/gwt/namefile.tex
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ \subsubsection{Explanation of Variables}
ADV6 & Advection Package \\
DSP6 & Dispersion Package \\
STO6 & Storage Package \\
SRB6 & Sorption Package \\
RCT6 & Reactions Package \\
IMD6 & Immobile Domain Package \\
SSM6 & Source and Sink Mixing Package \\
CNC6 & Constant Concentration Package & *\\
SRC6 & Mass Source Loading Package & * \\
Expand Down
17 changes: 17 additions & 0 deletions doc/mf6io/gwt/rct.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Reaction (RCT) Package information is read from the file that is specified by ``RCT6'' as the file type. Only one RCT Package can be specified for a GWT model.

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

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

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

17 changes: 0 additions & 17 deletions doc/mf6io/gwt/srb.tex

This file was deleted.

92 changes: 92 additions & 0 deletions doc/mf6io/mf6ivar/dfn/gwt-imd.dfn
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# --------------------- gwt imd options ---------------------

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

block options
name sorbtion
type keyword
reader urword
optional true
longname sorbtion keyword
description keyword to active sorbtion

block options
name decayorder
type string
valid one zero
reader urword
optional true
longname order of the decay rate
description is a text keyword to indicate that first or zero-order decay will occur. The text value for DECAYORDER can be ``ONE'' or ``ZERO''.

# --------------------- gwt imd griddata ---------------------

block griddata
name cim
type double precision
shape (nodes)
reader readarray
optional true
layered true
longname initial concentration of the immobile domain
description initial concentration of the immobile domain in mass per length cubed. If CIM is not specified, then it is assumed to be zero.

block griddata
name thetaim
type double precision
shape (nodes)
reader readarray
layered true
longname porosity of the immobile domain
description porosity of the immobile domain (dimensionless).

block griddata
name zetaim
type double precision
shape (nodes)
reader readarray
layered true
longname mass transfer rate coefficient between the mobile and immobile domains
description mass transfer rate coefficient between the mobile and immobile domains, in dimenions of per time.

block griddata
name rhob
type double precision
shape (nodes)
reader readarray
layered true
longname bulk density
description is the bulk density of the aquifer in mass per length cubed. rhob will have no affect on simulation results unless the SORBTION keyword is specified in the options block.

block griddata
name distcoef
type double precision
shape (nodes)
reader readarray
layered true
longname distribution coefficient
description is the distribution coefficient for the equilibrium-controlled linear sorption isotherm in dimensions of length cubed per mass. distcoef will have no affect on simulation results unless the SORBTION keyword is specified in the options block.

block griddata
name rc1
type double precision
shape (nodes)
reader readarray
layered true
longname first rate coefficient
description is the rate coefficient for first or zero-order decay for the aqueous phase. A negative value indicates solute production. The dimensions of rc1 for a first-order reaction is one over time. The dimensions of rc1 for a zero-order reaction is mass per length cubed per time. rc1 will have no affect on simulation results unless the DECAYORDER keyword is specified in the options block.

block griddata
name rc2
type double precision
shape (nodes)
reader readarray
layered true
longname second rate coefficient
description is the rate coefficient for first or zero-order decay for the sorbed phase. A negative value indicates solute production. The dimensions of rc2 for a first-order reaction is one over time. The dimensions of rc2 for a zero-order reaction is mass of solute per mass of aquifer per time. rc2 will have no affect on simulation results unless the SORPTION and DECAYORDER keywords are specified in the options block.
64 changes: 64 additions & 0 deletions doc/mf6io/mf6ivar/dfn/gwt-rct.dfn
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# --------------------- gwt rct options ---------------------

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

block options
name sorbtion
type keyword
reader urword
optional true
longname sorbtion keyword
description keyword to active sorbtion

block options
name decayorder
type string
valid one zero
reader urword
optional true
longname order of the decay rate
description is a text keyword to indicate that first or zero-order decay will occur. The text value for DECAYORDER can be ``ONE'' or ``ZERO''.

# --------------------- gwt rct griddata ---------------------

block griddata
name rhob
type double precision
shape (nodes)
reader readarray
layered true
longname bulk density
description is the bulk density of the aquifer in mass per length cubed. rhob will have no affect on simulation results unless the SORBTION keyword is specified in the options block.

block griddata
name distcoef
type double precision
shape (nodes)
reader readarray
layered true
longname distribution coefficient
description is the distribution coefficient for the equilibrium-controlled linear sorption isotherm in dimensions of length cubed per mass. distcoef will have no affect on simulation results unless the SORBTION keyword is specified in the options block.

block griddata
name rc1
type double precision
shape (nodes)
reader readarray
layered true
longname first rate coefficient
description is the rate coefficient for first or zero-order reactions for the aqueous phase. The dimensions of rc1 for a first-order reaction is one over time. The dimensions of rc1 for a zero-order reaction is mass per length cubed per time. rc1 will have no affect on simulation results unless the RATEORDER keyword is specified in the options block.

block griddata
name rc2
type double precision
shape (nodes)
reader readarray
layered true
longname second rate coefficient
description is the rate coefficient for first or zero-order reactions for the sorbed phase. The dimensions of rc2 for a first-order reaction is one over time. The dimensions of rc2 for a zero-order reaction is mass of solute per mass of aquifer per time. rc2 will have no affect on simulation results unless the SORPTION and RATEORDER keywords are specified in the options block.
Loading

0 comments on commit 608142a

Please sign in to comment.