Run configuration with VS2dh model
vs2di.runConfig(conf, engine = "vs2dh", tDir = tempdir(), returnOutput = TRUE, openTargetDir = TRUE, showWarnings = TRUE, dbgRun = TRUE, dbg = TRUE)
conf | as retrieved by vs2dh.ReadConfig (i.e. importing a working VS2DH configuration from an vs2h.dat file) or completley in R using function vs2dh.Configure() (ATTENTION: DEFAULT PARAMETERISATION FOR vs2dh.Configure() CURRENTLY YIELDS NO RUNNING VS2DH MODEL CONFIGURATION) |
---|---|
engine | model engine 'vs2dh' (for flow & heat modelling) or 'vs2dt' (for flow & solute transport) (Default: "vs2dh") |
tDir | target directory where vs2dh model input/output files should be stored. (Default: tempdir()) |
returnOutput | if TRUE model output files variables.out, balance.out and obsPoints.out are imported into R completely; vs2dh.out (only warnings imported) (Default: TRUE) |
openTargetDir | If TRUE path containing model files will be opened in explorer (Default: FALSE) |
showWarnings | if TRUE print warning messages during simulation on screen (default: TRUE) |
dbgRun | if true text output on screen on model run progress |
dbg | if true text output on screen on additional model run progress |
Import & write VS2dh model results in R object
if (FALSE) { ### Testing import and writing functions with ### Folder which contains the subfolders with the different models to test: model.main.path <- system.file("extdata", "vs2dh_example", package = "kwb.vs2dh") #### Using vs2dh.dat file contained in subfolders example1, example2, tutorial1 #### for testing (i.e. ignore example3 due to long run time, but this also works!) exampleModels <- c(paste0("example", 1:2), "tutorial1") ### Create result list in R for storing model outputs for each model in a separate ### sublist res <- list() #### Loop through all example model input files & plot temperature distribution for (testModel in exampleModels) { model.path <- file.path(model.main.path, testModel) cat(sprintf("Testing model in %s\n", model.path )) cat("1.Step: importing configuration to R.....") conf <- vs2dh.ReadConfig(model.path = model.path) cat("Done!") cat("2.Step: Run vs2di.runConfig():") tDir <- file.path(tempdir(), testModel) res[[testModel]] <- vs2di.runConfig(conf = conf, tDir = tDir) cat("3.Step: Plot temperature distribution...") vs2dh.plotVariables(para = "Temp", data = res[[testModel]]$variables, main = testModel ### nice label by using model folder name ) cat("Done!") } }