Skip to content

Commit

Permalink
Hantush_jacob and papadopulos_cooper functions of no_flow_boundary an…
Browse files Browse the repository at this point in the history
…d constant_head boundary added to the Rcpp file.
  • Loading branch information
khaors committed Mar 31, 2019
1 parent 409ab4f commit f21c050
Show file tree
Hide file tree
Showing 3 changed files with 191 additions and 3 deletions.
16 changes: 16 additions & 0 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,19 @@ no_flow_boulton_well_function_cpp <- function(Q, r1, r2, t, hydrpar) {
.Call('_pumpingtest_no_flow_boulton_well_function_cpp', PACKAGE = 'pumpingtest', Q, r1, r2, t, hydrpar)
}

constant_head_hantush_well_function_cpp <- function(Q, r1, r2, t, hydrpar) {
.Call('_pumpingtest_constant_head_hantush_well_function_cpp', PACKAGE = 'pumpingtest', Q, r1, r2, t, hydrpar)
}

no_flow_hantush_well_function_cpp <- function(Q, r1, r2, t, hydrpar) {
.Call('_pumpingtest_no_flow_hantush_well_function_cpp', PACKAGE = 'pumpingtest', Q, r1, r2, t, hydrpar)
}

constant_head_papadopulos_well_function_cpp <- function(Q, r1, r2, t, hydrpar) {
.Call('_pumpingtest_constant_head_papadopulos_well_function_cpp', PACKAGE = 'pumpingtest', Q, r1, r2, t, hydrpar)
}

no_flow_papadopulos_well_function_cpp <- function(Q, r1, r2, t, hydrpar) {
.Call('_pumpingtest_no_flow_papadopulos_well_function_cpp', PACKAGE = 'pumpingtest', Q, r1, r2, t, hydrpar)
}

64 changes: 64 additions & 0 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,66 @@ BEGIN_RCPP
return rcpp_result_gen;
END_RCPP
}
// constant_head_hantush_well_function_cpp
NumericVector constant_head_hantush_well_function_cpp(const double& Q, const double& r1, const double& r2, NumericVector t, NumericVector hydrpar);
RcppExport SEXP _pumpingtest_constant_head_hantush_well_function_cpp(SEXP QSEXP, SEXP r1SEXP, SEXP r2SEXP, SEXP tSEXP, SEXP hydrparSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< const double& >::type Q(QSEXP);
Rcpp::traits::input_parameter< const double& >::type r1(r1SEXP);
Rcpp::traits::input_parameter< const double& >::type r2(r2SEXP);
Rcpp::traits::input_parameter< NumericVector >::type t(tSEXP);
Rcpp::traits::input_parameter< NumericVector >::type hydrpar(hydrparSEXP);
rcpp_result_gen = Rcpp::wrap(constant_head_hantush_well_function_cpp(Q, r1, r2, t, hydrpar));
return rcpp_result_gen;
END_RCPP
}
// no_flow_hantush_well_function_cpp
NumericVector no_flow_hantush_well_function_cpp(const double& Q, const double& r1, const double& r2, NumericVector t, NumericVector hydrpar);
RcppExport SEXP _pumpingtest_no_flow_hantush_well_function_cpp(SEXP QSEXP, SEXP r1SEXP, SEXP r2SEXP, SEXP tSEXP, SEXP hydrparSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< const double& >::type Q(QSEXP);
Rcpp::traits::input_parameter< const double& >::type r1(r1SEXP);
Rcpp::traits::input_parameter< const double& >::type r2(r2SEXP);
Rcpp::traits::input_parameter< NumericVector >::type t(tSEXP);
Rcpp::traits::input_parameter< NumericVector >::type hydrpar(hydrparSEXP);
rcpp_result_gen = Rcpp::wrap(no_flow_hantush_well_function_cpp(Q, r1, r2, t, hydrpar));
return rcpp_result_gen;
END_RCPP
}
// constant_head_papadopulos_well_function_cpp
NumericVector constant_head_papadopulos_well_function_cpp(const double& Q, const double& r1, const double& r2, NumericVector t, NumericVector hydrpar);
RcppExport SEXP _pumpingtest_constant_head_papadopulos_well_function_cpp(SEXP QSEXP, SEXP r1SEXP, SEXP r2SEXP, SEXP tSEXP, SEXP hydrparSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< const double& >::type Q(QSEXP);
Rcpp::traits::input_parameter< const double& >::type r1(r1SEXP);
Rcpp::traits::input_parameter< const double& >::type r2(r2SEXP);
Rcpp::traits::input_parameter< NumericVector >::type t(tSEXP);
Rcpp::traits::input_parameter< NumericVector >::type hydrpar(hydrparSEXP);
rcpp_result_gen = Rcpp::wrap(constant_head_papadopulos_well_function_cpp(Q, r1, r2, t, hydrpar));
return rcpp_result_gen;
END_RCPP
}
// no_flow_papadopulos_well_function_cpp
NumericVector no_flow_papadopulos_well_function_cpp(const double& Q, const double& r1, const double& r2, NumericVector t, NumericVector hydrpar);
RcppExport SEXP _pumpingtest_no_flow_papadopulos_well_function_cpp(SEXP QSEXP, SEXP r1SEXP, SEXP r2SEXP, SEXP tSEXP, SEXP hydrparSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< const double& >::type Q(QSEXP);
Rcpp::traits::input_parameter< const double& >::type r1(r1SEXP);
Rcpp::traits::input_parameter< const double& >::type r2(r2SEXP);
Rcpp::traits::input_parameter< NumericVector >::type t(tSEXP);
Rcpp::traits::input_parameter< NumericVector >::type hydrpar(hydrparSEXP);
rcpp_result_gen = Rcpp::wrap(no_flow_papadopulos_well_function_cpp(Q, r1, r2, t, hydrpar));
return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
{"_pumpingtest_factorial_cpp", (DL_FUNC) &_pumpingtest_factorial_cpp, 1},
Expand Down Expand Up @@ -680,6 +740,10 @@ static const R_CallMethodDef CallEntries[] = {
{"_pumpingtest_no_flow_theis_well_function_cpp", (DL_FUNC) &_pumpingtest_no_flow_theis_well_function_cpp, 5},
{"_pumpingtest_constant_head_boulton_well_function_cpp", (DL_FUNC) &_pumpingtest_constant_head_boulton_well_function_cpp, 5},
{"_pumpingtest_no_flow_boulton_well_function_cpp", (DL_FUNC) &_pumpingtest_no_flow_boulton_well_function_cpp, 5},
{"_pumpingtest_constant_head_hantush_well_function_cpp", (DL_FUNC) &_pumpingtest_constant_head_hantush_well_function_cpp, 5},
{"_pumpingtest_no_flow_hantush_well_function_cpp", (DL_FUNC) &_pumpingtest_no_flow_hantush_well_function_cpp, 5},
{"_pumpingtest_constant_head_papadopulos_well_function_cpp", (DL_FUNC) &_pumpingtest_constant_head_papadopulos_well_function_cpp, 5},
{"_pumpingtest_no_flow_papadopulos_well_function_cpp", (DL_FUNC) &_pumpingtest_no_flow_papadopulos_well_function_cpp, 5},
{NULL, NULL, 0}
};

Expand Down
114 changes: 111 additions & 3 deletions src/pumpingtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1002,16 +1002,124 @@ NumericVector no_flow_boulton_well_function_cpp(const double& Q,
int ntimes = t.length();
NumericVector u1(ntimes),u2(ntimes), W1(ntimes), W2(ntimes);
NumericVector t1(ntimes), t2(ntimes), drawdown(ntimes);
double phi1,phi2;
double Tr = hydrpar[0];
double Ss = hydrpar[1];
double alpha1 = hydrpar[2];
double sigma = hydrpar[3];
u1 = (r1*r1*Ss)/(4.0*Tr*t);
u2 = (r2*r2*Ss)/(4.0*Tr*t);
t1 = 1.0/u1;
t2 = 1.0/u2;
W1 = boulton_well_function_cpp(t1, 0.0, 0.0, 0.0);
W2 = boulton_well_function_cpp(t2, 0.0, 0.0, 0.0);
phi1=alpha1*r1*r1*Ss/Tr;
phi2=alpha1*r2*r2*Ss/Tr;
W1 = boulton_well_function_cpp(t1, phi1, sigma, 0.0);
W2 = boulton_well_function_cpp(t2, phi2, sigma, 0.0);
drawdown = (Q/(4.0*M_PI*Tr))*(W1+W2);
return(drawdown);
}
//
// [[Rcpp::export]]
NumericVector constant_head_hantush_well_function_cpp(const double& Q,
const double& r1,
const double& r2,
NumericVector t,
NumericVector hydrpar){
int ntimes = t.length();
NumericVector u1(ntimes),u2(ntimes), W1(ntimes), W2(ntimes);
NumericVector t1(ntimes), t2(ntimes), drawdown(ntimes);
double phi1,phi2;
double Tr = hydrpar[0];
double Ss = hydrpar[1];
double Kh = hydrpar[2];
double Ss1 = hydrpar[3];
double beta1 = 0.25*r1*sqrt((Kh*Ss1)/(Tr*Ss));
double beta2 = 0.25*r2*sqrt((Kh*Ss1)/(Tr*Ss));
u1 = (r1*r1*Ss)/(4.0*Tr*t);
u2 = (r2*r2*Ss)/(4.0*Tr*t);
t1 = 1.0/u1;
t2 = 1.0/u2;
W1 = hantush_jacob_well_function_cpp(t1, beta1, 0.0, 0.0);
W2 = hantush_jacob_well_function_cpp(t2, beta2, 0.0, 0.0);
drawdown = (Q/(4.0*M_PI*Tr))*(W1-W2);
return(drawdown);
}
//

// [[Rcpp::export]]
NumericVector no_flow_hantush_well_function_cpp(const double& Q,
const double& r1,
const double& r2,
NumericVector t,
NumericVector hydrpar){
int ntimes = t.length();
NumericVector u1(ntimes),u2(ntimes), W1(ntimes), W2(ntimes);
NumericVector t1(ntimes), t2(ntimes), drawdown(ntimes);
double Tr = hydrpar[0];
double Ss = hydrpar[1];
double Kh = hydrpar[2];
double Ss1 = hydrpar[3];
double beta1 = 0.25*r1*sqrt((Kh*Ss1)/(Tr*Ss));
double beta2 = 0.25*r2*sqrt((Kh*Ss1)/(Tr*Ss));
u1 = (r1*r1*Ss)/(4.0*Tr*t);
u2 = (r2*r2*Ss)/(4.0*Tr*t);
t1 = 1.0/u1;
t2 = 1.0/u2;
W1 = hantush_jacob_well_function_cpp(t1, beta1, 0.0, 0.0);
W2 = hantush_jacob_well_function_cpp(t2, beta2, 0.0, 0.0);
drawdown = (Q/(4.0*M_PI*Tr))*(W1+W2);
return(drawdown);
}
//
// [[Rcpp::export]]
NumericVector constant_head_papadopulos_well_function_cpp(const double& Q,
const double& r1,
const double& r2,
NumericVector t,
NumericVector hydrpar){
int ntimes = t.length();
NumericVector u1(ntimes),u2(ntimes), W1(ntimes), W2(ntimes);
NumericVector t1(ntimes), t2(ntimes), drawdown(ntimes);
double phi1,phi2;
double Tr = hydrpar[0];
double Ss = hydrpar[1];
double rw = hydrpar[2];
double rc = hydrpar[3];
double cd = std::pow(rw, 2)*Ss/std::pow(rc, 2);
double rho1 = r1/rw;
double rho2 = r2/rw;
u1 = (r1*r1*Ss)/(4.0*Tr*t);
u2 = (r2*r2*Ss)/(4.0*Tr*t);
t1 = 1.0/u1;
t2 = 1.0/u2;
W1 = papadopulos_cooper_well_function_cpp(t1, cd, rho1, 0.0);
W2 = papadopulos_cooper_well_function_cpp(t2, cd, rho2, 0.0);
drawdown = (Q/(4.0*M_PI*Tr))*(W1-W2);
return(drawdown);
}
//
// [[Rcpp::export]]
NumericVector no_flow_papadopulos_well_function_cpp(const double& Q,
const double& r1,
const double& r2,
NumericVector t,
NumericVector hydrpar){
int ntimes = t.length();
NumericVector u1(ntimes),u2(ntimes), W1(ntimes), W2(ntimes);
NumericVector t1(ntimes), t2(ntimes), drawdown(ntimes);
double phi1,phi2;
double Tr = hydrpar[0];
double Ss = hydrpar[1];
double rw = hydrpar[2];
double rc = hydrpar[3];
double cd = std::pow(rw, 2)*Ss/std::pow(rc, 2);
double rho1 = r1/rw;
double rho2 = r2/rw;
u1 = (r1*r1*Ss)/(4.0*Tr*t);
u2 = (r2*r2*Ss)/(4.0*Tr*t);
t1 = 1.0/u1;
t2 = 1.0/u2;
W1 = papadopulos_cooper_well_function_cpp(t1, cd, rho1, 0.0);
W2 = papadopulos_cooper_well_function_cpp(t2, cd, rho2, 0.0);
drawdown = (Q/(4.0*M_PI*Tr))*(W1+W2);
return(drawdown);
}

0 comments on commit f21c050

Please sign in to comment.