Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
cneyens committed Jul 18, 2024
1 parent e8e92f8 commit ed1cbba
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 24 deletions.
22 changes: 11 additions & 11 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,27 @@ You can install the development version of `raem` from [GitHub](https://github.c
devtools::install_github("cneyens/raem")
```

## Documentation

The package documentation can be found at https://cneyens.github.io/raem/.

## Example

Construct an analytic element model of an aquifer with uniform background flow, two extraction wells and a reference point.

Specify the aquifer parameters and create elements:
Specify the aquifer parameters and create the elements:

```{r create-elements}
library(raem)
# aquifer parameters ----
k = 10 # hydraulic conductivity, m/d
top = 10 # aquifer top elevation, m
base = 0 # aquifer base elevation, m
base = 0 # aquifer bottom elevation, m
n = 0.2 # aquifer porosity, -
hr = 15 # head at reference point, m
TR = k * (top - base) # constant transmissivity of background flow, m2/d
TR = k * (top - base) # constant transmissivity of background flow, m^2/d
# create elements ----
uf = uniformflow(TR, gradient = 0.001, angle = -45)
Expand All @@ -65,16 +69,15 @@ w2 = well(xw = -200, yw = -150, Q = 400)
Create the model. This automatically solves the system of equations.

```{r create-model}
m = aem(k = k, top = top, base = base, n = n,
uf, rf, w1, w2)
m = aem(k = k, top = top, base = base, n = n, uf, rf, w1, w2)
```

Find the head and discharge at two locations `x = -200, y = 200` and `x = 100, y = 200`. Note that there are no vertical flow components in this model:
Find the head and discharge at two locations: `x = -200, y = 200` and `x = 100, y = 200`. Note that there are no vertical flow components in this model:

```{r find-head}
heads(m, x = c(-200, 100), y = 200)
discharge(m, c(-200, 100), 200, z = top) # [L^2 / T]
discharge(m, c(-200, 100), 200, z = top) # m^2/d
```

Plot head contours and element locations. First, specify the contouring grid:
Expand All @@ -94,7 +97,7 @@ plot(m, add = TRUE)
Compute particle traces starting along `y = 200` at 20 intervals per year for 5 years and add to the plot:

```{r plot-traces, dpi = 300}
paths = tracelines(m, x0 = seq(-450, 450, 50), y0 = 200, z0 = top, times = seq(0, 5*365, 365/20))
paths = tracelines(m, x0 = seq(-450, 450, 50), y0 = 200, z0 = top, times = seq(0, 5 * 365, 365 / 20))
plot(paths, add = TRUE, col = 'orange')
```

Expand All @@ -104,6 +107,3 @@ plot(paths, add = TRUE, col = 'orange')
knitr::opts_knit$set(global.device = FALSE)
```

## Documentation

The package documentation can be found at https://cneyens.github.io/raem/.
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,29 @@ You can install the development version of `raem` from
devtools::install_github("cneyens/raem")
```

## Documentation

The package documentation can be found at
<https://cneyens.github.io/raem/>.

## Example

Construct an analytic element model of an aquifer with uniform
background flow, two extraction wells and a reference point.

Specify the aquifer parameters and create elements:
Specify the aquifer parameters and create the elements:

``` r
library(raem)

# aquifer parameters ----
k = 10 # hydraulic conductivity, m/d
top = 10 # aquifer top elevation, m
base = 0 # aquifer base elevation, m
base = 0 # aquifer bottom elevation, m
n = 0.2 # aquifer porosity, -

hr = 15 # head at reference point, m
TR = k * (top - base) # constant transmissivity of background flow, m2/d
TR = k * (top - base) # constant transmissivity of background flow, m^2/d

# create elements ----
uf = uniformflow(TR, gradient = 0.001, angle = -45)
Expand All @@ -55,11 +60,10 @@ w2 = well(xw = -200, yw = -150, Q = 400)
Create the model. This automatically solves the system of equations.

``` r
m = aem(k = k, top = top, base = base, n = n,
uf, rf, w1, w2)
m = aem(k = k, top = top, base = base, n = n, uf, rf, w1, w2)
```

Find the head and discharge at two locations `x = -200, y = 200` and
Find the head and discharge at two locations: `x = -200, y = 200` and
`x = 100, y = 200`. Note that there are no vertical flow components in
this model:

Expand All @@ -70,7 +74,7 @@ heads(m, x = c(-200, 100), y = 200)

``` r

discharge(m, c(-200, 100), 200, z = top) # [L^2 / T]
discharge(m, c(-200, 100), 200, z = top) # m^2/d
#> Qx Qy Qz
#> [1,] 0.15028815 -0.2923908 0
#> [2,] 0.06041242 -0.3347206 0
Expand All @@ -97,13 +101,8 @@ Compute particle traces starting along `y = 200` at 20 intervals per
year for 5 years and add to the plot:

``` r
paths = tracelines(m, x0 = seq(-450, 450, 50), y0 = 200, z0 = top, times = seq(0, 5*365, 365/20))
paths = tracelines(m, x0 = seq(-450, 450, 50), y0 = 200, z0 = top, times = seq(0, 5 * 365, 365 / 20))
plot(paths, add = TRUE, col = 'orange')
```

<img src="man/figures/README-plot-traces-1.png" width="100%" />

## Documentation

The package documentation can be found at
<https://cneyens.github.io/raem/>.

0 comments on commit ed1cbba

Please sign in to comment.