/*
Copyright 2010 Statoil ASA.
This file is part of The Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see .
*/
/**
@file upscale_relpermvisc.C
@brief Upscales relative permeability as a funtion of watersaturation in the viscous limit.
Description:
Upscaling of relative permeability (two-phase) using steady-state
in the viscous limit, on Eclipse corner-point geometries in shoe-box format
Reads in a lithofacies geometry in Eclipse format, reads in
viscosities for oil and water from command line, relpermcurve(S_w)
for each stone type from file, and calculates upscaled (three
directions) relative permeability curves as a function of Sw.
Fixed, linear and periodic boundary conditions are supported,
yielding 3, 9 or 9 values respectively (but only 6 significant for
periodic) for relative permeability at each saturation point.
The relative permeability computation is based on
- Steady-state, viscous limit. v_w/v_o = constant, === lambda_w/lamda_o = constant
- No gravitational effects.
- No capillary effects.
Steps in the code:
1: Process command line options.
2: Read Eclipse file
3: Read relperm-function for each stone-type.
4: Tesselate the grid (Sintef code)
5: Generate simple statistics by looping over the cells.
6: Upscale fractional flow ratio vs. water saturation
6: Find upper and lower bounds for fractional flow ratio v_w/v_o
7: Upscale single phase permeability (in order to make relative perm later)
8: For uniformly distributed water saturation values between upscaled Swir and Swor,
a: Find fractional flow ratio corresponding to wanted upscaled water saturation
b: Model water saturation in each cell given fractional flow ratio
c: Model phase permeability in each cell given cell water saturation and inputted
relative permeability curves.
d: Upscale phase permeability
9: Repeat step 8 for the oil phase.
10: Print output to screen and optionally to files.
The relperm-functions must be defined in text files, with water saturation in
the first column, and then relative permeability for water in column 2, and relative
permeability for oil in column 3. Lines starting with -- or # are ignored.
Units for (dynamic) viscosity are assumed to be in Pascal seconds. (Pa s)
1000 Pa s = 1 centiPoise.
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include // FOR DBL_MAX/DBL_MIN
#include
#include
#include
#include
#include
#include
#include