Merge pull request #4299 from akva2/remove_test_ecl_output

remove test_ecl_output
This commit is contained in:
Bård Skaflestad 2022-11-30 16:39:41 +01:00 committed by GitHub
commit 79c8bc75bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 983 deletions

View File

@ -171,7 +171,6 @@ list (APPEND TEST_SOURCE_FILES
tests/test_blackoil_amg.cpp
tests/test_convergencereport.cpp
tests/test_deferredlogger.cpp
tests/test_ecl_output.cc
tests/test_eclinterregflows.cpp
tests/test_equil.cc
tests/test_flexiblesolver.cpp
@ -211,7 +210,6 @@ if(ROCALUTION_FOUND)
endif()
list (APPEND TEST_DATA_FILES
tests/SUMMARY_DECK_NON_CONSTANT_POROSITY.DATA
tests/equil_base.DATA
tests/equil_capillary.DATA
tests/equil_capillary_overlap.DATA

View File

@ -1,673 +0,0 @@
-- Synthetic test deck based on Norne. This data set is meant to be a simple,
-- well-documented deck for the behaviour of SUMMARY specified output. Data
-- is mostly entered to *traceable* and does not necessarily make sense from
-- a simulation point of view.
START
10 MAI 2007 /
RUNSPEC
TITLE
SUMMARYTESTS
-- A simple 10x10x10 cube. Simple to reason about, large enough for all tests
DIMENS
10 10 10 /
REGDIMS
3 /
--
-- WELL WELL GRUPS GRUPS
-- MXWELS MXCONS MXGRPS MXGRPW
WELLDIMS
4 4 3 3 /
OIL
GAS
WATER
DISGAS
METRIC
UNIFOUT
UNIFIN
GRID
DX
1000*1 /
DY
1000*1 /
DZ
1000*1 /
TOPS
100*1 /
ACTNUM
1000*1/
PORO
500*0.1 500*0.2/
PERMX
1000*500 /
COPY
PERMX PERMY /
PERMX PERMZ /
/
REGIONS
FIPNUM
400*1
200*2
400*3 /
PROPS
PVTW
1 1000 0 0.318 0.0 /
ROCK
14.7 3E-6 /
SWOF
0.12 0 1 0
0.18 4.64876033057851E-008 1 0
0.24 0.000000186 0.997 0
0.3 4.18388429752066E-007 0.98 0
0.36 7.43801652892562E-007 0.7 0
0.42 1.16219008264463E-006 0.35 0
0.48 1.67355371900826E-006 0.2 0
0.54 2.27789256198347E-006 0.09 0
0.6 2.97520661157025E-006 0.021 0
0.66 3.7654958677686E-006 0.01 0
0.72 4.64876033057851E-006 0.001 0
0.78 0.000005625 0.0001 0
0.84 6.69421487603306E-006 0 0
0.91 8.05914256198347E-006 0 0
1 0.00001 0 0 /
SGOF
0 0 1 0
0.001 0 1 0
0.02 0 0.997 0
0.05 0.005 0.980 0
0.12 0.025 0.700 0
0.2 0.075 0.350 0
0.25 0.125 0.200 0
0.3 0.190 0.090 0
0.4 0.410 0.021 0
0.45 0.60 0.010 0
0.5 0.72 0.001 0
0.6 0.87 0.0001 0
0.7 0.94 0.000 0
0.85 0.98 0.000 0
0.88 0.984 0.000 0 /
DENSITY
53.66 64.49 0.0533 /
PVDG
1 100 1
10 10 1 /
PVTO
0 1 10 1 /
1 1 10.001 1
10 1 1 /
/
SOLUTION
SWAT
1000*0.2 /
SGAS
1000*0.0 /
PRESSURE
100*1.0
100*2.0
100*3.0
100*4.0
100*5.0
100*6.0
100*7.0
100*8.0
100*9.0
100*10.0/
RS
1000*0 /
SUMMARY
DATE
PERFORMA
--
-- Field Data
-- Production Rates
FVPR
FWPR
FWPRH
FOPR
FOPRH
FGPR
FGPRH
FLPR
FLPRH
FGSR
FGCR
FNPR -- solvent
--FTPRSEA
-- Injection Rates
FVIR
FWIR
FWIRH
FGIR
FNIR -- solvent
FGIRH
-- Production Cummulatives
FVPT
FWPT
FOPT
FLPT
FLPTH
FGPT
FNPT
FOPTH
FGPTH
FWPTH
FGST
FGCT
-- Injection Cummulatives
FVIT
FWIT
FWITH
FGIT
FNIT
FGITH
-- In place
FWIP
FOIP
FGIP
-- Ratios
FWCT
FWCTH
FGOR
FGORH
-- From model2
FMWPR
FMWIN
FOE
-- Pressures
FPR
FPRP
BPR
1 1 1 /
1 1 2 /
1 1 3 /
1 1 4 /
1 1 5 /
1 1 6 /
1 1 7 /
1 1 8 /
1 1 9 /
1 1 10 /
2 1 10 / -- This cell is not ACTIVE
/
BSGAS
1 1 1 /
/
BSWAT
1 1 1 /
/
-- Region data
RPR
/
ROPT
/
RGPT
/
RWPT
/
RGFT
/
RWFT
/
ROIP
/
ROP
/
ROPR
/
RGPR
/
RWPR
/
RGIR
/
RGIT
/
RWIR
/
RWIT
/
RWPT
/
ROIPL
/
ROIPG
/
RGIP
/
RGIPL
/
RGIPG
/
RWIP
/
RPPO
/
-- Group data --
GPR
/
GLPR
/
GOPT
/
GGPT
/
GWPT
/
GNPT
/
GOPR
/
GGPR
/
GWPR
/
GWPRH
/
GGIR
/
GNPR
/
GNIR
/
GGIRH
/
GGIT
/
GNIT
/
GGITH
/
GWCT
/
GWCTH
/
GGOR
/
GGORH
/
GWIR
/
GWIT
/
GWIRH
/
GWITH
/
GOPRH
/
GGPRH
/
GLPRH
/
GWPTH
/
GOPTH
/
GGPTH
/
GLPTH
/
GPRG
/
GPRW
/
GOPTF
/
GOPTS
/
GOPTH
/
GOPRF
/
GOPRS
/
GOPRH
/
GGPTF
/
GGPTS
/
GGPTH
/
GGPTF
/
GGPTS
/
GGPTH
/
GGLR
/
GGLIR
/
GGLRH
/
GVPR
/
GVPT
/
GMCTP
/
GOPP
/
GVIR
/
GVIT
/
GVPRT
/
GMWPR
/
GMWIN
/
-- Well Data
-- Production Rates
WWPR
/
WWPRH
/
WOPR
/
WOPRH
/
WGPR
/
WNPR
/
WGPRH
/
WLPR
/
WLPRH
/
WLPT
/
WLPTH
/
-- Injection Rates
WWIR
W_3
/
WWIT
W_3
/
WWIRH
W_3
/
WWITH
W_3
/
WGIT
W_3
/
WGIR
W_3
/
WGIRH
W_3
/
WGITH
W_3
/
WNIR
W_3
/
WNIT
W_3
/
-- Production Cummulatives
WWPT
/
WWPTH
/
WOPT
/
WOPTH
/
WGPT
/
WGPTH
/
WNPT
/
-- Tracers
--WTPRSEA
--/
--WTPTSEA
--/
-- Injection Cummulatives
WWIT
W_3
/
-- Ratios
WWCT
/
WWCTH
/
WGOR
/
WGORH
/
WGLR
/
WGLRH
/
-- Performance
WBHP
/
WBHPH
/
WTHP
/
WTHPH
/
WPI
/
WBP
/
WBP4
/
-- from model2
WOPTF
/
WOPTS
/
WOPTH
/
WOPRS
/
WOPRF
/
WGPTF
/
WGPTS
/
WGPRF
/
WTPRS
/
WGLIR
/
WVPR
/
WVPT
/
WOPP
/
WVIR
/
WVIT
/
WMCTL
/
-- Water injection per connection
CWIR
* /
/
-- Gas injection on 3 1 1 (45)
CGIR
'W_3' 3 1 1 /
/
CWIT
'W_3' /
/
CGIT
* /
/
-- Production per connection
-- Using all the different ways of specifying connections here
-- as an informal test that we still get the data we want
CWPR
'W_1' 1 1 1 /
/
COPR
'W_1' /
'W_2' /
'W_3' /
/
CGPR
'*' /
/
CNFR
'*' /
/
CNPT
'*' /
/
CNIT
'*' /
/
CWPT
'W_1' 1 1 1 /
/
COPT
'W_1' /
/
CGPT
'W_1' /
'W_2' /
'W_3' /
/
---- Connection production rates
----CGFR
----'E-4AH' /
----/
----CWFR
----'E-2H' /
----/
SCHEDULE
-- Three wells, two producers (so that we can form a group) and one injector
WELSPECS
'W_1' 'G_1' 1 1 3.33 'OIL' 7* /
'W_2' 'G_1' 2 1 3.33 'OIL' 7* /
'W_3' 'G_2' 3 1 3.92 'WATER' 7* /
/
-- Completion data.
COMPDAT
-- 'Well' I J K1 K2
-- Passing 0 to I/J means they'll get the well head I/J
W_1 0 0 1 1 / -- Active index: 0
W_2 0 0 1 1 / -- Active index: 1
W_2 0 0 2 2 / -- Active index: 101
W_3 0 0 1 1 / -- Active index: 2
/
WCONHIST
-- history rates are set so that W_1 produces 1, W_2 produces 2 etc.
-- index.offset.
-- organised as oil-water-gas
W_1 SHUT ORAT 10.1 10 10.2 /
W_2 SHUT ORAT 20.1 20 20.2 /
/
WCONINJH
-- Injection historical rates (water only, as we only support pure injectors)
W_3 WATER STOP 30.0 /
/
TSTEP
-- register time steps (in days). This allows us to write *two* report steps (1
-- and 2. Without this, totals/accumulations would fail (segfault) when looking
-- up historical rates and volumes. These volumes however don't change, i.e.
-- every time step has the same set of values
10 10 /
-- Register a fourth well with completions later. This ensure we handle when
-- wells are registered or activated later in a simulation
WELSPECS
'W_4' 'G_3' 1 1 3.33 'OIL' 7* /
/
COMPDAT
W_4 1 1 3 3 /
/
TSTEP
10 10 /

View File

@ -1,308 +0,0 @@
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
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/>.
Consult the COPYING file in the top-level source directory of this
module for the precise wording of the license and the list of
copyright holders.
*/
#include "config.h"
#define BOOST_TEST_MODULE EclOutput
#include <ebos/equil/equilibrationhelpers.hh>
#include <ebos/eclproblem.hh>
#include <ebos/collecttoiorank.hh>
#include <ebos/ecloutputblackoilmodule.hh>
#include <ebos/eclwriter.hh>
#include <opm/grid/UnstructuredGrid.h>
#include <opm/grid/GridManager.hpp>
#include <opm/input/eclipse/Schedule/Action/State.hpp>
#include <opm/input/eclipse/Units/Units.hpp>
#include <opm/io/eclipse/ESmry.hpp>
#include <opm/models/utils/start.hh>
#include <opm/output/eclipse/Summary.hpp>
#include <opm/simulators/flow/BlackoilModelParametersEbos.hpp>
#include <opm/simulators/wells/BlackoilWellModel.hpp>
#if HAVE_DUNE_FEM
#include <dune/fem/misc/mpimanager.hh>
#else
#include <dune/common/parallel/mpihelper.hh>
#endif
#include <array>
#include <iostream>
#include <limits>
#include <memory>
#include <numeric>
#include <sstream>
#include <string>
#include <vector>
#include <string.h>
#include <boost/test/unit_test.hpp>
#include <boost/version.hpp>
#if BOOST_VERSION / 100000 == 1 && BOOST_VERSION / 100 % 1000 < 71
#include <boost/test/floating_point_comparison.hpp>
#else
#include <boost/test/tools/floating_point_comparison.hpp>
#endif
namespace Opm::Properties {
namespace TTag {
struct TestEclOutputTypeTag {
using InheritsFrom = std::tuple<FlowModelParameters, EclBaseProblem, BlackOilModel>;
};
}
template<class TypeTag>
struct EnableTerminalOutput<TypeTag, TTag::EclBaseProblem> {
static constexpr bool value = true;
};
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::TestEclOutputTypeTag> {
static constexpr bool value = false;
};
template<class TypeTag>
struct EnableAsyncEclOutput<TypeTag, TTag::TestEclOutputTypeTag> {
static constexpr bool value = false;
};
template<class TypeTag>
struct EclWellModel<TypeTag, TTag::TestEclOutputTypeTag> {
using type = BlackoilWellModel<TypeTag>;
};
} // namespace Opm::Properties
namespace {
std::unique_ptr<Opm::EclIO::ESmry> readsum(const std::string& base)
{
return std::make_unique<Opm::EclIO::ESmry>(base);
}
double ecl_sum_get_field_var(const Opm::EclIO::ESmry* smry,
const int timeIdx,
const std::string& var)
{
return smry->get(var)[timeIdx];
}
double ecl_sum_get_general_var(const Opm::EclIO::ESmry* smry,
const int timeIdx,
const std::string& var)
{
return smry->get(var)[timeIdx];
}
template <class TypeTag>
std::unique_ptr<Opm::GetPropType<TypeTag, Opm::Properties::Simulator>>
initSimulator(const char *filename)
{
using Simulator = Opm::GetPropType<TypeTag, Opm::Properties::Simulator>;
std::string filenameArg = "--ecl-deck-file-name=";
filenameArg += filename;
const char* argv[] = {
"test_equil",
filenameArg.c_str()
};
Opm::setupParameters_<TypeTag>(/*argc=*/sizeof(argv)/sizeof(argv[0]), argv, /*registerParams=*/false);
Opm::EclGenericVanguard::readDeck(filename);
return std::make_unique<Simulator>();
}
struct EclOutputFixture {
EclOutputFixture () {
int argc = boost::unit_test::framework::master_test_suite().argc;
char** argv = boost::unit_test::framework::master_test_suite().argv;
#if HAVE_DUNE_FEM
Dune::Fem::MPIManager::initialize(argc, argv);
#else
Dune::MPIHelper::instance(argc, argv);
#endif
Opm::EclGenericVanguard::setCommunication(std::make_unique<Opm::Parallel::Communication>());
using TypeTag = Opm::Properties::TTag::TestEclOutputTypeTag;
Opm::BlackoilModelParametersEbos<TypeTag>::registerParameters();
Opm::Parameters::registerParam<TypeTag, bool>("EnableTerminalOutput",
"EnableTerminalOutput",
Opm::getPropValue<TypeTag, Opm::Properties::EnableTerminalOutput>(),
"Dummy added for the well model to compile.");
Opm::registerAllParameters_<TypeTag>();
}
};
}
BOOST_GLOBAL_FIXTURE(EclOutputFixture);
BOOST_AUTO_TEST_CASE(Summary)
{
using TypeTag = Opm::Properties::TTag::TestEclOutputTypeTag;
const std::string filename = "SUMMARY_DECK_NON_CONSTANT_POROSITY.DATA";
const std::string casename = "SUMMARY_DECK_NON_CONSTANT_POROSITY";
auto simulator = initSimulator<TypeTag>(filename.data());
using Grid = Opm::GetPropType<TypeTag, Opm::Properties::Grid>;
using EquilGrid = Opm::GetPropType<TypeTag, Opm::Properties::EquilGrid>;
using GridView = Opm::GetPropType<TypeTag, Opm::Properties::GridView>;
using CollectDataToIORankType = Opm::CollectDataToIORank<Grid,EquilGrid,GridView>;
CollectDataToIORankType collectToIORank(simulator->vanguard().grid(),
&simulator->vanguard().equilGrid(),
simulator->vanguard().gridView(),
simulator->vanguard().cartesianIndexMapper(),
&simulator->vanguard().equilCartesianIndexMapper());
Opm::EclOutputBlackOilModule<TypeTag> eclOutputModule(*simulator, {}, collectToIORank);
typedef Opm::EclWriter<TypeTag> EclWriterType;
// create the actual ECL writer
std::unique_ptr<EclWriterType> eclWriter = std::unique_ptr<EclWriterType>(new EclWriterType(*simulator));
simulator->model().applyInitialSolution();
Opm::data::Wells dw;
bool substep = false;
simulator->startNextEpisode(0.0, 1e30);
simulator->setEpisodeIndex(0);
eclWriter->evalSummaryState(substep);
eclWriter->writeOutput(substep);
simulator->setEpisodeIndex(1);
eclWriter->evalSummaryState(substep);
eclWriter->writeOutput(substep);
simulator->setEpisodeIndex(2);
eclWriter->evalSummaryState(substep);
eclWriter->writeOutput(substep);
auto res = readsum( casename );
const auto* resp = res.get();
// fpr = sum_ (p * hcpv ) / hcpv, hcpv = pv * (1 - sw)
const double fpr = ( (3 * 0.1 + 8 * 0.2) * 500 * (1 - 0.2) ) / ( (500*0.1 + 500*0.2) * (1 - 0.2));
BOOST_CHECK_CLOSE( fpr, ecl_sum_get_field_var( resp, 1, "FPR" ) , 1e-3 );
// foip = sum_ (b * s * pv), rs == 0;
const double foip = ( (0.3 * 0.1 + 0.8 * 0.2) * 500 * (1 - 0.2) );
BOOST_CHECK_CLOSE(foip, ecl_sum_get_field_var( resp, 1, "FOIP" ), 1e-1 );
// fgip = sum_ (b * pv * s), sg == 0;
const double fgip = 0.0;
BOOST_CHECK_CLOSE(fgip, ecl_sum_get_field_var( resp, 1, "FGIP" ), 1e-1 );
// fgip = sum_ (b * pv * s),
const double fwip = 1.0/1000 * ( 0.1 + 0.2) * 500 * 0.2;
BOOST_CHECK_CLOSE(fwip, ecl_sum_get_field_var( resp, 1, "FWIP" ), 1e-1 );
// region 1
// rpr = sum_ (p * hcpv ) / hcpv, hcpv = pv * (1 - sw)
const double rpr1 = ( 2.5 * 0.1 * 400 * (1 - 0.2) ) / (400*0.1 * (1 - 0.2));
BOOST_CHECK_CLOSE( rpr1, ecl_sum_get_general_var( resp, 1, "RPR:1" ) , 1e-3 );
// roip = sum_ (b * s * pv) // rs == 0;
const double roip1 = ( 0.25 * 0.1 * 400 * (1 - 0.2) );
BOOST_CHECK_CLOSE(roip1, ecl_sum_get_general_var( resp, 1, "ROIP:1" ), 1e-1 );
// region 2
// rpr = sum_ (p * hcpv ) / hcpv, hcpv = pv * (1 - sw)
const double rpr2 = ( (5 * 0.1 * 100 + 6 * 0.2 * 100) * (1 - 0.2) ) / ( (100*0.1 + 100*0.2) * (1 - 0.2));
BOOST_CHECK_CLOSE( rpr2, ecl_sum_get_general_var( resp, 1, "RPR:2" ) , 1e-3 );
// roip = sum_ (b * s * pv) // rs == 0;
const double roip2 = ( (0.5 * 0.1 * 100 + 0.6 * 0.2 * 100) * (1 - 0.2) );
BOOST_CHECK_CLOSE(roip2, ecl_sum_get_general_var( resp, 1, "ROIP:2" ), 1e-1 );
}
BOOST_AUTO_TEST_CASE(readWriteWells)
{
using opt = Opm::data::Rates::opt;
Opm::data::Rates r1, r2, rc1, rc2, rc3;
r1.set( opt::wat, 5.67 );
r1.set( opt::oil, 6.78 );
r1.set( opt::gas, 7.89 );
r2.set( opt::wat, 8.90 );
r2.set( opt::oil, 9.01 );
r2.set( opt::gas, 10.12 );
rc1.set( opt::wat, 20.41 );
rc1.set( opt::oil, 21.19 );
rc1.set( opt::gas, 22.41 );
rc2.set( opt::wat, 23.19 );
rc2.set( opt::oil, 24.41 );
rc2.set( opt::gas, 25.19 );
rc3.set( opt::wat, 26.41 );
rc3.set( opt::oil, 27.19 );
rc3.set( opt::gas, 28.41 );
Opm::data::Well w1, w2;
w1.rates = r1;
w1.bhp = 1.23;
w1.temperature = 3.45;
w1.control = 1;
//w1.injectionControl = 1;
//w1.productionControl = 1;
/*
* the connection keys (active indices) and well names correspond to the
* input deck. All other entries in the well structures are arbitrary.
*/
w1.connections.push_back( { 88, rc1, 30.45, 123.45, 0.0, 0.0, 0.0, 0.0, 123.456 } );
w1.connections.push_back( { 288, rc2, 33.19, 67.89, 0.0, 0.0, 0.0, 0.0, 123.456 } );
w2.rates = r2;
w2.bhp = 2.34;
w2.temperature = 4.56;
w2.control = 1;
//w1.injectionControl = 2;
//w1.productionControl = 2;
w2.connections.push_back( { 188, rc3, 36.22, 19.28, 0.0, 0.0, 0.0, 0.0, 123.456 } );
Opm::data::Wells wellRates;
wellRates["OP_1"] = w1;
wellRates["OP_2"] = w2;
typedef Dune :: Point2PointCommunicator< Dune :: SimpleMessageBuffer > P2PCommunicatorType;
typedef typename P2PCommunicatorType :: MessageBufferType MessageBufferType;
MessageBufferType buffer;
wellRates.write(buffer);
Opm::data::Wells wellRatesCopy;
wellRatesCopy.read(buffer);
BOOST_CHECK_EQUAL( wellRatesCopy.get( "OP_1" , opt::wat) , wellRates.get( "OP_1" , opt::wat));
BOOST_CHECK_EQUAL( wellRatesCopy.get( "OP_2" , 188 , opt::wat) , wellRates.get( "OP_2" , 188 , opt::wat));
}