write.RIVpackage: Writes Modflow-USG River Package

Description Usage Arguments Author(s) See Also Examples

View source: R/write.RIVpackage.R

Description

Writes Modflow-USG River Package

Usage

1
write.RIVpackage(rivdf, filename, nSPs, IRIVCB, SPwarnings = T)

Arguments

rivdf

DataFrame/Geometry of drain nodes as returned by calc_stream_drn with conductances and elevation columns required for stress periods as 'cond[sp]', 'elev[sp]', and 'stage[sp]'

filename

character, name/location of output file

nSPs

integer, number of stress periods in simulation

IRIVCB

integer, CBB flow flag. See details (or PBJ package manual) for more info

SPwarnings

T/F (optional) turn on (True) or off (False) warnings about reused or missing SP data

Author(s)

Leland Scantlebury

See Also

calc_stream_drn write.PBJpackage

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#-- Read in shapefiles
stream <- read_sf(system.file("extdata", "straight_river.shp", package = "pbjr"))
tri <- read_sf(system.file("extdata", "straight_triangles.shp", package = "pbjr"))
vor <- read_sf(system.file("extdata", "straight_voronoi.shp", package = "pbjr"))

#-- Explode polyline
stream <- line_explode(stream)

#-- Create rivdf
rivdf <- calc_stream_drn(stream = stream, voronoi = vor)

#-- Add conductance
rivdf$cond1 <- calc_conductance_modflow(rivdf, k_streambed = 1,
                                        str_width = 1, thickness = 0.5)
#-- Add river bottom elevation
rivdf$elev1 <- 90.0

#-- Add stage as 1 m above river bottom
rivdf$stage1 <- rivdf$elev1 + 1

#-- Write file
write.DRNpackage(rivdf, filename = paste0(tempdir(),'/straight_model.drn'), nSPs=2, IRIVCB=50)

scantle/pbjr documentation built on Dec. 22, 2021, 10:19 p.m.