Sunteți pe pagina 1din 3

Octave Installation

Go to http://ftp.gnu.org/gnu/octave/
Download the newest version: octave-4.2.0.tar.gz (January 2, 2017)
Install it in your hard disk

MRST Installation

Go to www.sintef.no/projectweb/mrst/
Choose the proper version (MRST 2015a)
In MatLab, Address section, locate where you want to install MRST
In Command Window write:
untar mrst-2015a.tar.gz
This will create a folder named mrst-2015a

In Command Window write:


startup

Exercise #1
Analytical solution for the linear pressure describing hydrostatic equilibrium for an
incompressible, single-phase fluid (Gravity Column).

The basic model in subsurface flow consists of an equation expressing conservation of mass and
a constitutive relation called Darcy’s law that relates the volumetric flow rate to the gradient of
flow potential.

𝑘
∇ ∙ 𝑣⃗ = 0, 𝑣⃗ = − [∇𝑝 + 𝜌 𝑔 ∇𝑧]
𝜇
The unknowns are the pressure 𝑝 and the flow velocity 𝑣⃗. By eliminating 𝑣⃗, we can reduce the
above equation to the elliptic Poisson equation. In the equation, the rock is characterized by the
permeability 𝑘 that gives the rock’s ability to transmit fluid. Here 𝑘 is set to 100 millidarcy
(mD), whereas the porosity is set to 20%. The fluid has a density 𝜌 of 1000 kg/m3 and viscosity
𝜇 equal to one centipoise (cP), 𝑔 is the gravity constant, and 𝑧 is the depth.

The computational domain is a square column, [0, 1] × [0, 1] × [0, 30] m3, which we discretize
using a regular 1 × 1 × 30 Cartesian grid. The simulation model is set up by constructing a grid
and assigning the rock permeability, and setting boundary conditions
% Find the folder where MRST is located

>> startup
gravity reset on
G = cartGrid([1, 1, 30], [1, 1, 30]*meter^3);
G = computeGeometry(G);
rock = makeRock(G, 0.1*darcy(), 0.2);

MRST works in SI units and we must therefore be careful to specify the correct units for all
physical quantities. To solve the equation, we will use a standard two-point finite-volume
scheme that relates the flux between cells to their pressure difference 𝑣𝑖𝑗 = −𝑇𝑖𝑗 (𝑝𝑖 − 𝑝𝑗 ). For
Cartesian grids, this scheme coincides with the classical seven-point scheme for Poisson’s
problem and is the only discretization that is available in the basic parts of MRST. To define the
two-point discretization, we compute the transmissibilities 𝑇𝑖𝑗 , which can be defined independent
of the particular flow model once we have defined the grid and petrophysical parameters;

T = computeTrans(G, rock);

Since we are solving the equation on a finite domain, we must also describe conditions on all
boundaries. To this end, we prescribe 𝑝 = 100 bar at the top of the column and no-flow
conditions (𝑣⃗ ∙ 𝑛 = 0) elsewhere:

bc = pside([], G, 'TOP', 100.*barsa());

The next thing we need to define is the fluid properties. Unlike grids, petrophysical data, and
boundary conditions, data structures for representing fluid properties are not part of the basic
functionality of MRST. The reason is that the way fluid properties are specified is tightly
coupled with the mathematical and numerical formulation of the flow equations, and may differ
a lot between different types of simulators. Here, we have assumed incompressible flow and can
therefore use fluid models from the incomp add-on module

mrstModule add incomp;


fluid=initSingleFluid('mu', 1*centi*poise, 'rho', 1014*kilogram/meter^3);

As a final step, we use the transmissibilities, the fluid object, and the boundary conditions to
assemble and solve the discrete system:

sol = incompTPFA(initResSol(G, 0.0), G, T, fluid, 'bc', bc);

Having computed the solution, we plot the pressure given in units ‘bar’, which equals 0.1 MPa
and is referred to as ‘barsa’ in MRST since ‘bar’ is a built-in command in MATLAB:
plotFaces(G, 1:G.faces.num, convertTo(sol.facePressure, barsa()));
set(gca, 'ZDir', 'reverse'), title('Pressure [bar]')
view(3), colorbar, set(gca, 'DataAspect', [1 1 10])

From the plot we see that our solution correctly reproduces the linear pressure increase with
depth one would expect to find inside a column consisting of a single phase

S-ar putea să vă placă și