This is the classical and simple example of predicting production in a reservoir given an OOIP.
We use a simple function to get the MBAl model filename. This function can be later generalized to retrieve any model type.
Now, we open the MBAL model using the function shown above.
Let’s keep in mind that MBAL opens files a little bit different. The filename needs to be surrounded with double quotes ", not single quotes ' as in Prosper or GAP. We make that slight change and open the model.
# MBAL opens files a little bit different. The filename needs to be surrounded with
# double quote not single quotes as in Prosper or GAP.
model_file <- get_mbal_model(model = "oil.mbi")
print(model_file)
#> [1] "C:/Users/ipm/AppData/Local/Temp/RtmpY9Lvax/temp_libpath12c47481070/rOpenserver/models/oil.mbi"
open_cmd <- 'MBAL.OPENFILE'
open_cmd <- paste0(open_cmd, '("', model_file, '")')
print(open_cmd)
#> [1] "MBAL.OPENFILE(\"C:/Users/ipm/AppData/Local/Temp/RtmpY9Lvax/temp_libpath12c47481070/rOpenserver/models/oil.mbi\")"
DoCmd(mbal_server, open_cmd) # using S3 dispatch of R6 class