You are on page 1of 1

TPG4160 Reservoir Simulation 2012 Exercise 1

Page 1 of 1

Explicit and implicit solution of the one-dimensional diffusivity equation a) Make complete derivations of the numerical formulations found in Lecture note 1 under Solution of the difference equations (pages 6-8).

b) Make a FORTRAN program that solves the equations for pressures in the grid-blocks as functions of time. The program should also include computation of the analytical solution, as found under Analytical solution to the linear PDE (page 2). Organize the program so that it will compute pressures and print to a file for the cases: analytical solution, explicit solution, implicit solution depending on input via terminal. To reduce your programming efforts, you may copy following code from the web page of the course (http://www.ipt.ntnu.no/~kleppe/TPG4160): analy.f (program for analytical solution) expl.f (program for explicit solution) impl.f (program for implicit solution, including Gaussian elimination subroutine) Combine these programs into one, and make necessary modifications. The coefficients used in expl.f and impl.f should be checked carefully and modified in accordance with your derivations above. Test data Test the program using the following data:

=0.2 k=1.0 D N=10 PL=2 atm Tmax=0.2 sec.

=1.0 cp c=10-4 atm-1 L=100 cm PR=1 atm P0=1 atm

Please correct the fortran program based on the handout note befor running 1) Generate analytical solutions for all grid blocks at time intervals of 0.00025 s. 2) Run the explicit formulation using increasing time step sizes of t=0.00025, 0.0005, 0.00075, 0.00125... until the solution becomes unstable 3) Compare the stability of the explicit runs with the theoretical stability criterion ( t 0.5x 2 4) Run the implicit formulation using time steps of t=0.0005, 0.005 and 0.05.

c ). k

5) Make plots of pressures vs. time in block no. 5 for explicit (t=0.0005), implicit (t=0.005) and analytical solutions (plot in EXCEL). 6) Make plots of pressures vs. x for explicit (t=0.0005), implicit (t=0.005) and analytical solutions (plot in EXCEL). Hand in the program listing by email. Please include one figure for each case (1-6). Deadline: To be announced Norwegian University of Science and Technology Department of Petroleum Engineering and Applied Geophysics Professor Jon Kleppe 9.1.2012

You might also like