/*
Copyright 2008-2011 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_cap.C
@brief Upscales capillary pressure function, water saturation, and water saturation pr. rocktype.
Description:
Reads in a lithofacies geometry in Eclipse format, reads in J(S_w)
permeability and porosity, and upscale the capillary pressure function
and water saturation, both for the whole geometry, and on a per rocktype basis
Assumption for capillary pressure function
- Capillary equilibrium, p_c is spatially invariant.
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 and J-function for each stone-type.
4: Find minimum and maximum capillary pressure from the
J-functions in each cell.
5: Upscale water saturation as a function of capillary pressure
6: Print output to screen and optionally to file.
@author: Håvard Berland statoil.com>
*/
#include
#include
#include
#include
#include
#include
#include
#include // for DB_MAX/DBL_MIN
#include