2016-05-13 07:06:11 -05:00
|
|
|
/*
|
|
|
|
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 BOOST_TEST_MODULE EclipseRFTWriter
|
2019-08-26 08:44:49 -05:00
|
|
|
|
2016-05-13 07:06:11 -05:00
|
|
|
#include <boost/test/unit_test.hpp>
|
|
|
|
|
2019-08-26 08:44:49 -05:00
|
|
|
#include <opm/io/eclipse/ERft.hpp>
|
|
|
|
#include <opm/io/eclipse/OutputStream.hpp>
|
|
|
|
|
|
|
|
#include <opm/output/data/Solution.hpp>
|
2016-10-03 07:52:39 -05:00
|
|
|
#include <opm/output/data/Wells.hpp>
|
2019-08-26 08:44:49 -05:00
|
|
|
#include <opm/output/eclipse/EclipseIO.hpp>
|
|
|
|
#include <opm/output/eclipse/InteHEAD.hpp>
|
2019-08-28 03:31:26 -05:00
|
|
|
#include <opm/output/eclipse/WriteRFT.hpp>
|
2016-05-13 07:06:11 -05:00
|
|
|
|
|
|
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
|
|
|
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
|
|
|
|
#include <opm/parser/eclipse/EclipseState/IOConfig/IOConfig.hpp>
|
2019-08-26 08:44:49 -05:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
|
|
|
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
|
2016-05-13 07:06:11 -05:00
|
|
|
|
2019-08-26 08:44:49 -05:00
|
|
|
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
|
|
|
|
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
2016-05-13 07:06:11 -05:00
|
|
|
|
2019-08-28 03:31:26 -05:00
|
|
|
#include <opm/parser/eclipse/Units/Units.hpp>
|
|
|
|
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
|
|
|
|
|
2019-08-26 08:44:49 -05:00
|
|
|
#include <cstddef>
|
|
|
|
#include <ctime>
|
|
|
|
#include <map>
|
|
|
|
#include <iomanip>
|
|
|
|
#include <ostream>
|
|
|
|
#include <string>
|
|
|
|
#include <tuple>
|
|
|
|
#include <unordered_map>
|
|
|
|
#include <utility>
|
2016-05-13 07:06:11 -05:00
|
|
|
#include <vector>
|
|
|
|
|
2019-08-26 08:44:49 -05:00
|
|
|
#include <boost/date_time/posix_time/posix_time.hpp>
|
2020-02-12 02:12:29 -06:00
|
|
|
#include <opm/common/utility/FileSystem.hpp>
|
2019-08-26 08:44:49 -05:00
|
|
|
|
2016-05-13 07:06:11 -05:00
|
|
|
using namespace Opm;
|
|
|
|
|
2019-08-26 08:44:49 -05:00
|
|
|
namespace std { // hack...
|
|
|
|
// For printing ERft::RftDate objects. Needed by EQUAL_COLLECTIONS.
|
|
|
|
static ostream& operator<<(ostream& os, const tuple<int,int,int>& d)
|
|
|
|
{
|
|
|
|
os << setw(4) << get<0>(d)
|
|
|
|
<< "-" << setw(2) << setfill('0') << get<1>(d)
|
|
|
|
<< "-" << setw(2) << setfill('0') << get<2>(d);
|
|
|
|
|
|
|
|
return os;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-05-13 07:06:11 -05:00
|
|
|
namespace {
|
2019-08-26 08:44:49 -05:00
|
|
|
class RSet
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit RSet(std::string base)
|
2020-02-12 02:12:29 -06:00
|
|
|
: odir_(Opm::filesystem::temp_directory_path() /
|
|
|
|
Opm::unique_path("rset-%%%%"))
|
2019-08-26 08:44:49 -05:00
|
|
|
, base_(std::move(base))
|
|
|
|
{
|
2020-02-12 02:12:29 -06:00
|
|
|
Opm::filesystem::create_directories(this->odir_);
|
2019-08-26 08:44:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
~RSet()
|
|
|
|
{
|
2020-02-12 02:12:29 -06:00
|
|
|
Opm::filesystem::remove_all(this->odir_);
|
2019-08-26 08:44:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
std::string outputDir() const
|
|
|
|
{
|
|
|
|
return this->odir_.string();
|
|
|
|
}
|
2016-05-13 07:06:11 -05:00
|
|
|
|
2019-08-26 08:44:49 -05:00
|
|
|
operator ::Opm::EclIO::OutputStream::ResultSet() const
|
|
|
|
{
|
|
|
|
return { this->odir_.string(), this->base_ };
|
|
|
|
}
|
2016-05-13 07:06:11 -05:00
|
|
|
|
2019-08-26 08:44:49 -05:00
|
|
|
private:
|
2020-02-12 02:12:29 -06:00
|
|
|
Opm::filesystem::path odir_;
|
2019-08-26 08:44:49 -05:00
|
|
|
std::string base_;
|
|
|
|
};
|
2016-05-13 07:06:11 -05:00
|
|
|
|
2019-08-26 08:44:49 -05:00
|
|
|
class RFTRresults
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit RFTRresults(const ::Opm::EclIO::ERft& rft,
|
|
|
|
const std::string& well,
|
|
|
|
const ::Opm::EclIO::ERft::RftDate& date);
|
|
|
|
|
|
|
|
float depth(const int i, const int j, const int k) const
|
|
|
|
{
|
|
|
|
return this->depth_[this->conIx(i, j, k)];
|
|
|
|
}
|
2016-05-13 07:06:11 -05:00
|
|
|
|
2019-08-26 08:44:49 -05:00
|
|
|
float pressure(const int i, const int j, const int k) const
|
|
|
|
{
|
|
|
|
return this->press_[this->conIx(i, j, k)];
|
|
|
|
}
|
2016-05-13 07:06:11 -05:00
|
|
|
|
2019-08-26 08:44:49 -05:00
|
|
|
float sgas(const int i, const int j, const int k) const
|
|
|
|
{
|
|
|
|
return this->sgas_[this->conIx(i, j, k)];
|
|
|
|
}
|
2016-05-13 07:06:11 -05:00
|
|
|
|
2019-08-26 08:44:49 -05:00
|
|
|
float swat(const int i, const int j, const int k) const
|
|
|
|
{
|
|
|
|
return this->swat_[this->conIx(i, j, k)];
|
|
|
|
}
|
2016-05-13 07:06:11 -05:00
|
|
|
|
2019-08-26 08:44:49 -05:00
|
|
|
private:
|
|
|
|
std::vector<float> depth_;
|
|
|
|
std::vector<float> press_;
|
|
|
|
std::vector<float> sgas_;
|
|
|
|
std::vector<float> swat_;
|
2016-05-13 07:06:11 -05:00
|
|
|
|
2019-08-26 08:44:49 -05:00
|
|
|
std::map<std::tuple<int, int, int>, std::size_t> xConIx_;
|
2016-05-13 07:06:11 -05:00
|
|
|
|
2019-08-26 08:44:49 -05:00
|
|
|
std::size_t conIx(const int i, const int j, const int k) const;
|
|
|
|
};
|
2016-05-13 07:06:11 -05:00
|
|
|
|
2019-08-26 08:44:49 -05:00
|
|
|
RFTRresults::RFTRresults(const ::Opm::EclIO::ERft& rft,
|
|
|
|
const std::string& well,
|
|
|
|
const ::Opm::EclIO::ERft::RftDate& date)
|
|
|
|
{
|
|
|
|
BOOST_REQUIRE(rft.hasRft(well, date));
|
|
|
|
BOOST_REQUIRE(rft.hasArray("CONIPOS", well, date));
|
|
|
|
BOOST_REQUIRE(rft.hasArray("CONJPOS", well, date));
|
|
|
|
BOOST_REQUIRE(rft.hasArray("CONKPOS", well, date));
|
2016-05-13 07:06:11 -05:00
|
|
|
|
2019-08-26 08:44:49 -05:00
|
|
|
const auto& I = rft.getRft<int>("CONIPOS", well, date);
|
|
|
|
const auto& J = rft.getRft<int>("CONJPOS", well, date);
|
|
|
|
const auto& K = rft.getRft<int>("CONKPOS", well, date);
|
2016-05-13 07:06:11 -05:00
|
|
|
|
2019-08-26 08:44:49 -05:00
|
|
|
for (auto ncon = I.size(), con = 0*ncon; con < ncon; ++con) {
|
|
|
|
this->xConIx_[std::make_tuple(I[con], J[con], K[con])] = con;
|
|
|
|
}
|
2016-05-13 07:06:11 -05:00
|
|
|
|
2019-08-26 08:44:49 -05:00
|
|
|
BOOST_REQUIRE(rft.hasArray("DEPTH" , well, date));
|
|
|
|
BOOST_REQUIRE(rft.hasArray("PRESSURE", well, date));
|
|
|
|
BOOST_REQUIRE(rft.hasArray("SGAS" , well, date));
|
|
|
|
BOOST_REQUIRE(rft.hasArray("SWAT" , well, date));
|
2016-05-13 07:06:11 -05:00
|
|
|
|
2019-08-26 08:44:49 -05:00
|
|
|
this->depth_ = rft.getRft<float>("DEPTH" , well, date);
|
|
|
|
this->press_ = rft.getRft<float>("PRESSURE", well, date);
|
|
|
|
this->sgas_ = rft.getRft<float>("SGAS" , well, date);
|
|
|
|
this->swat_ = rft.getRft<float>("SWAT" , well, date);
|
|
|
|
}
|
|
|
|
|
|
|
|
std::size_t RFTRresults::conIx(const int i, const int j, const int k) const
|
|
|
|
{
|
|
|
|
auto conIx = this->xConIx_.find(std::make_tuple(i, j, k));
|
|
|
|
|
|
|
|
if (conIx == this->xConIx_.end()) {
|
2019-08-30 02:39:15 -05:00
|
|
|
BOOST_FAIL("Invalid IJK Tuple (" << i << ", "
|
|
|
|
<< j << ", " << k << ')');
|
2019-08-26 08:44:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
return conIx->second;
|
|
|
|
}
|
|
|
|
|
|
|
|
void verifyRFTFile(const std::string& rft_filename)
|
|
|
|
{
|
|
|
|
using RftDate = ::Opm::EclIO::ERft::RftDate;
|
|
|
|
|
|
|
|
const auto rft = ::Opm::EclIO::ERft{ rft_filename };
|
|
|
|
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_1", RftDate{ 2008, 10, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto tol = 1.0e-5;
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 1), 0.0 , tol);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 2), 1.0e-5, tol);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 3), 2.0e-5, tol);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 1), 0.0, tol);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 2), 0.2, tol);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 3), 0.4, tol);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 1), 0.0, tol);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 2), 0.1, tol);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 3), 0.2, tol);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 1), 1*0.250 + 0.250/2, tol);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 2), 2*0.250 + 0.250/2, tol);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 3), 3*0.250 + 0.250/2, tol);
|
|
|
|
}
|
|
|
|
|
|
|
|
data::Solution createBlackoilState(int timeStepIdx, int numCells)
|
|
|
|
{
|
|
|
|
std::vector< double > pressure( numCells );
|
|
|
|
std::vector< double > swat( numCells, 0 );
|
|
|
|
std::vector< double > sgas( numCells, 0 );
|
|
|
|
|
|
|
|
for (int i = 0; i < numCells; ++i) {
|
|
|
|
pressure[i] = timeStepIdx*1e5 + 1e4 + i;
|
|
|
|
}
|
|
|
|
|
|
|
|
data::Solution sol;
|
|
|
|
sol.insert( "PRESSURE", UnitSystem::measure::pressure, pressure , data::TargetType::RESTART_SOLUTION );
|
|
|
|
sol.insert( "SWAT", UnitSystem::measure::identity, swat , data::TargetType::RESTART_SOLUTION );
|
|
|
|
sol.insert( "SGAS", UnitSystem::measure::identity, sgas, data::TargetType::RESTART_SOLUTION );
|
|
|
|
|
|
|
|
return sol;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::time_t timeStamp(const ::Opm::EclIO::ERft::RftDate& date)
|
|
|
|
{
|
|
|
|
auto tp = std::tm{};
|
|
|
|
|
|
|
|
tp.tm_year = std::get<0>(date) - 1900;
|
|
|
|
tp.tm_mon = std::get<1>(date) - 1; // 0..11
|
|
|
|
tp.tm_mday = std::get<2>(date); // 1..31
|
|
|
|
|
|
|
|
return ::Opm::RestartIO::makeUTCTime(tp);
|
|
|
|
}
|
|
|
|
} // Anonymous namespace
|
|
|
|
|
2019-08-28 03:31:26 -05:00
|
|
|
BOOST_AUTO_TEST_SUITE(Using_EclipseIO)
|
|
|
|
|
2019-08-26 08:44:49 -05:00
|
|
|
BOOST_AUTO_TEST_CASE(test_RFT)
|
|
|
|
{
|
|
|
|
const auto rset = RSet{ "TESTRFT" };
|
|
|
|
|
|
|
|
const auto eclipse_data_filename = std::string{ "testrft.DATA" };
|
|
|
|
|
|
|
|
const auto deck = Parser{}.parseFile(eclipse_data_filename);
|
|
|
|
auto eclipseState = EclipseState { deck };
|
|
|
|
|
|
|
|
eclipseState.getIOConfig().setOutputDir(rset.outputDir());
|
2016-05-13 07:06:11 -05:00
|
|
|
|
|
|
|
{
|
|
|
|
/* eclipseWriter is scoped here to ensure it is destroyed after the
|
|
|
|
* file itself has been written, because we're going to reload it
|
|
|
|
* immediately. first upon destruction can we guarantee it being
|
|
|
|
* written to disk and flushed.
|
|
|
|
*/
|
|
|
|
|
2016-10-13 07:15:58 -05:00
|
|
|
const auto& grid = eclipseState.getInputGrid();
|
|
|
|
const auto numCells = grid.getCartesianSize( );
|
2019-08-26 08:44:49 -05:00
|
|
|
|
|
|
|
const Schedule schedule(deck, eclipseState);
|
|
|
|
const SummaryConfig summary_config( deck, schedule, eclipseState.getTableManager( ));
|
|
|
|
|
2017-10-02 05:40:28 -05:00
|
|
|
EclipseIO eclipseWriter( eclipseState, grid, schedule, summary_config );
|
2019-08-26 08:44:49 -05:00
|
|
|
|
|
|
|
const auto start_time = schedule.posixStartTime();
|
|
|
|
const auto step_time = timeStamp(::Opm::EclIO::ERft::RftDate{ 2008, 10, 10 });
|
|
|
|
|
2019-09-19 09:17:38 -05:00
|
|
|
SummaryState st(std::chrono::system_clock::now());
|
2016-05-13 07:06:11 -05:00
|
|
|
|
2016-09-25 11:31:34 -05:00
|
|
|
data::Rates r1, r2;
|
|
|
|
r1.set( data::Rates::opt::wat, 4.11 );
|
|
|
|
r1.set( data::Rates::opt::oil, 4.12 );
|
|
|
|
r1.set( data::Rates::opt::gas, 4.13 );
|
|
|
|
|
|
|
|
r2.set( data::Rates::opt::wat, 4.21 );
|
|
|
|
r2.set( data::Rates::opt::oil, 4.22 );
|
|
|
|
r2.set( data::Rates::opt::gas, 4.23 );
|
|
|
|
|
2018-06-10 13:54:34 -05:00
|
|
|
std::vector<Opm::data::Connection> well1_comps(9);
|
2018-02-07 07:32:01 -06:00
|
|
|
for (size_t i = 0; i < 9; ++i) {
|
2018-07-11 17:41:09 -05:00
|
|
|
Opm::data::Connection well_comp { grid.getGlobalIndex(8,8,i) ,r1, 0.0 , 0.0, (double)i, 0.1*i,0.2*i, 1.2e3};
|
2019-08-26 08:44:49 -05:00
|
|
|
well1_comps[i] = std::move(well_comp);
|
2018-02-07 07:32:01 -06:00
|
|
|
}
|
2018-06-10 13:54:34 -05:00
|
|
|
std::vector<Opm::data::Connection> well2_comps(6);
|
2018-02-07 07:32:01 -06:00
|
|
|
for (size_t i = 0; i < 6; ++i) {
|
2018-07-11 17:41:09 -05:00
|
|
|
Opm::data::Connection well_comp { grid.getGlobalIndex(3,3,i+3) ,r2, 0.0 , 0.0, (double)i, i*0.1,i*0.2, 0.15};
|
2019-08-26 08:44:49 -05:00
|
|
|
well2_comps[i] = std::move(well_comp);
|
2018-02-07 07:32:01 -06:00
|
|
|
}
|
|
|
|
|
2018-04-28 05:52:28 -05:00
|
|
|
Opm::data::Solution solution = createBlackoilState(2, numCells);
|
2016-10-25 04:45:29 -05:00
|
|
|
Opm::data::Wells wells;
|
2018-12-11 10:30:43 -06:00
|
|
|
|
|
|
|
using SegRes = decltype(wells["w"].segments);
|
2020-01-29 16:08:02 -06:00
|
|
|
using Ctrl = decltype(wells["w"].current_control);
|
2018-12-11 10:30:43 -06:00
|
|
|
|
2020-01-29 16:08:02 -06:00
|
|
|
wells["OP_1"] = { std::move(r1), 1.0, 1.1, 3.1, 1, std::move(well1_comps), SegRes{}, Ctrl{} };
|
|
|
|
wells["OP_2"] = { std::move(r2), 1.0, 1.1, 3.2, 1, std::move(well2_comps), SegRes{}, Ctrl{} };
|
2016-05-13 07:06:11 -05:00
|
|
|
|
2019-08-26 08:44:49 -05:00
|
|
|
RestartValue restart_value(std::move(solution), std::move(wells));
|
2018-04-28 05:52:28 -05:00
|
|
|
|
2019-06-03 10:35:26 -05:00
|
|
|
eclipseWriter.writeTimeStep( st,
|
|
|
|
2,
|
2016-08-20 11:50:43 -05:00
|
|
|
false,
|
|
|
|
step_time - start_time,
|
2019-08-26 08:44:49 -05:00
|
|
|
std::move(restart_value));
|
2016-05-13 07:06:11 -05:00
|
|
|
}
|
|
|
|
|
2019-08-26 08:44:49 -05:00
|
|
|
verifyRFTFile(Opm::EclIO::OutputStream::outputFileName(rset, "RFT"));
|
2016-05-13 07:06:11 -05:00
|
|
|
}
|
2017-09-09 02:11:30 -05:00
|
|
|
|
|
|
|
namespace {
|
2019-08-26 08:44:49 -05:00
|
|
|
void verifyRFTFile2(const std::string& rft_filename)
|
|
|
|
{
|
|
|
|
using RftDate = Opm::EclIO::ERft::RftDate;
|
|
|
|
const auto rft = ::Opm::EclIO::ERft{ rft_filename };
|
|
|
|
|
|
|
|
auto dates = std::unordered_map<
|
|
|
|
std::string, std::vector<RftDate>
|
|
|
|
>{};
|
|
|
|
|
|
|
|
for (const auto& wellDate : rft.listOfRftReports()) {
|
2020-03-18 13:10:21 -05:00
|
|
|
dates[std::get<0>(wellDate)].push_back(std::get<1>(wellDate));
|
2019-08-26 08:44:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// Well OP_1
|
|
|
|
{
|
|
|
|
auto op_1 = dates.find("OP_1");
|
|
|
|
if (op_1 == dates.end()) {
|
2019-08-30 02:39:15 -05:00
|
|
|
BOOST_FAIL("Missing RFT Data for Well OP_1");
|
2019-08-26 08:44:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
const auto expect = std::vector<Opm::EclIO::ERft::RftDate> {
|
|
|
|
RftDate{ 2008, 10, 10 },
|
|
|
|
};
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL_COLLECTIONS(op_1->second.begin(),
|
|
|
|
op_1->second.end(),
|
|
|
|
expect.begin(), expect.end());
|
|
|
|
}
|
|
|
|
|
|
|
|
// Well OP_2
|
|
|
|
{
|
|
|
|
auto op_2 = dates.find("OP_2");
|
|
|
|
if (op_2 == dates.end()) {
|
2019-08-30 02:39:15 -05:00
|
|
|
BOOST_FAIL("Missing RFT Data for Well OP_2");
|
2019-08-26 08:44:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
const auto expect = std::vector<RftDate> {
|
|
|
|
RftDate{ 2008, 10, 10 },
|
|
|
|
RftDate{ 2008, 11, 10 },
|
|
|
|
};
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL_COLLECTIONS(op_2->second.begin(),
|
|
|
|
op_2->second.end(),
|
|
|
|
expect.begin(), expect.end());
|
|
|
|
}
|
|
|
|
}
|
2017-09-09 02:11:30 -05:00
|
|
|
}
|
|
|
|
|
2019-08-26 08:44:49 -05:00
|
|
|
BOOST_AUTO_TEST_CASE(test_RFT2)
|
|
|
|
{
|
|
|
|
const auto rset = RSet{ "TESTRFT" };
|
2017-09-09 02:11:30 -05:00
|
|
|
|
2019-08-26 08:44:49 -05:00
|
|
|
const auto eclipse_data_filename = std::string{ "testrft.DATA" };
|
2017-09-09 02:11:30 -05:00
|
|
|
|
2019-08-26 08:44:49 -05:00
|
|
|
const auto deck = Parser().parseFile( eclipse_data_filename );
|
2019-01-03 11:05:19 -06:00
|
|
|
auto eclipseState = EclipseState(deck);
|
2019-08-26 08:44:49 -05:00
|
|
|
|
|
|
|
eclipseState.getIOConfig().setOutputDir(rset.outputDir());
|
|
|
|
|
2017-09-09 02:11:30 -05:00
|
|
|
{
|
|
|
|
/* eclipseWriter is scoped here to ensure it is destroyed after the
|
|
|
|
* file itself has been written, because we're going to reload it
|
|
|
|
* immediately. first upon destruction can we guarantee it being
|
|
|
|
* written to disk and flushed.
|
|
|
|
*/
|
|
|
|
|
|
|
|
const auto& grid = eclipseState.getInputGrid();
|
|
|
|
const auto numCells = grid.getCartesianSize( );
|
|
|
|
|
2019-01-03 11:05:19 -06:00
|
|
|
Schedule schedule(deck, eclipseState);
|
|
|
|
SummaryConfig summary_config( deck, schedule, eclipseState.getTableManager( ));
|
2019-09-19 09:17:38 -05:00
|
|
|
SummaryState st(std::chrono::system_clock::now());
|
2019-08-26 08:44:49 -05:00
|
|
|
|
|
|
|
const auto start_time = schedule.posixStartTime();
|
|
|
|
const auto& time_map = schedule.getTimeMap( );
|
2017-09-09 02:11:30 -05:00
|
|
|
|
|
|
|
for (int counter = 0; counter < 2; counter++) {
|
2018-11-02 07:15:43 -05:00
|
|
|
EclipseIO eclipseWriter( eclipseState, grid, schedule, summary_config );
|
2017-09-09 02:11:30 -05:00
|
|
|
for (size_t step = 0; step < time_map.size(); step++) {
|
2019-08-26 08:44:49 -05:00
|
|
|
const auto step_time = time_map[step];
|
2017-09-09 02:11:30 -05:00
|
|
|
|
|
|
|
data::Rates r1, r2;
|
|
|
|
r1.set( data::Rates::opt::wat, 4.11 );
|
|
|
|
r1.set( data::Rates::opt::oil, 4.12 );
|
|
|
|
r1.set( data::Rates::opt::gas, 4.13 );
|
|
|
|
|
|
|
|
r2.set( data::Rates::opt::wat, 4.21 );
|
|
|
|
r2.set( data::Rates::opt::oil, 4.22 );
|
|
|
|
r2.set( data::Rates::opt::gas, 4.23 );
|
|
|
|
|
2018-06-10 13:54:34 -05:00
|
|
|
std::vector<Opm::data::Connection> well1_comps(9);
|
2018-02-07 07:32:01 -06:00
|
|
|
for (size_t i = 0; i < 9; ++i) {
|
2018-07-11 17:41:09 -05:00
|
|
|
Opm::data::Connection well_comp { grid.getGlobalIndex(8,8,i) ,r1, 0.0 , 0.0, (double)i, 0.1*i,0.2*i, 3.14e5};
|
2019-08-26 08:44:49 -05:00
|
|
|
well1_comps[i] = std::move(well_comp);
|
2018-02-07 07:32:01 -06:00
|
|
|
}
|
2018-06-10 13:54:34 -05:00
|
|
|
std::vector<Opm::data::Connection> well2_comps(6);
|
2018-02-07 07:32:01 -06:00
|
|
|
for (size_t i = 0; i < 6; ++i) {
|
2018-07-11 17:41:09 -05:00
|
|
|
Opm::data::Connection well_comp { grid.getGlobalIndex(3,3,i+3) ,r2, 0.0 , 0.0, (double)i, i*0.1,i*0.2, 355.113};
|
2019-08-26 08:44:49 -05:00
|
|
|
well2_comps[i] = std::move(well_comp);
|
2018-02-07 07:32:01 -06:00
|
|
|
}
|
|
|
|
|
2017-09-09 02:11:30 -05:00
|
|
|
Opm::data::Wells wells;
|
2018-04-28 05:52:28 -05:00
|
|
|
Opm::data::Solution solution = createBlackoilState(2, numCells);
|
2018-12-11 10:30:43 -06:00
|
|
|
|
|
|
|
using SegRes = decltype(wells["w"].segments);
|
2020-01-29 16:08:02 -06:00
|
|
|
using Ctrl = decltype(wells["w"].current_control);
|
2018-12-11 10:30:43 -06:00
|
|
|
|
2020-01-29 16:08:02 -06:00
|
|
|
wells["OP_1"] = { std::move(r1), 1.0, 1.1, 3.1, 1, std::move(well1_comps), SegRes{}, Ctrl{} };
|
|
|
|
wells["OP_2"] = { std::move(r2), 1.0, 1.1, 3.2, 1, std::move(well2_comps), SegRes{}, Ctrl{} };
|
2019-08-26 08:44:49 -05:00
|
|
|
|
|
|
|
RestartValue restart_value(std::move(solution), std::move(wells));
|
2017-09-09 02:11:30 -05:00
|
|
|
|
2019-06-03 10:35:26 -05:00
|
|
|
eclipseWriter.writeTimeStep( st,
|
|
|
|
step,
|
2017-09-09 02:11:30 -05:00
|
|
|
false,
|
|
|
|
step_time - start_time,
|
2019-08-26 08:44:49 -05:00
|
|
|
std::move(restart_value));
|
2017-09-09 02:11:30 -05:00
|
|
|
}
|
2019-08-26 08:44:49 -05:00
|
|
|
|
|
|
|
verifyRFTFile2(Opm::EclIO::OutputStream::outputFileName(rset, "RFT"));
|
2017-09-09 02:11:30 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-08-28 03:31:26 -05:00
|
|
|
|
|
|
|
BOOST_AUTO_TEST_SUITE_END() // Using_EclipseIO
|
|
|
|
|
|
|
|
// =====================================================================
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_SUITE(Using_Direct_Write)
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
struct Setup
|
|
|
|
{
|
|
|
|
explicit Setup(const std::string& deckfile)
|
|
|
|
: Setup{ ::Opm::Parser{}.parseFile(deckfile) }
|
|
|
|
{}
|
|
|
|
|
|
|
|
explicit Setup(const ::Opm::Deck& deck)
|
|
|
|
: es { deck }
|
|
|
|
, sched{ deck, es }
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
::Opm::EclipseState es;
|
|
|
|
::Opm::Schedule sched;
|
|
|
|
};
|
|
|
|
|
|
|
|
std::vector<Opm::data::Connection>
|
|
|
|
connRes_OP1(const ::Opm::EclipseGrid& grid)
|
|
|
|
{
|
|
|
|
auto xcon = std::vector<Opm::data::Connection>{};
|
|
|
|
xcon.reserve(9);
|
|
|
|
|
|
|
|
for (auto con = 0; con < 9; ++con) {
|
|
|
|
xcon.emplace_back();
|
|
|
|
|
|
|
|
auto& c = xcon.back();
|
|
|
|
c.index = grid.getGlobalIndex(8, 8, con);
|
|
|
|
|
|
|
|
c.cell_pressure = (120 + con*10)*::Opm::unit::barsa;
|
|
|
|
|
|
|
|
c.cell_saturation_gas = 0.15;
|
|
|
|
c.cell_saturation_water = 0.3 + con/20.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return xcon;
|
|
|
|
}
|
|
|
|
|
|
|
|
::Opm::data::Well wellSol_OP1(const ::Opm::EclipseGrid& grid)
|
|
|
|
{
|
|
|
|
auto xw = ::Opm::data::Well{};
|
|
|
|
xw.connections = connRes_OP1(grid);
|
|
|
|
|
|
|
|
return xw;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::vector<Opm::data::Connection>
|
|
|
|
connRes_OP2(const ::Opm::EclipseGrid& grid)
|
|
|
|
{
|
|
|
|
auto xcon = std::vector<Opm::data::Connection>{};
|
|
|
|
xcon.reserve(6);
|
|
|
|
|
|
|
|
for (auto con = 3; con < 9; ++con) {
|
|
|
|
xcon.emplace_back();
|
|
|
|
|
|
|
|
auto& c = xcon.back();
|
|
|
|
c.index = grid.getGlobalIndex(3, 3, con);
|
|
|
|
|
|
|
|
c.cell_pressure = (120 + con*10)*::Opm::unit::barsa;
|
|
|
|
|
|
|
|
c.cell_saturation_gas = 0.6 - con/20.0;
|
|
|
|
c.cell_saturation_water = 0.25;
|
|
|
|
}
|
|
|
|
|
|
|
|
return xcon;
|
|
|
|
}
|
|
|
|
|
|
|
|
::Opm::data::Well wellSol_OP2(const ::Opm::EclipseGrid& grid)
|
|
|
|
{
|
|
|
|
auto xw = ::Opm::data::Well{};
|
|
|
|
xw.connections = connRes_OP2(grid);
|
|
|
|
|
|
|
|
return xw;
|
|
|
|
}
|
|
|
|
|
|
|
|
::Opm::data::WellRates wellSol(const ::Opm::EclipseGrid& grid)
|
|
|
|
{
|
|
|
|
auto xw = ::Opm::data::Wells{};
|
|
|
|
|
|
|
|
xw["OP_1"] = wellSol_OP1(grid);
|
|
|
|
xw["OP_2"] = wellSol_OP2(grid);
|
|
|
|
|
|
|
|
return xw;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(Basic_Unformatted)
|
|
|
|
{
|
|
|
|
using RftDate = ::Opm::EclIO::ERft::RftDate;
|
|
|
|
|
|
|
|
const auto rset = RSet { "TESTRFT" };
|
|
|
|
const auto model = Setup{ "testrft.DATA" };
|
|
|
|
|
|
|
|
{
|
|
|
|
auto rftFile = ::Opm::EclIO::OutputStream::RFT {
|
|
|
|
rset, ::Opm::EclIO::OutputStream::Formatted { false },
|
|
|
|
::Opm::EclIO::OutputStream::RFT::OpenExisting{ false }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto reportStep = 2;
|
|
|
|
const auto elapsed = model.sched.seconds(reportStep);
|
|
|
|
const auto& grid = model.es.getInputGrid();
|
|
|
|
|
|
|
|
::Opm::RftIO::write(reportStep, elapsed, model.es.getUnits(),
|
|
|
|
grid, model.sched, wellSol(grid), rftFile);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto rft = ::Opm::EclIO::ERft {
|
|
|
|
::Opm::EclIO::OutputStream::outputFileName(rset, "RFT")
|
|
|
|
};
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_1", RftDate{ 2008, 10, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto thick = 0.25f;
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 1), 1*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 2), 2*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 3), 3*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 4), 4*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 5), 5*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 6), 6*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 7), 7*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 8), 8*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 9), 9*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 1), 120.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 2), 130.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 3), 140.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 4), 150.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 5), 160.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 6), 170.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 7), 180.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 8), 190.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 9), 200.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 1), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 2), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 3), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 4), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 5), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 6), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 7), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 8), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 9), 0.15f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 1), 0.30f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 2), 0.35f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 3), 0.40f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 4), 0.45f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 5), 0.50f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 6), 0.55f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 7), 0.60f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 8), 0.65f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 9), 0.70f, 1.0e-10f);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_2", RftDate{ 2008, 10, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto thick = 0.25f;
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 4), 4*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 5), 5*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 6), 6*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 7), 7*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 8), 8*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 9), 9*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 4), 150.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 5), 160.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 6), 170.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 7), 180.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 8), 190.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 9), 200.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 4), 0.45f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 5), 0.40f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 6), 0.35f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 7), 0.30f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 9), 0.20f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 4), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 5), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 6), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 7), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 9), 0.25f, 1.0e-10f);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto date = RftDate{2008, 10, 10};
|
|
|
|
|
|
|
|
BOOST_CHECK(rft.hasArray("WELLETC", "OP_1", date));
|
|
|
|
|
|
|
|
const auto& welletc = rft.getRft<std::string>("WELLETC", "OP_1", date);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 0], " DAYS");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 1], "OP_1");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 2], "");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 3], " METRES");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 4], " BARSA");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 5], "R");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 6], "STANDARD");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 7], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 8], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 9], " RM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[10], " M/SEC");
|
|
|
|
// No check for welletc[11]
|
|
|
|
BOOST_CHECK_EQUAL(welletc[12], " CP");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[13], " KG/SM3");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[14], " KG/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[15], " KG/KG");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto date = RftDate{2008, 10, 10};
|
|
|
|
|
|
|
|
BOOST_CHECK(rft.hasArray("WELLETC", "OP_2", date));
|
|
|
|
|
|
|
|
const auto& welletc = rft.getRft<std::string>("WELLETC", "OP_2", date);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 0], " DAYS");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 1], "OP_2");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 2], "");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 3], " METRES");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 4], " BARSA");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 5], "R");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 6], "STANDARD");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 7], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 8], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 9], " RM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[10], " M/SEC");
|
|
|
|
// No check for welletc[11]
|
|
|
|
BOOST_CHECK_EQUAL(welletc[12], " CP");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[13], " KG/SM3");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[14], " KG/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[15], " KG/KG");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
auto rftFile = ::Opm::EclIO::OutputStream::RFT {
|
|
|
|
rset, ::Opm::EclIO::OutputStream::Formatted { false },
|
|
|
|
::Opm::EclIO::OutputStream::RFT::OpenExisting{ true }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto reportStep = 3;
|
|
|
|
const auto elapsed = model.sched.seconds(reportStep);
|
|
|
|
const auto& grid = model.es.getInputGrid();
|
|
|
|
|
|
|
|
::Opm::RftIO::write(reportStep, elapsed, model.es.getUnits(),
|
|
|
|
grid, model.sched, wellSol(grid), rftFile);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto rft = ::Opm::EclIO::ERft {
|
|
|
|
::Opm::EclIO::OutputStream::outputFileName(rset, "RFT")
|
|
|
|
};
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_1", RftDate{ 2008, 10, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto thick = 0.25f;
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 1), 1*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 2), 2*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 3), 3*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 4), 4*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 5), 5*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 6), 6*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 7), 7*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 8), 8*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 9), 9*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 1), 120.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 2), 130.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 3), 140.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 4), 150.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 5), 160.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 6), 170.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 7), 180.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 8), 190.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 9), 200.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 1), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 2), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 3), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 4), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 5), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 6), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 7), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 8), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 9), 0.15f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 1), 0.30f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 2), 0.35f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 3), 0.40f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 4), 0.45f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 5), 0.50f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 6), 0.55f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 7), 0.60f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 8), 0.65f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 9), 0.70f, 1.0e-10f);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_2", RftDate{ 2008, 10, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto thick = 0.25f;
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 4), 4*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 5), 5*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 6), 6*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 7), 7*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 8), 8*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 9), 9*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 4), 150.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 5), 160.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 6), 170.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 7), 180.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 8), 190.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 9), 200.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 4), 0.45f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 5), 0.40f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 6), 0.35f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 7), 0.30f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 9), 0.20f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 4), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 5), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 6), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 7), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 9), 0.25f, 1.0e-10f);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_2", RftDate{ 2008, 11, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto thick = 0.25f;
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 4), 4*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 5), 5*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 6), 6*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 7), 7*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 8), 8*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 9), 9*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 4), 150.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 5), 160.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 6), 170.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 7), 180.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 8), 190.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 9), 200.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 4), 0.45f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 5), 0.40f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 6), 0.35f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 7), 0.30f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 9), 0.20f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 4), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 5), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 6), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 7), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 9), 0.25f, 1.0e-10f);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto date = RftDate{2008, 10, 10};
|
|
|
|
|
|
|
|
BOOST_CHECK(rft.hasArray("WELLETC", "OP_1", date));
|
|
|
|
|
|
|
|
const auto& welletc = rft.getRft<std::string>("WELLETC", "OP_1", date);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 0], " DAYS");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 1], "OP_1");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 2], "");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 3], " METRES");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 4], " BARSA");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 5], "R");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 6], "STANDARD");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 7], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 8], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 9], " RM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[10], " M/SEC");
|
|
|
|
// No check for welletc[11]
|
|
|
|
BOOST_CHECK_EQUAL(welletc[12], " CP");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[13], " KG/SM3");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[14], " KG/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[15], " KG/KG");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto date = RftDate{2008, 10, 10};
|
|
|
|
|
|
|
|
BOOST_CHECK(rft.hasArray("WELLETC", "OP_2", date));
|
|
|
|
|
|
|
|
const auto& welletc = rft.getRft<std::string>("WELLETC", "OP_2", date);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 0], " DAYS");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 1], "OP_2");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 2], "");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 3], " METRES");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 4], " BARSA");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 5], "R");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 6], "STANDARD");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 7], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 8], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 9], " RM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[10], " M/SEC");
|
|
|
|
// No check for welletc[11]
|
|
|
|
BOOST_CHECK_EQUAL(welletc[12], " CP");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[13], " KG/SM3");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[14], " KG/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[15], " KG/KG");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto date = RftDate{2008, 11, 10};
|
|
|
|
|
|
|
|
BOOST_CHECK(rft.hasArray("WELLETC", "OP_2", date));
|
|
|
|
|
|
|
|
const auto& welletc = rft.getRft<std::string>("WELLETC", "OP_2", date);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 0], " DAYS");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 1], "OP_2");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 2], "");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 3], " METRES");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 4], " BARSA");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 5], "R");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 6], "STANDARD");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 7], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 8], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 9], " RM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[10], " M/SEC");
|
|
|
|
// No check for welletc[11]
|
|
|
|
BOOST_CHECK_EQUAL(welletc[12], " CP");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[13], " KG/SM3");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[14], " KG/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[15], " KG/KG");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(Basic_Formatted)
|
|
|
|
{
|
|
|
|
using RftDate = ::Opm::EclIO::ERft::RftDate;
|
|
|
|
|
|
|
|
const auto rset = RSet { "TESTRFT" };
|
|
|
|
const auto model = Setup{ "testrft.DATA" };
|
|
|
|
|
|
|
|
{
|
|
|
|
auto rftFile = ::Opm::EclIO::OutputStream::RFT {
|
|
|
|
rset, ::Opm::EclIO::OutputStream::Formatted { true },
|
|
|
|
::Opm::EclIO::OutputStream::RFT::OpenExisting{ false }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto reportStep = 2;
|
|
|
|
const auto elapsed = model.sched.seconds(reportStep);
|
|
|
|
const auto& grid = model.es.getInputGrid();
|
|
|
|
|
|
|
|
::Opm::RftIO::write(reportStep, elapsed, model.es.getUnits(),
|
|
|
|
grid, model.sched, wellSol(grid), rftFile);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto rft = ::Opm::EclIO::ERft {
|
|
|
|
::Opm::EclIO::OutputStream::outputFileName(rset, "FRFT")
|
|
|
|
};
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_1", RftDate{ 2008, 10, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto thick = 0.25f;
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 1), 1*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 2), 2*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 3), 3*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 4), 4*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 5), 5*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 6), 6*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 7), 7*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 8), 8*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 9), 9*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 1), 120.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 2), 130.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 3), 140.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 4), 150.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 5), 160.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 6), 170.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 7), 180.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 8), 190.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 9), 200.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 1), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 2), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 3), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 4), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 5), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 6), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 7), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 8), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 9), 0.15f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 1), 0.30f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 2), 0.35f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 3), 0.40f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 4), 0.45f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 5), 0.50f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 6), 0.55f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 7), 0.60f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 8), 0.65f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 9), 0.70f, 1.0e-10f);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_2", RftDate{ 2008, 10, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto thick = 0.25f;
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 4), 4*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 5), 5*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 6), 6*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 7), 7*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 8), 8*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 9), 9*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 4), 150.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 5), 160.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 6), 170.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 7), 180.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 8), 190.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 9), 200.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 4), 0.45f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 5), 0.40f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 6), 0.35f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 7), 0.30f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 9), 0.20f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 4), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 5), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 6), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 7), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 9), 0.25f, 1.0e-10f);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto date = RftDate{2008, 10, 10};
|
|
|
|
|
|
|
|
BOOST_CHECK(rft.hasArray("WELLETC", "OP_1", date));
|
|
|
|
|
|
|
|
const auto& welletc = rft.getRft<std::string>("WELLETC", "OP_1", date);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 0], " DAYS");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 1], "OP_1");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 2], "");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 3], " METRES");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 4], " BARSA");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 5], "R");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 6], "STANDARD");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 7], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 8], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 9], " RM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[10], " M/SEC");
|
|
|
|
// No check for welletc[11]
|
|
|
|
BOOST_CHECK_EQUAL(welletc[12], " CP");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[13], " KG/SM3");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[14], " KG/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[15], " KG/KG");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto date = RftDate{2008, 10, 10};
|
|
|
|
|
|
|
|
BOOST_CHECK(rft.hasArray("WELLETC", "OP_2", date));
|
|
|
|
|
|
|
|
const auto& welletc = rft.getRft<std::string>("WELLETC", "OP_2", date);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 0], " DAYS");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 1], "OP_2");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 2], "");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 3], " METRES");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 4], " BARSA");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 5], "R");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 6], "STANDARD");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 7], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 8], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 9], " RM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[10], " M/SEC");
|
|
|
|
// No check for welletc[11]
|
|
|
|
BOOST_CHECK_EQUAL(welletc[12], " CP");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[13], " KG/SM3");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[14], " KG/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[15], " KG/KG");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
auto rftFile = ::Opm::EclIO::OutputStream::RFT {
|
|
|
|
rset, ::Opm::EclIO::OutputStream::Formatted { true },
|
|
|
|
::Opm::EclIO::OutputStream::RFT::OpenExisting{ true }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto reportStep = 3;
|
|
|
|
const auto elapsed = model.sched.seconds(reportStep);
|
|
|
|
const auto& grid = model.es.getInputGrid();
|
|
|
|
|
|
|
|
::Opm::RftIO::write(reportStep, elapsed, model.es.getUnits(),
|
|
|
|
grid, model.sched, wellSol(grid), rftFile);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto rft = ::Opm::EclIO::ERft {
|
|
|
|
::Opm::EclIO::OutputStream::outputFileName(rset, "FRFT")
|
|
|
|
};
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_1", RftDate{ 2008, 10, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto thick = 0.25f;
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 1), 1*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 2), 2*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 3), 3*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 4), 4*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 5), 5*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 6), 6*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 7), 7*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 8), 8*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 9), 9*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 1), 120.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 2), 130.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 3), 140.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 4), 150.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 5), 160.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 6), 170.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 7), 180.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 8), 190.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 9), 200.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 1), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 2), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 3), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 4), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 5), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 6), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 7), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 8), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 9), 0.15f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 1), 0.30f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 2), 0.35f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 3), 0.40f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 4), 0.45f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 5), 0.50f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 6), 0.55f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 7), 0.60f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 8), 0.65f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 9), 0.70f, 1.0e-10f);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_2", RftDate{ 2008, 10, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto thick = 0.25f;
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 4), 4*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 5), 5*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 6), 6*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 7), 7*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 8), 8*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 9), 9*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 4), 150.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 5), 160.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 6), 170.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 7), 180.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 8), 190.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 9), 200.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 4), 0.45f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 5), 0.40f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 6), 0.35f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 7), 0.30f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 9), 0.20f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 4), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 5), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 6), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 7), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 9), 0.25f, 1.0e-10f);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_2", RftDate{ 2008, 11, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto thick = 0.25f;
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 4), 4*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 5), 5*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 6), 6*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 7), 7*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 8), 8*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 9), 9*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 4), 150.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 5), 160.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 6), 170.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 7), 180.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 8), 190.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 9), 200.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 4), 0.45f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 5), 0.40f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 6), 0.35f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 7), 0.30f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 9), 0.20f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 4), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 5), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 6), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 7), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 9), 0.25f, 1.0e-10f);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto date = RftDate{2008, 10, 10};
|
|
|
|
|
|
|
|
BOOST_CHECK(rft.hasArray("WELLETC", "OP_1", date));
|
|
|
|
|
|
|
|
const auto& welletc = rft.getRft<std::string>("WELLETC", "OP_1", date);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 0], " DAYS");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 1], "OP_1");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 2], "");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 3], " METRES");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 4], " BARSA");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 5], "R");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 6], "STANDARD");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 7], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 8], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 9], " RM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[10], " M/SEC");
|
|
|
|
// No check for welletc[11]
|
|
|
|
BOOST_CHECK_EQUAL(welletc[12], " CP");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[13], " KG/SM3");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[14], " KG/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[15], " KG/KG");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto date = RftDate{2008, 10, 10};
|
|
|
|
|
|
|
|
BOOST_CHECK(rft.hasArray("WELLETC", "OP_2", date));
|
|
|
|
|
|
|
|
const auto& welletc = rft.getRft<std::string>("WELLETC", "OP_2", date);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 0], " DAYS");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 1], "OP_2");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 2], "");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 3], " METRES");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 4], " BARSA");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 5], "R");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 6], "STANDARD");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 7], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 8], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 9], " RM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[10], " M/SEC");
|
|
|
|
// No check for welletc[11]
|
|
|
|
BOOST_CHECK_EQUAL(welletc[12], " CP");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[13], " KG/SM3");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[14], " KG/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[15], " KG/KG");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto date = RftDate{2008, 11, 10};
|
|
|
|
|
|
|
|
BOOST_CHECK(rft.hasArray("WELLETC", "OP_2", date));
|
|
|
|
|
|
|
|
const auto& welletc = rft.getRft<std::string>("WELLETC", "OP_2", date);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 0], " DAYS");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 1], "OP_2");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 2], "");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 3], " METRES");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 4], " BARSA");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 5], "R");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 6], "STANDARD");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 7], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 8], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 9], " RM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[10], " M/SEC");
|
|
|
|
// No check for welletc[11]
|
|
|
|
BOOST_CHECK_EQUAL(welletc[12], " CP");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[13], " KG/SM3");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[14], " KG/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[15], " KG/KG");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(Field_Units)
|
|
|
|
{
|
|
|
|
using RftDate = ::Opm::EclIO::ERft::RftDate;
|
|
|
|
|
|
|
|
const auto rset = RSet { "TESTRFT" };
|
|
|
|
const auto model = Setup{ "testrft.DATA" };
|
|
|
|
const auto usys = ::Opm::UnitSystem::newFIELD();
|
|
|
|
|
|
|
|
{
|
|
|
|
auto rftFile = ::Opm::EclIO::OutputStream::RFT {
|
|
|
|
rset, ::Opm::EclIO::OutputStream::Formatted { false },
|
|
|
|
::Opm::EclIO::OutputStream::RFT::OpenExisting{ false }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto reportStep = 2;
|
|
|
|
const auto elapsed = model.sched.seconds(reportStep);
|
|
|
|
const auto& grid = model.es.getInputGrid();
|
|
|
|
|
|
|
|
::Opm::RftIO::write(reportStep, elapsed, usys, grid,
|
|
|
|
model.sched, wellSol(grid), rftFile);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto rft = ::Opm::EclIO::ERft {
|
|
|
|
::Opm::EclIO::OutputStream::outputFileName(rset, "RFT")
|
|
|
|
};
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_1", RftDate{ 2008, 10, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto thick = ::Opm::unit::convert::to(0.25f, ::Opm::unit::feet);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 1), 1*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 2), 2*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 3), 3*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 4), 4*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 5), 5*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 6), 6*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 7), 7*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 8), 8*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 9), 9*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 1), 1.740452852762511e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 2), 1.885490590492720e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 3), 2.030528328222930e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 4), 2.175566065953139e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 5), 2.320603803683348e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 6), 2.465641541413557e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 7), 2.610679279143767e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 8), 2.755717016873976e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 9), 2.900754754604185e+03f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 1), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 2), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 3), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 4), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 5), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 6), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 7), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 8), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 9), 0.15f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 1), 0.30f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 2), 0.35f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 3), 0.40f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 4), 0.45f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 5), 0.50f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 6), 0.55f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 7), 0.60f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 8), 0.65f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 9), 0.70f, 1.0e-10f);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_2", RftDate{ 2008, 10, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto thick = ::Opm::unit::convert::to(0.25f, ::Opm::unit::feet);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 4), 4*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 5), 5*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 6), 6*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 7), 7*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 8), 8*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 9), 9*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 4), 2.175566065953139e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 5), 2.320603803683348e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 6), 2.465641541413557e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 7), 2.610679279143767e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 8), 2.755717016873976e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 9), 2.900754754604185e+03f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 4), 0.45f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 5), 0.40f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 6), 0.35f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 7), 0.30f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 9), 0.20f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 4), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 5), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 6), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 7), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 9), 0.25f, 1.0e-10f);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto date = RftDate{2008, 10, 10};
|
|
|
|
|
|
|
|
BOOST_CHECK(rft.hasArray("WELLETC", "OP_1", date));
|
|
|
|
|
|
|
|
const auto& welletc = rft.getRft<std::string>("WELLETC", "OP_1", date);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 0], " DAYS");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 1], "OP_1");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 2], "");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 3], " FEET");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 4], " PSIA");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 5], "R");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 6], "STANDARD");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 7], " STB/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 8], "MSCF/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 9], " RB/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[10], " FT/SEC");
|
|
|
|
// No check for welletc[11]
|
|
|
|
BOOST_CHECK_EQUAL(welletc[12], " CP");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[13], " LB/STB");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[14], " LB/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[15], " LB/LB");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto date = RftDate{2008, 10, 10};
|
|
|
|
|
|
|
|
BOOST_CHECK(rft.hasArray("WELLETC", "OP_2", date));
|
|
|
|
|
|
|
|
const auto& welletc = rft.getRft<std::string>("WELLETC", "OP_2", date);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 0], " DAYS");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 1], "OP_2");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 2], "");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 3], " FEET");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 4], " PSIA");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 5], "R");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 6], "STANDARD");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 7], " STB/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 8], "MSCF/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 9], " RB/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[10], " FT/SEC");
|
|
|
|
// No check for welletc[11]
|
|
|
|
BOOST_CHECK_EQUAL(welletc[12], " CP");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[13], " LB/STB");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[14], " LB/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[15], " LB/LB");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
auto rftFile = ::Opm::EclIO::OutputStream::RFT {
|
|
|
|
rset, ::Opm::EclIO::OutputStream::Formatted { false },
|
|
|
|
::Opm::EclIO::OutputStream::RFT::OpenExisting{ true }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto reportStep = 3;
|
|
|
|
const auto elapsed = model.sched.seconds(reportStep);
|
|
|
|
const auto& grid = model.es.getInputGrid();
|
|
|
|
|
|
|
|
::Opm::RftIO::write(reportStep, elapsed, usys, grid,
|
|
|
|
model.sched, wellSol(grid), rftFile);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto rft = ::Opm::EclIO::ERft {
|
|
|
|
::Opm::EclIO::OutputStream::outputFileName(rset, "RFT")
|
|
|
|
};
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_1", RftDate{ 2008, 10, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto thick = ::Opm::unit::convert::to(0.25f, ::Opm::unit::feet);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 1), 1*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 2), 2*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 3), 3*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 4), 4*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 5), 5*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 6), 6*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 7), 7*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 8), 8*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 9), 9*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 1), 1.740452852762511e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 2), 1.885490590492720e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 3), 2.030528328222930e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 4), 2.175566065953139e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 5), 2.320603803683348e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 6), 2.465641541413557e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 7), 2.610679279143767e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 8), 2.755717016873976e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 9), 2.900754754604185e+03f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 1), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 2), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 3), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 4), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 5), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 6), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 7), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 8), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 9), 0.15f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 1), 0.30f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 2), 0.35f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 3), 0.40f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 4), 0.45f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 5), 0.50f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 6), 0.55f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 7), 0.60f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 8), 0.65f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 9), 0.70f, 1.0e-10f);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_2", RftDate{ 2008, 10, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto thick = ::Opm::unit::convert::to(0.25f, ::Opm::unit::feet);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 4), 4*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 5), 5*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 6), 6*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 7), 7*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 8), 8*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 9), 9*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 4), 2.175566065953139e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 5), 2.320603803683348e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 6), 2.465641541413557e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 7), 2.610679279143767e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 8), 2.755717016873976e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 9), 2.900754754604185e+03f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 4), 0.45f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 5), 0.40f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 6), 0.35f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 7), 0.30f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 9), 0.20f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 4), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 5), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 6), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 7), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 9), 0.25f, 1.0e-10f);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_2", RftDate{ 2008, 11, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto thick = ::Opm::unit::convert::to(0.25f, ::Opm::unit::feet);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 4), 4*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 5), 5*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 6), 6*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 7), 7*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 8), 8*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 9), 9*thick + thick/2.0f, 5.0e-6f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 4), 2.175566065953139e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 5), 2.320603803683348e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 6), 2.465641541413557e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 7), 2.610679279143767e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 8), 2.755717016873976e+03f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 9), 2.900754754604185e+03f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 4), 0.45f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 5), 0.40f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 6), 0.35f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 7), 0.30f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 9), 0.20f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 4), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 5), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 6), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 7), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 9), 0.25f, 1.0e-10f);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto date = RftDate{2008, 10, 10};
|
|
|
|
|
|
|
|
BOOST_CHECK(rft.hasArray("WELLETC", "OP_1", date));
|
|
|
|
|
|
|
|
const auto& welletc = rft.getRft<std::string>("WELLETC", "OP_1", date);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 0], " DAYS");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 1], "OP_1");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 2], "");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 3], " FEET");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 4], " PSIA");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 5], "R");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 6], "STANDARD");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 7], " STB/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 8], "MSCF/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 9], " RB/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[10], " FT/SEC");
|
|
|
|
// No check for welletc[11]
|
|
|
|
BOOST_CHECK_EQUAL(welletc[12], " CP");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[13], " LB/STB");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[14], " LB/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[15], " LB/LB");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto date = RftDate{2008, 10, 10};
|
|
|
|
|
|
|
|
BOOST_CHECK(rft.hasArray("WELLETC", "OP_2", date));
|
|
|
|
|
|
|
|
const auto& welletc = rft.getRft<std::string>("WELLETC", "OP_2", date);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 0], " DAYS");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 1], "OP_2");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 2], "");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 3], " FEET");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 4], " PSIA");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 5], "R");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 6], "STANDARD");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 7], " STB/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 8], "MSCF/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 9], " RB/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[10], " FT/SEC");
|
|
|
|
// No check for welletc[11]
|
|
|
|
BOOST_CHECK_EQUAL(welletc[12], " CP");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[13], " LB/STB");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[14], " LB/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[15], " LB/LB");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto date = RftDate{2008, 11, 10};
|
|
|
|
|
|
|
|
BOOST_CHECK(rft.hasArray("WELLETC", "OP_2", date));
|
|
|
|
|
|
|
|
const auto& welletc = rft.getRft<std::string>("WELLETC", "OP_2", date);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 0], " DAYS");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 1], "OP_2");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 2], "");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 3], " FEET");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 4], " PSIA");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 5], "R");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 6], "STANDARD");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 7], " STB/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 8], "MSCF/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 9], " RB/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[10], " FT/SEC");
|
|
|
|
// No check for welletc[11]
|
|
|
|
BOOST_CHECK_EQUAL(welletc[12], " CP");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[13], " LB/STB");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[14], " LB/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[15], " LB/LB");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(Lab_Units)
|
|
|
|
{
|
|
|
|
using RftDate = ::Opm::EclIO::ERft::RftDate;
|
|
|
|
|
|
|
|
const auto rset = RSet { "TESTRFT" };
|
|
|
|
const auto model = Setup{ "testrft.DATA" };
|
|
|
|
const auto usys = ::Opm::UnitSystem::newLAB();
|
|
|
|
|
|
|
|
{
|
|
|
|
auto rftFile = ::Opm::EclIO::OutputStream::RFT {
|
|
|
|
rset, ::Opm::EclIO::OutputStream::Formatted { false },
|
|
|
|
::Opm::EclIO::OutputStream::RFT::OpenExisting{ false }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto reportStep = 2;
|
|
|
|
const auto elapsed = model.sched.seconds(reportStep);
|
|
|
|
const auto& grid = model.es.getInputGrid();
|
|
|
|
|
|
|
|
::Opm::RftIO::write(reportStep, elapsed, usys, grid,
|
|
|
|
model.sched, wellSol(grid), rftFile);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto rft = ::Opm::EclIO::ERft {
|
|
|
|
::Opm::EclIO::OutputStream::outputFileName(rset, "RFT")
|
|
|
|
};
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_1", RftDate{ 2008, 10, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto thick = 25.0f; // cm
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 1), 1*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 2), 2*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 3), 3*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 4), 4*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 5), 5*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 6), 6*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 7), 7*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 8), 8*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 9), 9*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 1), 1.184307920059215e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 2), 1.283000246730817e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 3), 1.381692573402418e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 4), 1.480384900074019e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 5), 1.579077226745621e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 6), 1.677769553417222e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 7), 1.776461880088823e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 8), 1.875154206760424e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 9), 1.973846533432026e+02f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 1), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 2), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 3), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 4), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 5), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 6), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 7), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 8), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 9), 0.15f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 1), 0.30f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 2), 0.35f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 3), 0.40f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 4), 0.45f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 5), 0.50f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 6), 0.55f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 7), 0.60f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 8), 0.65f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 9), 0.70f, 1.0e-10f);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_2", RftDate{ 2008, 10, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto thick = 25.0f; // cm
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 4), 4*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 5), 5*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 6), 6*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 7), 7*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 8), 8*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 9), 9*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 4), 1.480384900074019e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 5), 1.579077226745621e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 6), 1.677769553417222e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 7), 1.776461880088823e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 8), 1.875154206760424e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 9), 1.973846533432026e+02f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 4), 0.45f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 5), 0.40f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 6), 0.35f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 7), 0.30f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 9), 0.20f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 4), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 5), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 6), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 7), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 9), 0.25f, 1.0e-10f);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto date = RftDate{2008, 10, 10};
|
|
|
|
|
|
|
|
BOOST_CHECK(rft.hasArray("WELLETC", "OP_1", date));
|
|
|
|
|
|
|
|
const auto& welletc = rft.getRft<std::string>("WELLETC", "OP_1", date);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 0], " HR");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 1], "OP_1");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 2], "");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 3], " CM");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 4], " ATMA");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 5], "R");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 6], "STANDARD");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 7], " SCC/HR");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 8], " SCC/HR");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 9], " RCC/HR");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[10], " CM/SEC");
|
|
|
|
// No check for welletc[11]
|
|
|
|
BOOST_CHECK_EQUAL(welletc[12], " CP");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[13], " GM/SCC");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[14], " GM/HR");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[15], " GM/GM");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto date = RftDate{2008, 10, 10};
|
|
|
|
|
|
|
|
BOOST_CHECK(rft.hasArray("WELLETC", "OP_2", date));
|
|
|
|
|
|
|
|
const auto& welletc = rft.getRft<std::string>("WELLETC", "OP_2", date);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 0], " HR");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 1], "OP_2");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 2], "");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 3], " CM");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 4], " ATMA");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 5], "R");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 6], "STANDARD");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 7], " SCC/HR");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 8], " SCC/HR");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 9], " RCC/HR");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[10], " CM/SEC");
|
|
|
|
// No check for welletc[11]
|
|
|
|
BOOST_CHECK_EQUAL(welletc[12], " CP");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[13], " GM/SCC");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[14], " GM/HR");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[15], " GM/GM");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
auto rftFile = ::Opm::EclIO::OutputStream::RFT {
|
|
|
|
rset, ::Opm::EclIO::OutputStream::Formatted { false },
|
|
|
|
::Opm::EclIO::OutputStream::RFT::OpenExisting{ true }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto reportStep = 3;
|
|
|
|
const auto elapsed = model.sched.seconds(reportStep);
|
|
|
|
const auto& grid = model.es.getInputGrid();
|
|
|
|
|
|
|
|
::Opm::RftIO::write(reportStep, elapsed, usys, grid,
|
|
|
|
model.sched, wellSol(grid), rftFile);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto rft = ::Opm::EclIO::ERft {
|
|
|
|
::Opm::EclIO::OutputStream::outputFileName(rset, "RFT")
|
|
|
|
};
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_1", RftDate{ 2008, 10, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto thick = 25.0f; // cm
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 1), 1*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 2), 2*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 3), 3*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 4), 4*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 5), 5*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 6), 6*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 7), 7*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 8), 8*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 9), 9*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 1), 1.184307920059215e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 2), 1.283000246730817e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 3), 1.381692573402418e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 4), 1.480384900074019e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 5), 1.579077226745621e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 6), 1.677769553417222e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 7), 1.776461880088823e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 8), 1.875154206760424e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 9), 1.973846533432026e+02f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 1), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 2), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 3), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 4), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 5), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 6), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 7), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 8), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 9), 0.15f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 1), 0.30f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 2), 0.35f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 3), 0.40f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 4), 0.45f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 5), 0.50f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 6), 0.55f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 7), 0.60f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 8), 0.65f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 9), 0.70f, 1.0e-10f);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_2", RftDate{ 2008, 10, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto thick = 25.0f; // cm
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 4), 4*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 5), 5*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 6), 6*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 7), 7*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 8), 8*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 9), 9*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 4), 1.480384900074019e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 5), 1.579077226745621e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 6), 1.677769553417222e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 7), 1.776461880088823e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 8), 1.875154206760424e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 9), 1.973846533432026e+02f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 4), 0.45f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 5), 0.40f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 6), 0.35f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 7), 0.30f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 9), 0.20f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 4), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 5), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 6), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 7), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 9), 0.25f, 1.0e-10f);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_2", RftDate{ 2008, 11, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto thick = 25.0f; // cm
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 4), 4*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 5), 5*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 6), 6*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 7), 7*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 8), 8*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 9), 9*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 4), 1.480384900074019e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 5), 1.579077226745621e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 6), 1.677769553417222e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 7), 1.776461880088823e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 8), 1.875154206760424e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 9), 1.973846533432026e+02f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 4), 0.45f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 5), 0.40f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 6), 0.35f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 7), 0.30f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 9), 0.20f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 4), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 5), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 6), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 7), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 9), 0.25f, 1.0e-10f);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto date = RftDate{2008, 10, 10};
|
|
|
|
|
|
|
|
BOOST_CHECK(rft.hasArray("WELLETC", "OP_1", date));
|
|
|
|
|
|
|
|
const auto& welletc = rft.getRft<std::string>("WELLETC", "OP_1", date);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 0], " HR");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 1], "OP_1");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 2], "");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 3], " CM");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 4], " ATMA");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 5], "R");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 6], "STANDARD");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 7], " SCC/HR");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 8], " SCC/HR");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 9], " RCC/HR");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[10], " CM/SEC");
|
|
|
|
// No check for welletc[11]
|
|
|
|
BOOST_CHECK_EQUAL(welletc[12], " CP");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[13], " GM/SCC");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[14], " GM/HR");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[15], " GM/GM");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto date = RftDate{2008, 10, 10};
|
|
|
|
|
|
|
|
BOOST_CHECK(rft.hasArray("WELLETC", "OP_2", date));
|
|
|
|
|
|
|
|
const auto& welletc = rft.getRft<std::string>("WELLETC", "OP_2", date);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 0], " HR");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 1], "OP_2");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 2], "");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 3], " CM");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 4], " ATMA");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 5], "R");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 6], "STANDARD");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 7], " SCC/HR");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 8], " SCC/HR");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 9], " RCC/HR");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[10], " CM/SEC");
|
|
|
|
// No check for welletc[11]
|
|
|
|
BOOST_CHECK_EQUAL(welletc[12], " CP");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[13], " GM/SCC");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[14], " GM/HR");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[15], " GM/GM");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto date = RftDate{2008, 11, 10};
|
|
|
|
|
|
|
|
BOOST_CHECK(rft.hasArray("WELLETC", "OP_2", date));
|
|
|
|
|
|
|
|
const auto& welletc = rft.getRft<std::string>("WELLETC", "OP_2", date);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 0], " HR");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 1], "OP_2");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 2], "");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 3], " CM");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 4], " ATMA");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 5], "R");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 6], "STANDARD");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 7], " SCC/HR");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 8], " SCC/HR");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 9], " RCC/HR");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[10], " CM/SEC");
|
|
|
|
// No check for welletc[11]
|
|
|
|
BOOST_CHECK_EQUAL(welletc[12], " CP");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[13], " GM/SCC");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[14], " GM/HR");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[15], " GM/GM");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(PVT_M_Units)
|
|
|
|
{
|
|
|
|
using RftDate = ::Opm::EclIO::ERft::RftDate;
|
|
|
|
|
|
|
|
const auto rset = RSet { "TESTRFT" };
|
|
|
|
const auto model = Setup{ "testrft.DATA" };
|
|
|
|
const auto usys = ::Opm::UnitSystem::newPVT_M();
|
|
|
|
|
|
|
|
{
|
|
|
|
auto rftFile = ::Opm::EclIO::OutputStream::RFT {
|
|
|
|
rset, ::Opm::EclIO::OutputStream::Formatted { false },
|
|
|
|
::Opm::EclIO::OutputStream::RFT::OpenExisting{ false }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto reportStep = 2;
|
|
|
|
const auto elapsed = model.sched.seconds(reportStep);
|
|
|
|
const auto& grid = model.es.getInputGrid();
|
|
|
|
|
|
|
|
::Opm::RftIO::write(reportStep, elapsed, usys, grid,
|
|
|
|
model.sched, wellSol(grid), rftFile);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto rft = ::Opm::EclIO::ERft {
|
|
|
|
::Opm::EclIO::OutputStream::outputFileName(rset, "RFT")
|
|
|
|
};
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_1", RftDate{ 2008, 10, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto thick = 0.25f;
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 1), 1*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 2), 2*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 3), 3*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 4), 4*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 5), 5*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 6), 6*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 7), 7*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 8), 8*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 9), 9*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 1), 1.184307920059215e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 2), 1.283000246730817e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 3), 1.381692573402418e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 4), 1.480384900074019e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 5), 1.579077226745621e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 6), 1.677769553417222e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 7), 1.776461880088823e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 8), 1.875154206760424e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 9), 1.973846533432026e+02f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 1), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 2), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 3), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 4), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 5), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 6), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 7), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 8), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 9), 0.15f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 1), 0.30f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 2), 0.35f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 3), 0.40f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 4), 0.45f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 5), 0.50f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 6), 0.55f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 7), 0.60f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 8), 0.65f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 9), 0.70f, 1.0e-10f);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_2", RftDate{ 2008, 10, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto thick = 0.25f;
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 4), 4*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 5), 5*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 6), 6*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 7), 7*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 8), 8*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 9), 9*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 4), 1.480384900074019e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 5), 1.579077226745621e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 6), 1.677769553417222e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 7), 1.776461880088823e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 8), 1.875154206760424e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 9), 1.973846533432026e+02f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 4), 0.45f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 5), 0.40f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 6), 0.35f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 7), 0.30f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 9), 0.20f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 4), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 5), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 6), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 7), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 9), 0.25f, 1.0e-10f);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto date = RftDate{2008, 10, 10};
|
|
|
|
|
|
|
|
BOOST_CHECK(rft.hasArray("WELLETC", "OP_1", date));
|
|
|
|
|
|
|
|
const auto& welletc = rft.getRft<std::string>("WELLETC", "OP_1", date);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 0], " DAYS");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 1], "OP_1");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 2], "");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 3], " METRES");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 4], " ATMA");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 5], "R");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 6], "STANDARD");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 7], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 8], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 9], " RM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[10], " M/SEC");
|
|
|
|
// No check for welletc[11]
|
|
|
|
BOOST_CHECK_EQUAL(welletc[12], " CP");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[13], " KG/SM3");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[14], " KG/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[15], " KG/KG");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto date = RftDate{2008, 10, 10};
|
|
|
|
|
|
|
|
BOOST_CHECK(rft.hasArray("WELLETC", "OP_2", date));
|
|
|
|
|
|
|
|
const auto& welletc = rft.getRft<std::string>("WELLETC", "OP_2", date);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 0], " DAYS");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 1], "OP_2");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 2], "");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 3], " METRES");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 4], " ATMA");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 5], "R");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 6], "STANDARD");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 7], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 8], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 9], " RM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[10], " M/SEC");
|
|
|
|
// No check for welletc[11]
|
|
|
|
BOOST_CHECK_EQUAL(welletc[12], " CP");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[13], " KG/SM3");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[14], " KG/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[15], " KG/KG");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
auto rftFile = ::Opm::EclIO::OutputStream::RFT {
|
|
|
|
rset, ::Opm::EclIO::OutputStream::Formatted { false },
|
|
|
|
::Opm::EclIO::OutputStream::RFT::OpenExisting{ true }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto reportStep = 3;
|
|
|
|
const auto elapsed = model.sched.seconds(reportStep);
|
|
|
|
const auto& grid = model.es.getInputGrid();
|
|
|
|
|
|
|
|
::Opm::RftIO::write(reportStep, elapsed, usys, grid,
|
|
|
|
model.sched, wellSol(grid), rftFile);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto rft = ::Opm::EclIO::ERft {
|
|
|
|
::Opm::EclIO::OutputStream::outputFileName(rset, "RFT")
|
|
|
|
};
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_1", RftDate{ 2008, 10, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto thick = 0.25;
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 1), 1*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 2), 2*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 3), 3*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 4), 4*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 5), 5*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 6), 6*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 7), 7*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 8), 8*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(9, 9, 9), 9*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 1), 1.184307920059215e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 2), 1.283000246730817e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 3), 1.381692573402418e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 4), 1.480384900074019e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 5), 1.579077226745621e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 6), 1.677769553417222e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 7), 1.776461880088823e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 8), 1.875154206760424e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(9, 9, 9), 1.973846533432026e+02f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 1), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 2), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 3), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 4), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 5), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 6), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 7), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 8), 0.15f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(9, 9, 9), 0.15f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 1), 0.30f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 2), 0.35f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 3), 0.40f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 4), 0.45f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 5), 0.50f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 6), 0.55f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 7), 0.60f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 8), 0.65f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(9, 9, 9), 0.70f, 1.0e-10f);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_2", RftDate{ 2008, 10, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto thick = 0.25;
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 4), 4*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 5), 5*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 6), 6*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 7), 7*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 8), 8*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 9), 9*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 4), 1.480384900074019e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 5), 1.579077226745621e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 6), 1.677769553417222e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 7), 1.776461880088823e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 8), 1.875154206760424e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 9), 1.973846533432026e+02f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 4), 0.45f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 5), 0.40f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 6), 0.35f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 7), 0.30f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 9), 0.20f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 4), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 5), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 6), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 7), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 9), 0.25f, 1.0e-10f);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto xRFT = RFTRresults {
|
|
|
|
rft, "OP_2", RftDate{ 2008, 11, 10 }
|
|
|
|
};
|
|
|
|
|
|
|
|
const auto thick = 0.25;
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 4), 4*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 5), 5*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 6), 6*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 7), 7*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 8), 8*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.depth(4, 4, 9), 9*thick + thick/2.0f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 4), 1.480384900074019e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 5), 1.579077226745621e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 6), 1.677769553417222e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 7), 1.776461880088823e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 8), 1.875154206760424e+02f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.pressure(4, 4, 9), 1.973846533432026e+02f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 4), 0.45f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 5), 0.40f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 6), 0.35f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 7), 0.30f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.sgas(4, 4, 9), 0.20f, 1.0e-10f);
|
|
|
|
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 4), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 5), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 6), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 7), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 8), 0.25f, 1.0e-10f);
|
|
|
|
BOOST_CHECK_CLOSE(xRFT.swat(4, 4, 9), 0.25f, 1.0e-10f);
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto date = RftDate{2008, 10, 10};
|
|
|
|
|
|
|
|
BOOST_CHECK(rft.hasArray("WELLETC", "OP_1", date));
|
|
|
|
|
|
|
|
const auto& welletc = rft.getRft<std::string>("WELLETC", "OP_1", date);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 0], " DAYS");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 1], "OP_1");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 2], "");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 3], " METRES");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 4], " ATMA");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 5], "R");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 6], "STANDARD");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 7], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 8], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 9], " RM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[10], " M/SEC");
|
|
|
|
// No check for welletc[11]
|
|
|
|
BOOST_CHECK_EQUAL(welletc[12], " CP");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[13], " KG/SM3");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[14], " KG/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[15], " KG/KG");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto date = RftDate{2008, 10, 10};
|
|
|
|
|
|
|
|
BOOST_CHECK(rft.hasArray("WELLETC", "OP_2", date));
|
|
|
|
|
|
|
|
const auto& welletc = rft.getRft<std::string>("WELLETC", "OP_2", date);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 0], " DAYS");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 1], "OP_2");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 2], "");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 3], " METRES");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 4], " ATMA");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 5], "R");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 6], "STANDARD");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 7], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 8], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 9], " RM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[10], " M/SEC");
|
|
|
|
// No check for welletc[11]
|
|
|
|
BOOST_CHECK_EQUAL(welletc[12], " CP");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[13], " KG/SM3");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[14], " KG/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[15], " KG/KG");
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto date = RftDate{2008, 11, 10};
|
|
|
|
|
|
|
|
BOOST_CHECK(rft.hasArray("WELLETC", "OP_2", date));
|
|
|
|
|
|
|
|
const auto& welletc = rft.getRft<std::string>("WELLETC", "OP_2", date);
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 0], " DAYS");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 1], "OP_2");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 2], "");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 3], " METRES");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 4], " ATMA");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 5], "R");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 6], "STANDARD");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 7], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 8], " SM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[ 9], " RM3/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[10], " M/SEC");
|
|
|
|
// No check for welletc[11]
|
|
|
|
BOOST_CHECK_EQUAL(welletc[12], " CP");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[13], " KG/SM3");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[14], " KG/DAY");
|
|
|
|
BOOST_CHECK_EQUAL(welletc[15], " KG/KG");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_SUITE_END() // Using_Direct_Write
|