From 86288f885c0a1240f2b9c05c783f4b06c9e48742 Mon Sep 17 00:00:00 2001 From: Andrew Barbour Date: Wed, 7 Apr 2021 17:27:09 +0000 Subject: [PATCH] working in rc76 --- R/ricecleary76.R | 73 ++++++++++++++++++------------------ man/rc76_edge_disloc_poro.Rd | 21 ++++++----- 2 files changed, 49 insertions(+), 45 deletions(-) diff --git a/R/ricecleary76.R b/R/ricecleary76.R index b856314..2897c9a 100644 --- a/R/ricecleary76.R +++ b/R/ricecleary76.R @@ -6,34 +6,35 @@ #' @param Times numeric; times to calculate at \code{depth} [s] #' @param slip numeric; relative slip along the edge dislocation [m] #' @param radial_dist numeric; distance from xxx to xxx [m] -#' @param angFromEast -#' @param diffusiv -#' @param nuu -#' @param nu -#' @param B -#' @param mu -#' @param ... +#' @param flt_angle numeric; angle counter clockwise from fault strike +#' @param diffusiv numeric; in plane hydraulic diffusivity [m^2/s] +#' @param nuu numeric; undrained Poisson's ratio [-] +#' @param nu numeric; drained Poisson's ratio [-] +#' @param B numeric; Skempton's coefficient [-] +#' @param mu numeric; elastic shear modulus [Pa] +#' @param ... additional arguments #' -#' @return +#' @return tibble #' @export #' #' @examples -rc76_edge_disloc_poro <- function(Times, slip, radial_dist, angFromEast=30, +#' NULL +rc76_edge_disloc_poro <- function(Times, slip, radial_dist, flt_angle=30, diffusiv=1, - nuu=0.33, nu=0.25, B = 0.6, + nuu=0.33, nu=0.25, B=0.6, mu=30e9, ...){ # Equation X of Rice and Cleary 1976, or equations 7.149 - 7.152 of Wang (2000) data.table::inrange(radial_dist, 0, Inf) stopifnot(length(slip) == 1) stopifnot(length(radial_dist) == 1) - stopifnot(length(angFromEast) == 1) + stopifnot(length(flt_angle) == 1) zer <- Times <= 0 calc_times <- Times calc_times[zer] <- NA - theta <- angFromEast * pi / 180 + theta <- flt_angle * pi / 180 r <- radial_dist geom_fac <- slip / r nu_fac <- (nuu - nu) / (1 - nu) / (1 - nuu) @@ -60,30 +61,30 @@ rc76_edge_disloc_poro <- function(Times, slip, radial_dist, angFromEast=30, examp <- function(){ -library(dplyr) -ti <- c(-100, -1, 0, 10**seq(-4, log10(6598), length.out=301)) -Mw <- 4.33 -M0 <- Mw2M0(Mw) #3.935501e+15 N*m for Mw 4.33 -bx <- 10^(-3.22 + 0.69 * Mw) #0.5 -rd <- 250 -mu <- 2e8 -Diffu <- 60 -rc <- rc76_edge_disloc_poro(ti, bx, rd, diffusiv=Diffu, mu=mu) -nrc <- rc76_edge_disloc_poro(ti, bx, -rd, diffusiv=Diffu, mu=mu) -all.equal(rc$pp, -nrc$pp) - -plot(pp / 1e3 + 5 ~ I(Times / 3600), rc, type='l', lwd=2, ylab='kPa', - ylim=c(-8.8,36.9), yaxs='i', xaxs='i') -axis(4) -abline(v=1*60/3600, lty=3) -rect(0,0,100,100) -#lines(sigma_tt / 1e3 ~ Times, rc, lty=2) -#lines(sigma_rt / 1e3 ~ Times, rc, lty=3) -#lines(sigma_rr / 1e3 ~ Times, rc) -#plot((sigma_rt - dplyr::first(na.omit(sigma_rt)))/1e3 ~ Times, rc, type='l') -SrcArea <- M0 / (mu * bx) -SrcRad <- sqrt(SrcArea / pi) -print(c(Area=SrcArea, Rad=SrcRad)) + library(dplyr) + ti <- c(-100, -1, 0, 10**seq(-4, log10(6598), length.out=301)) + Mw <- 4.33 + M0 <- Mw2M0(Mw) #3.935501e+15 N*m for Mw 4.33 + bx <- 10^(-3.22 + 0.69 * Mw) #0.5 + rd <- 250 + mu <- 2e8 + Diffu <- 60 + rc <- rc76_edge_disloc_poro(ti, bx, rd, diffusiv=Diffu, mu=mu) + nrc <- rc76_edge_disloc_poro(ti, bx, -rd, diffusiv=Diffu, mu=mu) + all.equal(rc$pp, -nrc$pp) + + plot(pp / 1e3 + 5 ~ I(Times / 3600), rc, type='l', lwd=2, ylab='kPa', + ylim=c(-8.8,36.9), yaxs='i', xaxs='i') + axis(4) + abline(v=1*60/3600, lty=3) + rect(0,0,100,100) + #lines(sigma_tt / 1e3 ~ Times, rc, lty=2) + #lines(sigma_rt / 1e3 ~ Times, rc, lty=3) + #lines(sigma_rr / 1e3 ~ Times, rc) + #plot((sigma_rt - dplyr::first(na.omit(sigma_rt)))/1e3 ~ Times, rc, type='l') + SrcArea <- M0 / (mu * bx) + SrcRad <- sqrt(SrcArea / pi) + print(c(Area=SrcArea, Rad=SrcRad)) } diff --git a/man/rc76_edge_disloc_poro.Rd b/man/rc76_edge_disloc_poro.Rd index 55208d2..6437097 100644 --- a/man/rc76_edge_disloc_poro.Rd +++ b/man/rc76_edge_disloc_poro.Rd @@ -8,7 +8,7 @@ rc76_edge_disloc_poro( Times, slip, radial_dist, - angFromEast = 30, + flt_angle = 30, diffusiv = 1, nuu = 0.33, nu = 0.25, @@ -24,22 +24,22 @@ rc76_edge_disloc_poro( \item{radial_dist}{numeric; distance from xxx to xxx [m]} -\item{angFromEast}{} +\item{flt_angle}{numeric; angle counter clockwise from fault strike} -\item{diffusiv}{} +\item{diffusiv}{numeric; in plane hydraulic diffusivity [m^2/s]} -\item{nuu}{} +\item{nuu}{numeric; undrained Poisson's ratio [-]} -\item{nu}{} +\item{nu}{numeric; drained Poisson's ratio [-]} -\item{B}{} +\item{B}{numeric; Skempton's coefficient [-]} -\item{mu}{} +\item{mu}{numeric; elastic shear modulus [Pa]} -\item{...}{} +\item{...}{additional arguments} } \value{ - +tibble } \description{ Rice and Cleary solutions @@ -48,3 +48,6 @@ Rice and Cleary solutions \code{\link{rc76_edge_disloc_poro}} is the 2D solution to an edge dislocation (e.g., fault) embedded in a poroelastic medium } +\examples{ +NULL +}