|
|
|
|
@@ -1,45 +1,38 @@
|
|
|
|
|
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
|
// vi: set et ts=4 sw=4 sts=4:
|
|
|
|
|
/*
|
|
|
|
|
Copyright 2014 SINTEF ICT, Applied Mathematics.
|
|
|
|
|
*/
|
|
|
|
|
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"
|
|
|
|
|
|
|
|
|
|
/* --- Boost.Test boilerplate --- */
|
|
|
|
|
#if HAVE_DYNAMIC_BOOST_TEST
|
|
|
|
|
#define BOOST_TEST_DYN_LINK
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#define NVERBOSE // Suppress own messages when throw()ing
|
|
|
|
|
|
|
|
|
|
#define BOOST_TEST_MODULE UnitsTest
|
|
|
|
|
#include <boost/test/unit_test.hpp>
|
|
|
|
|
#include <boost/test/floating_point_comparison.hpp>
|
|
|
|
|
|
|
|
|
|
/* --- our own headers --- */
|
|
|
|
|
|
|
|
|
|
#include <opm/core/simulator/initStateEquil.hpp>
|
|
|
|
|
#include <ebos/equil/equilibrationhelpers.hh>
|
|
|
|
|
#include <ebos/eclproblem.hh>
|
|
|
|
|
#include <ewoms/common/start.hh>
|
|
|
|
|
|
|
|
|
|
#include <opm/core/grid.h>
|
|
|
|
|
#include <opm/core/grid/cart_grid.h>
|
|
|
|
|
#include <opm/core/grid/GridManager.hpp>
|
|
|
|
|
#include <opm/core/utility/compressedToCartesian.hpp>
|
|
|
|
|
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
|
|
|
|
|
|
|
|
|
#include <opm/material/fluidmatrixinteractions/EclMaterialLawManager.hpp>
|
|
|
|
|
#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
|
|
|
|
|
#include <opm/material/fluidsystems/BlackOilFluidSystem.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/DeckItem.hpp>
|
|
|
|
|
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
|
|
|
|
|
#include <opm/parser/eclipse/EclipseState/InitConfig/Equil.hpp>
|
|
|
|
|
#include <opm/parser/eclipse/Units/Dimension.hpp>
|
|
|
|
|
|
|
|
|
|
#include <opm/parser/eclipse/Units/Units.hpp>
|
|
|
|
|
|
|
|
|
|
#include <dune/common/parallel/mpihelper.hh>
|
|
|
|
|
|
|
|
|
|
#include <array>
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <limits>
|
|
|
|
|
@@ -48,28 +41,56 @@
|
|
|
|
|
#include <sstream>
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
|
#define CHECK(value, expected) \
|
|
|
|
|
{ \
|
|
|
|
|
if ((value) != (expected)) \
|
|
|
|
|
std::abort(); \
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
typedef Opm::FluidSystems::BlackOil<double> FluidSystem;
|
|
|
|
|
// Forward declaring the MaterialLawManager template.
|
|
|
|
|
typedef Opm::ThreePhaseMaterialTraits<double,
|
|
|
|
|
/*wettingPhaseIdx=*/FluidSystem::waterPhaseIdx,
|
|
|
|
|
/*nonWettingPhaseIdx=*/FluidSystem::oilPhaseIdx,
|
|
|
|
|
/*gasPhaseIdx=*/FluidSystem::gasPhaseIdx> MaterialTraits;
|
|
|
|
|
typedef Opm::EclMaterialLawManager<MaterialTraits> MaterialLawManager;
|
|
|
|
|
#define CHECK_CLOSE(value, expected, reltol) \
|
|
|
|
|
{ \
|
|
|
|
|
if (std::fabs((expected) - (value)) > 1e-14 && \
|
|
|
|
|
std::fabs(((expected) - (value))/((expected) + (value))) > reltol) \
|
|
|
|
|
std::abort(); \
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#define REQUIRE(cond) \
|
|
|
|
|
{ \
|
|
|
|
|
if (!(cond)) \
|
|
|
|
|
std::abort(); \
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#define CHECK(value, expected, reltol) \
|
|
|
|
|
{ \
|
|
|
|
|
if (std::fabs((expected)) < 1.e-14) \
|
|
|
|
|
BOOST_CHECK_SMALL((value), (reltol)); \
|
|
|
|
|
else \
|
|
|
|
|
BOOST_CHECK_CLOSE((value), (expected), (reltol)); \
|
|
|
|
|
namespace Ewoms {
|
|
|
|
|
namespace Properties {
|
|
|
|
|
NEW_TYPE_TAG(TestEquilTypeTag, INHERITS_FROM(BlackOilModel, EclBaseProblem));
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
|
|
template <class TypeTag>
|
|
|
|
|
std::unique_ptr<typename GET_PROP_TYPE(TypeTag, Simulator)>
|
|
|
|
|
initSimulator(const char *filename)
|
|
|
|
|
{
|
|
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
|
|
|
|
|
|
|
|
|
|
std::string filenameArg = "--ecl-deck-file-name=";
|
|
|
|
|
filenameArg += filename;
|
|
|
|
|
|
|
|
|
|
const char* argv[] = {
|
|
|
|
|
"test_equil",
|
|
|
|
|
filenameArg.c_str()
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Ewoms::setupParameters_<TypeTag>(/*argc=*/sizeof(argv)/sizeof(argv[0]), argv, /*registerParams=*/false);
|
|
|
|
|
|
|
|
|
|
return std::unique_ptr<Simulator>(new Simulator);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace
|
|
|
|
|
template <class TypeTag>
|
|
|
|
|
static void initDefaultFluidSystem()
|
|
|
|
|
{
|
|
|
|
|
static void initDefaultFluidSystem() {
|
|
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
|
|
|
|
|
|
|
|
|
|
std::vector<std::pair<double, double> > Bo = {
|
|
|
|
|
{ 101353, 1. },
|
|
|
|
|
{ 6.21542e+07, 1 }
|
|
|
|
|
@@ -130,13 +151,11 @@ static void initDefaultFluidSystem() {
|
|
|
|
|
FluidSystem::setWaterPvt(std::move(waterPvt));
|
|
|
|
|
FluidSystem::initEnd();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_SUITE ()
|
|
|
|
|
|
|
|
|
|
static Opm::EquilRecord mkEquilRecord( double datd, double datp,
|
|
|
|
|
double zwoc, double pcow_woc,
|
|
|
|
|
double zgoc, double pcgo_goc ) {
|
|
|
|
|
double zgoc, double pcgo_goc )
|
|
|
|
|
{
|
|
|
|
|
using namespace Opm;
|
|
|
|
|
|
|
|
|
|
DeckItem dd( "datdep", double() );
|
|
|
|
|
@@ -190,71 +209,74 @@ static Opm::EquilRecord mkEquilRecord( double datd, double datp,
|
|
|
|
|
return EquilRecord( rec );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE (PhasePressure)
|
|
|
|
|
void test_PhasePressure()
|
|
|
|
|
{
|
|
|
|
|
typedef std::vector<double> PVal;
|
|
|
|
|
typedef std::vector<PVal> PPress;
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<UnstructuredGrid>
|
|
|
|
|
G(create_grid_cart3d(10, 1, 10), destroy_grid);
|
|
|
|
|
|
|
|
|
|
auto record = mkEquilRecord( 0, 1e5, 5, 0, 0, 0 );
|
|
|
|
|
|
|
|
|
|
initDefaultFluidSystem();
|
|
|
|
|
typedef TTAG(TestEquilTypeTag) TypeTag;
|
|
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
|
|
|
|
|
auto simulator = initSimulator<TypeTag>("data/equil_base.DATA");
|
|
|
|
|
initDefaultFluidSystem<TypeTag>();
|
|
|
|
|
|
|
|
|
|
Opm::EQUIL::EquilReg
|
|
|
|
|
Ewoms::EQUIL::EquilReg
|
|
|
|
|
region(record,
|
|
|
|
|
std::make_shared<Opm::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
std::make_shared<Opm::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
std::make_shared<Ewoms::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
std::make_shared<Ewoms::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
0);
|
|
|
|
|
|
|
|
|
|
std::vector<int> cells(G->number_of_cells);
|
|
|
|
|
std::vector<int> cells(simulator->gridManager().grid().size(0));
|
|
|
|
|
std::iota(cells.begin(), cells.end(), 0);
|
|
|
|
|
|
|
|
|
|
const double grav = 10;
|
|
|
|
|
const PPress ppress = Opm::EQUIL::phasePressures<FluidSystem>(*G, region, cells, grav);
|
|
|
|
|
const PPress ppress = Ewoms::EQUIL::phasePressures<FluidSystem>(simulator->gridManager().grid(), region, cells, grav);
|
|
|
|
|
|
|
|
|
|
const int first = 0, last = G->number_of_cells - 1;
|
|
|
|
|
const int first = 0, last = simulator->gridManager().grid().size(0) - 1;
|
|
|
|
|
const double reltol = 1.0e-8;
|
|
|
|
|
BOOST_CHECK_CLOSE(ppress[0][first] , 90e3 , reltol);
|
|
|
|
|
BOOST_CHECK_CLOSE(ppress[0][last ] , 180e3 , reltol);
|
|
|
|
|
BOOST_CHECK_CLOSE(ppress[1][first] , 103.5e3 , reltol);
|
|
|
|
|
BOOST_CHECK_CLOSE(ppress[1][last ] , 166.5e3 , reltol);
|
|
|
|
|
CHECK_CLOSE(ppress[0][first] , 90e3 , reltol);
|
|
|
|
|
CHECK_CLOSE(ppress[0][last ] , 180e3 , reltol);
|
|
|
|
|
CHECK_CLOSE(ppress[1][first] , 103.5e3 , reltol);
|
|
|
|
|
CHECK_CLOSE(ppress[1][last ] , 166.5e3 , reltol);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE (CellSubset)
|
|
|
|
|
void test_CellSubset()
|
|
|
|
|
{
|
|
|
|
|
typedef std::vector<double> PVal;
|
|
|
|
|
typedef std::vector<PVal> PPress;
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<UnstructuredGrid>
|
|
|
|
|
G(create_grid_cart3d(10, 1, 10), destroy_grid);
|
|
|
|
|
|
|
|
|
|
initDefaultFluidSystem();
|
|
|
|
|
typedef TTAG(TestEquilTypeTag) TypeTag;
|
|
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
|
|
|
|
|
auto simulator = initSimulator<TypeTag>("data/equil_base.DATA");
|
|
|
|
|
const auto& eclipseState = simulator->gridManager().eclState();
|
|
|
|
|
Opm::GridManager gm(eclipseState.getInputGrid());
|
|
|
|
|
const UnstructuredGrid& grid = *(gm.c_grid());
|
|
|
|
|
initDefaultFluidSystem<TypeTag>();
|
|
|
|
|
|
|
|
|
|
Opm::EquilRecord record[] = { mkEquilRecord( 0, 1e5, 2.5, -0.075e5, 0, 0 ),
|
|
|
|
|
mkEquilRecord( 5, 1.35e5, 7.5, -0.225e5, 5, 0 ) };
|
|
|
|
|
|
|
|
|
|
Opm::EQUIL::EquilReg region[] =
|
|
|
|
|
Ewoms::EQUIL::EquilReg region[] =
|
|
|
|
|
{
|
|
|
|
|
Opm::EQUIL::EquilReg(record[0],
|
|
|
|
|
std::make_shared<Opm::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
std::make_shared<Opm::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
Ewoms::EQUIL::EquilReg(record[0],
|
|
|
|
|
std::make_shared<Ewoms::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
std::make_shared<Ewoms::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
0)
|
|
|
|
|
,
|
|
|
|
|
Opm::EQUIL::EquilReg(record[0],
|
|
|
|
|
std::make_shared<Opm::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
std::make_shared<Opm::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
Ewoms::EQUIL::EquilReg(record[0],
|
|
|
|
|
std::make_shared<Ewoms::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
std::make_shared<Ewoms::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
0)
|
|
|
|
|
,
|
|
|
|
|
Opm::EQUIL::EquilReg(record[1],
|
|
|
|
|
std::make_shared<Opm::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
std::make_shared<Opm::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
Ewoms::EQUIL::EquilReg(record[1],
|
|
|
|
|
std::make_shared<Ewoms::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
std::make_shared<Ewoms::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
0)
|
|
|
|
|
,
|
|
|
|
|
Opm::EQUIL::EquilReg(record[1],
|
|
|
|
|
std::make_shared<Opm::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
std::make_shared<Opm::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
Ewoms::EQUIL::EquilReg(record[1],
|
|
|
|
|
std::make_shared<Ewoms::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
std::make_shared<Ewoms::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
0)
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@@ -263,22 +285,22 @@ BOOST_AUTO_TEST_CASE (CellSubset)
|
|
|
|
|
for (std::size_t d = 1; d < 3; ++d) { ncoarse *= cdim[d]; }
|
|
|
|
|
|
|
|
|
|
std::vector< std::vector<int> > cells(ncoarse);
|
|
|
|
|
for (int c = 0; c < G->number_of_cells; ++c) {
|
|
|
|
|
for (int c = 0; c < simulator->gridManager().grid().size(0); ++c) {
|
|
|
|
|
int ci = c;
|
|
|
|
|
const int i = ci % G->cartdims[0]; ci /= G->cartdims[0];
|
|
|
|
|
const int j = ci % G->cartdims[1];
|
|
|
|
|
const int k = ci / G->cartdims[1];
|
|
|
|
|
const int i = ci % grid.cartdims[0]; ci /= grid.cartdims[0];
|
|
|
|
|
const int j = ci % grid.cartdims[1];
|
|
|
|
|
const int k = ci / grid.cartdims[1];
|
|
|
|
|
|
|
|
|
|
const int ic = (i / (G->cartdims[0] / cdim[0]));
|
|
|
|
|
const int jc = (j / (G->cartdims[1] / cdim[1]));
|
|
|
|
|
const int kc = (k / (G->cartdims[2] / cdim[2]));
|
|
|
|
|
const int ic = (i / (grid.cartdims[0] / cdim[0]));
|
|
|
|
|
const int jc = (j / (grid.cartdims[1] / cdim[1]));
|
|
|
|
|
const int kc = (k / (grid.cartdims[2] / cdim[2]));
|
|
|
|
|
const int ix = ic + cdim[0]*(jc + cdim[1]*kc);
|
|
|
|
|
|
|
|
|
|
assert ((0 <= ix) && (ix < ncoarse));
|
|
|
|
|
cells[ix].push_back(c);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PPress ppress(2, PVal(G->number_of_cells, 0));
|
|
|
|
|
PPress ppress(2, PVal(simulator->gridManager().grid().size(0), 0));
|
|
|
|
|
for (std::vector< std::vector<int> >::const_iterator
|
|
|
|
|
r = cells.begin(), e = cells.end();
|
|
|
|
|
r != e; ++r)
|
|
|
|
|
@@ -286,7 +308,7 @@ BOOST_AUTO_TEST_CASE (CellSubset)
|
|
|
|
|
const int rno = int(r - cells.begin());
|
|
|
|
|
const double grav = 10;
|
|
|
|
|
const PPress p =
|
|
|
|
|
Opm::EQUIL::phasePressures<FluidSystem>(*G, region[rno], *r, grav);
|
|
|
|
|
Ewoms::EQUIL::phasePressures<FluidSystem>(simulator->gridManager().grid(), region[rno], *r, grav);
|
|
|
|
|
|
|
|
|
|
PVal::size_type i = 0;
|
|
|
|
|
for (std::vector<int>::const_iterator
|
|
|
|
|
@@ -300,54 +322,51 @@ BOOST_AUTO_TEST_CASE (CellSubset)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const int first = 0, last = G->number_of_cells - 1;
|
|
|
|
|
const int first = 0, last = simulator->gridManager().grid().size(0) - 1;
|
|
|
|
|
const double reltol = 1.0e-8;
|
|
|
|
|
BOOST_CHECK_CLOSE(ppress[0][first] , 105e3 , reltol);
|
|
|
|
|
BOOST_CHECK_CLOSE(ppress[0][last ] , 195e3 , reltol);
|
|
|
|
|
BOOST_CHECK_CLOSE(ppress[1][first] , 103.5e3 , reltol);
|
|
|
|
|
BOOST_CHECK_CLOSE(ppress[1][last ] , 166.5e3 , reltol);
|
|
|
|
|
CHECK_CLOSE(ppress[0][first] , 105e3 , reltol);
|
|
|
|
|
CHECK_CLOSE(ppress[0][last ] , 195e3 , reltol);
|
|
|
|
|
CHECK_CLOSE(ppress[1][first] , 103.5e3 , reltol);
|
|
|
|
|
CHECK_CLOSE(ppress[1][last ] , 166.5e3 , reltol);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE (RegMapping)
|
|
|
|
|
void test_RegMapping()
|
|
|
|
|
{
|
|
|
|
|
typedef std::vector<double> PVal;
|
|
|
|
|
typedef std::vector<PVal> PPress;
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<UnstructuredGrid>
|
|
|
|
|
G(create_grid_cart3d(10, 1, 10), destroy_grid);
|
|
|
|
|
|
|
|
|
|
Opm::EquilRecord record[] = { mkEquilRecord( 0, 1e5, 2.5, -0.075e5, 0, 0 ),
|
|
|
|
|
mkEquilRecord( 5, 1.35e5, 7.5, -0.225e5, 5, 0 ) };
|
|
|
|
|
|
|
|
|
|
initDefaultFluidSystem();
|
|
|
|
|
typedef TTAG(TestEquilTypeTag) TypeTag;
|
|
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
|
|
|
|
|
auto simulator = initSimulator<TypeTag>("data/equil_base.DATA");
|
|
|
|
|
initDefaultFluidSystem<TypeTag>();
|
|
|
|
|
|
|
|
|
|
Opm::EQUIL::EquilReg region[] =
|
|
|
|
|
Ewoms::EQUIL::EquilReg region[] =
|
|
|
|
|
{
|
|
|
|
|
Opm::EQUIL::EquilReg(record[0],
|
|
|
|
|
std::make_shared<Opm::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
std::make_shared<Opm::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
Ewoms::EQUIL::EquilReg(record[0],
|
|
|
|
|
std::make_shared<Ewoms::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
std::make_shared<Ewoms::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
0)
|
|
|
|
|
,
|
|
|
|
|
Opm::EQUIL::EquilReg(record[0],
|
|
|
|
|
std::make_shared<Opm::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
std::make_shared<Opm::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
Ewoms::EQUIL::EquilReg(record[0],
|
|
|
|
|
std::make_shared<Ewoms::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
std::make_shared<Ewoms::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
0)
|
|
|
|
|
,
|
|
|
|
|
Opm::EQUIL::EquilReg(record[1],
|
|
|
|
|
std::make_shared<Opm::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
std::make_shared<Opm::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
Ewoms::EQUIL::EquilReg(record[1],
|
|
|
|
|
std::make_shared<Ewoms::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
std::make_shared<Ewoms::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
0)
|
|
|
|
|
,
|
|
|
|
|
Opm::EQUIL::EquilReg(record[1],
|
|
|
|
|
std::make_shared<Opm::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
std::make_shared<Opm::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
Ewoms::EQUIL::EquilReg(record[1],
|
|
|
|
|
std::make_shared<Ewoms::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
std::make_shared<Ewoms::EQUIL::Miscibility::NoMixing>(),
|
|
|
|
|
0)
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
std::vector<int> eqlnum(G->number_of_cells);
|
|
|
|
|
std::vector<int> eqlnum(simulator->gridManager().grid().size(0));
|
|
|
|
|
// [ 0 1; 2 3]
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < 5; ++i) {
|
|
|
|
|
@@ -368,16 +387,16 @@ BOOST_AUTO_TEST_CASE (RegMapping)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Opm::RegionMapping<> eqlmap(eqlnum);
|
|
|
|
|
Ewoms::RegionMapping<> eqlmap(eqlnum);
|
|
|
|
|
|
|
|
|
|
PPress ppress(2, PVal(G->number_of_cells, 0));
|
|
|
|
|
PPress ppress(2, PVal(simulator->gridManager().grid().size(0), 0));
|
|
|
|
|
for (const auto& r : eqlmap.activeRegions()) {
|
|
|
|
|
const auto& rng = eqlmap.cells(r);
|
|
|
|
|
|
|
|
|
|
const int rno = r;
|
|
|
|
|
const double grav = 10;
|
|
|
|
|
const PPress p =
|
|
|
|
|
Opm::EQUIL::phasePressures<FluidSystem>(*G, region[rno], rng, grav);
|
|
|
|
|
Ewoms::EQUIL::phasePressures<FluidSystem>(simulator->gridManager().grid(), region[rno], rng, grav);
|
|
|
|
|
|
|
|
|
|
PVal::size_type i = 0;
|
|
|
|
|
for (const auto& c : rng) {
|
|
|
|
|
@@ -390,76 +409,47 @@ BOOST_AUTO_TEST_CASE (RegMapping)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const int first = 0, last = G->number_of_cells - 1;
|
|
|
|
|
const int first = 0, last = simulator->gridManager().grid().size(0) - 1;
|
|
|
|
|
const double reltol = 1.0e-8;
|
|
|
|
|
BOOST_CHECK_CLOSE(ppress[0][first] , 105e3 , reltol);
|
|
|
|
|
BOOST_CHECK_CLOSE(ppress[0][last ] , 195e3 , reltol);
|
|
|
|
|
BOOST_CHECK_CLOSE(ppress[1][first] , 103.5e3 , reltol);
|
|
|
|
|
BOOST_CHECK_CLOSE(ppress[1][last ] , 166.5e3 , reltol);
|
|
|
|
|
CHECK_CLOSE(ppress[0][first] , 105e3 , reltol);
|
|
|
|
|
CHECK_CLOSE(ppress[0][last ] , 195e3 , reltol);
|
|
|
|
|
CHECK_CLOSE(ppress[1][first] , 103.5e3 , reltol);
|
|
|
|
|
CHECK_CLOSE(ppress[1][last ] , 166.5e3 , reltol);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE (DeckAllDead)
|
|
|
|
|
void test_DeckAllDead()
|
|
|
|
|
{
|
|
|
|
|
std::shared_ptr<UnstructuredGrid>
|
|
|
|
|
grid(create_grid_cart3d(1, 1, 10), destroy_grid);
|
|
|
|
|
Opm::ParseContext parseContext;
|
|
|
|
|
Opm::Parser parser;
|
|
|
|
|
Opm::Deck deck = parser.parseFile("deadfluids.DATA" , parseContext);
|
|
|
|
|
Opm::EclipseState eclipseState(deck, parseContext); // Create material law manager.
|
|
|
|
|
typedef TTAG(TestEquilTypeTag) TypeTag;
|
|
|
|
|
auto simulator = initSimulator<TypeTag>("data/equil_deadfluids.DATA");
|
|
|
|
|
const auto& eclipseState = simulator->gridManager().eclState();
|
|
|
|
|
Opm::GridManager gm(eclipseState.getInputGrid());
|
|
|
|
|
const UnstructuredGrid& grid = *(gm.c_grid());
|
|
|
|
|
|
|
|
|
|
std::vector<int> compressedToCartesianIdx
|
|
|
|
|
= Opm::compressedToCartesian(grid->number_of_cells, grid->global_cell);
|
|
|
|
|
MaterialLawManager materialLawManager = MaterialLawManager();
|
|
|
|
|
materialLawManager.initFromDeck(deck, eclipseState, compressedToCartesianIdx);
|
|
|
|
|
|
|
|
|
|
typedef Opm::FluidSystems::BlackOil<double> FluidSystem;
|
|
|
|
|
|
|
|
|
|
// Initialize the fluid system
|
|
|
|
|
FluidSystem::initFromDeck(deck, eclipseState);
|
|
|
|
|
|
|
|
|
|
Opm::EQUIL::DeckDependent::InitialStateComputer<FluidSystem> comp(materialLawManager, eclipseState, *grid, 10.0);
|
|
|
|
|
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> comp(*simulator->problem().materialLawManager(), eclipseState, simulator->gridManager().grid(), 10.0);
|
|
|
|
|
const auto& pressures = comp.press();
|
|
|
|
|
BOOST_REQUIRE(pressures.size() == 3);
|
|
|
|
|
BOOST_REQUIRE(int(pressures[0].size()) == grid->number_of_cells);
|
|
|
|
|
REQUIRE(pressures.size() == 3);
|
|
|
|
|
REQUIRE(int(pressures[0].size()) == grid.number_of_cells);
|
|
|
|
|
|
|
|
|
|
const int first = 0, last = grid->number_of_cells - 1;
|
|
|
|
|
const int first = 0, last = grid.number_of_cells - 1;
|
|
|
|
|
// The relative tolerance is too loose to be very useful,
|
|
|
|
|
// but the answer we are checking is the result of an ODE
|
|
|
|
|
// solver, and it is unclear if we should check it against
|
|
|
|
|
// the true answer or something else.
|
|
|
|
|
const double reltol = 1.0e-3;
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[0][first] , 1.496329839e7 , reltol);
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[0][last ] , 1.504526940e7 , reltol);
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[1][last] , 1.504526940e7 , reltol);
|
|
|
|
|
CHECK_CLOSE(pressures[0][first] , 1.496329839e7 , reltol);
|
|
|
|
|
CHECK_CLOSE(pressures[0][last ] , 1.504526940e7 , reltol);
|
|
|
|
|
CHECK_CLOSE(pressures[1][last] , 1.504526940e7 , reltol);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE (CapillaryInversion)
|
|
|
|
|
void test_CapillaryInversion()
|
|
|
|
|
{
|
|
|
|
|
// Test setup.
|
|
|
|
|
Opm::GridManager gm(1, 1, 40, 1.0, 1.0, 2.5);
|
|
|
|
|
const UnstructuredGrid& grid = *(gm.c_grid());
|
|
|
|
|
Opm::Parser parser;
|
|
|
|
|
Opm::ParseContext parseContext;
|
|
|
|
|
Opm::Deck deck = parser.parseFile("capillary.DATA" , parseContext);
|
|
|
|
|
Opm::EclipseState eclipseState(deck , parseContext);
|
|
|
|
|
typedef typename TTAG(TestEquilTypeTag) TypeTag;
|
|
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
|
|
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
|
|
|
|
|
typedef typename GET_PROP(TypeTag, MaterialLaw)::EclMaterialLawManager MaterialLawManager;
|
|
|
|
|
auto simulator = initSimulator<TypeTag>("data/equil_capillary.DATA");
|
|
|
|
|
|
|
|
|
|
// Create material law manager.
|
|
|
|
|
std::vector<int> compressedToCartesianIdx
|
|
|
|
|
= Opm::compressedToCartesian(grid.number_of_cells, grid.global_cell);
|
|
|
|
|
MaterialLawManager materialLawManager = MaterialLawManager();
|
|
|
|
|
materialLawManager.initFromDeck(deck, eclipseState, compressedToCartesianIdx);
|
|
|
|
|
|
|
|
|
|
typedef Opm::FluidSystems::BlackOil<double> FluidSystem;
|
|
|
|
|
typedef MaterialLawManager::MaterialLaw MaterialLaw;
|
|
|
|
|
|
|
|
|
|
if (!FluidSystem::isInitialized()) {
|
|
|
|
|
// make sure that we don't initialize the fluid system twice
|
|
|
|
|
FluidSystem::initFromDeck(deck, eclipseState);
|
|
|
|
|
}
|
|
|
|
|
// Test the capillary inversion for oil-water.
|
|
|
|
|
const int cell = 0;
|
|
|
|
|
const double reltol = 1.0e-7;
|
|
|
|
|
@@ -468,10 +458,10 @@ BOOST_AUTO_TEST_CASE (CapillaryInversion)
|
|
|
|
|
const bool increasing = false;
|
|
|
|
|
const std::vector<double> pc = { 10.0e5, 0.5e5, 0.4e5, 0.3e5, 0.2e5, 0.1e5, 0.099e5, 0.0e5, -10.0e5 };
|
|
|
|
|
const std::vector<double> s = { 0.2, 0.2, 0.2, 0.466666666666, 0.733333333333, 1.0, 1.0, 1.0, 1.0 };
|
|
|
|
|
BOOST_REQUIRE(pc.size() == s.size());
|
|
|
|
|
REQUIRE(pc.size() == s.size());
|
|
|
|
|
for (size_t i = 0; i < pc.size(); ++i) {
|
|
|
|
|
const double s_computed = Opm::EQUIL::satFromPc<FluidSystem, MaterialLaw, MaterialLawManager>(materialLawManager, phase, cell, pc[i], increasing);
|
|
|
|
|
BOOST_CHECK_CLOSE(s_computed, s[i], reltol);
|
|
|
|
|
const double s_computed = Ewoms::EQUIL::satFromPc<FluidSystem, MaterialLaw, MaterialLawManager>(*simulator->problem().materialLawManager(), phase, cell, pc[i], increasing);
|
|
|
|
|
CHECK_CLOSE(s_computed, s[i], reltol);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -481,10 +471,10 @@ BOOST_AUTO_TEST_CASE (CapillaryInversion)
|
|
|
|
|
const bool increasing = true;
|
|
|
|
|
const std::vector<double> pc = { 10.0e5, 0.6e5, 0.5e5, 0.4e5, 0.3e5, 0.2e5, 0.1e5, 0.0e5, -10.0e5 };
|
|
|
|
|
const std::vector<double> s = { 0.8, 0.8, 0.8, 0.533333333333, 0.266666666666, 0.0, 0.0, 0.0, 0.0 };
|
|
|
|
|
BOOST_REQUIRE(pc.size() == s.size());
|
|
|
|
|
REQUIRE(pc.size() == s.size());
|
|
|
|
|
for (size_t i = 0; i < pc.size(); ++i) {
|
|
|
|
|
const double s_computed = Opm::EQUIL::satFromPc<FluidSystem, MaterialLaw, MaterialLawManager>(materialLawManager, phase, cell, pc[i], increasing);
|
|
|
|
|
BOOST_CHECK_CLOSE(s_computed, s[i], reltol);
|
|
|
|
|
const double s_computed = Ewoms::EQUIL::satFromPc<FluidSystem, MaterialLaw, MaterialLawManager>(*simulator->problem().materialLawManager(), phase, cell, pc[i], increasing);
|
|
|
|
|
CHECK_CLOSE(s_computed, s[i], reltol);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -494,41 +484,27 @@ BOOST_AUTO_TEST_CASE (CapillaryInversion)
|
|
|
|
|
const int gas = 2;
|
|
|
|
|
const std::vector<double> pc = { 0.9e5, 0.8e5, 0.6e5, 0.4e5, 0.3e5 };
|
|
|
|
|
const std::vector<double> s = { 0.2, 0.333333333333, 0.6, 0.866666666666, 1.0 };
|
|
|
|
|
BOOST_REQUIRE(pc.size() == s.size());
|
|
|
|
|
REQUIRE(pc.size() == s.size());
|
|
|
|
|
for (size_t i = 0; i < pc.size(); ++i) {
|
|
|
|
|
const double s_computed = Opm::EQUIL::satFromSumOfPcs<FluidSystem, MaterialLaw, MaterialLawManager>(materialLawManager, water, gas, cell, pc[i]);
|
|
|
|
|
BOOST_CHECK_CLOSE(s_computed, s[i], reltol);
|
|
|
|
|
const double s_computed = Ewoms::EQUIL::satFromSumOfPcs<FluidSystem, MaterialLaw, MaterialLawManager>(*simulator->problem().materialLawManager(), water, gas, cell, pc[i]);
|
|
|
|
|
CHECK_CLOSE(s_computed, s[i], reltol);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE (DeckWithCapillary)
|
|
|
|
|
void test_DeckWithCapillary()
|
|
|
|
|
{
|
|
|
|
|
Opm::GridManager gm(1, 1, 20, 1.0, 1.0, 5.0);
|
|
|
|
|
typedef typename TTAG(TestEquilTypeTag) TypeTag;
|
|
|
|
|
auto simulator = initSimulator<TypeTag>("data/equil_capillary.DATA");
|
|
|
|
|
auto& eclipseState = simulator->gridManager().eclState();
|
|
|
|
|
Opm::GridManager gm(eclipseState.getInputGrid());
|
|
|
|
|
const UnstructuredGrid& grid = *(gm.c_grid());
|
|
|
|
|
Opm::Parser parser;
|
|
|
|
|
Opm::ParseContext parseContext;
|
|
|
|
|
Opm::Deck deck = parser.parseFile("capillary.DATA" , parseContext);
|
|
|
|
|
Opm::EclipseState eclipseState(deck , parseContext);
|
|
|
|
|
|
|
|
|
|
// Create material law manager.
|
|
|
|
|
std::vector<int> compressedToCartesianIdx
|
|
|
|
|
= Opm::compressedToCartesian(grid.number_of_cells, grid.global_cell);
|
|
|
|
|
MaterialLawManager materialLawManager = MaterialLawManager();
|
|
|
|
|
materialLawManager.initFromDeck(deck, eclipseState, compressedToCartesianIdx);
|
|
|
|
|
|
|
|
|
|
typedef Opm::FluidSystems::BlackOil<double> FluidSystem;
|
|
|
|
|
|
|
|
|
|
// Initialize the fluid system
|
|
|
|
|
FluidSystem::initFromDeck(deck, eclipseState);
|
|
|
|
|
|
|
|
|
|
Opm::EQUIL::DeckDependent::InitialStateComputer<FluidSystem> comp(materialLawManager, eclipseState, grid, 10.0);
|
|
|
|
|
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> comp(*simulator->problem().materialLawManager(), eclipseState, simulator->gridManager().grid(), 10.0);
|
|
|
|
|
|
|
|
|
|
const auto& pressures = comp.press();
|
|
|
|
|
BOOST_REQUIRE(pressures.size() == 3);
|
|
|
|
|
BOOST_REQUIRE(int(pressures[0].size()) == grid.number_of_cells);
|
|
|
|
|
REQUIRE(pressures.size() == 3);
|
|
|
|
|
REQUIRE(int(pressures[0].size()) == grid.number_of_cells);
|
|
|
|
|
|
|
|
|
|
const int first = 0, last = grid.number_of_cells - 1;
|
|
|
|
|
// The relative tolerance is too loose to be very useful,
|
|
|
|
|
@@ -536,9 +512,9 @@ BOOST_AUTO_TEST_CASE (DeckWithCapillary)
|
|
|
|
|
// solver, and it is unclear if we should check it against
|
|
|
|
|
// the true answer or something else.
|
|
|
|
|
const double reltol = 1.0e-6;
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[0][first] , 1.469769063e7 , reltol);
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[0][last ] , 15452880.328284413 , reltol);
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[1][last] , 15462880.328284413 , reltol);
|
|
|
|
|
CHECK_CLOSE(pressures[0][first] , 1.469769063e7 , reltol);
|
|
|
|
|
CHECK_CLOSE(pressures[0][last ] , 15452880.328284413 , reltol);
|
|
|
|
|
CHECK_CLOSE(pressures[1][last] , 15462880.328284413 , reltol);
|
|
|
|
|
|
|
|
|
|
const auto& sats = comp.saturation();
|
|
|
|
|
const std::vector<double> s[3]{
|
|
|
|
|
@@ -547,39 +523,25 @@ BOOST_AUTO_TEST_CASE (DeckWithCapillary)
|
|
|
|
|
{ 0.8, 0.8, 0.8, 0.79265183888768165, 0.0072772917691866562, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
|
|
|
|
|
};
|
|
|
|
|
for (int phase = 0; phase < 3; ++phase) {
|
|
|
|
|
BOOST_REQUIRE(sats[phase].size() == s[phase].size());
|
|
|
|
|
REQUIRE(sats[phase].size() == s[phase].size());
|
|
|
|
|
for (size_t i = 0; i < s[phase].size(); ++i) {
|
|
|
|
|
CHECK(sats[phase][i], s[phase][i], reltol);
|
|
|
|
|
CHECK_CLOSE(sats[phase][i], s[phase][i], reltol);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE (DeckWithCapillaryOverlap)
|
|
|
|
|
void test_DeckWithCapillaryOverlap()
|
|
|
|
|
{
|
|
|
|
|
Opm::GridManager gm(1, 1, 20, 1.0, 1.0, 5.0);
|
|
|
|
|
typedef typename TTAG(TestEquilTypeTag) TypeTag;
|
|
|
|
|
auto simulator = initSimulator<TypeTag>("data/equil_capillary_overlap.DATA");
|
|
|
|
|
const auto& eclipseState = simulator->gridManager().eclState();
|
|
|
|
|
Opm::GridManager gm(eclipseState.getInputGrid());
|
|
|
|
|
const UnstructuredGrid& grid = *(gm.c_grid());
|
|
|
|
|
Opm::Parser parser;
|
|
|
|
|
Opm::ParseContext parseContext;
|
|
|
|
|
Opm::Deck deck = parser.parseFile("capillary_overlap.DATA" , parseContext);
|
|
|
|
|
Opm::EclipseState eclipseState(deck , parseContext);
|
|
|
|
|
// Create material law manager.
|
|
|
|
|
std::vector<int> compressedToCartesianIdx
|
|
|
|
|
= Opm::compressedToCartesian(grid.number_of_cells, grid.global_cell);
|
|
|
|
|
MaterialLawManager materialLawManager = MaterialLawManager();
|
|
|
|
|
materialLawManager.initFromDeck(deck, eclipseState, compressedToCartesianIdx);
|
|
|
|
|
|
|
|
|
|
typedef Opm::FluidSystems::BlackOil<double> FluidSystem;
|
|
|
|
|
|
|
|
|
|
// Initialize the fluid system
|
|
|
|
|
FluidSystem::initFromDeck(deck, eclipseState);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Opm::EQUIL::DeckDependent::InitialStateComputer<FluidSystem> comp(materialLawManager, eclipseState, grid, 9.80665);
|
|
|
|
|
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> comp(*simulator->problem().materialLawManager(), eclipseState, simulator->gridManager().grid(), 9.80665);
|
|
|
|
|
const auto& pressures = comp.press();
|
|
|
|
|
BOOST_REQUIRE(pressures.size() == 3);
|
|
|
|
|
BOOST_REQUIRE(int(pressures[0].size()) == grid.number_of_cells);
|
|
|
|
|
REQUIRE(pressures.size() == 3);
|
|
|
|
|
REQUIRE(int(pressures[0].size()) == grid.number_of_cells);
|
|
|
|
|
|
|
|
|
|
const int first = 0, last = grid.number_of_cells - 1;
|
|
|
|
|
// The relative tolerance is too loose to be very useful,
|
|
|
|
|
@@ -588,14 +550,14 @@ BOOST_AUTO_TEST_CASE (DeckWithCapillaryOverlap)
|
|
|
|
|
// the true answer or something else.
|
|
|
|
|
const double reltol = 1.0e-6;
|
|
|
|
|
const double reltol_ecl = 1.0;
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[0][first], 1.48324e+07, reltol_ecl); // eclipse
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[0][last], 1.54801e+07, reltol_ecl);
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[1][first], 1.49224e+07, reltol_ecl);
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[1][last], 1.54901e+07, reltol_ecl);
|
|
|
|
|
CHECK_CLOSE(pressures[0][first], 1.48324e+07, reltol_ecl); // eclipse
|
|
|
|
|
CHECK_CLOSE(pressures[0][last], 1.54801e+07, reltol_ecl);
|
|
|
|
|
CHECK_CLOSE(pressures[1][first], 1.49224e+07, reltol_ecl);
|
|
|
|
|
CHECK_CLOSE(pressures[1][last], 1.54901e+07, reltol_ecl);
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[0][first] , 14832467.14, reltol); // opm
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[0][last ] , 15479883.47, reltol);
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[1][last ] , 15489883.47, reltol);
|
|
|
|
|
CHECK_CLOSE(pressures[0][first] , 14832467.14, reltol); // opm
|
|
|
|
|
CHECK_CLOSE(pressures[0][last ] , 15479883.47, reltol);
|
|
|
|
|
CHECK_CLOSE(pressures[1][last ] , 15489883.47, reltol);
|
|
|
|
|
|
|
|
|
|
const auto& sats = comp.saturation();
|
|
|
|
|
// std::cout << "Saturations:\n";
|
|
|
|
|
@@ -618,39 +580,28 @@ BOOST_AUTO_TEST_CASE (DeckWithCapillaryOverlap)
|
|
|
|
|
{ 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.77107068773113863, 0.46593542169947511, 0.015192997516294321, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
|
|
|
|
|
};
|
|
|
|
|
for (int phase = 0; phase < 3; ++phase) {
|
|
|
|
|
BOOST_REQUIRE(sats[phase].size() == s_opm[phase].size());
|
|
|
|
|
REQUIRE(sats[phase].size() == s_opm[phase].size());
|
|
|
|
|
for (size_t i = 0; i < s_opm[phase].size(); ++i) {
|
|
|
|
|
//std::cout << std::setprecision(10) << sats[phase][i] << '\n';
|
|
|
|
|
CHECK(sats[phase][i], s_ecl[phase][i], reltol_ecl);
|
|
|
|
|
CHECK(sats[phase][i], s_opm[phase][i], reltol);
|
|
|
|
|
CHECK_CLOSE(sats[phase][i], s_ecl[phase][i], reltol_ecl);
|
|
|
|
|
CHECK_CLOSE(sats[phase][i], s_opm[phase][i], reltol);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE (DeckWithLiveOil)
|
|
|
|
|
void test_DeckWithLiveOil()
|
|
|
|
|
{
|
|
|
|
|
Opm::GridManager gm(1, 1, 20, 1.0, 1.0, 5.0);
|
|
|
|
|
typedef typename TTAG(TestEquilTypeTag) TypeTag;
|
|
|
|
|
auto simulator = initSimulator<TypeTag>("data/equil_liveoil.DATA");
|
|
|
|
|
const auto& eclipseState = simulator->gridManager().eclState();
|
|
|
|
|
Opm::GridManager gm(eclipseState.getInputGrid());
|
|
|
|
|
const UnstructuredGrid& grid = *(gm.c_grid());
|
|
|
|
|
Opm::Parser parser;
|
|
|
|
|
Opm::ParseContext parseContext;
|
|
|
|
|
Opm::Deck deck = parser.parseFile("equil_liveoil.DATA" , parseContext);
|
|
|
|
|
Opm::EclipseState eclipseState(deck , parseContext);
|
|
|
|
|
// Create material law manager.
|
|
|
|
|
std::vector<int> compressedToCartesianIdx
|
|
|
|
|
= Opm::compressedToCartesian(grid.number_of_cells, grid.global_cell);
|
|
|
|
|
MaterialLawManager materialLawManager = MaterialLawManager();
|
|
|
|
|
materialLawManager.initFromDeck(deck, eclipseState, compressedToCartesianIdx);
|
|
|
|
|
|
|
|
|
|
typedef Opm::FluidSystems::BlackOil<double> FluidSystem;
|
|
|
|
|
|
|
|
|
|
// Initialize the fluid system
|
|
|
|
|
FluidSystem::initFromDeck(deck, eclipseState);
|
|
|
|
|
Opm::EQUIL::DeckDependent::InitialStateComputer<FluidSystem> comp(materialLawManager, eclipseState, grid, 9.80665);
|
|
|
|
|
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> comp(*simulator->problem().materialLawManager(), eclipseState, simulator->gridManager().grid(), 9.80665);
|
|
|
|
|
const auto& pressures = comp.press();
|
|
|
|
|
BOOST_REQUIRE(pressures.size() == 3);
|
|
|
|
|
BOOST_REQUIRE(int(pressures[0].size()) == grid.number_of_cells);
|
|
|
|
|
REQUIRE(pressures.size() == 3);
|
|
|
|
|
REQUIRE(int(pressures[0].size()) == grid.number_of_cells);
|
|
|
|
|
|
|
|
|
|
const int first = 0, last = grid.number_of_cells - 1;
|
|
|
|
|
// The relative tolerance is too loose to be very useful,
|
|
|
|
|
@@ -659,15 +610,15 @@ BOOST_AUTO_TEST_CASE (DeckWithLiveOil)
|
|
|
|
|
// the true answer or something else.
|
|
|
|
|
const double reltol = 1.0e-6;
|
|
|
|
|
const double reltol_ecl = 1.0;
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[0][first], 1.48324e+07, reltol_ecl); // eclipse
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[0][last], 1.54801e+07, reltol_ecl);
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[1][first], 1.49224e+07, reltol_ecl);
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[1][last], 1.54901e+07, reltol_ecl);
|
|
|
|
|
CHECK_CLOSE(pressures[0][first], 1.48324e+07, reltol_ecl); // eclipse
|
|
|
|
|
CHECK_CLOSE(pressures[0][last], 1.54801e+07, reltol_ecl);
|
|
|
|
|
CHECK_CLOSE(pressures[1][first], 1.49224e+07, reltol_ecl);
|
|
|
|
|
CHECK_CLOSE(pressures[1][last], 1.54901e+07, reltol_ecl);
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[0][first], 1.483246714e7, reltol); // opm
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[0][last], 1.547991652e7, reltol);
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[1][first], 1.492246714e7, reltol);
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[1][last], 1.548991652e7, reltol);
|
|
|
|
|
CHECK_CLOSE(pressures[0][first], 1.483246714e7, reltol); // opm
|
|
|
|
|
CHECK_CLOSE(pressures[0][last], 1.547991652e7, reltol);
|
|
|
|
|
CHECK_CLOSE(pressures[1][first], 1.492246714e7, reltol);
|
|
|
|
|
CHECK_CLOSE(pressures[1][last], 1.548991652e7, reltol);
|
|
|
|
|
|
|
|
|
|
const auto& sats = comp.saturation();
|
|
|
|
|
// std::cout << "Saturations:\n";
|
|
|
|
|
@@ -688,11 +639,11 @@ BOOST_AUTO_TEST_CASE (DeckWithLiveOil)
|
|
|
|
|
{ 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.77083036553538653, 0.46569509476225479, 0.014706750907401245, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
|
|
|
|
|
};
|
|
|
|
|
for (int phase = 0; phase < 3; ++phase) {
|
|
|
|
|
BOOST_REQUIRE(sats[phase].size() == s_opm[phase].size());
|
|
|
|
|
REQUIRE(sats[phase].size() == s_opm[phase].size());
|
|
|
|
|
for (size_t i = 0; i < s_opm[phase].size(); ++i) {
|
|
|
|
|
//std::cout << std::setprecision(10) << sats[phase][i] << '\n';
|
|
|
|
|
CHECK(sats[phase][i], s_opm[phase][i], reltol);
|
|
|
|
|
CHECK(sats[phase][i], s_ecl[phase][i], reltol_ecl);
|
|
|
|
|
CHECK_CLOSE(sats[phase][i], s_opm[phase][i], reltol);
|
|
|
|
|
CHECK_CLOSE(sats[phase][i], s_ecl[phase][i], reltol_ecl);
|
|
|
|
|
}
|
|
|
|
|
std::cout << std::endl;
|
|
|
|
|
}
|
|
|
|
|
@@ -710,36 +661,23 @@ BOOST_AUTO_TEST_CASE (DeckWithLiveOil)
|
|
|
|
|
75.000000, 75.000000, 75.000000, 75.000000};
|
|
|
|
|
for (size_t i = 0; i < rs_opm.size(); ++i) {
|
|
|
|
|
//std::cout << std::setprecision(10) << rs[i] << '\n';
|
|
|
|
|
BOOST_CHECK_CLOSE(rs[i], rs_opm[i], reltol);
|
|
|
|
|
BOOST_CHECK_CLOSE(rs[i], rs_ecl[i], reltol_ecl);
|
|
|
|
|
CHECK_CLOSE(rs[i], rs_opm[i], reltol);
|
|
|
|
|
CHECK_CLOSE(rs[i], rs_ecl[i], reltol_ecl);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE (DeckWithLiveGas)
|
|
|
|
|
void test_DeckWithLiveGas()
|
|
|
|
|
{
|
|
|
|
|
Opm::GridManager gm(1, 1, 20, 1.0, 1.0, 5.0);
|
|
|
|
|
typedef typename TTAG(TestEquilTypeTag) TypeTag;
|
|
|
|
|
auto simulator = initSimulator<TypeTag>("data/equil_livegas.DATA");
|
|
|
|
|
const auto& eclipseState = simulator->gridManager().eclState();
|
|
|
|
|
Opm::GridManager gm(eclipseState.getInputGrid());
|
|
|
|
|
const UnstructuredGrid& grid = *(gm.c_grid());
|
|
|
|
|
Opm::Parser parser;
|
|
|
|
|
Opm::ParseContext parseContext;
|
|
|
|
|
Opm::Deck deck = parser.parseFile("equil_livegas.DATA" , parseContext);
|
|
|
|
|
Opm::EclipseState eclipseState(deck , parseContext);
|
|
|
|
|
// Create material law manager.
|
|
|
|
|
std::vector<int> compressedToCartesianIdx
|
|
|
|
|
= Opm::compressedToCartesian(grid.number_of_cells, grid.global_cell);
|
|
|
|
|
MaterialLawManager materialLawManager = MaterialLawManager();
|
|
|
|
|
materialLawManager.initFromDeck(deck, eclipseState, compressedToCartesianIdx);
|
|
|
|
|
|
|
|
|
|
typedef Opm::FluidSystems::BlackOil<double> FluidSystem;
|
|
|
|
|
|
|
|
|
|
// Initialize the fluid system
|
|
|
|
|
FluidSystem::initFromDeck(deck, eclipseState);
|
|
|
|
|
|
|
|
|
|
Opm::EQUIL::DeckDependent::InitialStateComputer<FluidSystem> comp(materialLawManager, eclipseState, grid, 9.80665);
|
|
|
|
|
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> comp(*simulator->problem().materialLawManager(), eclipseState, simulator->gridManager().grid(), 9.80665);
|
|
|
|
|
const auto& pressures = comp.press();
|
|
|
|
|
BOOST_REQUIRE(pressures.size() == 3);
|
|
|
|
|
BOOST_REQUIRE(int(pressures[0].size()) == grid.number_of_cells);
|
|
|
|
|
REQUIRE(pressures.size() == 3);
|
|
|
|
|
REQUIRE(int(pressures[0].size()) == grid.number_of_cells);
|
|
|
|
|
|
|
|
|
|
const int first = 0, last = grid.number_of_cells - 1;
|
|
|
|
|
// The relative tolerance is too loose to be very useful,
|
|
|
|
|
@@ -748,15 +686,15 @@ BOOST_AUTO_TEST_CASE (DeckWithLiveGas)
|
|
|
|
|
// the true answer or something else.
|
|
|
|
|
const double reltol = 1.0e-3;
|
|
|
|
|
const double reltol_ecl = 1.0;
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[0][first], 1.48215e+07, reltol_ecl); // eclipse
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[0][last], 1.54801e+07, reltol_ecl);
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[1][first], 1.49115e+07, reltol_ecl);
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[1][last], 1.54901e+07, reltol_ecl);
|
|
|
|
|
CHECK_CLOSE(pressures[0][first], 1.48215e+07, reltol_ecl); // eclipse
|
|
|
|
|
CHECK_CLOSE(pressures[0][last], 1.54801e+07, reltol_ecl);
|
|
|
|
|
CHECK_CLOSE(pressures[1][first], 1.49115e+07, reltol_ecl);
|
|
|
|
|
CHECK_CLOSE(pressures[1][last], 1.54901e+07, reltol_ecl);
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[0][first], 1.482150311e7, reltol); // opm
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[0][last], 1.547988347e7, reltol);
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[1][first], 1.491150311e7, reltol);
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[1][last], 1.548988347e7, reltol);
|
|
|
|
|
CHECK_CLOSE(pressures[0][first], 1.482150311e7, reltol); // opm
|
|
|
|
|
CHECK_CLOSE(pressures[0][last], 1.547988347e7, reltol);
|
|
|
|
|
CHECK_CLOSE(pressures[1][first], 1.491150311e7, reltol);
|
|
|
|
|
CHECK_CLOSE(pressures[1][last], 1.548988347e7, reltol);
|
|
|
|
|
|
|
|
|
|
const auto& sats = comp.saturation();
|
|
|
|
|
// std::cout << "Saturations:\n";
|
|
|
|
|
@@ -778,11 +716,11 @@ BOOST_AUTO_TEST_CASE (DeckWithLiveGas)
|
|
|
|
|
{ 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.75689455, 0.4612, 0.03253333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
|
|
|
|
|
};
|
|
|
|
|
for (int phase = 0; phase < 3; ++phase) {
|
|
|
|
|
BOOST_REQUIRE(sats[phase].size() == s_opm[phase].size());
|
|
|
|
|
REQUIRE(sats[phase].size() == s_opm[phase].size());
|
|
|
|
|
for (size_t i = 0; i < s_opm[phase].size(); ++i) {
|
|
|
|
|
//std::cout << std::setprecision(10) << sats[phase][i] << '\n';
|
|
|
|
|
CHECK(sats[phase][i], s_opm[phase][i], 100.*reltol);
|
|
|
|
|
CHECK(sats[phase][i], s_ecl[phase][i], reltol_ecl);
|
|
|
|
|
CHECK_CLOSE(sats[phase][i], s_opm[phase][i], 100.*reltol);
|
|
|
|
|
CHECK_CLOSE(sats[phase][i], s_ecl[phase][i], reltol_ecl);
|
|
|
|
|
}
|
|
|
|
|
std::cout << std::endl;
|
|
|
|
|
}
|
|
|
|
|
@@ -803,34 +741,23 @@ BOOST_AUTO_TEST_CASE (DeckWithLiveGas)
|
|
|
|
|
0.25104999E-03, 0.25104999E-03, 0.25104999E-03, 0.25104999E-03};
|
|
|
|
|
|
|
|
|
|
for (size_t i = 0; i < rv_opm.size(); ++i) {
|
|
|
|
|
CHECK(rv[i], rv_opm[i], reltol);
|
|
|
|
|
CHECK(rv[i], rv_ecl[i], reltol_ecl);
|
|
|
|
|
CHECK_CLOSE(rv[i], rv_opm[i], reltol);
|
|
|
|
|
CHECK_CLOSE(rv[i], rv_ecl[i], reltol_ecl);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE (DeckWithRSVDAndRVVD)
|
|
|
|
|
void test_DeckWithRSVDAndRVVD()
|
|
|
|
|
{
|
|
|
|
|
Opm::GridManager gm(1, 1, 20, 1.0, 1.0, 5.0);
|
|
|
|
|
typedef typename TTAG(TestEquilTypeTag) TypeTag;
|
|
|
|
|
auto simulator = initSimulator<TypeTag>("data/equil_rsvd_and_rvvd.DATA");
|
|
|
|
|
const auto& eclipseState = simulator->gridManager().eclState();
|
|
|
|
|
Opm::GridManager gm(eclipseState.getInputGrid());
|
|
|
|
|
const UnstructuredGrid& grid = *(gm.c_grid());
|
|
|
|
|
Opm::ParseContext parseContext;
|
|
|
|
|
Opm::Parser parser;
|
|
|
|
|
Opm::Deck deck = parser.parseFile("equil_rsvd_and_rvvd.DATA", parseContext);
|
|
|
|
|
Opm::EclipseState eclipseState(deck , parseContext);
|
|
|
|
|
// Create material law manager.
|
|
|
|
|
std::vector<int> compressedToCartesianIdx
|
|
|
|
|
= Opm::compressedToCartesian(grid.number_of_cells, grid.global_cell);
|
|
|
|
|
MaterialLawManager materialLawManager = MaterialLawManager();
|
|
|
|
|
materialLawManager.initFromDeck(deck, eclipseState, compressedToCartesianIdx);
|
|
|
|
|
|
|
|
|
|
typedef Opm::FluidSystems::BlackOil<double> FluidSystem;
|
|
|
|
|
|
|
|
|
|
// Initialize the fluid system
|
|
|
|
|
FluidSystem::initFromDeck(deck, eclipseState);
|
|
|
|
|
|
|
|
|
|
Opm::EQUIL::DeckDependent::InitialStateComputer<FluidSystem> comp(materialLawManager, eclipseState, grid, 9.80665);
|
|
|
|
|
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> comp(*simulator->problem().materialLawManager(), eclipseState, simulator->gridManager().grid(), 9.80665);
|
|
|
|
|
const auto& pressures = comp.press();
|
|
|
|
|
BOOST_REQUIRE(pressures.size() == 3);
|
|
|
|
|
BOOST_REQUIRE(int(pressures[0].size()) == grid.number_of_cells);
|
|
|
|
|
REQUIRE(pressures.size() == 3);
|
|
|
|
|
REQUIRE(int(pressures[0].size()) == grid.number_of_cells);
|
|
|
|
|
|
|
|
|
|
const int first = 0, last = grid.number_of_cells - 1;
|
|
|
|
|
// The relative tolerance is too loose to be very useful,
|
|
|
|
|
@@ -839,15 +766,15 @@ BOOST_AUTO_TEST_CASE (DeckWithRSVDAndRVVD)
|
|
|
|
|
// the true answer or something else.
|
|
|
|
|
const double reltol = 1.0e-6;
|
|
|
|
|
const double reltol_ecl = 1.0;
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[0][first], 1.48350e+07, reltol_ecl); // eclipse
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[0][last], 1.54794e+07, reltol_ecl);
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[1][first], 1.49250e+07, reltol_ecl);
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[1][last], 1.54894e+07, reltol_ecl);
|
|
|
|
|
CHECK_CLOSE(pressures[0][first], 1.48350e+07, reltol_ecl); // eclipse
|
|
|
|
|
CHECK_CLOSE(pressures[0][last], 1.54794e+07, reltol_ecl);
|
|
|
|
|
CHECK_CLOSE(pressures[1][first], 1.49250e+07, reltol_ecl);
|
|
|
|
|
CHECK_CLOSE(pressures[1][last], 1.54894e+07, reltol_ecl);
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[0][first], 1.483499660e7, reltol); // opm
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[0][last], 1.547924516e7, reltol);
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[1][first], 1.492499660e7, reltol);
|
|
|
|
|
BOOST_CHECK_CLOSE(pressures[1][last], 1.548924516e7, reltol);
|
|
|
|
|
CHECK_CLOSE(pressures[0][first], 1.483499660e7, reltol); // opm
|
|
|
|
|
CHECK_CLOSE(pressures[0][last], 1.547924516e7, reltol);
|
|
|
|
|
CHECK_CLOSE(pressures[1][first], 1.492499660e7, reltol);
|
|
|
|
|
CHECK_CLOSE(pressures[1][last], 1.548924516e7, reltol);
|
|
|
|
|
|
|
|
|
|
const auto& sats = comp.saturation();
|
|
|
|
|
// std::cout << "Saturations:\n";
|
|
|
|
|
@@ -870,11 +797,11 @@ BOOST_AUTO_TEST_CASE (DeckWithRSVDAndRVVD)
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
for (int phase = 0; phase < 3; ++phase) {
|
|
|
|
|
BOOST_REQUIRE(sats[phase].size() == s_opm[phase].size());
|
|
|
|
|
REQUIRE(sats[phase].size() == s_opm[phase].size());
|
|
|
|
|
for (size_t i = 0; i < s_opm[phase].size(); ++i) {
|
|
|
|
|
//std::cout << std::setprecision(10) << sats[phase][i] << '\n';
|
|
|
|
|
CHECK(sats[phase][i], s_opm[phase][i], reltol);
|
|
|
|
|
CHECK(sats[phase][i], s_ecl[phase][i], reltol_ecl);
|
|
|
|
|
CHECK_CLOSE(sats[phase][i], s_opm[phase][i], reltol);
|
|
|
|
|
CHECK_CLOSE(sats[phase][i], s_ecl[phase][i], reltol_ecl);
|
|
|
|
|
}
|
|
|
|
|
std::cout << std::endl;
|
|
|
|
|
}
|
|
|
|
|
@@ -911,20 +838,19 @@ BOOST_AUTO_TEST_CASE (DeckWithRSVDAndRVVD)
|
|
|
|
|
|
|
|
|
|
for (size_t i = 0; i < rv_opm.size(); ++i) {
|
|
|
|
|
//std::cout << std::setprecision(10) << rs[i] << '\n';
|
|
|
|
|
BOOST_CHECK_CLOSE(rs[i], rs_opm[i], reltol);
|
|
|
|
|
BOOST_CHECK_CLOSE(rs[i], rs_ecl[i], reltol_ecl);
|
|
|
|
|
BOOST_CHECK_CLOSE(rv[i], rv_opm[i], reltol);
|
|
|
|
|
BOOST_CHECK_CLOSE(rv[i], rv_ecl[i], reltol_ecl);
|
|
|
|
|
CHECK_CLOSE(rs[i], rs_opm[i], reltol);
|
|
|
|
|
CHECK_CLOSE(rs[i], rs_ecl[i], reltol_ecl);
|
|
|
|
|
CHECK_CLOSE(rv[i], rv_opm[i], reltol);
|
|
|
|
|
CHECK_CLOSE(rv[i], rv_ecl[i], reltol_ecl);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE (DeckWithSwatinit)
|
|
|
|
|
void test_DeckWithSwatinit()
|
|
|
|
|
{
|
|
|
|
|
//Opm::GridManager gm(1, 1, 20, 1.0, 1.0, 5.0);
|
|
|
|
|
Opm::Parser parser;
|
|
|
|
|
Opm::ParseContext parseContext;
|
|
|
|
|
Opm::Deck deck = parser.parseFile("capillarySwatinit.DATA" , parseContext);
|
|
|
|
|
Opm::EclipseState eclipseState(deck , parseContext);
|
|
|
|
|
#if 0
|
|
|
|
|
typedef typename TTAG(TestEquilTypeTag) TypeTag;
|
|
|
|
|
auto simulator = initSimulator<TypeTag>("data/equil_capillary_swatinit.DATA");
|
|
|
|
|
const auto& eclipseState = simulator->gridManager().eclState();
|
|
|
|
|
Opm::GridManager gm(eclipseState.getInputGrid());
|
|
|
|
|
const UnstructuredGrid& grid = *(gm.c_grid());
|
|
|
|
|
|
|
|
|
|
@@ -1008,9 +934,9 @@ BOOST_AUTO_TEST_CASE (DeckWithSwatinit)
|
|
|
|
|
|
|
|
|
|
// compute the initial state
|
|
|
|
|
// apply swatinit
|
|
|
|
|
Opm::EQUIL::DeckDependent::InitialStateComputer<FluidSystem> compScaled(materialLawManagerScaled, eclipseState, grid, 9.81, true);
|
|
|
|
|
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> compScaled(materialLawManagerScaled, eclipseState, simulator->gridManager().grid(), 9.81, true);
|
|
|
|
|
// don't apply swatinit
|
|
|
|
|
Opm::EQUIL::DeckDependent::InitialStateComputer<FluidSystem> compUnscaled(materialLawManager, eclipseState, grid, 9.81, false);
|
|
|
|
|
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> compUnscaled(*simulator->problem().materialLawManager(), eclipseState, simulator->gridManager().grid(), 9.81, false);
|
|
|
|
|
|
|
|
|
|
// compute pc
|
|
|
|
|
std::vector<double> pc_scaled(numCells * FluidSystem::numPhases);
|
|
|
|
|
@@ -1051,17 +977,38 @@ BOOST_AUTO_TEST_CASE (DeckWithSwatinit)
|
|
|
|
|
const double reltol = 1.0e-3;
|
|
|
|
|
for (int phase = 0; phase < 3; ++phase) {
|
|
|
|
|
for (size_t i = 0; i < 20; ++i) {
|
|
|
|
|
CHECK( pc_original[3*i + phase ], pc_unscaled[3*i + phase ], reltol);
|
|
|
|
|
CHECK( pc_scaled_truth[3*i + phase], pc_scaled[3*i + phase ], reltol);
|
|
|
|
|
CHECK_CLOSE( pc_original[3*i + phase ], pc_unscaled[3*i + phase ], reltol);
|
|
|
|
|
CHECK_CLOSE( pc_scaled_truth[3*i + phase], pc_scaled[3*i + phase ], reltol);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int phase = 0; phase < 3; ++phase) {
|
|
|
|
|
for (size_t i = 0; i < 20; ++i) {
|
|
|
|
|
CHECK(compUnscaled.saturation()[phase][i], s[phase][i], reltol);
|
|
|
|
|
CHECK(compScaled.saturation()[phase][i], swatinit[phase][i], reltol);
|
|
|
|
|
CHECK_CLOSE(compUnscaled.saturation()[phase][i], s[phase][i], reltol);
|
|
|
|
|
CHECK_CLOSE(compScaled.saturation()[phase][i], swatinit[phase][i], reltol);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_SUITE_END()
|
|
|
|
|
int main(int argc, char** argv)
|
|
|
|
|
{
|
|
|
|
|
Dune::MPIHelper::instance(argc, argv);
|
|
|
|
|
|
|
|
|
|
typedef TTAG(TestEquilTypeTag) TypeTag;
|
|
|
|
|
Ewoms::registerAllParameters_<TypeTag>();
|
|
|
|
|
|
|
|
|
|
test_PhasePressure();
|
|
|
|
|
test_CellSubset();
|
|
|
|
|
test_RegMapping();
|
|
|
|
|
test_DeckAllDead();
|
|
|
|
|
test_CapillaryInversion();
|
|
|
|
|
test_DeckWithCapillary();
|
|
|
|
|
test_DeckWithCapillaryOverlap();
|
|
|
|
|
test_DeckWithLiveOil();
|
|
|
|
|
test_DeckWithLiveGas();
|
|
|
|
|
test_DeckWithRSVDAndRVVD();
|
|
|
|
|
//test_DeckWithSwatinit();
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|