mirror of
https://git.gfz-potsdam.de/naaice/poet.git
synced 2025-12-15 12:28:22 +01:00
dolo_interp benchmark for naa-naaice
This commit is contained in:
parent
3a83ca1346
commit
cb01ce3d67
@ -1,9 +1,11 @@
|
|||||||
SOLUTION 1
|
SOLUTION 1
|
||||||
units mol/kgw
|
units mol/kgw
|
||||||
water 1
|
water 1
|
||||||
temperature 25
|
temperature 25
|
||||||
pH 7
|
pH 7
|
||||||
pe 4
|
pe 4
|
||||||
|
Mg 1E-12
|
||||||
|
Cl 2E-12
|
||||||
PURE 1
|
PURE 1
|
||||||
Calcite 0.0 1
|
Calcite 0.0 1
|
||||||
END
|
END
|
||||||
@ -41,3 +43,7 @@ SOLUTION 4
|
|||||||
Mg 0.002
|
Mg 0.002
|
||||||
Cl 0.004
|
Cl 0.004
|
||||||
END
|
END
|
||||||
|
|
||||||
|
RUN_CELLS
|
||||||
|
-cells 2 3 4
|
||||||
|
END
|
||||||
|
|||||||
@ -1,15 +1,15 @@
|
|||||||
rows <- 400
|
rows <- 200
|
||||||
cols <- 200
|
cols <- 400
|
||||||
|
|
||||||
grid_def <- matrix(2, nrow = rows, ncol = cols)
|
grid_def <- matrix(2, nrow = rows, ncol = cols)
|
||||||
|
|
||||||
# Define grid configuration for POET model
|
## Define grid configuration for POET model
|
||||||
grid_setup <- list(
|
grid_setup <- list(
|
||||||
pqc_in_file = "./dol.pqi",
|
pqc_in_file = "./dol.pqi",
|
||||||
pqc_db_file = "./phreeqc_kin.dat", # Path to the database file for Phreeqc
|
pqc_db_file = "./phreeqc_kin.dat",
|
||||||
grid_def = grid_def, # Definition of the grid, containing IDs according to the Phreeqc input script
|
grid_def = grid_def,
|
||||||
grid_size = c(2.5, 5), # Size of the grid in meters
|
grid_size = c(5, 2.5),
|
||||||
constant_cells = c() # IDs of cells with constant concentration
|
constant_cells = c()
|
||||||
)
|
)
|
||||||
|
|
||||||
bound_def_we <- list(
|
bound_def_we <- list(
|
||||||
@ -41,29 +41,29 @@ diffusion_setup <- list(
|
|||||||
)
|
)
|
||||||
|
|
||||||
check_sign_cal_dol_dht <- function(old, new) {
|
check_sign_cal_dol_dht <- function(old, new) {
|
||||||
# if ((old["Calcite"] == 0) != (new["Calcite"] == 0)) {
|
## if ((old["Calcite"] == 0) != (new["Calcite"] == 0)) {
|
||||||
# return(TRUE)
|
## return(TRUE)
|
||||||
# }
|
## }
|
||||||
# if ((old["Dolomite"] == 0) != (new["Dolomite"] == 0)) {
|
## if ((old["Dolomite"] == 0) != (new["Dolomite"] == 0)) {
|
||||||
# return(TRUE)
|
## return(TRUE)
|
||||||
# }
|
## }
|
||||||
return(FALSE)
|
return(FALSE)
|
||||||
}
|
}
|
||||||
|
|
||||||
# fuzz_input_dht_keys <- function(input) {
|
## fuzz_input_dht_keys <- function(input) {
|
||||||
# dht_species <- c(
|
## dht_species <- c(
|
||||||
# "H" = 3,
|
## "H" = 3,
|
||||||
# "O" = 3,
|
## "O" = 3,
|
||||||
# "Charge" = 3,
|
## "Charge" = 3,
|
||||||
# "C" = 6,
|
## "C" = 6,
|
||||||
# "Ca" = 6,
|
## "Ca" = 6,
|
||||||
# "Cl" = 3,
|
## "Cl" = 3,
|
||||||
# "Mg" = 5,
|
## "Mg" = 5,
|
||||||
# "Calcite" = 4,
|
## "Calcite" = 4,
|
||||||
# "Dolomite" = 4
|
## "Dolomite" = 4
|
||||||
# )
|
## )
|
||||||
# return(input[names(dht_species)])
|
## return(input[names(dht_species)])
|
||||||
# }
|
## }
|
||||||
|
|
||||||
check_sign_cal_dol_interp <- function(to_interp, data_set) {
|
check_sign_cal_dol_interp <- function(to_interp, data_set) {
|
||||||
dht_species <- c(
|
dht_species <- c(
|
||||||
@ -74,32 +74,32 @@ check_sign_cal_dol_interp <- function(to_interp, data_set) {
|
|||||||
"Ca" = 6,
|
"Ca" = 6,
|
||||||
"Cl" = 3,
|
"Cl" = 3,
|
||||||
"Mg" = 5,
|
"Mg" = 5,
|
||||||
"Calcite" = 4,
|
"Calcite_kin" = 4,
|
||||||
"Dolomite" = 4
|
"Dolomite_kin" = 4
|
||||||
)
|
)
|
||||||
data_set <- as.data.frame(do.call(rbind, data_set), check.names = FALSE, optional = TRUE)
|
data_set <- as.data.frame(do.call(rbind, data_set), check.names = FALSE, optional = TRUE)
|
||||||
names(data_set) <- names(dht_species)
|
names(data_set) <- names(dht_species)
|
||||||
cal <- (data_set$Calcite == 0) == (to_interp["Calcite"] == 0)
|
cal <- (data_set$Calcite_kin == 0) == (to_interp["Calcite_kin"] == 0)
|
||||||
dol <- (data_set$Dolomite == 0) == (to_interp["Dolomite"] == 0)
|
dol <- (data_set$Dolomite_kin == 0) == (to_interp["Dolomite_kin"] == 0)
|
||||||
|
|
||||||
cal_dol_same_sig <- cal == dol
|
cal_dol_same_sig <- cal == dol
|
||||||
return(rev(which(!cal_dol_same_sig)))
|
return(rev(which(!cal_dol_same_sig)))
|
||||||
}
|
}
|
||||||
|
|
||||||
check_neg_cal_dol <- function(result) {
|
check_neg_cal_dol <- function(result) {
|
||||||
neg_sign <- (result["Calcite"] < 0) || (result["Dolomite"] < 0)
|
neg_sign <- (result["Calcite_kin"] < 0) || (result["Dolomite_kin"] < 0)
|
||||||
return(neg_sign)
|
return(neg_sign)
|
||||||
}
|
}
|
||||||
|
|
||||||
# Optional when using Interpolation (example with less key species and custom
|
## Optional when using Interpolation (example with less key species
|
||||||
# significant digits)
|
## and custom significant digits)
|
||||||
|
|
||||||
pht_species <- c(
|
pht_species <- c(
|
||||||
"C" = 3,
|
"C" = 3,
|
||||||
"Ca" = 3,
|
"Ca" = 3,
|
||||||
"Mg" = 2,
|
"Mg" = 2,
|
||||||
"Calcite" = 2,
|
"Calcite_kin" = 2,
|
||||||
"Dolomite" = 2
|
"Dolomite_kin" = 2
|
||||||
)
|
)
|
||||||
|
|
||||||
chemistry_setup <- list(
|
chemistry_setup <- list(
|
||||||
@ -111,21 +111,21 @@ chemistry_setup <- list(
|
|||||||
"Ca" = 6,
|
"Ca" = 6,
|
||||||
"Cl" = 3,
|
"Cl" = 3,
|
||||||
"Mg" = 5,
|
"Mg" = 5,
|
||||||
"Calcite" = 4,
|
"Calcite_kin" = 4,
|
||||||
"Dolomite" = 4
|
"Dolomite_kin" = 4
|
||||||
),
|
),
|
||||||
pht_species = pht_species,
|
pht_species = pht_species,
|
||||||
hooks = list(
|
hooks = list(
|
||||||
dht_fill = check_sign_cal_dol_dht,
|
dht_fill = check_sign_cal_dol_dht,
|
||||||
# dht_fuzz = fuzz_input_dht_keys,
|
## dht_fuzz = fuzz_input_dht_keys,
|
||||||
interp_pre = check_sign_cal_dol_interp,
|
interp_pre = check_sign_cal_dol_interp,
|
||||||
interp_post = check_neg_cal_dol
|
interp_post = check_neg_cal_dol
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
# Define a setup list for simulation configuration
|
## Define a setup list for simulation configuration
|
||||||
setup <- list(
|
setup <- list(
|
||||||
Grid = grid_setup, # Parameters related to the grid structure
|
Grid = grid_setup, ## Parameters related to the grid structure
|
||||||
Diffusion = diffusion_setup, # Parameters related to the diffusion process
|
Diffusion = diffusion_setup, ## Parameters related to the diffusion process
|
||||||
Chemistry = chemistry_setup # Parameters related to the chemistry process
|
Chemistry = chemistry_setup ## Parameters related to the chemistry process
|
||||||
)
|
)
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
iterations <- 20000
|
iterations <- 2000
|
||||||
dt <- 200
|
dt <- 200
|
||||||
|
|
||||||
out_save <- seq(50, iterations, by = 50)
|
out_save <- c(1, 5, 10, seq(20, iterations, by = 20))
|
||||||
|
|
||||||
list(
|
list(
|
||||||
timesteps = rep(dt, iterations),
|
timesteps = rep(dt, iterations),
|
||||||
|
|||||||
10
bench/dolo/dolo_interp_rt_dt2000.R
Normal file
10
bench/dolo/dolo_interp_rt_dt2000.R
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
iterations <- 2000
|
||||||
|
dt <- 200
|
||||||
|
|
||||||
|
out_save <- c(1, 5, 10, seq(20, iterations, by = 20))
|
||||||
|
|
||||||
|
list(
|
||||||
|
timesteps = rep(dt, iterations),
|
||||||
|
store_result = TRUE,
|
||||||
|
out_save = out_save
|
||||||
|
)
|
||||||
Loading…
x
Reference in New Issue
Block a user