Add support for MINPVV

The test and code for pinchprocessor is removed since it is no
longer used.
This commit is contained in:
Tor Harald Sandve 2018-10-15 13:39:47 +02:00
parent 9ac269a304
commit df4db9dfbc
4 changed files with 5 additions and 428 deletions

View File

@ -161,7 +161,6 @@ list (APPEND TEST_SOURCE_FILES
tests/test_wellcontrols.cpp
tests/test_wellsgroup.cpp
tests/test_wellcollection.cpp
tests/test_pinchprocessor.cpp
tests/test_anisotropiceikonal.cpp
tests/test_stoppedwells.cpp
tests/test_relpermdiagnostics.cpp
@ -197,7 +196,6 @@ list (APPEND TEST_DATA_FILES
tests/satfuncEPS_D.DATA
tests/testBlackoilState1.DATA
tests/testBlackoilState2.DATA
tests/testPinch1.DATA
tests/wells_manager_data.data
tests/wells_manager_data_expanded.data
tests/wells_manager_data_wellSTOP.data

View File

@ -320,7 +320,7 @@ namespace Opm
aboveCellCartIdx >= 0;
aboveCellCartIdx -= nx*ny)
{
if (porvData[aboveCellCartIdx] >= eclGrid.getMinpvValue()) {
if (porvData[aboveCellCartIdx] >= eclGrid.getMinpvVector()[aboveCellCartIdx]) {
// stop if we encounter a cell which has a pore volume which is
// at least as large as the minimum one
break;
@ -434,7 +434,7 @@ namespace Opm
int cartesianCellIdxAbove = cartesianCellIdx - nx*ny;
while ( cartesianCellIdxAbove >= 0 &&
actnum[cartesianCellIdxAbove] > 0 &&
porv[cartesianCellIdxAbove] < eclgrid.getMinpvValue() ) {
porv[cartesianCellIdxAbove] < eclgrid.getMinpvVector()[cartesianCellIdxAbove] ) {
// Volume weighted arithmetic average of NTG
const double cellAboveVolume = eclgrid.getCellVolume(cartesianCellIdxAbove);
@ -454,34 +454,9 @@ namespace Opm
const Opm::EclipseState& eclState,
const Vector& htrans,
int numCells)
{
// NOTE that this function is currently never invoked due to
// opmfil being hardcoded to be true.
auto eclgrid = eclState.getInputGrid();
auto& eclProps = eclState.get3DProperties();
const double minpv = eclgrid.getMinpvValue();
const double thickness = eclgrid.getPinchThresholdThickness();
auto transMode = eclgrid.getPinchOption();
auto multzMode = eclgrid.getMultzOption();
PinchProcessor<GridType> pinch(minpv, thickness, transMode, multzMode);
std::vector<double> htrans_copy(htrans.size());
std::copy_n(htrans.data(), htrans.size(), htrans_copy.begin());
std::vector<int> actnum;
eclgrid.exportACTNUM(actnum);
const auto& transMult = eclState.getTransMult();
std::vector<double> multz(numCells, 0.0);
const int* global_cell = Opm::UgGridHelpers::globalCell(grid);
for (int i = 0; i < numCells; ++i) {
multz[i] = transMult.getMultiplier(global_cell[i], Opm::FaceDir::ZPlus);
}
// Note the pore volume from eclState is used and not the pvol_ calculated above
const auto& porv = eclProps.getDoubleGridProperty("PORV").getData();
pinch.process(grid, htrans_copy, actnum, multz, porv, nnc_);
{
// this is not used
OPM_THROW(std::runtime_error, "This method is not implemented");
}

View File

@ -1,281 +0,0 @@
---------------------------------------------------------------------------
RUNSPEC
---------------------------------------------------------------------------
TITLE
MINPV and PINCH tests
METRIC
DIMENS
4 1 4 /
OIL
WATER
GAS
DISGAS
VAPOIL
EQLDIMS
1 100 10 1 1 /
TABDIMS
-- NTSFUN NTPVT NSSFUN NPPVT NTFIP NRPVT
1 1 41 12 1 12 /
WELLDIMS
-- MAX CONN WELLS IN
-- WELLS PR WELL GROUPS GROUP
2 20 1 2 /
START
1 'JAN' 2014 /
UNIFIN
UNIFOUT
-- Linear solver stack size
NSTACK
25 / -- Increased from 10 due to convergence problems
-- Increase the allowable amount of problem prints
MESSAGES
-- LIM1 LIM2 LIM3 LIM4 LIM5 LIM6 STOP1 STOP2 STOP3 STOP4 STOP5 STOP6
-- MESS COM WARN PROB ERR BUG MESS COM WARN PROB ERR BUG
2* 1000000 1000000 4* 1000000 1000000 /
---------------------------------------------------------------------------
GRID
---------------------------------------------------------------------------
DXV
4*5 /
DYV
1*5 /
DZV
4*5 /
TOPS
4*1000 /
/
-- In this section, the geometry of the simulation grid and the rock
-- permeabilities and porosities are defined.
INIT
-- ARRAY VALUE ------- BOX ------
EQUALS
-- DX 5 1 1 1 1 1 4 /
-- DX 5 2 2 1 1 1 4 /
-- DX 5 3 4 1 1 1 4 /
-- DY 5 1 4 1 1 1 4 /
-- DZ 5 1 4 1 1 1 4 /
-- TOPS 1000 1 1 1 4 1 1 / top layer
PERMX 1000 1 4 1 1 1 4 /
PORO 0.3 1 1 1 1 1 4 /
PORO 0.0000001 2 2 1 1 2 3 /
PORO 0.3 2 2 1 1 1 1 /
PORO 0.3 2 2 1 1 4 4 /
PORO 0.3 3 4 1 1 1 4 /
/
EQUALS
MULTZ 0.1 1 4 1 1 1 1 /
MULTZ 0.2 1 4 1 1 2 3 /
MULTZ 0.05 1 4 1 1 4 4 /
/
COPY
'PERMX' 'PERMY' /
'PERMX' 'PERMZ' /
/
PINCH
------- All default
0.001 'GAP' 1* 'TOPBOT' /
/
MINPV
------- All default
0.001
/
RPTGRID
COORD=1 ZCORN=1 TRANX TRANY TRANZ ALLNNC PORV MINPV PINCH DZ NNC /
--RPTINIT
-- AREAX AREAY AREAZ MULTX MULTY MULTZ MULTX- MULTY- MULTZ- TRANX TRANY TRANZ NTG DZ /
PROPS ======
PVTO
-- Rs Pbub Bo Vo
0 1. 1.0000 1.20 /
20 40. 1.0120 1.17 /
40 80. 1.0255 1.14 /
60 120. 1.0380 1.11 /
80 160. 1.0510 1.08 /
100 200. 1.0630 1.06 /
120 240. 1.0750 1.03 /
140 280. 1.0870 1.00 /
160 320. 1.0985 .98 /
180 360. 1.1100 .95 /
200 400. 1.1200 .94
500. 1.1189 .94 /
/
PVTG
-- Pg Rv Bg Vg
100 0.0001 0.010 0.1
0.0 0.0104 0.1 /
200 0.0004 0.005 0.2
0.0 0.0054 0.2 /
/
SWOF
0.1 0.0 1.0 0.9
0.2 0.0 0.8 0.8
0.3 0.1 0.6 0.7
0.4 0.2 0.4 0.6
0.7 0.5 0.1 0.3
0.8 0.6 0.0 0.2
0.9 0.7 0.0 0.1
/
SGOF
0.0 0.0 1.0 0.2
0.1 0.0 0.7 0.4
0.2 0.1 0.6 0.6
0.8 0.7 0.0 2.0
0.9 1.0 0.0 2.1
/
PVTW
--RefPres Bw Comp Vw Cv
1. 1.0 4.0E-5 0.96 0.0 /
ROCK
--RefPres Comp
1. 5.0E-5 /
/
DENSITY
-- Oil Water G
1000 1000 0.82 /
---------------------------------------------------------------------------
REGIONS
---------------------------------------------------------------------------
EQUALS
-- VAL ------- BOX ------
SATNUM 1 /
PVTNUM 1 /
/
---------------------------------------------------------------------------
SOLUTION
---------------------------------------------------------------------------
-- The solution section defines the initial state of the solution
-- variables (phase pressures, saturations, and gas-oil ratios)
-- Equilibration data specification
--EQUIL
-- DEPTH PRES OW CONTACT
-- (m) (bar) (m)
-- 1000 210 1040 /
-- Initial water saturation for each grid cell
--EQUALS
SWAT
16*0.1 /
SGAS
16*0.1 /
PRESSURE
16*200 /
---------------------------------------------------------------------------
SUMMARY
---------------------------------------------------------------------------
ALL
-- This keyword requests that summary data be written to the Summary file
-- only at report times. The default, if the RPTONLY keyword is not
-- present (and it was not requested in a restart file), is to write the
-- summary information at every time step.
-- Otherwise, the summary file may grow very large.
RPTONLY
---------------------------------------------------------------------------
SCHEDULE
---------------------------------------------------------------------------
-- The schedule section defines the operations to be simulated
-- Controls on output to the RESTART file
RPTRST
BASIC=3 -- restart data written every FREQ time
FREQ=10 -- save every 10th report time
PCOW
TRANX
TRANY
TRANZ
/
WELSPECS
-- WELL GROUP LOCATION BHP PI
-- NAME NAME I J DEPTH DEFN
PROD 'G' 1 1 1000 'OIL' /
INJE 'G' 1 1 1000 'WATER' /
/
COMPDAT
-- WELL -LOCATION- OPEN/ SAT CONN WELL
-- NAME I J K1 K2 SHUT TAB FACT DIAM
PROD 4 1 1 1 'OPEN' 2* 0.1 /
INJE 1 1 1 1 'OPEN' 2* 0.1 /
/
---------------------------------------------------------------------------
-- CONTROL: PURE WATER INJECTION
---------------------------------------------------------------------------
WCONINJE
-- WELL INJ OPEN/ CNTL FLOW FLOW BHP
-- NAME TYPE SHUT MODE RATE LIMIT LIMIT
-- (m^3/day) (m^3/day) (bar)
INJE 'WATER' 'OPEN' 'RESV' 1* 1.0000e+00 1000000 /
/
WCONPROD
-- WELL OPEN/ CNTL OIL WATER GAS LIQU RES BHP
-- NAME SHUT MODE RATE RATE RATE RATE RATE LIMIT
-- (m^3/day) (bar)
PROD 'OPEN' 'RESV' 4* 1.0000e+00 /
/
TSTEP
1
/
---------------------------------------------------------------------------
END
---------------------------------------------------------------------------

View File

@ -1,115 +0,0 @@
/*
Copyright 2015 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 <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#define NVERBOSE // Suppress own messages when throw()in
#define BOOST_TEST_MODULE PinchProcessorTest
#include <opm/common/utility/platform_dependent/disable_warnings.h>
#include <boost/test/unit_test.hpp>
#include <opm/common/utility/platform_dependent/reenable_warnings.h>
#include <vector>
#include <opm/grid/UnstructuredGrid.h>
#include <opm/grid/GridManager.hpp>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/GridProperty.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/TransMult.hpp>
#include <opm/grid/transmissibility/TransTpfa.hpp>
#include <opm/grid/PinchProcessor.hpp>
#include <opm/core/props/rock/RockFromDeck.hpp>
using namespace Opm;
BOOST_AUTO_TEST_CASE(Processing)
{
const std::string filename="../tests/testPinch1.DATA";
Opm::Parser parser;
Opm::ParseContext parseContext({{ ParseContext::PARSE_RANDOM_SLASH , InputError::IGNORE }});
Opm::Deck deck = parser.parseFile(filename, parseContext);
EclipseState eclstate(deck, parseContext);
const auto& porv = eclstate.get3DProperties().getDoubleGridProperty("PORV").getData();
const auto& eclgrid = eclstate.getInputGrid();
BOOST_CHECK_EQUAL(eclgrid.getMinpvMode(), MinpvMode::EclSTD);
const int nc_initial = eclgrid.getNumActive();
Opm::GridManager gridM(eclgrid, porv);
typedef UnstructuredGrid Grid;
const Grid& grid = *(gridM.c_grid());
const int* global_cell = Opm::UgGridHelpers::globalCell(grid);
const int* cart_dims = Opm::UgGridHelpers::cartDims(grid);
const int nc = Opm::UgGridHelpers::numCells(grid);
BOOST_CHECK_EQUAL(nc_initial - nc, 2); // two cells are removed
Opm::RockFromDeck rock;
rock.init(eclstate, nc, global_cell, cart_dims);
const double minpv = eclgrid.getMinpvValue();
BOOST_CHECK_EQUAL(minpv, 0.001);
const double thickness = eclgrid.getPinchThresholdThickness();
BOOST_CHECK_EQUAL(thickness, 0.001);
auto transMode = eclgrid.getPinchOption();
BOOST_CHECK_EQUAL(transMode, PinchMode::ModeEnum::TOPBOT);
auto multzMode = eclgrid.getMultzOption();
BOOST_CHECK_EQUAL(multzMode, PinchMode::ModeEnum::TOP);
PinchProcessor<Grid> pinch(minpv, thickness, transMode, multzMode);
std::vector<int> actnum(nc_initial, 1);
std::vector<double> htrans(Opm::UgGridHelpers::numCellFaces(grid));
Grid* ug = const_cast<Grid*>(& grid);
tpfa_htrans_compute(ug, rock.permeability(), htrans.data());
const auto& transMult = eclstate.getTransMult();
std::vector<double> multz(nc, 0.0);
for (int i = 0; i < nc; ++i) {
multz[i] = transMult.getMultiplier(global_cell[i], Opm::FaceDir::ZPlus);
}
Opm::NNC nnc(deck);
pinch.process(grid, htrans, actnum, multz, porv, nnc);
std::vector<NNCdata> nncdata = nnc.nncdata();
BOOST_CHECK(nnc.hasNNC());
BOOST_CHECK_EQUAL(nnc.numNNC(), 1);
auto nnc1_index = 1 + cart_dims[0] * (0 + cart_dims[1] * 0);
auto nnc2_index = 1 + cart_dims[0] * (0 + cart_dims[1] * 3);
BOOST_CHECK_EQUAL(nncdata[0].cell1, nnc1_index);
BOOST_CHECK_EQUAL(nncdata[0].cell2, nnc2_index);
std::cout << "WARNING. The opmfil option is hardcoded i.e. the calculated transmissibility is wrong";
// double factor = Opm::prefix::centi*Opm::unit::Poise
// * Opm::unit::cubic(Opm::unit::meter)
// / Opm::unit::day
// / Opm::unit::barsa;
// double trans = unit::convert::to(nncdata[0].trans, factor);
//BOOST_CHECK(std::fabs(trans - 4.26350022) < 1e-3);
}