/*
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_relperm.C
@brief Upscales relative permeability as a fuction of water saturation assuming capillary equilibrium.
Description:
Reads in a lithofacies geometry in Eclipse format, reads in J(S_w)
and relpermcurve(S_w) for each stone type, and calculates upscaled
(three directions) relative permeability curves as a function of Sw.
The relative permeability computation is based on
- Capillary equilibrium, p_c is spatially invariant.
- Optional gravitational effects. If gravity is not specified,
gravity will be assumed to be zero.
Units handling:
- Assumes cornerpoint file reports lengths in cm.
- Input surface tension is in dynes/cm
- Input density is in g/cm^3
- The denominator \sigma * cos(\phi) in J-function scaling
is what we call "surface tension". If angle dependency is to be
included, calculate the "surface tension" yourself.
- Outputted capillary pressure is in Pascals.
Steps in the code:
1: Process command line options.
2: Read Eclipse file
3: Read relperm- and J-function for each stone-type.
4: Tesselate the grid (Sintef code)
5: Find minimum and maximum capillary pressure from the
J-functions in each cell.
6: Upscale water saturation as a function of capillary pressure
7: Upscale single phase permeability.
8: Upscale phase permeability for capillary pressures
that corresponds to a uniform saturation grid, and
compute relative permeability.
9: Print output to screen and optionally to file.
*/
#include
#include
#include
#include
#include
#include
#include // for DBL_MAX/DBL_MIN
#include