# TRAJECTORY PIECEWISE LINEARIZATION (TPWL) USING THE MATLAB RESERVOIR SIMULATION TOOLBOX (MRST) FOR RESERVOIR SIMULATION

## Palavras-chave:

Matlab Reservoir Simulation Toolbox, Trajectory Piecewise Linearization, Reservoir Simulation## Resumo

The goal of the present work is to show the Trajectory Piecewise Linearization (TPWL)

procedure for modeling of two-phase flow in subsurface formations, using the Matlab Reservoir

Simulation Toolbox - MRST for reservoir simulation, developed by SINTEF Digital. In this work we

will show how MRST can be used to simulate black-oil models using automatic differentiation to

compute the Jacobian matrices required for the nonlinear Newton-type solver. In automatic

differentiation (AD) the key idea is to keep track of quantities and their derivatives simultaneously:

every time an operation is applied to a quantity, the corresponding differential operation is applied to

its derivative. Thus, MRST-AD allows the fully-implicit nonlinear pressure equation, using a discrete

operators and equations simulator, to compute automatically the correct Jacobian for black-oil system.

In general, the simulator code presented in automatic differentiation black-oil module (ad – blackoil)

is modified to export the necessary data to build the TPWL procedure. This is known as semi-intrusive

methodology, since it requires knowledge of the simulator code, but the changes do not affect the

equations solutions. The Trajectory Piecewise Linearization (TPWL) procedure reduces the numerical

complexity of the problem by performing the linearization of governing equations around converged

states stored during a training simulation. Therefore, we will show implementation of TPWL after

getting the system states (pressure and saturation) and the derivatives of residual equation from the

MRST. The method is shown to be accurate in the neighborhood of the training trajectory.