WaveModel: Wave Evolution Model

View source: R/WaveModel.R

WaveModelR Documentation

Wave Evolution Model

Description

Wave attenuation model originally developed by Dr. Greg Guannel for the Coastal Natural Capital InVEST project. This function models wave attenuation along a cross-shore elevation profile.

Usage

WaveModel(
  dat = NA,
  total_wsl_adj = NA,
  Ho = NA,
  To = NA,
  tran_force = FALSE,
  print_debug = FALSE,
  mangrove = NULL
)

Arguments

dat

A sf and dataframe of cross-profiles returned from ExtractVeg.

total_wsl_adj

Total water surface level above the chart datum. Recall that the chart datum and TopoBathy DEM are referenced to have 0 at low water. It is therefore suggested to set this value at the mean sea level above chart datum or a specific tidal elevation of interest.

Ho

Numeric. Initial offshore wave height in meters.

To

Numeric. Initial offshore wave period in second.

tran_force

Boolean TRUE/FALSE. should transect be forced even if there are error codes.

print_debug

Boolean TRUE/FALSE. Turn on function debugging mode.

mangrove

Named numeric vector. Defaults to NULL. The mangrove object is a named numeric vector specifying mangrove attributes. 'c("NRoots" = 130, "dRoots" = 0.1, "hRoots" = 1, "NCanop" = 100, "dCanop" = 0.5, "hCanop" = 3, "NTrunk" = 1.7, "dTrunk" = 0.4, "hTrunk" = 5, "Cd" = 1)'. If supplied these values will override vegetation attributes in the GIS data. the 'mangrove' object can be left as NULL (default value)for seagrass, marsh etc., but if users are trying to simulate effects of mangroves a vector of mangrove attributes should be supplied here. GIS data can be populated with dummy values for height, diameter and density (e.g., 999). GIS should be supplied to mark mangrove coverage. For element naming in the vector NTrunk NRoots NCanop are densities (#/m2) for trunks, roots and canopy; dTrunk dRoots dCanop are diameter (m2) for trunks, roots and canopy; hTrunk hRoots hCanop are heights (m2) for trunks, roots and canopy.

Details

Wave attenuation model originally developed by Dr. Greg Guannel for the Coastal Natural Capital InVEST project. This function models wave attenuation along a cross-shore elevation profile. Input parameters include a pre-processed cross shore profile dataset (dat) developed through the sequence of functions show in the example, the total water surface level of still water (total_wsl_adj) above the chart datum, the wave height (Ho) and wave period (To). After running the function populates the original input dataset (dat) with the follow data attributes: wave setup with vegetation (Eta), wave setup without vegetation (Etas), bottom orbital velocity (Ubot), wave height with vegetation (H_veg), wave height without vegetation (H_noveg) and wave dissipation (Dis1). If you receive a message stating Transect failed - bad sort order, we suggest decreasing the MaxOnshoreDist, adding a trim line or decreasing the water level.

Value

An object of class sf and data.frame updated with wave data along each cross-shore profile.

References

InVEST: Wave Attenuation & Erosion Reduction: Coastal Protection (G. Guannel)

Guannel et al. (2014) Integrated modeling framework to quantify the coastal protection services supplied by vegetation. Journal of Geophysical Research: Oceans. DOI: 10.1002/2014JC009821.

Examples

## Not run: 
library(MNAI.CPBT)
data(Coastline)
# Generate cross-shore profile lines along the coastline.
crossshore_profiles <- samplePoints(
  Coastline = Coastline,
  ShorelinePointDist = 150,
  BufferDist = 50,
  RadLineDist = 1.5
)
crossshore_lines <- crossshore_profiles[[2]]

# Extract elevation values along each profile
rpath <-  system.file("extdata", "TopoBathy.tif", package = "MNAI.CPBT")
TopoBathy <- raster::raster(rpath)
pt_elevs <- ExtractElev(crossshore_lines, TopoBathy)

# Run SignalSmooth function to smooth elevation profiles
pt_elevs <- SignalSmooth(point_elev = pt_elevs,
SmoothParameter = 5)

# Clean the cross-shore profiles with CleanTransect
data(Trimline)
cleantransect <- CleanTransect(
  point_elev = pt_elevs,
  RadLineDist = 1.5,
  MaxOnshoreDist = 0.01,
  trimline = Trimline
)

# Merge vegetation onto lines
data(Vegetation)
dat_veg <- ExtractVeg(pt_exp = cleantransect, Vegetation = Vegetation)

# Run the wave evolution model
wave_data <- WaveModel(dat = dat_veg,
  total_wsl_adj = 1.5,
  Ho = 2,
  To = 8
)

# Preview individual transect
dsub <- wave_data[wave_data$line_id == 2, ]

# Plot cross-shore profile
par(mfrow = c(2, 1))
plot(dsub$Xpos, dsub$elev, type = "l", xlab = "Cross-shore Distance (m)",
ylab = "Elevation (m) Chart Datum", main = "ELEVATION PROFILE")
points(dsub$Xpos, dsub$elev_smooth, col="red", type = "l")

# Add MLLW water line
abline(h = 0, lty = 2, col = "blue")

# Look at the wave height (without vegetation)
plot(dsub$Xpos, dsub$H_noveg, type = 'l', xlab = "Cross-shore Distance (m)",
ylab = "Wave Height (m)", main = "WAVE ATTENUATION")
# Add on wave height with vegetation
points(dsub$Xpos, dsub$H_veg, col="green", type = "l")

# Show veg extent
lsub <- dat_veg[dat_veg$line_id == 2, ]
lsub <- lsub[!(is.na(lsub$StemHeight)), ]
veg_col <- adjustcolor("green", alpha.f = 0.1)
polygon(c(min(lsub$Xpos), min(lsub$Xpos),
max(lsub$Xpos), max(lsub$Xpos), min(lsub$Xpos)),
c(-9999, 9999, 9999, -9999, -9999), col = veg_col, border = NA)


# Run Mangrove Example:
mangrove <- c("NRoots" = 130, "dRoots" = 0.1, "hRoots" = 1,
"NCanop" = 100, "dCanop" = 0.5, "hCanop" = 3, "NTrunk" = 1.7,
"dTrunk" = 0.4, "hTrunk" = 5)

wave_data <- WaveModel(dat = dat_veg,
  total_wsl_adj = 1.5,
  Ho = 2,
  To = 8,
  mangrove = mangrove # will override veg attributes
)

# Show minimal mangrove estimates
mangrove_thin <- c("NRoots" = 5, "dRoots" = 0.05, "hRoots" = 0.1, "NCanop" = 5, "dCanop" = 0.02, "hCanop" = 0.2, "NTrunk" = 0.01, "dTrunk" = 0.07, "hTrunk" = 0.8)

wave_data <- WaveModel(dat = dat_veg,
  total_wsl_adj = 1.5,
  Ho = 2,
  To = 8,
  mangrove = mangrove_thin # will override veg attributes
)



## End(Not run)

essatech/MNAI.CPBT documentation built on July 1, 2023, 12:34 p.m.