get_gridded_hydrodynamics: Map hydrodynamics

Description Usage Arguments Value Examples

View source: R/anem_wrappers.R

Description

This function is used for mapping hydrodynamics by generating gridded output of hydraulic head and flow direction

Usage

1
2
get_gridded_hydrodynamics(wells, aquifer, head_dim = c(20, 20),
  flow_dim = c(10, 10))

Arguments

wells

Wells data.frame or tibble

aquifer

Aquifer object

head_dim

Vector containing number of rows and columns as c(nrow,ncol) for the grid of hydraulic head

flow_dim

Vector containing number of rows and columns as c(nrow,ncol) for the grid of flow

Value

The function returns a list containing:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# define aquifer
bounds_df <- data.frame(bound_type=c("CH","NF","NF","NF"),m=c(Inf,0,Inf,0),b=c(0,1000,1000,0))
aquifer_unconfined <- define_aquifer("unconfined",1e-3,bounds=bounds_df,h0=100)

# define wells and well images
set.seed(30)
wells_df <- data.frame(x=runif(8,0,1000), y=runif(8,0,1000), diam=1, R=1000)
wells_df$Q <- -1/(1:nrow(wells_df))
wells <- generate_image_wells(define_wells(wells_df),aquifer_unconfined)

gridded <- get_gridded_hydrodynamics(wells,aquifer_unconfined,c(20,20),c(8,8))

library(ggplot2)
ggplot() +
  geom_raster(data=gridded$head,aes(x,y,fill=head_m)) +
  geom_segment(data=gridded$flow,aes(x,y,xend=x2,yend=y2),
               arrow = arrow(ends="last",type="closed",length=unit(1,"mm")),color="black") +
  geom_segment(data=aquifer_unconfined$bounds,aes(x1,y1,xend=x2,yend=y2,color=bound_type)) +
  geom_point(data=wells[wells$wID==wells$orig_wID,],aes(x,y),shape=21) +
  coord_equal()

recharge_params <- list(recharge_type="D",recharge_vector=c(500,500,501,501),
flow_main=.001,flow_opp=.002,x0=1000,y0=1000)
bounds <- define_bounds(data.frame(bound_type=rep("PB",4),m=c(Inf,0,Inf,0),b=c(0,0,1000,1000)))
aquifer <- define_aquifer("confined",1,h0=0,z0=1,recharge=recharge_params,bounds=bounds)
gridded <- get_gridded_hydrodynamics(wells=NULL,aquifer,c(20,20),c(8,8))
ggplot() +
  geom_raster(data=gridded$head,aes(x,y,fill=head_m)) +
  geom_segment(data=gridded$flow,aes(x,y,xend=x2,yend=y2),
               arrow = arrow(ends="last",type="closed",length=unit(1,"mm")),color="black") +
  geom_segment(data=aquifer$bounds,aes(x1,y1,xend=x2,yend=y2,color=bound_type)) +
  coord_equal()

gopalpenny/anem documentation built on Dec. 20, 2020, 5:27 a.m.