Start a test suite for class BlackoilPropsAd.

Relies on external data ("fluid.data") to describe the fluid model.
This commit is contained in:
Bård Skaflestad 2013-05-14 14:59:31 +02:00
parent 1069cfae6d
commit 99c3ec2824
2 changed files with 140 additions and 0 deletions

66
fluid.data Normal file
View File

@ -0,0 +1,66 @@
RUNSPEC
DIMENS
1 1 1
/
OIL
WATER
METRIC
-- =====================================================================
GRID
DXV
1
/
DYV
1
/
DZV
0.1
/
DEPTHZ
4*0
/
PERMX
1.01325E15
/
PERMY
1.01325E15
/
PERMZ
1.01325E15
/
PORO
1
/
-- =====================================================================
PROPS
PVTW
-- Pw Bw(Pw) Cw muw Cv
1 1 0 1000 0
/
PVCDO
-- Po Bo(Po) Co muo Cv
1 1 0 1000 0
/
SWOF
0 0 1 0
1 1 0 0
/
-- =====================================================================
END

74
test_boprops_ad.cpp Normal file
View File

@ -0,0 +1,74 @@
/*
Copyright 2013 SINTEF ICT, Applied Mathematics.
Copyright 2013 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/>.
*/
#if HAVE_DYNAMIC_BOOST_TEST
#define BOOST_TEST_DYN_LINK
#endif
#define BOOST_TEST_MODULE FluidPropertiesTest
#include "BlackoilPropsAd.hpp"
#include <boost/test/unit_test.hpp>
#include <opm/core/io/eclipse/EclipseGridParser.hpp>
#include <opm/core/grid/GridManager.hpp>
#include <opm/core/props/BlackoilPropertiesFromDeck.hpp>
#include <opm/core/utility/parameters/ParameterGroup.hpp>
#include <fstream>
struct SetupSimple {
SetupSimple()
: param()
, deck()
{
std::ifstream str("fluid.data");
deck.read(str);
param.insertParameter("init_rock" , false );
param.insertParameter("threephase_model", "simple");
}
Opm::parameter::ParameterGroup param;
Opm::EclipseGridParser deck;
};
template <class Setup>
struct TestFixture : public Setup
{
TestFixture()
: Setup()
, grid (Setup::deck)
, props(Setup::deck, *grid.c_grid(), Setup::param,
Setup::param.getDefault("init_rock", false))
{
}
Opm::GridManager grid;
Opm::BlackoilPropertiesFromDeck props;
};
BOOST_FIXTURE_TEST_CASE(Construction, TestFixture<SetupSimple>)
{
Opm::BlackoilPropsAd boprops_ad(props);
}