trans
The trans module can extract transmissibilities (neighbour and non-neigbor-connections) from a simulation grid.
Python API: res2df.trans.df()
Applied on a .DATA file, the trans module will give out a dataframe of neighbour connections
from res2df import trans, ResdataFiles
resdatafiles = ResdataFiles("MYDATADECK.DATA")
dframe = res2df.trans.df(resdatafiles)
I1 |
J1 |
K1 |
TRAN |
I2 |
J2 |
K2 |
DIR |
---|---|---|---|---|---|---|---|
7 |
63 |
2 |
0.16 |
8 |
63 |
2 |
I |
12 |
44 |
3 |
507.75 |
12 |
44 |
4 |
K |
16 |
61 |
5 |
0.24 |
17 |
61 |
5 |
I |
34 |
14 |
10 |
4.58 |
35 |
14 |
10 |
I |
35 |
24 |
3 |
105.97 |
35 |
24 |
4 |
K |
4 |
59 |
11 |
0.88 |
5 |
59 |
11 |
I |
38 |
45 |
3 |
0.21 |
39 |
45 |
3 |
I |
The last column DIR
is the direction of the connection in i-j-k, space, and can
take on the values I
, J
, and K
. The TRAN
column has values from the
TRANX
, TRANY
or TRANZ
in output files.
You can obtain this dataframe as a CSV file by writing this command on the command line:
res2csv trans MYDATADECK.DATA --verbose --output trans.csv
Adding more data for each connection
You can add coords=True
to the df()
call, which will add the columns X
,
Y
, Z
(which will be the average of the coordinates for the two cell
centerpoints) and also DX
, DY
and DZ
being the distance between the
two cells centerpoints. If using the command line client, the option is called
--coords
.
Extra INIT (static data) vectors can be added, of particular interest is perhaps
some region parameter like FIPNUM
or EQLNUM
, through the vectors
argument.
For such vectors, there will be one column FIPNUM1
and another column FIPNUM2
for the other cell in the cell pair. This is often used together with filtering,
see below.
Non-neighbour connections can be added the dataframe by supplying the option
addnnc=True
. These connections will have the string NNC
in the DIR
column.
Filtering connections
The API supports some filtering directly in the df()
function call for
convenience.
Simple filtering based on vertical vs horizontal can be accomplished
by the options onlyijdir=True
or onlykdir=True
, or through the command line
options --onlyk
or --onlyij
. Filtering is only a selection of which
the Eclipse vectors TRANX
, TRANY
and TRANZ
to include.
Note that the filtering only applies to neighbour connections. If you also choose to add NNC-connections, these will still be added to the dataframe with no filtering.
If you have added (only one) an INIT vector, typically a region parameter like
FIPNUM
or EQLNUM
, you have the option to filter to those connections
where this region parameter changes, which implies the connection is over
a region boundary. This is accomplished by providing a vector to include, and the
option boundaryfilter
. It is recommmended to include NNC in applications
like this. Example:
dframe = res2df.trans.df(resdatafiles, vectors="FIPNUM", boundaryfilter=True, addnnc=True)
which gives the dataframe
I1 |
J1 |
K1 |
TRAN |
I2 |
J2 |
K2 |
DIR |
FIPNUM1 |
FIPNUM2 |
---|---|---|---|---|---|---|---|---|---|
17 |
1 |
5 |
180.10 |
17 |
1 |
6 |
K |
2.00 |
4.00 |
24 |
18 |
10 |
0.00 |
25 |
18 |
11 |
NNC |
3.00 |
5.00 |
22 |
27 |
5 |
1.21 |
22 |
27 |
6 |
K |
1.00 |
3.00 |
18 |
7 |
10 |
0.00 |
19 |
7 |
8 |
NNC |
4.00 |
3.00 |
20 |
40 |
10 |
0.00 |
21 |
40 |
14 |
NNC |
4.00 |
5.00 |
16 |
10 |
7 |
0.04 |
17 |
10 |
7 |
I |
4.00 |
3.00 |
6 |
55 |
5 |
0.67 |
6 |
55 |
6 |
K |
2.00 |
4.00 |
24 |
24 |
5 |
0.62 |
24 |
24 |
6 |
K |
1.00 |
3.00 |
14 |
21 |
5 |
0.34 |
14 |
21 |
6 |
K |
2.00 |
4.00 |
23 |
57 |
5 |
3.15 |
23 |
57 |
6 |
K |
2.00 |
4.00 |
If you also append coordinates to this dataframe, it would be possible to visualize all your region connections in 3D, coloured by transmissibility.
Aggregating connection data over region interfaces
The example above with filtering to wherever for example FIPNUM
is changing,
naturally leads over to an application where transmissibility data is aggregated
over a region interface. This is accomplished by adding the group=True
option.
(this requires one INIT vector to have been specified, and it implicitly implies
boundaryfilter=True
). NNC is not required, but recommended.
from res2df import trans, ResdataFiles
resdatafiles = ResdataFiles("MYDATADECK.DATA")
dframe = res2df.trans.df(resdatafiles, vectors="FIPNUM", addnnc=True, group=True)
FIPNUMPAIR |
TRAN |
FIPNUM1 |
FIPNUM2 |
---|---|---|---|
1-2 |
2381.65 |
1 |
2 |
1-3 |
24624.76 |
1 |
3 |
1-4 |
0.02 |
1 |
4 |
1-5 |
135.81 |
1 |
5 |
2-3 |
0.43 |
2 |
3 |
2-4 |
35864.16 |
2 |
4 |
2-5 |
0.15 |
2 |
5 |
3-4 |
3903.47 |
3 |
4 |
3-5 |
6759383.45 |
3 |
5 |
3-6 |
0.05 |
3 |
6 |
4-5 |
0.26 |
4 |
5 |
4-6 |
11127640.81 |
4 |
6 |
5-6 |
2298.43 |
5 |
6 |
where this last table can also be exported directly from the command line using
res2csv trans MYDATADECK.DATA --vectors FIPNUM --nnc --group --output fipnuminterfaces.csv