/*
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_benchmark.C
@brief Benchmark version of upscale_relperm.
BENCHMARK VERSION
This is a benchmark version of upscale_relperm, whose ordinary description is given below.
The main machinery is the same, but with some changes:
- Input data (grid file, rock file and reference solution) is not provided from command line,
but is built in at compiler time by embedding hexadecimal (1 byte) input data files. See
README for further documentation.
- Other command line options are not supported.
- The construction of deck and stone data is changed due to change in input routine.
- All checks on number of input from command line are removed (since this no longer is valid).
- Some option defaults are changed:
points = 20
upscaleBothPhases = 0 (false)
jFunctionCurve = 3
outputprecision = 20
- All output is surpressed, except for a start-up message and the final output in step 9.
- A test for verification of computed solution is implemented in Step 9. The comparison is done
within an absolute tolerance that can be changed below.
- Output provided in Step 9 is changed to fit the benchmark suite
There are two models available with different model sizes. It is important that the model size
don't fit into the cache. The model type can be chosen below by changing the macro 'MODEL_TYPE'.
The tolerance to be used when comparing results can also be changed below. To re-build simply
run 'make' inside the root directory (opm-benchmarks).
Assumptions:
- Only one stone type
- Isotropic input data
- upscales only one phase
*/
/**
Original description of upscale_relperm:
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
#include // for DBL_MAX/DBL_MIN
#include