DRW: Dynamic Random Walk aqueous contaminant transport solution

Description Usage Arguments Value Examples

Description

Dynamic Random Walk aqueous contaminant transport solution

Usage

1
2
3
4
5
6
DRW(rootname, description, mfdir = ".", mfdata, wtop, dis, bas, wel, hds, cbb,
  cbf, newcbf = TRUE, source.term, STna.rm = FALSE, porosity, start.t,
  end.t, dt, D, vdepD, Rf = 1, lambda = 0, decay.sorbed = FALSE, cd, mm,
  minnp = 100L, maxnp, Ndp = 2L, init = NULL, nc.to.mf = 1L,
  plot.state = TRUE, keep.MF.cellref = TRUE, time.mismatch.tol = 0.001,
  ..., keepMPfiles = FALSE)

Arguments

rootname

character string; the rootname for the results file (".rds" is automatically affixed)

description

character string; a description of this model run, for future reference

mfdir

character string; path to the directory holding all the MODFLOW input and output files; the function navigates to this directory so that extended file paths for MODFLOW files needn't be specified

mfdata

NetCDF object, list of NetCDF objects or character string[Nmfds]; the MODFLOW data sets in NetCDF form (see GW.nc), either as NetCDF objects (see open.nc) or as character string file paths; this function may use a series of MODFLOW models with identical spatial co-ordinates and grids and with time periods that lead on from one another, thus a historic flow model may seamlessly be linked to a recent flow model, for example

wtop

NetCDF object, list of NetCDF objects or character string [Nmfds]; NetCDF data sets of the cell-by-cell top of water in each cell (the lower out of head and cell top); if character string file names are used, the files needn't exist beforehand as they can be created using get.wtop.nc

dis

character string [Nmfds]; file paths to DIS package files corresponding to the MODFLOW data sets in mfdata (note, this cannot be a list of DIS.MFpackage objects, as the file names are needed for MODPATH)

bas

BAS.MFpackage object (or list thereof) or character string [Nmfds]; the BAS packages corresponding to mfdata (see read.BAS); only the $IBOUND element is used

wel

Optional: WEL.MFpackage object (or list thereof) or character string [Nmfds]; the WEL packages corresponding to mfdata (see read.WEL); this information is only used for plotting, and plotting does not depend on it

hds, cbb

character string [Nmfds]; the head save and cell-by-cell budget files corresponding to mfdata; although this information is in mfdata, MODPATH needs to know where the original HDS files are

cbf

character string [Nmfds]; the composite budget file names created by MODPATH 5; if these files don't already exist or newcbf = TRUE, MODPATH 5 will write these files afresh

newcbf

logical [1]; Whether MODPATH 5 should rewrite the CBF file. If you have modified the MODFLOW model since the last DRW run, then you should set this to TRUE (the default), but this can be time-consuming, so if you know it is not needed, set to FALSE. The CBF will only ever be written for the first time step using a particular MODFLOW data set.

source.term

data.table, data.frame, DNAPLSourceTerm object, or list of any combination of these; information about the transient point releases in the system; if a data table or frame, columns should be: x, y (location in the same absolute co-ordinate system as mfdata), L (MODFLOW layer), zo (z-offset within layer) and J (list of functions of one variable, time, returning values representing source term flux, in units of mass per time OR numeric values representing constant release rates in units of mass per time)

STna.rm

logical [1]; if TRUE, any NA values resulting from the source term functions (within the model time frame) are ignored and treated as 0, otherwise an error will occur if NAs are found.

porosity

numeric [1], numeric [NLAY] or numeric array [NCOL, NROW, NLAY]; the porosity (fractional, 0 to 1), either as uniform value, layer-by-layer values or a 3D array of cell-by-cell values matching the MODFLOW grid dimensions

start.t, end.t

numeric [1]; start and end times of the model (the td function may be useful)

dt

numeric [1]; time step size

D

numeric [2 or 3]; simplified dispersivity/ dispersion coefficient tensor, giving longitudinal, transverse and optionally vertical components

vdepD

logical [1]; TRUE if the dispersion coefficient is velocity-dependent, in which case D is taken to represent dispersivity, with units of length

Rf

numeric [1]; retardation factor (1 - (bulk_density times K_d)/(effective_porosity))

lambda

numeric [1]; first-order degradation constant (log(2)/half_life)

decay.sorbed

logical [1]; TRUE if first-order degradation affects sorbed contaminant (not yet implemented)

cd

numeric [2]; horizontal and vertical coalescing search radii (see coalesce)

mm

numeric [1]; minimum mass of particles after coalescing (see coalesce)

minnp

integer [1]; minimum number of particles on which to perform coalescing

maxnp

integer [1]; maximum number of particles after coalescing (see coalesce)

Ndp

integer [1]; number of pairs of particles to spawn to model the dispersion of contaminant mass

init

NULL, a DRWmodel object or a character string giving the RDS file name in which a DRWmodel object is stored; another DRW model run to use as the initial state for the current model; the time step just before start.t is used as the initial state, modifying the time step times as necessary

nc.to.mf

integer [length(mfdata)]; the MODFLOW model that is related to by each NetCDF dataset in mfdata; normally this will be 1, 2, 3 ..., but sometimes a large MODFLOW model may be split into multiple NetCDF datasets (see GW.nc), in which case it will be something like 1, 1, 1 ...; for the most common case in which there is only one MODFLOW model used, the default value of 1 is appropriate

plot.state

logical [1]; if TRUE, a summary plot of the model state will be shown after each time step (generally, not costly in terms of run time)

keep.MF.cellref

logical [2]; if TRUE, the final results for mobile and immobile particles will retain MODFLOW column (C), row (R), dataset (mfds) and time step (mfts) references

time.mismatch.tol

numeric [1]; various time comparisons are made during the model in order to check consistency, such as checking that the end time of one MODFLOW dataset matches the start time of the next; time.mismatch.tol gives the tolerance used in these comparisons in calls to all.equal

...

graphical parameters such as xlim (not axis labels, titles, asp or zlim)

keepMPfiles

logical [1]; use for debugging when MODPATH not working: doesn't delete the MODPATH files

Value

A DRWmodel object, invisibly. The result is also saved to file: paste0(rootname, ".rds").

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
library(data.table)

# single point source which ceases after t = 10000
mfdir <- system.file(package = "DRW")
demoDRW <- DRW("DRW_EXAMPLE", "demo", mfdir,
               "drw_mf_demo.nc", "drw_mf_demo_wtop.nc",
               "drw_mf_demo.dis", "drw_mf_demo.bas", "drw_mf_demo.wel",
               "drw_mf_demo.hds", "drw_mf_demo.cbb", "DRWtest.cbf",
               newcbf = TRUE,
               source.term = data.table(x = 625, y = 825,
                                        L = 1L, zo = .5,
                                        J = function(t){
                                          if(t < 1e4) 1 else 0
                                        }),
               porosity = .1,
               start.t = 9000, end.t = 11000, dt = 200,
               D = c(10, 1), vdepD = TRUE,
               cd = c(20, 10), mm = 1e-7, minnp = 100L, maxnp = 2e4L,
               Ndp = 4L)

CJBarry/DRW documentation built on May 6, 2019, 9:25 a.m.

Related to DRW in CJBarry/DRW...