Flow systems are initialized by assigning a complete set of primary thermodynamic variables to all grid blocks into which the flow domain is discretized. Various options are available in a hierarchical system, as follows. During the initialization of a TOUGH4 run, all grid blocks are first assigned to default thermodynamic conditions specified in data block PARAM.4. The defaults can be overwritten for selected reservoir domains by assigning domain-specific conditions in data block INDOM. These in turn may be superseded by thermodynamic conditions assigned to individual grid blocks in data block INCON. A file INCON written to the same specifications as data block INCON may also be used.
Different EOS modules use different sets of primary variables, and some EOS modules allow different choices of primary variables for initialization, See Section "" for details. For a given EOS module, the primary variables used depend on the fluid phase composition. During phase change, primary variables will be automatically switched from one set to another. In multiphase flow systems, therefore, different grid blocks will in general have different sets of primary variables, and must be initialized accordingly. For most EOS modules, the phase state condition at an element can be determined from the values of primary variables at this element. If the state condition cannot be determined, state indexes need to be inputted as initial condition.
For many applications, special initial conditions are needed, such as gravity-capillary equilibrium, or steady state corresponding to certain mass and heat flows. This can be realized by performing a series of TOUGH4 runs, in which thermodynamic conditions obtained in one run, and written to the file SAVE, are used as initial conditions in a subsequent continuation run. For example, in a geothermal reservoir simulation, a first run may be made to obtain hydrostatic pressure conditions. These may subsequently be used as boundary conditions in a second run segment to simulate undisturbed natural state conditions with throughflow of mass and heat. This could be followed by a third run segment with fluid production and injection. Restarting of a TOUGH4 run is accomplished by providing file SAVE generated in a previous run as file INCON for initialization. Usually additional (often minor) adjustments will be made for a restart. For example, different specifications for the number of time steps and desired printout times may be made. Some editing of the SAVE and/or MESH files may be needed to implement boundary conditions on certain grid blocks. Then, previously calculated pressures on those grid blocks can serve as boundary conditions. In a continuation run, simulation time and time step counters may be continuously incremented, or they may be reset to zero. For example, the latter option will be used when simulating production and injection operations following preparation of a “natural” initial state, which may correspond to a large simulation time.
As far as the internal workings of the code is concerned, there is no difference between a fresh start of a simulation and a restart. The only feature that makes a simulation a continuation run is that the INCON data were generated by a previous TOUGH4 run, rather than having them explicitly provided by the user. File SAVE always ends with a data record with ‘:::’ in the first three columns, followed by one record with restart information (time step and iteration counters, simulation time). To reset all counters to zero, users should simply replace the ‘:::’ and following lines with a blank record when using SAVE as file INCON for another TOUGH4 run.