mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #2018 from joakim-hove/summary-state-time
Pass sim start argument to SummaryState constructor
This commit is contained in:
commit
6aa701ae04
@ -51,9 +51,10 @@
|
|||||||
#include <mpi.h>
|
#include <mpi.h>
|
||||||
#endif // HAVE_MPI
|
#endif // HAVE_MPI
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include <unordered_set>
|
|
||||||
#include <array>
|
#include <array>
|
||||||
|
#include <chrono>
|
||||||
|
#include <unordered_set>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
template <class TypeTag>
|
template <class TypeTag>
|
||||||
@ -343,6 +344,7 @@ public:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
eclSchedule_ = externalEclSchedule_;
|
eclSchedule_ = externalEclSchedule_;
|
||||||
|
this->summaryState_.reset( new Opm::SummaryState( std::chrono::system_clock::from_time_t(this->eclSchedule_->getStartTime() )));
|
||||||
|
|
||||||
if (!externalEclSummaryConfig_) {
|
if (!externalEclSummaryConfig_) {
|
||||||
// create the schedule object. Note that if eclState is supposed to represent
|
// create the schedule object. Note that if eclState is supposed to represent
|
||||||
@ -444,10 +446,10 @@ public:
|
|||||||
* the UDQ, WTEST and ACTIONX calculations.
|
* the UDQ, WTEST and ACTIONX calculations.
|
||||||
*/
|
*/
|
||||||
Opm::SummaryState& summaryState()
|
Opm::SummaryState& summaryState()
|
||||||
{ return summaryState_; }
|
{ return *summaryState_; }
|
||||||
|
|
||||||
const Opm::SummaryState& summaryState() const
|
const Opm::SummaryState& summaryState() const
|
||||||
{ return summaryState_; }
|
{ return *summaryState_; }
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Parameter deciding the edge-weight strategy of the load balancer.
|
* \brief Parameter deciding the edge-weight strategy of the load balancer.
|
||||||
@ -588,6 +590,7 @@ private:
|
|||||||
std::unique_ptr<Opm::EclipseState> internalEclState_;
|
std::unique_ptr<Opm::EclipseState> internalEclState_;
|
||||||
std::unique_ptr<Opm::Schedule> internalEclSchedule_;
|
std::unique_ptr<Opm::Schedule> internalEclSchedule_;
|
||||||
std::unique_ptr<Opm::SummaryConfig> internalEclSummaryConfig_;
|
std::unique_ptr<Opm::SummaryConfig> internalEclSummaryConfig_;
|
||||||
|
std::unique_ptr<Opm::SummaryState> summaryState_;
|
||||||
|
|
||||||
// these attributes point either to the internal or to the external version of the
|
// these attributes point either to the internal or to the external version of the
|
||||||
// parser objects.
|
// parser objects.
|
||||||
@ -598,8 +601,6 @@ private:
|
|||||||
Opm::Schedule* eclSchedule_;
|
Opm::Schedule* eclSchedule_;
|
||||||
Opm::SummaryConfig* eclSummaryConfig_;
|
Opm::SummaryConfig* eclSummaryConfig_;
|
||||||
|
|
||||||
Opm::SummaryState summaryState_;
|
|
||||||
|
|
||||||
Dune::EdgeWeightMethod edgeWeightsMethod_;
|
Dune::EdgeWeightMethod edgeWeightsMethod_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@
|
|||||||
#include <list>
|
#include <list>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <chrono>
|
||||||
|
|
||||||
#ifdef HAVE_MPI
|
#ifdef HAVE_MPI
|
||||||
#include <mpi.h>
|
#include <mpi.h>
|
||||||
@ -426,7 +427,7 @@ public:
|
|||||||
cumulatives will be counted doubly, we therefor use a temporary
|
cumulatives will be counted doubly, we therefor use a temporary
|
||||||
SummaryState instance in this call to loadRestart().
|
SummaryState instance in this call to loadRestart().
|
||||||
*/
|
*/
|
||||||
Opm::SummaryState summaryState;
|
Opm::SummaryState summaryState(std::chrono::system_clock::from_time_t(simulator_.vanguard().schedule().getStartTime()));
|
||||||
auto restartValues = eclIO_->loadRestart(summaryState, solutionKeys, extraKeys);
|
auto restartValues = eclIO_->loadRestart(summaryState, solutionKeys, extraKeys);
|
||||||
|
|
||||||
for (unsigned elemIdx = 0; elemIdx < numElements; ++elemIdx) {
|
for (unsigned elemIdx = 0; elemIdx < numElements; ++elemIdx) {
|
||||||
|
@ -18,8 +18,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
#include <chrono>
|
||||||
|
|
||||||
#define BOOST_TEST_MODULE StoppedWellsTests
|
#define BOOST_TEST_MODULE StoppedWellsTests
|
||||||
|
|
||||||
#include <boost/test/unit_test.hpp>
|
#include <boost/test/unit_test.hpp>
|
||||||
|
|
||||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||||
@ -46,7 +48,7 @@ BOOST_AUTO_TEST_CASE(TestStoppedWells)
|
|||||||
const Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
const Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||||
const Opm::Runspec runspec (deck);
|
const Opm::Runspec runspec (deck);
|
||||||
const Schedule sched(deck, grid, eclipseProperties, runspec);
|
const Schedule sched(deck, grid, eclipseProperties, runspec);
|
||||||
Opm::SummaryState summaryState;
|
Opm::SummaryState summaryState(std::chrono::system_clock::from_time_t(sched.getStartTime()));
|
||||||
|
|
||||||
double target_surfacerate_inj;
|
double target_surfacerate_inj;
|
||||||
double target_surfacerate_prod;
|
double target_surfacerate_prod;
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
#include <chrono>
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@ -44,7 +45,7 @@ BOOST_AUTO_TEST_CASE(AddWellsAndGroupToCollection) {
|
|||||||
const Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
const Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||||
const Runspec runspec(deck);
|
const Runspec runspec(deck);
|
||||||
const Schedule sched(deck, grid, eclipseProperties, runspec);
|
const Schedule sched(deck, grid, eclipseProperties, runspec);
|
||||||
SummaryState summaryState;
|
SummaryState summaryState(std::chrono::system_clock::from_time_t(sched.getStartTime()));
|
||||||
|
|
||||||
WellCollection collection;
|
WellCollection collection;
|
||||||
|
|
||||||
@ -83,7 +84,7 @@ BOOST_AUTO_TEST_CASE(EfficiencyFactor) {
|
|||||||
const Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
const Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||||
const Runspec runspec(deck);
|
const Runspec runspec(deck);
|
||||||
const Schedule sched(deck, grid, eclipseProperties, runspec);
|
const Schedule sched(deck, grid, eclipseProperties, runspec);
|
||||||
SummaryState summaryState;
|
Opm::SummaryState summaryState(std::chrono::system_clock::from_time_t(sched.getStartTime()));
|
||||||
|
|
||||||
size_t timestep = 2;
|
size_t timestep = 2;
|
||||||
WellCollection collection;
|
WellCollection collection;
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
|
|
||||||
#define BOOST_TEST_MODULE WellModelTest
|
#define BOOST_TEST_MODULE WellModelTest
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
|
||||||
#include <opm/common/utility/platform_dependent/disable_warnings.h>
|
#include <opm/common/utility/platform_dependent/disable_warnings.h>
|
||||||
#include <boost/test/unit_test.hpp>
|
#include <boost/test/unit_test.hpp>
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
@ -73,6 +75,7 @@ struct SetupTest {
|
|||||||
const Opm::Eclipse3DProperties eclipseProperties ( deck , table, ecl_state->getInputGrid());
|
const Opm::Eclipse3DProperties eclipseProperties ( deck , table, ecl_state->getInputGrid());
|
||||||
const Opm::Runspec runspec (deck);
|
const Opm::Runspec runspec (deck);
|
||||||
schedule.reset( new Opm::Schedule(deck, ecl_state->getInputGrid(), eclipseProperties, runspec));
|
schedule.reset( new Opm::Schedule(deck, ecl_state->getInputGrid(), eclipseProperties, runspec));
|
||||||
|
summaryState.reset( new Opm::SummaryState(std::chrono::system_clock::from_time_t(schedule->getStartTime())));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create grid.
|
// Create grid.
|
||||||
@ -87,7 +90,7 @@ struct SetupTest {
|
|||||||
// Create wells.
|
// Create wells.
|
||||||
wells_manager.reset(new Opm::WellsManager(*ecl_state,
|
wells_manager.reset(new Opm::WellsManager(*ecl_state,
|
||||||
*schedule,
|
*schedule,
|
||||||
summaryState,
|
*summaryState,
|
||||||
current_timestep,
|
current_timestep,
|
||||||
Opm::UgGridHelpers::numCells(grid),
|
Opm::UgGridHelpers::numCells(grid),
|
||||||
Opm::UgGridHelpers::globalCell(grid),
|
Opm::UgGridHelpers::globalCell(grid),
|
||||||
@ -103,7 +106,7 @@ struct SetupTest {
|
|||||||
std::unique_ptr<const Opm::WellsManager> wells_manager;
|
std::unique_ptr<const Opm::WellsManager> wells_manager;
|
||||||
std::unique_ptr<const Opm::EclipseState> ecl_state;
|
std::unique_ptr<const Opm::EclipseState> ecl_state;
|
||||||
std::unique_ptr<const Opm::Schedule> schedule;
|
std::unique_ptr<const Opm::Schedule> schedule;
|
||||||
Opm::SummaryState summaryState;
|
std::unique_ptr<Opm::SummaryState> summaryState;
|
||||||
int current_timestep;
|
int current_timestep;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#define BOOST_TEST_MODULE WellsGroupTest
|
#define BOOST_TEST_MODULE WellsGroupTest
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@ -50,8 +51,8 @@ BOOST_AUTO_TEST_CASE(ConstructGroupFromWell) {
|
|||||||
const Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
const Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||||
const Opm::Runspec runspec (deck);
|
const Opm::Runspec runspec (deck);
|
||||||
const Schedule sched(deck, grid, eclipseProperties, runspec);
|
const Schedule sched(deck, grid, eclipseProperties, runspec);
|
||||||
SummaryState summaryState;
|
SummaryState summaryState(std::chrono::system_clock::from_time_t(sched.getStartTime()));
|
||||||
PhaseUsage pu = phaseUsageFromDeck(eclipseState);
|
PhaseUsage pu = phaseUsageFromDeck(eclipseState);
|
||||||
|
|
||||||
auto wells = sched.getWells2atEnd();
|
auto wells = sched.getWells2atEnd();
|
||||||
|
|
||||||
@ -89,7 +90,7 @@ BOOST_AUTO_TEST_CASE(ConstructGroupFromGroup) {
|
|||||||
const Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
const Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||||
const Opm::Runspec runspec (deck);
|
const Opm::Runspec runspec (deck);
|
||||||
const Schedule sched(deck, grid, eclipseProperties, runspec);
|
const Schedule sched(deck, grid, eclipseProperties, runspec);
|
||||||
SummaryState summaryState;
|
Opm::SummaryState summaryState(std::chrono::system_clock::from_time_t(sched.getStartTime()));
|
||||||
|
|
||||||
for( const auto& grp_name : sched.groupNames() ) {
|
for( const auto& grp_name : sched.groupNames() ) {
|
||||||
const auto& group = sched.getGroup2(grp_name, 2);
|
const auto& group = sched.getGroup2(grp_name, 2);
|
||||||
@ -127,7 +128,7 @@ BOOST_AUTO_TEST_CASE(EfficiencyFactor) {
|
|||||||
const Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
const Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||||
const Opm::Runspec runspec (deck);
|
const Opm::Runspec runspec (deck);
|
||||||
const Schedule sched(deck, grid, eclipseProperties, runspec);
|
const Schedule sched(deck, grid, eclipseProperties, runspec);
|
||||||
SummaryState summaryState;
|
Opm::SummaryState summaryState(std::chrono::system_clock::from_time_t(sched.getStartTime()));
|
||||||
|
|
||||||
for( const auto& grp_name : sched.groupNames() ) {
|
for( const auto& grp_name : sched.groupNames() ) {
|
||||||
const auto& group = sched.getGroup2(grp_name, 2);
|
const auto& group = sched.getGroup2(grp_name, 2);
|
||||||
|
@ -184,7 +184,7 @@ BOOST_AUTO_TEST_CASE(New_Constructor_Works) {
|
|||||||
const Opm::Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
const Opm::Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||||
const Opm::Runspec runspec (deck);
|
const Opm::Runspec runspec (deck);
|
||||||
const Opm::Schedule sched(deck, grid, eclipseProperties, runspec);
|
const Opm::Schedule sched(deck, grid, eclipseProperties, runspec);
|
||||||
Opm::SummaryState summaryState;
|
Opm::SummaryState summaryState(std::chrono::system_clock::from_time_t(sched.getStartTime()));
|
||||||
|
|
||||||
{
|
{
|
||||||
Opm::WellsManager wellsManager(eclipseState, sched, summaryState, 0, *vanguard.c_grid());
|
Opm::WellsManager wellsManager(eclipseState, sched, summaryState, 0, *vanguard.c_grid());
|
||||||
@ -225,7 +225,7 @@ BOOST_AUTO_TEST_CASE(WellsEqual) {
|
|||||||
const Opm::Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
const Opm::Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||||
const Opm::Runspec runspec (deck);
|
const Opm::Runspec runspec (deck);
|
||||||
const Opm::Schedule sched(deck, grid, eclipseProperties, runspec);
|
const Opm::Schedule sched(deck, grid, eclipseProperties, runspec);
|
||||||
Opm::SummaryState summaryState;
|
Opm::SummaryState summaryState(std::chrono::system_clock::from_time_t(sched.getStartTime()));
|
||||||
|
|
||||||
|
|
||||||
Opm::WellsManager wellsManager0(eclipseState, sched, summaryState, 0, *vanguard.c_grid());
|
Opm::WellsManager wellsManager0(eclipseState, sched, summaryState, 0, *vanguard.c_grid());
|
||||||
@ -246,7 +246,7 @@ BOOST_AUTO_TEST_CASE(ControlsEqual) {
|
|||||||
const Opm::Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
const Opm::Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||||
const Opm::Runspec runspec (deck);
|
const Opm::Runspec runspec (deck);
|
||||||
const Opm::Schedule sched(deck, grid, eclipseProperties, runspec);
|
const Opm::Schedule sched(deck, grid, eclipseProperties, runspec);
|
||||||
Opm::SummaryState summaryState;
|
Opm::SummaryState summaryState(std::chrono::system_clock::from_time_t(sched.getStartTime()));
|
||||||
|
|
||||||
|
|
||||||
Opm::WellsManager wellsManager0(eclipseState, sched, summaryState, 0, *vanguard.c_grid());
|
Opm::WellsManager wellsManager0(eclipseState, sched, summaryState, 0, *vanguard.c_grid());
|
||||||
@ -274,7 +274,7 @@ BOOST_AUTO_TEST_CASE(WellShutOK) {
|
|||||||
const Opm::Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
const Opm::Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||||
const Opm::Runspec runspec (deck);
|
const Opm::Runspec runspec (deck);
|
||||||
const Opm::Schedule sched(deck, grid, eclipseProperties, runspec);
|
const Opm::Schedule sched(deck, grid, eclipseProperties, runspec);
|
||||||
Opm::SummaryState summaryState;
|
Opm::SummaryState summaryState(std::chrono::system_clock::from_time_t(sched.getStartTime()));
|
||||||
|
|
||||||
Opm::WellsManager wellsManager2(eclipseState, sched, summaryState, 2, *vanguard.c_grid());
|
Opm::WellsManager wellsManager2(eclipseState, sched, summaryState, 2, *vanguard.c_grid());
|
||||||
|
|
||||||
@ -295,7 +295,7 @@ BOOST_AUTO_TEST_CASE(WellSTOPOK) {
|
|||||||
const Opm::Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
const Opm::Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||||
const Opm::Runspec runspec (deck);
|
const Opm::Runspec runspec (deck);
|
||||||
const Opm::Schedule sched(deck, grid, eclipseProperties, runspec);
|
const Opm::Schedule sched(deck, grid, eclipseProperties, runspec);
|
||||||
Opm::SummaryState summaryState;
|
Opm::SummaryState summaryState(std::chrono::system_clock::from_time_t(sched.getStartTime()));
|
||||||
|
|
||||||
|
|
||||||
Opm::WellsManager wellsManager(eclipseState, sched, summaryState, 0, *vanguard.c_grid());
|
Opm::WellsManager wellsManager(eclipseState, sched, summaryState, 0, *vanguard.c_grid());
|
||||||
@ -319,7 +319,7 @@ BOOST_AUTO_TEST_CASE(removeWellWithNoPerforation) {
|
|||||||
const Opm::Eclipse3DProperties eclipseProperties ( deck , table, inputGrid);
|
const Opm::Eclipse3DProperties eclipseProperties ( deck , table, inputGrid);
|
||||||
const Opm::Runspec runspec (deck);
|
const Opm::Runspec runspec (deck);
|
||||||
Opm::Schedule sched(deck, inputGrid, eclipseProperties, runspec);
|
Opm::Schedule sched(deck, inputGrid, eclipseProperties, runspec);
|
||||||
Opm::SummaryState summaryState;
|
Opm::SummaryState summaryState(std::chrono::system_clock::from_time_t(sched.getStartTime()));
|
||||||
const auto eclipseGrid = Opm::UgGridHelpers::createEclipseGrid(*gridManager.c_grid(), inputGrid);
|
const auto eclipseGrid = Opm::UgGridHelpers::createEclipseGrid(*gridManager.c_grid(), inputGrid);
|
||||||
sched.filterConnections(eclipseGrid);
|
sched.filterConnections(eclipseGrid);
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
|
|
||||||
#include <opm/grid/GridManager.hpp>
|
#include <opm/grid/GridManager.hpp>
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@ -51,7 +52,7 @@ struct Setup
|
|||||||
, pu (Opm::phaseUsageFromDeck(es))
|
, pu (Opm::phaseUsageFromDeck(es))
|
||||||
, grid (es.getInputGrid())
|
, grid (es.getInputGrid())
|
||||||
, sched(deck, es)
|
, sched(deck, es)
|
||||||
, st()
|
, st(std::chrono::system_clock::from_time_t(sched.getStartTime()))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
Opm::EclipseState es;
|
Opm::EclipseState es;
|
||||||
|
Loading…
Reference in New Issue
Block a user