Configuration file
The following configuration file is available in the examples folder in the GitHub repository as co2.txt and in the examples documentation section the simulation results are shown.
The first input parameter in the configuration file is:
1"""Set the full path to the flow executable and flags"""
2flow --enable-opm-rst-file=true
If flow is not in your path, then write the full path to the executable (e.g., /Users/dmar/Github/opm/build/opm-simulators/bin/flow). We also add in the same line as many flags as required (see the OPM Flow documentation here).
Note
If you have installed flow with MPI support, then you can run the simulations in parallel by adding mpirun -np N flow … where N is the number of cpus.
Reservoir-related parameters
The following input lines are:
4"""Set the model parameters"""
5co2store base #Model (co2store/h2store/co2eor/saltprec) and name of the template file (see src/pyopmnearwell/templates/)
6cake 60 #Grid type (core/radial/cake/cartesian2d/cartesian/cpg3d/coord2d/coord3d/tensor2d/tensor3d) and size (input/output pipe length[m]/theta[in degrees]/theta[in degrees]/width[m]/anynumber(the y size is set equal to the x one))
7100 24 #Reservoir dimensions [m] (Lenght and height (diameter for the core geometry))
880 48 2 #Number of x- and z-cells [-] and exponential factor for the telescopic x-gridding (0 to use an equidistance partition)
90.1 0 0 #Well diameter [m], well transmiscibility (0 to use the computed one internally in Flow), and remove the smaller cells than the well diameter
101e7 40 0 #Pressure [Pa] on the top, uniform temperature [°], and initial phase in the reservoir (0 wetting, 1 non-wetting)
111e10 0 #Pore volume multiplier on the boundary [-] (0 to use well producers instead) and deactivate cross flow within the wellbore (see XFLOW in OPM Manual)
121 5 6 #Activate perforations [-], number of perforations [-], and lenght [m]
134 Killough 0 #Number of layers [-], hysteresis (Killough, Carlson, or 0 to neglect it), and econ for the producer (for h2 models)
140 0 0 0 0 0 0 #Ini salt conc [kg/m3], salt sol lim [kg/m3], prec salt den [kg/m3], gamma [-], phi_r [-], npoints [-], threshold [-], and expression ('default' to use the relatinonship in Verma and Pruess 1988 and 'power' to use the one described in the OPM Manual in PERMFACT kewword with phi_r=phi_c/phi_0) (all entries for saltprec)
152-2*mt.cos((2*mt.pi*x/50)) + 10*(x/100)**2 #The function for the reservoir surface
Here we first select the physical model and the corresponding template. To add additional models (e.g., blackoil), one could look at the opm-tests decks, convert the necessary input decks and files to mako templates, add them to the src/pyopmnearwell/templates folder, and extending the Python scripts in the src/pyopmnearwell/utils folder. In the following line we select type of grid and the second entry defines the length of the inlet/outlet tubes for the core, theta aperture for the radial/cake/coord2d/tensord2d grids, the width of the cells for the cartesian2d grid, or it is ignored for the 3D cartesian grids (the width and number of cells is set equal to the ones in the x directions). See/Run the tests/geometries configuration files for these grids. Then we set the length and height of the reservoir (diameter for the core geometry), as well as the number of grid elements in the x and z direction (for the y/theta direction we consider only one element, with exception to the core/3D grids where the width and number of cells is set equal to the ones in the z/x directions). The third entry defines the exponential factor for the telescopic serie used to generate the x partition (if set to 0 then an equidistance partition is generated).
We then define the diameter of the well, the well transmissibility (0 to use the computed one internally in Flow), the reservoir pressure on the top, the initial phase, the factor to multiply the pore volume on the boundaries (0 to add production wells intead), and option to deactivate the XFLOW (see XFLOW in the OPM Manual). On line 12 there is an option to add heterogeinity by adding a defined number of layers around the injection well by a given length. After, the number of different rocks along the z direction is defined as well as the possibility to include hysteresis effects. If the saltprec model is used, then on line 14 we set the parameters as described in the line comment. Finally, there is an option to add a function to include spatial variatons in the geometry in the z direction.
Rock-related parameters
The following entries define the rock related parameters:
17"""Set the saturation functions"""
18krw * ((sw - swi) / (1.0 - sni -swi)) ** nkrw #Wetting rel perm saturation function [-]
19krn * ((1.0 - sw - sni) / (1.0 - sni - swi)) ** nkrn #Non-wetting rel perm saturation function [-]
20pec * ((sw - swi) / (1.0 - swi)) ** (-(1.0 / npe)) #Capillary pressure saturation function [Pa]
In this example we consider properties for the sands number 2 to 5 as described in the 11th SPE CSP:
22"""Properties saturation functions"""
23"""swi [-], sni [-], krn [-], krw [-], pec [Pa], nkrw [-], nkrn [-], npe [-], threshold cP evaluation, ignore swi for cP"""
24SWI2 0.14 SNI2 0.1 KRW2 1 KRN2 1 PRE2 8655 NNKRW2 2 NNKRN2 2 HNPE2 2 THRE2 1e-4 IGN1 0
25SWI3 0.12 SNI3 0.1 KRW3 1 KRN3 1 PRE3 6120 NNKRW3 2 NNKRN3 2 HNPE3 2 THRE3 1e-4 IGN2 0
26SWI4 0.12 SNI4 0.1 KRW4 1 KRN4 1 PRE4 3871 NNKRW4 2 NNKRN4 2 HNPE4 2 THRE4 1e-4 IGN3 0
27SWI5 0.12 SNI5 0.1 KRW5 1 KRN5 1 PRE5 3060 NNKRW5 2 NNKRN5 2 HNPE5 2 THRE5 1e-4 IGN4 0
28SWIP 0 SNIP 0 KRWP 1 KRNP 1 PECP 0 NNKRWP 1 NNKRNP 1 NPEP 1 THREP 1e-4 IGNP 0
29HSWI2 0.28 HSNI2 0.2 HKRW2 1 HKRN2 1 HPRE2 8655 HNKRW2 3 HNKRN2 3 HNPE2 2 HTHRE2 1e-4 HIGN1 0
30HSWI3 0.24 HSNI3 0.2 HKRW3 1 HKRN3 1 HPRE3 6120 HNKRW3 3 HNKRN3 3 HNPE3 2 HTHRE3 1e-4 HIGN2 0
31HSWI4 0.24 HSNI4 0.2 HKRW4 1 HKRN4 1 HPRE4 3871 HNKRW4 3 HNKRN4 3 HNPE4 2 HTHRE4 1e-4 HIGN3 0
32HSWI5 0.24 HSNI5 0.2 HKRW5 1 HKRN5 1 HPRE5 3060 HNKRW5 3 HNKRN5 3 HNPE5 2 HTHRE5 1e-4 HIGN4 0
33HSWIP 0 HSNIP 0 HKRWP 1 HKRNP 1 HPECP 0 HNKRWP 1 HNKRNP 1 HNPEP 1 HTHREP 1e-4 HIGN5 0
Since the ‘activate perforations option’ is set to 1, then we add an extra line after the 4 rock properties to define the ones in the perforations (Line 28). Since the hysteresis option is activated, then the imbibition saturation functions are defined by adding as many additional lines as number of rocks (+1 if the perforations are activated, Lines 29 to 33 in this example).
Now for the rock properties:
35"""Properties rock"""
36"""Kxy [mD], Kz [mD], phi [-], thickness [m]"""
37PERMXY2 101.324 PERMZ2 10.1324 PORO2 0.20 THIC2 6
38PERMXY3 202.650 PERMZ3 20.2650 PORO3 0.20 THIC3 6
39PERMXY4 506.625 PERMZ4 50.6625 PORO4 0.20 THIC4 6
40PERMXY5 1013.25 PERMZ5 101.325 PORO5 0.25 THIC5 6
41PERMXYP 2013.25 PERMZP 201.325 POROP 0.45
As seen from the previous values, the finnest sand corresponds to No. 2 and it gets coarser towards sand No. 5. The last entry define the z size of the layer (the sum should be equal to the second entry of line 7, while for the perforations these have the thickness of one individual cell).
Note
The names for the saturation functions and rock properties are not used in the framework (they are used to ease the visualization of the parameter values in the configuration file, i.e., writing SWIX in line 24 has no impact, so far the name has at least one character since this is used in the reading of the values).
Well-related parameters
Now we proceed to define the schedule for the injection well. Here the injection well is located from the top to the bottom on the left side of the domain and the injection is given as kg/day:
43"""Define the injection values"""
44"""injection time [d], time step size to write results [d], maximum time step [d], injected phase (0 wetting, 1 non-wetting), injection rate [kg/day]"""
457 1e-1 5e-2 1 57611.52
467 1e-1 5e-2 0 57611.52
477 1e-1 5e-2 1 57611.52
Here CO2 (non-wetting phase) is injected for seven days printing the results 70 times and limmiting the time step to 5e-2 days, after water (wetting phase) is injected for the same period at the same mass rate, and finally CO2 is reinjected for the same period.
Warning
Keep the linebreak between the sections in the whole configuration file (in the current implementation this is used for the reading of the parameters).