Skip to content

Commit

Permalink
agarwal_skin_solution_space added to the pumpingtest.cpp file.
Browse files Browse the repository at this point in the history
  • Loading branch information
khaors committed Mar 31, 2019
1 parent f21c050 commit f9929c1
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 4 deletions.
4 changes: 4 additions & 0 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ general_radial_flow_solution_space <- function(Q, x0, y0, t, hydrpar, nx, ny, xm
.Call('_pumpingtest_general_radial_flow_solution_space', PACKAGE = 'pumpingtest', Q, x0, y0, t, hydrpar, nx, ny, xmin, xmax, ymin, ymax)
}

agarwal_skin_solution_space <- function(Q, x0, y0, t, hydrpar, nx, ny, xmin, xmax, ymin, ymax) {
.Call('_pumpingtest_agarwal_skin_solution_space', PACKAGE = 'pumpingtest', Q, x0, y0, t, hydrpar, nx, ny, xmin, xmax, ymin, ymax)
}

space_calculation_via_string <- function(model, Q, x0, y0, t, hydrpar, nx, ny, xmin, xmax, ymin, ymax) {
.Call('_pumpingtest_space_calculation_via_string', PACKAGE = 'pumpingtest', model, Q, x0, y0, t, hydrpar, nx, ny, xmin, xmax, ymin, ymax)
}
Expand Down
22 changes: 22 additions & 0 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,27 @@ BEGIN_RCPP
return rcpp_result_gen;
END_RCPP
}
// agarwal_skin_solution_space
NumericVector agarwal_skin_solution_space(const double& Q, const double& x0, const double& y0, const double& t, NumericVector hydrpar, const int& nx, const int& ny, const double& xmin, const double& xmax, const double& ymin, const double& ymax);
RcppExport SEXP _pumpingtest_agarwal_skin_solution_space(SEXP QSEXP, SEXP x0SEXP, SEXP y0SEXP, SEXP tSEXP, SEXP hydrparSEXP, SEXP nxSEXP, SEXP nySEXP, SEXP xminSEXP, SEXP xmaxSEXP, SEXP yminSEXP, SEXP ymaxSEXP) {
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 x0(x0SEXP);
Rcpp::traits::input_parameter< const double& >::type y0(y0SEXP);
Rcpp::traits::input_parameter< const double& >::type t(tSEXP);
Rcpp::traits::input_parameter< NumericVector >::type hydrpar(hydrparSEXP);
Rcpp::traits::input_parameter< const int& >::type nx(nxSEXP);
Rcpp::traits::input_parameter< const int& >::type ny(nySEXP);
Rcpp::traits::input_parameter< const double& >::type xmin(xminSEXP);
Rcpp::traits::input_parameter< const double& >::type xmax(xmaxSEXP);
Rcpp::traits::input_parameter< const double& >::type ymin(yminSEXP);
Rcpp::traits::input_parameter< const double& >::type ymax(ymaxSEXP);
rcpp_result_gen = Rcpp::wrap(agarwal_skin_solution_space(Q, x0, y0, t, hydrpar, nx, ny, xmin, xmax, ymin, ymax));
return rcpp_result_gen;
END_RCPP
}
// space_calculation_via_string
NumericVector space_calculation_via_string(std::string model, const double& Q, const double& x0, const double& y0, const double& t, NumericVector hydrpar, const int& nx, const int& ny, const double& xmin, const double& xmax, const double& ymin, const double& ymax);
RcppExport SEXP _pumpingtest_space_calculation_via_string(SEXP modelSEXP, SEXP QSEXP, SEXP x0SEXP, SEXP y0SEXP, SEXP tSEXP, SEXP hydrparSEXP, SEXP nxSEXP, SEXP nySEXP, SEXP xminSEXP, SEXP xmaxSEXP, SEXP yminSEXP, SEXP ymaxSEXP) {
Expand Down Expand Up @@ -734,6 +755,7 @@ static const R_CallMethodDef CallEntries[] = {
{"_pumpingtest_papadopulos_solution_space", (DL_FUNC) &_pumpingtest_papadopulos_solution_space, 11},
{"_pumpingtest_hantush_jacob_solution_space", (DL_FUNC) &_pumpingtest_hantush_jacob_solution_space, 11},
{"_pumpingtest_general_radial_flow_solution_space", (DL_FUNC) &_pumpingtest_general_radial_flow_solution_space, 11},
{"_pumpingtest_agarwal_skin_solution_space", (DL_FUNC) &_pumpingtest_agarwal_skin_solution_space, 11},
{"_pumpingtest_space_calculation_via_string", (DL_FUNC) &_pumpingtest_space_calculation_via_string, 12},
{"_pumpingtest_infinite_aquifer_calculate_drawdown_cpp", (DL_FUNC) &_pumpingtest_infinite_aquifer_calculate_drawdown_cpp, 12},
{"_pumpingtest_constant_head_theis_well_function_cpp", (DL_FUNC) &_pumpingtest_constant_head_theis_well_function_cpp, 5},
Expand Down
36 changes: 32 additions & 4 deletions src/pumpingtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ NumericVector boulton_solution_space(const double& Q, const double& x0,
alpha1 = hydrpar[3];
sigma(1) = Ss/Sy;
phi = (alpha1*dist*dist*Ss)/(Tr);
u = (Ss*dist)/(4.0*Tr*t);
u = (Ss*dist*dist)/(4.0*Tr*t);
td = 1.0/u;
par3(1)=0.0;
W = boulton_well_function_vector_cpp(td, phi, sigma, par3);
Expand All @@ -772,7 +772,7 @@ NumericVector papadopulos_solution_space(const double& Q, const double& x0,
Ss = hydrpar[1];
rw = hydrpar[2];
rc = hydrpar[3];
u = (Ss*dist)/(4.0*Tr*t);
u = (Ss*dist*dist)/(4.0*Tr*t);
cd(1) = std::pow(rw, 2)*Ss/std::pow(rc, 2);
rho = dist/rw;
td = 1.0/u;
Expand All @@ -798,7 +798,7 @@ NumericVector hantush_jacob_solution_space(const double& Q, const double& x0,
Ss = hydrpar[1];
K = hydrpar[2];
b = hydrpar[3];
u = (Ss*dist)/(4.0*Tr*t);
u = (Ss*dist*dist)/(4.0*Tr*t);
beta = std::sqrt(K/(b*Tr))*dist;
td = 1.0/u;
W=hantush_jacob_well_function_vector_cpp(td, beta, 0.0, 0.0);
Expand Down Expand Up @@ -826,13 +826,41 @@ NumericVector general_radial_flow_solution_space(const double& Q,
Ss = hydrpar[1];
n = hydrpar[2];
rd = hydrpar[3];
u = (Ss*dist)/(4.0*Tr*t);
u = (Ss*dist*dist)/(4.0*Tr*t);
td = 1.0/u;
W = general_radial_flow_well_function_cpp(td, n, rd, 0.0);
drawdown = (Q/(4.0*M_PI*Tr))*W;
return(drawdown);
}
//
// [[Rcpp::export]]
NumericVector agarwal_skin_solution_space(const double& Q,
const double& x0,
const double& y0,
const double& t,
NumericVector hydrpar,
const int& nx,
const int& ny,
const double& xmin,
const double& xmax,
const double& ymin,
const double& ymax){
NumericVector dist(nx*ny), u(nx*ny), td(nx*ny), drawdown(nx*ny);
dist = calculate_distance_well(x0,y0,nx,ny,xmin,xmax,ymin,ymax);
double Tr, Ss, cd, rd, sigma;
NumericVector W(nx*ny),rho(nx*ny),beta(nx*ny);
Tr = hydrpar[0];
Ss = hydrpar[1];
cd = hydrpar[2];
rd = hydrpar[3];
sigma = hydrpar[4];
u = (Ss*dist*dist)/(4.0*Tr*t);
td = 1.0/u;
W = agarwal_skin_well_function_cpp(td, cd, rd, sigma);
drawdown = (Q/(4.0*M_PI*Tr))*W;
return(drawdown);
}
//
//
typedef NumericVector (*spacefuncPtr)(const double& Q,
const double& x0,
Expand Down

0 comments on commit f9929c1

Please sign in to comment.