-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Segall subsidence -- time varying not working.
- Loading branch information
Showing
11 changed files
with
203 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
# Generated by roxygen2 (4.0.1): do not edit by hand | ||
|
||
export(.surface_g) | ||
export(D_project) | ||
export(agency.root) | ||
export(degreelen) | ||
export(ellipsoid) | ||
export(erf) | ||
export(erfc) | ||
export(getEPSG) | ||
export(hydraulic_diffusivity) | ||
export(ierf) | ||
export(ierfc) | ||
export(rigid_hydraulic_diffusivity) | ||
export(segall85) | ||
export(surface_displacement) | ||
export(timevarying_surface_displacement) | ||
exportPattern("^[[:alpha:]]+") | ||
importFrom(Rcpp,evalCpp) | ||
useDynLib(deform) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
library(deform) | ||
|
||
y. <- c(-10:-2, seq(-1.9,1.9,by=0.1), 2:10) | ||
su <- surface_displacement(y.*1e3, C.=1e13, z_src=1e3) | ||
#plot(uz ~ y, su, type="b", ylim=c(-2,1)*10) | ||
#lines(uy ~ y, su, type="b", col="red") | ||
#lines((uy+uz) ~ y, su, type="b", col="blue") | ||
|
||
# Fig 8 | ||
#y. <- 0:10 | ||
t. <- c(0.1,0.5,1:5) | ||
Vdot <- 2e6 | ||
D. <- 1e3 | ||
L. <- 10e3 | ||
B. <- 0.6 | ||
c. <- 0.1 | ||
matplot(y.,t., | ||
timevarying_surface_displacement(y., t., Vdot, B., L., D., c., y_src.=1), | ||
type="l") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#' Error functions | ||
#' @param x numeric; | ||
#' @export | ||
erf <- function(x){ | ||
2 * pnorm(x * sqrt(2)) - 1 | ||
} | ||
|
||
#' @rdname erf | ||
#' @export | ||
erfc <- function(x){ | ||
2 * pnorm(x * sqrt(2), lower = FALSE) | ||
} | ||
|
||
#' @rdname erf | ||
#' @export | ||
ierf <- function (x){ | ||
qnorm((1 + x)/2)/sqrt(2) | ||
} | ||
|
||
#' @rdname erf | ||
#' @export | ||
ierfc <- function (x){ | ||
qnorm(x/2, lower = FALSE)/sqrt(2) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#' Calculate hydraulic diffusivity of a fluid saturated medium | ||
#' @export | ||
hydraulic_diffusivity <- function(k., eta., mu., B., nu.=1/4, nuu.=1/3){ | ||
# segall85 eq 11 | ||
n1 <- 1 - nu. | ||
n1u <- 1 - nuu. | ||
n2 <- 1 - 2*nu. | ||
k. * B.^2 * (2*mu.*n1/n2) * (n2 * (1 + nuu.)^2 / n1u / (nuu. - nu.)) / eta. / 9 | ||
} | ||
#' @rdname hydraulic_diffusivity | ||
#' @export | ||
rigid_hydraulic_diffusivity <- function(k., eta., phi., Beta.){ | ||
# segall85 eq 12 | ||
k./eta./phi./Beta. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#' Surface deformation associated with fluid withdrawl | ||
#' @name segall85 | ||
#' @export | ||
#' @examples | ||
#' \dontrun{ | ||
#' y. <- c(-10:-2, seq(-1.9,1.9,by=0.1), 2:10) | ||
#' su <- surface_displacement(y.*1e3, z_src=1e3) | ||
#' plot(uz ~ y, su, type="b") | ||
#' } | ||
segall85 <- function(){ | ||
} | ||
|
||
# spatial coordinates in segall | ||
# x is positive downwards | ||
# y is positive away from source | ||
# z is along line source | ||
# source coordinates: | ||
# z_src is zeta (depth) | ||
# y_src is xi (distance away) | ||
# parameters: | ||
# mu shear modulus | ||
# C units of force, proportional to the source strength | ||
#' @rdname segall85 | ||
#' @export | ||
surface_displacement <- function(y, C.=1, mu.=1e9, ...){ | ||
sg <- .surface_g(y, ...) | ||
c. <- C./mu. | ||
sg$uz <- sg$gz * c. | ||
sg$uy <- sg$gy * c. | ||
return(sg) | ||
} | ||
|
||
#' @rdname segall85 | ||
#' @export | ||
.surface_g <- function(y=0, z_src=0, y_src=0, nuu=1/3){ | ||
# segall85 C9 | ||
gz <- -2*(1 - nuu)*z_src/(z_src^2 + (y - y_src)^2) | ||
gy <- 2*(1 - nuu)*(y - y_src)/(z_src^2 + (y - y_src)^2) | ||
data.frame(y, gz, gy) | ||
} | ||
|
||
# Time varying deformation associatedw with fluid extraction | ||
|
||
#' @rdname segall85 | ||
#' @export | ||
timevarying_surface_displacement <- function(y, Time, Vdot., B., L., D., HD., nuu.=1/3, y_src.=0){ | ||
# segall85 eq 26 | ||
# at each time slice, calculate a profile | ||
.tvsd <- function(yi, ti, .Vdot, .B, .L, .D, .HD, .nuu, .y_src){ | ||
message(paste(.Vdot, .B, .L, .D, .HD, .nuu, .y_src)) | ||
# source | ||
mod <- 2*.B*(1 + .nuu)*.Vdot*.D*sqrt(ti/.HD)/(3*pi*.L) | ||
# line source correction | ||
sc <- if (.y_src==0){ | ||
1 | ||
} else { | ||
Time.src <- sqrt(.y_src^2 / 4 / .HD / ti) | ||
err <- qnorm(Time.src/2, lower = FALSE)/sqrt(2) #ierfc | ||
sum(err/(.D^2 + (yi - .y_src)^2), na.rm=TRUE) | ||
} | ||
return(mod*sc) | ||
} | ||
outer(X=y, Y=Time, FUN=.tvsd, .Vdot=Vdot., .B=B., .L=L., .D=D., .HD=HD., .nuu=nuu., .y_src=y_src.) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
% Generated by roxygen2 (4.0.1): do not edit by hand | ||
\name{erf} | ||
\alias{erf} | ||
\alias{erfc} | ||
\alias{ierf} | ||
\alias{ierfc} | ||
\title{Error functions} | ||
\usage{ | ||
erf(x) | ||
|
||
erfc(x) | ||
|
||
ierf(x) | ||
|
||
ierfc(x) | ||
} | ||
\arguments{ | ||
\item{x}{numeric;} | ||
} | ||
\description{ | ||
Error functions | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
% Generated by roxygen2 (4.0.1): do not edit by hand | ||
\name{hydraulic_diffusivity} | ||
\alias{hydraulic_diffusivity} | ||
\alias{rigid_hydraulic_diffusivity} | ||
\title{Calculate hydraulic diffusivity of a fluid saturated medium} | ||
\usage{ | ||
hydraulic_diffusivity(k., eta., mu., B., nu. = 1/4, nuu. = 1/3) | ||
|
||
rigid_hydraulic_diffusivity(k., eta., phi., Beta.) | ||
} | ||
\description{ | ||
Calculate hydraulic diffusivity of a fluid saturated medium | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
% Generated by roxygen2 (4.0.1): do not edit by hand | ||
\name{segall85} | ||
\alias{.surface_g} | ||
\alias{segall85} | ||
\alias{surface_displacement} | ||
\alias{timevarying_surface_displacement} | ||
\title{Surface deformation associated with fluid withdrawl} | ||
\usage{ | ||
segall85() | ||
|
||
surface_displacement(y, C. = 1, mu. = 1e+09, ...) | ||
|
||
.surface_g(y = 0, z_src = 0, y_src = 0, nuu = 1/3) | ||
|
||
timevarying_surface_displacement(y, Time, Vdot., B., L., D., HD., nuu. = 1/3, | ||
y_src. = 0) | ||
} | ||
\description{ | ||
Surface deformation associated with fluid withdrawl | ||
} | ||
\examples{ | ||
\dontrun{ | ||
y. <- c(-10:-2, seq(-1.9,1.9,by=0.1), 2:10) | ||
su <- surface_displacement(y.*1e3, z_src=1e3) | ||
plot(uz ~ y, su, type="b") | ||
} | ||
} | ||
|