Input formats
It is also possible to read cases that have been set up in MRST (see setup_case_from_mrst and simulate_mrst_case) or from .DATA files (see setup_case_from_data_file and simulate_data_file)
setup_case_from_afi
DATA-files from commercial reservoir modelling software
JutulDarcy can set up cases from Eclipse and Intersect type input files by making use of the GeoEnergyIO.jl package for parsing. This package is a direct dependency of JutulDarcy and these cases can be simulated directly. If you want to parse the input files and possibly modify them in your Julia session before the case is simulated, we refer you to the GeoEnergyIO Documentation.
If you want to directly simulate a file from disk, you can sue the high level functions that automatically parse the files for you:
JutulDarcy.simulate_data_file Function
simulate_data_file(inp; parse_arg = NamedTuple(), kwarg...)Simulate standard input file (with extension .DATA). inp can either be the output from the GeoEnergyIO function parse_data_file or a String for the path of an input file with the .DATA extension.
Additional arguments are passed onto simulate_reservoir. Extra inputs to the parser can be sent as a setup_arg NamedTuple.
JutulDarcy.setup_case_from_data_file Function
case = setup_case_from_data_file(
filename;
parse_arg = NamedTuple(),
kwarg...
)
case, data = setup_case_from_data_file(filename; include_data = true)Set up a JutulCase from a standard input file (with extension .DATA). Additional arguments to the parser can be passed as key/values in a NamedTuple given as parse_arg. The optional input include_data=true will make the function return the parsed data in addition the case itself. Additional keyword arguments are passed on to setup_case_from_parsed_data.
OPM CO2STORE/CO2STOR decks without dissolution or vaporization keywords default to immiscible CO2-brine physics. Set co2_physics=:kvalue to override this and allow both dissolution and vaporization.
Surface-rate GCONPROD and GCONINJE controls are mapped to well groups, including individual well limits and GRUPTREE ancestor lookup. Production groups are named <group>_PRODUCTION, and injection groups <group>_<phase>. Nested group constraints, dynamic allocation-group membership, guide-rate overrides and reservoir-volume group controls are not supported. Additional water, gas or liquid RATE constraints require explicit exceed procedures; defaulted and explicit NONE procedures are currently indistinguishable in the parser. Constraints under NONE control are not supported.
JutulDarcy.AFISetup.setup_case_from_afi Function
case = setup_case_from_afi(afi_path)
case = setup_case_from_afi(afi_dict)
case = setup_case_from_afi(afi, reservoir = existing_reservoir)Set up a JutulCase from an AFI input file. The input can be provided either as a file path to the AFI file or as a dictionary representation of the AFI input (from read_afi_file in GeoEnergyIO).
The parser requires that the mesh and mesh properties are either provided inline (i.e. as direct keywords with numbers) or in the RESQML format. GSG files are not currently supported.
Keyword arguments
step_limit: An optional limit on the number of simulation steps to set up.step_override: An optional vector of time points (in seconds) to override the simulation steps defined in the AFI file. If provided, the simulation will use these time points as the time steps. If the time points are normalized (i.e. in the range [0, 1]), setstep_override_is_normalizedto true.step_override_is_normalized: A boolean indicating whether thestep_overridetime points are normalized (i.e. in the range [0, 1]). Defaults to false.reservoir: An optional existing reservoir domain to use instead of setting up a new one from the AFI file.
JutulDarcy.setup_case_from_parsed_data Function
setup_case_from_parsed_data(datafile; skip_wells = false, simple_well = true, use_ijk_trans = true, verbose = false, kwarg...)Set up a case from a parsed input file (in Dict format). Internal function, not exported. Use setup_case_from_data_file.
JutulDarcy.convert_co2store_to_co2_brine Function
convert_co2store_to_co2_brine(data; verbose = true)Converts a CO2STORE data file to a co2-brine model. The PVT correlations can differ from those used by the original simulator.
sourceReservoir simulator input files are highly complex and contain a great number of different keywords. JutulDarcy and GeoEnergyIO has extensive support for this format, but many keywords are missing or only partially supported. Sometimes cases can be made to run by removing keywords that do not impact simulation outcomes, or have very little impact. If you want a turnkey open source solution for simulation reservoir models you should also have a look at OPM Flow.
If you can share your input file or the missing keywords in the issues section it may be easier to figure out if a case can be supported.
MAT-files from the Matlab Reservoir Simulation Toolbox (MRST)
Simulation of .MAT files
JutulDarcy.setup_case_from_mrst Function
setup_case_from_mrst("filename.mat"; kwarg...)Set up a Jutul.JutulCase from a MRST-exported .mat file.
JutulDarcy.simulate_mrst_case Function
ws, states = simulate_mrst_case(file_name)
simulate_mrst_case(file_name; <keyword arguments>)Simulate a MRST case from file_name as exported by writeJutulInput in MRST.
Arguments
file_name::String: The path to a.mator.datafile that is to be simulated.
Keyword arguments
extra_outputs::Vector{Symbol} = [:Saturations]: Additional variables to output from the simulation.write_output::Bool = true: Write output (in the default JLD2 format)output_path = nothing: Directory for output files. Files will be written under this directory. Defaults to the folder offile_name.write_mrst = true: Write MRST compatible output after completed simulation that can be read byreadJutulOutputin MRST.backend=:csc: choice of backend for linear systems.:cscfor default Julia sparse,:csrfor experimental parallel CSR.verbose=true: print some extra information specific to this routine upon callingnthreads=Threads.nthreads(): number of threads to uselinear_solver=:bicgstab: name of Krylov.jl solver to use, or :direct (for small cases only)info_level=0: standard Jutul info_level. 0 for minimal printing, -1 for no printing, 1-5 for various levels of verbosity
Additional input arguments are passed onto, setup_case_from_mrst, setup_reservoir_simulator and simulator_config if applicable.
MRST-specific types
Jutul.MRSTWrapMesh Type
MRSTWrapMesh(G, N = nothing)Mesh that adapts an exported MRST mesh to the Jutul interface. G is assumed to be read directly from file using MAT.matread. The raw exported grid can be found under the data field.
Premade models
SPE10, model 2
JutulDarcy.SPE10.setup_case Function
JutulDarcy.SPE10.setup_case()
JutulDarcy.SPE10.setup_case(layers = 1:5, num_steps = 200)
JutulDarcy.SPE10.setup_case(layers = 1:5, tiling = (2, 3, 1))Set up the SPE10, model2, benchmark case. This model is a 1.1 million cell nearly incompressible oil-water model with highly heterogenous static properties (permeability/porosity).
tiling = (tilex, tiley, tilez) repeats the selected layers and static properties in each direction. Each horizontal tile has an injector at its center, with producers shared at tile corners to avoid adjacent wells at tile boundaries. Vertical wells span all repeated layers.
Pass system to use a custom fluid system without installing the SPE10 relative permeability or PVT functions. equil can be an EquilibriumRegion or a function model -> EquilibriumRegion(model, ...). forces_arg forwards keyword arguments to setup_well_forces, including a custom injection_control.
There are also a number of examples (SPE1, SPE9, EGG, OLYMPUS, Norne, ...) with input files included in the validation suite, starting at Validation overview.