[UP]
[TOP]
[HOME]
Using 2PhaseGen
The 2PhaseGen application creates pseudo relative permeability and capillary pressure tables for grid-blocks adjacent to faults from the groupings of variables determined by ViewGen. The output from 2PhaseGen (KRNUM file output) is formatted as the Eclipse
SWOF keyword (or in Shell MoReS format) and contains a new pseudo table for each grouping. Original tables input using the SATNUM keyword are output first, followed by the new tables.
NOTE:- Before using the 2PhaseGen module, the following needs to be done:-
appropriate Two phase flow settings must be input and saved via WizGen in "Flexible project" mode.
ViewGen must run to create the groupings of faulted cells and to output an index of cells in KRNUM format identifying which pseudos to use for particular cells for a particular direction of flow to a temporary file (groupings.out) stored in the project _OUTPUT directory. This file is used by 2PhaseGen (for details see the section on Two-Phase ViewGen calculations).
1. Open the 2PhaseGen module
Click on the
2PhaseGen icon towards the right on the TransGen
Control Menu as shown below.
Alternatively run 2PhaseGen as non-interactive (batch) version
Type the following script/command at the prompt in an Xterm window:-
../<TG_HOME>/bin/2phasegenauto <TGDATA> <TGproject_dir>
where <TG_HOME> is the installation directory of TransGen, <TGDATA> is the name of the runfile created by WizGen for the current TransGen project and <TGproject_dir> is the directory containing the TGDATA run file.
The 2PhaseGen module (shown below) still appears, but controls are activated automatically. Settings required by the batch version are read from the TGDATA runfile in exactly the same way as normal, so WizGen must used to set up both the interactive and non-interactive runs and ViewGen used to create the groupings of faulted cells.
The difference between using the interactive and non-interactive versions of 2PhaseGen are the initial maximum number of iterations. This is set to one million in the interactive version. If a solution has not converged after the maximum, a dialog window appears allowing the user to increase the maximum number of iterations and try again, skip the current group or abort altogether. In the non-interactive version, the initial maximum number of iterations is set to 300 million and if a solution does not converge the group is automatically "skipped"
i.e. no dialog window appears.
NOTE:- If the attributes of the model or the way the plugins that calculate fault properties are changed etc in WizGen, then a new groupings file should be generated using ViewGen before running 2PhaseGen again in either interactive or non-interactive mode.


The application will open as shown above with a single frame containing 4 windows, 3 of which are initially blank graphs.
The program is driven by clicking on the control button to the right of the Progress bar (bottom right of window) which is initially named Start.
2. Start application
Click on
Start button to prepare the two-phase plugins (either written directly by WizGen from constants or user-defined) as set on the
Two phase flow - Fault Rock Properties page of WizGen. The nine files containing plugin code are read into memory and compiled.
If any of the plugin files cannot be opened for any reason or the plugin code cannot be compiled, an error message detailing the problems will be displayed. For example, the following message refers to errors in the SWC (Connate water saturation) plugin.
At this stage, 2PhaseGen also reads the temporary
groupings.out file containing the definitions of the groups to be upscaled. If for some reason this file is not found (
e.g. ViewGen has not been run or the file has been deleted), 2PhaseGen will issue an error message.
For example:-

When the plugins have been successfully prepared and the groupings.out file has been read, the Start button changes to Compute.
At this stage you can chose to either run the application:-
in "normal" default mode (i.e. with the Advanced Mode option "off") - this is the essential mode for changing the SWOF or MoReS output to be used as simulator input.
or
in Advanced mode (i.e. with the Advanced Mode option "on" as shown below) - to examine interactively how sensitive the pseudos are to changes in the input and to provide a quantitative feel for what the best number of grouping division might be.
NOTE:- The output from 2PhaseGen using a run in which group parameters have been modified interactively should not be used as simulator input, since the up-scaled curves reflect the modified input, rather than the model specific input. However, if the Advanced Mode is selected, but the Compute stage is not interrupted, 2PhaseGen will act as it would in "normal" mode and the SWOF (or MoReS) output can be used as simulator input.

3. Compute
Click on Compute to set 2PhaseGen working sequentially through the groupings information input from ViewGen, calculating a new pseudo-table for each.
The variables defined in a particular grouping are displayed in the bottom right-hand window panel. The other three windows display the cell, fault and newly calculated pseudo tables for the last grouping processed. The windows display graphs for oil and water relative permeability and capillary pressure. The progress bar indicates the overall advancement as a percentage of the total number of groupings. The compute stage may take a while to complete.

If 2PhaseGen is in advanced mode, the user is allowed to interrupt the compute stage at any grouping calculation by pressing the control button (which reads Interrupt ).
The group variables can be edited and a different pseudo table may be calculated for that group by pressing the Recalculate button.
The control button is renamed Continue and, if pressed, causes the compute stage to continue as normal.
NOTE:- Only the six variables in the boxes can be modified. The original (cell) SWOF table cannot be changed in advanced mode and, although the toggle can be changed between Drainage and Imbibition, this change is not updated in the software. Allowing these two parameters to be changed will be added to later version of 2PhaseGen.

The algorithm, which implements the pseudoisation method used to create the new tables, contains several points where a parameter must converge to a solution with a suitable accuracy. To prevent an infinite loop condition which would cause the application to freeze, an upper limit is placed on the number of iterations attempted in any part of the algorithm. If the upper limit is reached the user is informed via the dialog box shown below. The user then has the choice of increasing the limit and retrying (the default), skipping the current grouping being processed or aborting the compute stage (as described below).

Increase number of iterations & Retry
This is the recommended procedure if this dialog appears. Increase the number of iterations (e.g. by a factor of 10) and click on the Retry button - this will usually ensure convergence.
Once the upper limit on the number of iterations is changed, the new limit is applied to successive groupings. In practical terms, the upper limit is initially set to be very high within the software and non-convergence state should not be an issue.
Skip
If the solution cannot converge within the memory of the machine, there is probably a numerical reason for this. If this occurs, please contact user support with information of the problem. If Skip is pressed, the group being up scaled is marked as incomplete. At the end of the compute stage, 2PhaseGen searches for each incomplete grouping and attempts to find a similar grouping that has completed successfully. The search uses a minimisation algorithm to match an incomplete and complete group from a ranked list of suitable candidates. Candidates must share the same fault cycle (drainage or imbibition) and SATNUM as the incomplete group. Similarity between each candidate is assessed by comparing grouping variables weighted by the variables priority setting. The pseudo tables from the group most similar to the incomplete one are output for the incomplete group. An additional comment is added to the header of the table in the SWOF keyword indicating which table has been substituted.
Abort
If the run is aborted, no further calculations are made, and no 2PhaseGen output is written.
4. Write output to file
Once all groups have been processed, the run control button changes to Write, and the messages window reads "new tables complete".
When the Write button is pressed a file containing pseudo tables is written as the SWOF keyword (or in MoReS format).
If there are any problems writing the output (e.g. file permissions, disk space, etc) they are reported in a dialog box.
When the output file(s) as specified on the Two-phase flow output page in WizGen have been written, the button changes to Finish.
Click on Finish to cleanly exit from the 2PhaseGen application.
NOTE:- If 2PhaseGen has been run in Advanced Mode during which any of group parameters have been modified interactively, the output should NOT be used as simulator input, since the up-scaled curves reflect the modified input rather than the model specific input. However, if the Advanced Mode is selected, but the Compute stage was not interrupted, 2PhaseGen will have acted as it would in "normal" mode and the SWOF (or MoReS) output can be used as simulator input.
Examples of output files
The 2PhaseGen application calculates new sets of relative permeability tables for grid-blocks adjacent to faults. These tables are output using the Eclipse
SWOF keyword (or in
MoReS format for Shell users) as specified on the
Two phase flow - Output section of WizGen. If the original model contained n tables and m new ones are calculated for the faults, the final output file will contain n + m tables, with the top ones reproducing the original tables (appropriate for unfaulted grid-blocks). Full details on the derivation of the Tables are included as comments at the top of each one.
Relative permeabilities tables file
-- ORIGINAL AND NEW PSUEDO REL. PERM. TABLES GENERATED BY 2PHASEGEN
-- 6 ORIGINAL AND 97 NEW TABLES
-- TOTAL NUMBER OF TABLES IS 103 (SET NTSFUN TO 103 IN ECLIPSE RUNSPEC SECTION)
-- LARGEST TABLE CONTAINS 28 ROWS (SET NSSFUN TO 28 IN ECLIPSE RUNSPEC SECTION)
SWOF
-- TABLE 1 - ORIGINAL TABLE
0.3817 0 0.85 2.9599
0.5053 1e-06 0.8228 1.4583
0.5913 1e-05 0.4985 0.4405
0.6297 0.1131 0.0199 0.0502
0.6633 0.1907 0.0072 0.0262
0.7001 0.3001 0 0
/
-- TABLE 2 - ORIGINAL TABLE
0.1458 0 0.85 2.9618
....
/
....
-- TABLE 46
-- FAULT CYCLE: DRAINAGE
-- FAULT PERMEABILITY: 0.00179307mD
-- FAULT THICKNESS: 0.186239m -- FLOW RATE: 0.00487657m/DAY
-- CELL PERMEABILITY: 402.097mD
-- CELL POROSITY: 0.184494
-- CELL LENGTH: 75.23
-- ORIGINAL CELL TABLE NUMBER: 2
0.199812 0 0.055506 2.9618
0.236056 7.45659e-07 0.0553998 2.2679
0.486823 2.82676e-05 0.0537005 0.431316
0.505856 0.000288668 0.0531006 0.29737
0.544532 0.00500344 0.0444187 0.0562041
0.553365 0.0115648 0.0303037 0.0350734
0.556601 0.0155613 0.0203406 0.0287964
0.566937 0.0183374 0.0150864 0.0254787
0.59368 0.0217408 0.00955168 0.0209261
0.685757 0.0261557 0.000305149 0.00663319
0.688036 0.0264093 8.40631e-06 0.00625222
0.687929 0.0400969 0 0.00622588
0.688086 0.113716 0 0.0060988
0.699742 0.299769 0 0.00103016
0.699933 0.29994 0 0.00100165
/
...
-- TABLE 103
-- FAULT CYCLE: IMBIBITION
-- FAULT PERMEABILITY: 0.00130761mD
-- FAULT THICKNESS: 0.312933m
-- FLOW RATE: 2.07963e-05m/DAY
-- CELL PERMEABILITY: 220.824mD
-- CELL POROSITY: 0.175558
-- CELL LENGTH: 75.23
-- ORIGINAL CELL TABLE NUMBER: 2
0.1458 0 0.000757404 2.96181
0.17236 2.08692e-07 0.000482913 2.75733
0.229872 6.56727e-07 0.000481802 2.31459
0.485946 2.3862e-05 0.000410465 0.437669
0.496933 4.73326e-05 0.000374687 0.359855
0.501516 7.05713e-05 0.000338077 0.327608
0.50643 0.000116527 0.000261264 0.293238
0.509521 0.000175795 0.000176988 0.271713
0.512076 0.000298053 7.69391e-05 0.253843
0.513639 0.000612739 1.36498e-05 0.24276
0.515 0.00305691 4.6169e-07 0.233057
0.523105 0.00812683 9.03858e-08 0.177569
0.525078 0.00936099 0 0
/
KRNUM output file
Once each faulted cell face has been assigned to a group (created at the end of the
ViewGen run according to the divisions and priorities assigned on the
Two phase flow - Groupings section in
WizGen), this information is output using the directional
KRNUM keywords to the file specified in the
Two phase flow - Output section in
WizGen. The six KRNUM keywords (KRNUMX, KRNUMX- KRNUMY, KRNUMY-, KRNUMZ, KRNUMZ-) identify which set of relative permeability curves to use for flow out of each grid-block in the model.
For example KRNUMY is used to define the SWOF table (see above) for flow from cell [I J K] to cell [I J+1 K], while KRNUMY- defines the table for flow from cell [I J K] to cell [I J-1 K]. For all unfaulted cell faces and for all cells in the two vertical directions (
i.e. KRNUMZ and KRNUMZ-) the original
SATNUM index is used.

In the 3*3*2 example illustrated above, 16 cell edges are faulted. Assuming the cells originally have the same relative permeability functions, then the original SATNUM file would be:-
SATNUM
18*1
/
If a separate pseudo-relative permeability function is calculated for each faulted cell face, then the new KRNUM files will be:-
KRNUMX
1 1 1 1 2 1 1 3 1
1 1 1 1 4 1 1 5 1
/
KRNUMX-
1 1 1 1 1 6 1 1 7
1 1 1 1 1 8 1 1 9
/
KRNUMY
10 11 1 1 1 1 1 1 1
12 13 1 1 1 1 1 1 1
/
KRNUMY-
1 1 1 14 15 1 1 1 1
1 1 1 16 17 1 1 1 1
/
KRNUMZ
18*1
/
KRNUMZ-
18*1
/
5. Include Two-Phase TransGen output in Eclipse Simulation
NOTE:- To implement the use of Two-phase fault rock properties in the Eclipse simulation model, a file containing the KRNUM keywords together the upscaled relative permeability and capillary pressure tables output from the Two-Phase Flow module need to be included plus the original SATNUM file in the REGIONS section of the Eclipse instructions file .
Changes need to be made in the following portions of the Eclipse
.DATA file to include the TransGen output:-
The RUNSPEC Section
The SATOPTS keyword
"DIRECT" AND "IRREVERS" should be specified below this keyword to activate directional, irreversible relative permeability tables.
Example:-
SATOPTS
`DIRECT' `IRREVERS'
/
The TABDIMS keyword
The TABDIMS keyword has up to 8 items, two of which need to be changed.
NTSFUN is the total number of tables in the output SWOF file. This is the first item in the keyword.
NSSFUN is the maximum number of nodes in any table. This is the third item in the keyword.
The other items in the keyword should not be changed.
NTSFUN and NSSFUN are reported in the 2PhaseGen "Messages" window upon completion of the up-scaling and in the header of the output SWOF file.
For example, the original TABDIMS keyword may be:-
TABDIMS
6 1 8 25 3 /
and the header of the SWOF file may be:-
-- ORIGINAL AND NEW PSUEDO REL. PERM. TABLES GENERATED BY 2PHASEGEN
-- 6 ORIGINAL AND 97 NEW TABLES -- TOTAL NUMBER OF TABLES IS 103 (SET NTSFUN TO 103 IN ECLIPSE RUNSPEC SECTION)
-- LARGEST TABLE CONTAINS 28 ROWS (SET NSSFUN TO 28 IN ECLIPSE RUNSPEC SECTION)
in which case the new TABDIMS keyword should be:-
TABDIMS 103 1 28 25 3 /
The EDIT Section
The single-phase TransGen output files for the EDITNNC, TRANX and TRANY keywords which are included in the Eclipse run in the Edit Section should also be included in runs using two-phase fault rock properties. The two-phase TransGen output supplements these single-phase files; it does not replace them.
The PROPS Section
The TransGen (2PhaseGen) output SWOF tables replace the original SWOF tables included in the PROPS section of the Eclipse instructions file.
The REGIONS Section
The TransGen (ViewGen) output KRNUM file, which contains the indices of SWOF tables to use for each cell in each of the six directions, should be included in the REGIONS section of the Eclipse instructions file, together with the original SATNUM data.
Results of including two-phase fault rock properties in the simulation model
The graph below shows a comparison of the behaviour of various models using the Demo dataset for the 3D model described in Manzocchi et al. 2002 which is included with the TransGen 3.2 release. The results obtained using TransGen in single-phase mode (solid black curve) are shown together with three other models including two-phase fault rock properties. All those including two-phase fault rock properties are similar (but not identical), with the differences attributable to variations in the up-scaling methods, derivation of the input flow rates, the groupings etc.
NOTE:- The TGDATA files included with the Demo dataset (i.e. SINGLE_PHASE.TGDATA and TWO_PHASE.TGDATA) have some unconventional plugins to make the models directly equivalent to those used in the paper (which were not made using TransGen).
The paper cited is "The representation of two phase fault-rock properties" by T. Mazocchi, A.E. Heath, J. J. Walsh & C. Childs in Petroleum Geoscience, Vol. 8 2002, pp. 119-132.

[UP]
[TOP]
[HOME]