fix: updated bench/barite/{barite.R, barite_interp_eval.R}, added bench/barite/barite_200.R

This commit is contained in:
Marco De Lucia 2024-01-12 12:50:54 +01:00
parent 433f095f58
commit 0b14de480b
3 changed files with 209 additions and 84 deletions

View File

@ -1,5 +1,4 @@
## Time-stamp: "Last modified 2023-08-02 13:59:22 mluebke" ## Time-stamp: "Last modified 2024-01-12 12:39:14 delucia"
database <- normalizePath("../share/poet/bench/barite/db_barite.dat") database <- normalizePath("../share/poet/bench/barite/db_barite.dat")
input_script <- normalizePath("../share/poet/bench/barite/barite.pqi") input_script <- normalizePath("../share/poet/bench/barite/barite.pqi")
@ -16,11 +15,11 @@ types <- c("scratch", "phreeqc", "rds")
init_cell <- list( init_cell <- list(
"H" = 110.0124, "H" = 110.0124,
"O" = 55.5087, "O" = 55.5087,
"Charge" = -1.217E-09, "Charge" = -1.216307845207e-09,
"Ba" = 1.E-10, "Ba" = 1.E-12,
"Cl" = 2.E-10, "Cl" = 2.E-12,
"S" = 6.205E-4, "S(6)" = 6.204727095976e-04,
"Sr" = 6.205E-4, "Sr" = 6.204727095976e-04,
"Barite" = 0.001, "Barite" = 0.001,
"Celestite" = 1 "Celestite" = 1
) )
@ -28,7 +27,11 @@ init_cell <- list(
grid <- list( grid <- list(
n_cells = c(n, m), n_cells = c(n, m),
s_cells = c(1, 1), s_cells = c(1, 1),
type = types[1] type = types[1],
init_cell = as.data.frame(init_cell, check.names = FALSE),
props = names(init_cell),
database = database,
input_script = input_script
) )
@ -40,26 +43,20 @@ grid <- list(
## initial conditions ## initial conditions
init_diffu <- list( init_diffu <- list(
#"H" = 110.0124, "H" = 110.0124,
"H" = 0.00000028904, "O" = 55.5087,
#"O" = 55.5087, "Charge" = -1.216307845207e-09,
"O" = 0.000000165205, "Ba" = 1.E-12,
#"Charge" = -1.217E-09, "Cl" = 2.E-12,
"Charge" = -3.337E-08, "S(6)" = 6.204727095976e-04,
"Ba" = 1.E-10, "Sr" = 6.204727095976e-04
"Cl" = 1.E-10,
"S(6)" = 6.205E-4,
"Sr" = 6.205E-4
) )
injection_diff <- list( injection_diff <- list(
list( list(
#"H" = 111.0124, "H" = 111.0124,
"H" = 0.0000002890408, "O" = 55.50622,
#"O" = 55.50622, "Charge" = -3.336970273297e-08,
"O" = 0.00002014464,
#"Charge" = -3.337E-08,
"Charge" = -3.337000004885E-08,
"Ba" = 0.1, "Ba" = 0.1,
"Cl" = 0.2, "Cl" = 0.2,
"S(6)" = 0, "S(6)" = 0,
@ -84,11 +81,12 @@ alpha_diffu <- c(
## ) ## )
boundary <- list( boundary <- list(
"N" = rep(1, n), "N" = c(1,1, rep(0, n-2)),
## "N" = rep(0, n), ## "N" = rep(0, n),
"E" = rep(0, n), "E" = rep(0, n),
"S" = rep(0, n), "S" = rep(0, n),
"W" = rep(0, n) # "W" = rep(0, n)
"W" = c(1,1, rep(0, n-2))
) )
diffu_list <- names(alpha_diffu) diffu_list <- names(alpha_diffu)
@ -112,15 +110,19 @@ diffusion <- list(
## # Needed when using DHT ## # Needed when using DHT
dht_species <- c( dht_species <- c(
"H" = 10, "H" = 7,
"O" = 10, "O" = 7,
"Charge" = 3, "Charge" = 4,
"Ba" = 5, "Ba" = 7,
"Cl" = 5, "Cl" = 7,
"S(6)" = 5, "S(6)" = 7,
"Sr" = 5 "Sr" = 7,
"Barite" = 4,
"Celestite" = 4
) )
chemistry <- list( chemistry <- list(
database = database, database = database,
input_script = input_script, input_script = input_script,

138
bench/barite/barite_200.R Normal file
View File

@ -0,0 +1,138 @@
## Time-stamp: "Last modified 2024-01-12 12:49:03 delucia"
database <- normalizePath("../share/poet/bench/barite/db_barite.dat")
input_script <- normalizePath("../share/poet/bench/barite/barite.pqi")
## database <- normalizePath("/home/work/simR/Rphree/poetsims/Sims/Hans/db_barite.dat")
## input_script <- normalizePath("/home/work/simR/Rphree/poetsims/Sims/Hans/barite.pqi")
#################################################################
## Section 1 ##
## Grid initialization ##
#################################################################
n <- 200
m <- 200
init_cell <- list(
"H" = 110.0124,
"O" = 55.5087,
"Charge" = -1.216307845207e-09,
"Ba" = 1.E-12,
"Cl" = 2.E-12,
"S(6)" = 6.204727095976e-04,
"Sr" = 6.204727095976e-04,
"Barite" = 0.001,
"Celestite" = 1
)
grid <- list(
n_cells = c(n, m),
s_cells = c(1, 1),
type = "scratch",
init_cell = as.data.frame(init_cell, check.names = FALSE),
props = names(init_cell),
database = database,
input_script = input_script
)
##################################################################
## Section 2 ##
## Diffusion parameters and boundary conditions ##
##################################################################
## initial conditions
init_diffu <- list(
"H" = 110.0124,
"O" = 55.5087,
"Charge" = -1.216307845207e-09,
"Ba" = 1.E-12,
"Cl" = 2.E-12,
"S(6)" = 6.204727095976e-04,
"Sr" = 6.204727095976e-04
)
injection_diff <- list(
list(
"H" = 111.0124,
"O" = 55.50622,
"Charge" = -3.336970273297e-08,
"Ba" = 0.1,
"Cl" = 0.2,
"S(6)" = 0,
"Sr" = 0)
)
## diffusion coefficients
alpha_diffu <- c(
"H" = 1E-06,
"O" = 1E-06,
"Charge" = 1E-06,
"Ba" = 1E-06,
"Cl" = 1E-06,
"S(6)" = 1E-06,
"Sr" = 1E-06
)
boundary <- list(
"N" = c(1,1, rep(0, n-2)),
"E" = rep(0, n),
"S" = rep(0, n),
"W" = c(1,1, rep(0, n-2))
)
diffu_list <- names(alpha_diffu)
vecinj <- do.call(rbind.data.frame, injection_diff)
names(vecinj) <- names(init_diffu)
diffusion <- list(
init = as.data.frame(init_diffu, check.names = FALSE),
vecinj = vecinj,
vecinj_index = boundary,
alpha = alpha_diffu
)
#################################################################
## Section 3 ##
## Chemistry module (Phreeqc) ##
#################################################################
## DHT significant digits
dht_species <- c(
"H" = 7,
"O" = 7,
"Charge" = 4,
"Ba" = 7,
"Cl" = 7,
"S(6)" = 7,
"Sr" = 7,
"Barite" = 4,
"Celestite" = 4
)
chemistry <- list(
database = database,
input_script = input_script,
dht_species = dht_species
)
#################################################################
## Section 4 ##
## Putting all those things together ##
#################################################################
iterations <- 50
dt <- 100
setup <- list(
grid = grid,
diffusion = diffusion,
chemistry = chemistry,
iterations = iterations,
timesteps = rep(dt, iterations),
store_result = TRUE,
out_save = seq(1, iterations)
## out_save = c(1, 5, 10, seq(50, iterations, by=50))
)

View File

@ -1,4 +1,4 @@
## Time-stamp: "Last modified 2023-07-21 15:04:49 mluebke" ## Time-stamp: "Last modified 2024-01-12 11:35:11 delucia"
database <- normalizePath("../share/poet/bench/barite/db_barite.dat") database <- normalizePath("../share/poet/bench/barite/db_barite.dat")
input_script <- normalizePath("../share/poet/bench/barite/barite.pqi") input_script <- normalizePath("../share/poet/bench/barite/barite.pqi")
@ -16,18 +16,18 @@ types <- c("scratch", "phreeqc", "rds")
init_cell <- list( init_cell <- list(
"H" = 110.0124, "H" = 110.0124,
"O" = 55.5087, "O" = 55.5087,
"Charge" = -1.217E-09, "Charge" = -1.216307845207e-09,
"Ba" = 1.E-10, "Ba" = 1.E-12,
"Cl" = 2.E-10, "Cl" = 2.E-12,
"S" = 6.205E-4, "S(6)" = 6.204727095976e-04,
"Sr" = 6.205E-4, "Sr" = 6.204727095976e-04,
"Barite" = 0.001, "Barite" = 0.001,
"Celestite" = 1 "Celestite" = 1
) )
grid <- list( grid <- list(
n_cells = c(n, m), n_cells = c(n, m),
s_cells = c(n / 10, m / 10), s_cells = c(1, 1),
type = types[1], type = types[1],
init_cell = as.data.frame(init_cell, check.names = FALSE), init_cell = as.data.frame(init_cell, check.names = FALSE),
props = names(init_cell), props = names(init_cell),
@ -44,56 +44,42 @@ grid <- list(
## initial conditions ## initial conditions
init_diffu <- list( init_diffu <- list(
# "H" = 110.0124, "H" = 110.0124,
"H" = 0.00000028904, "O" = 55.5087,
# "O" = 55.5087, "Charge" = -1.216307845207e-09,
"O" = 0.000000165205, "Ba" = 1.E-12,
# "Charge" = -1.217E-09, "Cl" = 2.E-12,
"Charge" = -3.337E-08, "S(6)" = 6.204727095976e-04,
"Ba" = 1.E-10, "Sr" = 6.204727095976e-04
"Cl" = 1.E-10,
"S(6)" = 6.205E-4,
"Sr" = 6.205E-4
) )
injection_diff <- list( injection_diff <- list(
list( list(
# "H" = 111.0124, "H" = 111.0124,
"H" = 0.0000002890408, "O" = 55.50622,
# "O" = 55.50622, "Charge" = -3.336970273297e-08,
"O" = 0.00002014464, "Ba" = 0.1,
# "Charge" = -3.337E-08, "Cl" = 0.2,
"Charge" = -3.337000004885E-08, "S(6)" = 0,
"Ba" = 0.1, "Sr" = 0)
"Cl" = 0.2,
"S(6)" = 0,
"Sr" = 0
)
) )
## diffusion coefficients ## diffusion coefficients
alpha_diffu <- c( alpha_diffu <- c(
"H" = 1E-06, "H" = 1E-06,
"O" = 1E-06, "O" = 1E-06,
"Charge" = 1E-06, "Charge" = 1E-06,
"Ba" = 1E-06, "Ba" = 1E-06,
"Cl" = 1E-06, "Cl" = 1E-06,
"S(6)" = 1E-06, "S(6)" = 1E-06,
"Sr" = 1E-06 "Sr" = 1E-06
) )
vecinj_inner <- list(
l1 = c(1, floor(n / 2), floor(m / 2))
## l2 = c(2,80,80),
## l3 = c(2,60,80)
)
boundary <- list( boundary <- list(
# "N" = rep(1, n), "N" = c(1,1, rep(0, n-2)),
"N" = rep(0, n),
"E" = rep(0, n), "E" = rep(0, n),
"S" = rep(0, n), "S" = rep(0, n),
"W" = rep(0, n) "W" = c(1,1, rep(0, n-2))
) )
diffu_list <- names(alpha_diffu) diffu_list <- names(alpha_diffu)
@ -104,7 +90,6 @@ names(vecinj) <- names(init_diffu)
diffusion <- list( diffusion <- list(
init = as.data.frame(init_diffu, check.names = FALSE), init = as.data.frame(init_diffu, check.names = FALSE),
vecinj = vecinj, vecinj = vecinj,
vecinj_inner = vecinj_inner,
vecinj_index = boundary, vecinj_index = boundary,
alpha = alpha_diffu alpha = alpha_diffu
) )
@ -116,13 +101,15 @@ diffusion <- list(
## # Needed when using DHT ## # Needed when using DHT
dht_species <- c( dht_species <- c(
"H" = 10, "H" = 7,
"O" = 10, "O" = 7,
"Charge" = 3, "Charge" = 4,
"Ba" = 5, "Ba" = 7,
"Cl" = 5, "Cl" = 7,
"S(6)" = 5, "S(6)" = 7,
"Sr" = 5 "Sr" = 7,
"Barite" = 4,
"Celestite" = 4
) )
chemistry <- list( chemistry <- list(
@ -135,8 +122,6 @@ chemistry <- list(
## Section 4 ## ## Section 4 ##
## Putting all those things together ## ## Putting all those things together ##
################################################################# #################################################################
iterations <- 200 iterations <- 200
dt <- 250 dt <- 250