Title: | Tephra Transport Modeling |
---|---|
Description: | Models and displays tephra transport through custom (windy, turbulent, heterogeneous) atmosphere over custom topography. Includes a Lagrangian (particle-tracking) tephra transport model and a function to save snapshots of model as png files. |
Authors: | Jake Anderson |
Maintainer: | Jake Anderson <[email protected]> |
License: | GPL |
Version: | 0.1 |
Built: | 2025-03-06 03:47:59 UTC |
Source: | https://github.com/cran/rTephra |
Generates png files showing map view and cross-section view of tephra motion and final position on ground
BlastAnim3d(L, tframe = 0.1, dir = ".", TOPO = NULL, az = 0, xlim = NULL, ylim = NULL, zlim = NULL, units = "m", plotMapView = TRUE, plotCrossSection = TRUE)
BlastAnim3d(L, tframe = 0.1, dir = ".", TOPO = NULL, az = 0, xlim = NULL, ylim = NULL, zlim = NULL, units = "m", plotMapView = TRUE, plotCrossSection = TRUE)
L |
output of BlastSim3d |
tframe |
time interval between frames [s] |
dir |
directory where png files should be saved |
TOPO |
DEM: list containing vectors x and y and matrix z with dimensions (length(x), length(y)) |
az |
azimuth of section line (degrees clockwise from North) |
xlim |
easting limits for map view |
ylim |
northing limits for map view |
zlim |
elevation limits for section view |
units |
units of length (string) |
plotMapView |
logical: should the map view panel be plotted? |
plotCrossSection |
logical: should the cross-section panel be plotted? |
## Not run: ## BlastSim3d(v = 40, th_i = 2* 1:40, th_a = 90, dt = 0.01) ## BlastAnim3d(L, tframe = 0.1, az = 90) ## ImageMagick shell command: animate -delay 10 * # animate with 0.1-s frame rate
## Not run: ## BlastSim3d(v = 40, th_i = 2* 1:40, th_a = 90, dt = 0.01) ## BlastAnim3d(L, tframe = 0.1, az = 90) ## ImageMagick shell command: animate -delay 10 * # animate with 0.1-s frame rate
Models the transport of particles ejected at the same velocity and different angles using tephra3d.
BlastSim3d(v, th_i = 2 * 1:40, th_a = 0, dt = 0.01, ...)
BlastSim3d(v, th_i = 2 * 1:40, th_a = 0, dt = 0.01, ...)
v |
initial velocity [m/s] |
th_i |
initial inclination angles to test [degrees] |
th_a |
initial azimuth angles to test [degrees clockwise from north] |
dt |
model time interval [s] |
... |
parameters to pass to Tephra3d |
BlastSim3d(v = 10, th_i = 2* 1:40, th_a = 0, dt = 0.01)
BlastSim3d(v = 10, th_i = 2* 1:40, th_a = 0, dt = 0.01)
N-Dimensional Meshgrid Make a list in which all combinations of inputs occur.
meshgridn(L)
meshgridn(L)
L |
list containing any number of vectors |
meshgridn(list(1:2, 5:6, 7:9))
meshgridn(list(1:2, 5:6, 7:9))
This function models the transport of a single particle through a spatially variable, windy, turbulent atmosphere with gravity. It allows 4D-varying atmospheric wind and density. Currently, only Rayleigh drag (low Re) is permitted.
Tephra3d(vx0, vy0, vz0, x0 = 0, y0 = 0, z0 = 0, t0 = 0, rho_r = 2000, r = 1, dt = 0.01, Cd = 0.6, verbose = FALSE, rho_a = NULL, zt = NULL, wx = 0, wy = 0, wz = 0, mindist = 0, TOPO = NULL, Kh = 0, Kz = 0, eddy_timescale = 60, g = 9.80665)
Tephra3d(vx0, vy0, vz0, x0 = 0, y0 = 0, z0 = 0, t0 = 0, rho_r = 2000, r = 1, dt = 0.01, Cd = 0.6, verbose = FALSE, rho_a = NULL, zt = NULL, wx = 0, wy = 0, wz = 0, mindist = 0, TOPO = NULL, Kh = 0, Kz = 0, eddy_timescale = 60, g = 9.80665)
vx0 |
initial x component of velocity [m/s] |
vy0 |
initial y component of velocity [m/s] |
vz0 |
initial z component of velocity [m/s] |
x0 |
initial easting [m] |
y0 |
initial northing [m] |
z0 |
initial elevation [m] |
t0 |
initial time [s] |
rho_r |
density of tephra particle [kg/m^3] |
r |
rock radius [m] |
dt |
model time interval [s] |
Cd |
drag coefficient [unitless] |
verbose |
logical: print runtime info to screen? |
rho_a |
scalar or function(x,y,z,t) or function(z) giving atmospheric density [kg/m^3]. If NULL, use a variable-density isothermal atmosphere (T = 0 deg C) |
zt |
function(x,y) giving topographic height [m] |
wx |
scalar or function(x,y,z,t) or function(z) giving component of wind to the east [m/s] |
wy |
scalar or function(x,y,z,t) or function(z) giving component of wind to the north [m/s] |
wz |
scalar or function(x,y,z,t) or function(z) giving upward component of wind [m/s] |
mindist |
minimum distance a particle must travel before simulation can stop. This is to prevent early model ends due to spurious collision with crater. |
TOPO |
DEM: list containing vectors x and y and matrix z with dimensions (length(x), length(y)) |
Kh |
horizontal eddy diffusivity [m^2/s] |
Kz |
vertical eddy diffusivity (often neglected) [m^2/s] |
eddy_timescale |
1/e decay time of turbulent eddies [s] |
g |
gravitational acceleration [m/s^2] |
Tephra3d(vx0 = 40, vy0 = 0, vz0 = 40, z0 = 0)
Tephra3d(vx0 = 40, vy0 = 0, vz0 = 40, z0 = 0)
Interpolates elevation at point (x, y) given Digital Elevation Model (DEM).
TopoInterp(x, y, TOPO = NULL, N = 10)
TopoInterp(x, y, TOPO = NULL, N = 10)
x |
Easting of point to interpolate [same units as TOPO$x, TOPO$y] |
y |
Northing of point to interpolate [same units as TOPO$x, TOPO$y] |
TOPO |
DEM: list containing vectors x and y and matrix z with dimensions (length(x), length(y)) |
N |
Smoothing parameter, must be positive. Larger N means less smoothing. |
data(VILL) contour(VILL, xlim = c(-500, 500), ylim = c(-500, 500)) TopoInterp(0, 0, VILL) # interpolate elevation at point (0, 0)
data(VILL) contour(VILL, xlim = c(-500, 500), ylim = c(-500, 500)) TopoInterp(0, 0, VILL) # interpolate elevation at point (0, 0)
Digital Elevation Model (DEM) of Villarrica Volcano, Chile.
List with following elements:
Easting from vent (m)
Northing from vent (m)
Elevation above sea level (m)
Latitude (degrees)
Longitude (degrees)
data(VILL) contour(VILL)
data(VILL) contour(VILL)