2016-09-05 08:23:24 -05:00
|
|
|
#include "gtest/gtest.h"
|
|
|
|
|
2023-02-26 03:48:40 -06:00
|
|
|
const std::string casePath = "\\\\csfiles\\Store\\ProjectData\\StatoilReservoir\\ReferenceCases\\simple_FlowDiag_Model\\";
|
2016-12-08 07:57:32 -06:00
|
|
|
|
2017-05-12 05:22:50 -05:00
|
|
|
/*
|
2016-12-08 10:09:03 -06:00
|
|
|
#include "exampleSetup.hpp"
|
2016-09-05 08:23:24 -05:00
|
|
|
|
|
|
|
TEST(opm_flowdiagnostics_test, basic_construction)
|
|
|
|
{
|
2016-12-08 07:57:32 -06:00
|
|
|
|
2016-12-08 10:09:03 -06:00
|
|
|
try
|
2016-12-08 07:57:32 -06:00
|
|
|
{
|
2017-05-12 05:22:50 -05:00
|
|
|
Opm::ECLRestartData rstrt(casePath + "SIMPLE.UNRST");
|
|
|
|
Opm::ECLInitFileData initData(casePath + "SIMPLE.INIT");
|
|
|
|
|
2016-12-08 10:09:03 -06:00
|
|
|
Opm::ECLGraph graph = Opm::ECLGraph::load(casePath + "SIMPLE.EGRID",
|
2017-05-12 05:22:50 -05:00
|
|
|
initData);
|
|
|
|
|
2016-12-08 10:09:03 -06:00
|
|
|
int step = 2;
|
2017-05-12 05:22:50 -05:00
|
|
|
if ( ! rstrt.selectReportStep(step) )
|
2016-12-08 10:09:03 -06:00
|
|
|
{
|
|
|
|
std::ostringstream os;
|
2016-12-08 07:57:32 -06:00
|
|
|
|
2016-12-08 10:09:03 -06:00
|
|
|
os << "Report Step " << step
|
|
|
|
<< " is Not Available in Result Set '"
|
|
|
|
<< casePath << '\'';
|
2016-12-08 07:57:32 -06:00
|
|
|
|
2016-12-08 10:09:03 -06:00
|
|
|
throw std::domain_error(os.str());
|
|
|
|
}
|
2016-12-08 07:57:32 -06:00
|
|
|
|
2016-12-08 10:09:03 -06:00
|
|
|
Opm::FlowDiagnostics::Toolbox fdTool = example::initialiseFlowDiagnostics(graph);
|
2016-12-08 07:57:32 -06:00
|
|
|
|
|
|
|
// Solve for time of flight.
|
|
|
|
std::vector<Opm::FlowDiagnostics::CellSet> start;
|
2016-12-14 02:38:51 -06:00
|
|
|
Opm::FlowDiagnostics::Toolbox::Forward sol = fdTool.computeInjectionDiagnostics(start);
|
|
|
|
const std::vector<double>& tof = sol.fd.timeOfFlight();
|
2016-12-08 07:57:32 -06:00
|
|
|
|
2016-12-08 10:09:03 -06:00
|
|
|
// Write it to standard out.
|
|
|
|
std::cout.precision(16);
|
|
|
|
for ( double t : tof )
|
|
|
|
{
|
2017-05-22 11:11:03 -05:00
|
|
|
// std::cout << t << '\n';
|
2016-12-08 10:09:03 -06:00
|
|
|
}
|
2016-12-08 07:55:01 -06:00
|
|
|
}
|
2016-12-08 10:09:03 -06:00
|
|
|
catch ( const std::exception& e )
|
2016-12-08 07:55:01 -06:00
|
|
|
{
|
|
|
|
std::cerr << "Caught exception: " << e.what() << '\n';
|
|
|
|
}
|
2016-09-05 08:23:24 -05:00
|
|
|
}
|
2017-05-12 05:22:50 -05:00
|
|
|
*/
|