2016-06-06 08:40:06 -05:00
|
|
|
/*
|
|
|
|
Copyright 2013, 2015 SINTEF ICT, Applied Mathematics.
|
|
|
|
Copyright 2015 Andreas Lauser
|
2017-11-21 04:12:16 -06:00
|
|
|
Copyright 2017 IRIS
|
2016-06-06 08:40:06 -05:00
|
|
|
|
|
|
|
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/>.
|
|
|
|
*/
|
|
|
|
|
2016-09-12 16:28:44 -05:00
|
|
|
#ifndef OPM_SIMULATORFULLYIMPLICITBLACKOILEBOS_HEADER_INCLUDED
|
|
|
|
#define OPM_SIMULATORFULLYIMPLICITBLACKOILEBOS_HEADER_INCLUDED
|
2016-06-06 08:40:06 -05:00
|
|
|
|
2017-12-07 08:25:21 -06:00
|
|
|
#include <opm/autodiff/BlackoilOutputEbos.hpp>
|
2016-09-12 16:28:44 -05:00
|
|
|
#include <opm/autodiff/IterationReport.hpp>
|
2016-06-06 08:40:06 -05:00
|
|
|
#include <opm/autodiff/NonlinearSolver.hpp>
|
|
|
|
#include <opm/autodiff/BlackoilModelEbos.hpp>
|
2016-07-12 11:47:52 -05:00
|
|
|
#include <opm/autodiff/BlackoilModelParameters.hpp>
|
2017-10-06 03:59:42 -05:00
|
|
|
#include <opm/autodiff/WellStateFullyImplicitBlackoil.hpp>
|
2017-09-26 03:52:05 -05:00
|
|
|
#include <opm/autodiff/BlackoilWellModel.hpp>
|
2017-03-13 11:48:19 -05:00
|
|
|
#include <opm/autodiff/moduleVersion.hpp>
|
2017-02-10 06:01:50 -06:00
|
|
|
#include <opm/simulators/timestepping/AdaptiveTimeStepping.hpp>
|
2018-02-09 06:42:16 -06:00
|
|
|
#include <opm/grid/utility/StopWatch.hpp>
|
2016-08-11 06:31:52 -05:00
|
|
|
|
2016-09-12 16:28:44 -05:00
|
|
|
#include <opm/common/Exceptions.hpp>
|
|
|
|
#include <opm/common/ErrorMacros.hpp>
|
2016-06-06 08:40:06 -05:00
|
|
|
|
2016-11-21 05:01:20 -06:00
|
|
|
#include <dune/common/unused.hh>
|
|
|
|
|
2016-06-06 08:40:06 -05:00
|
|
|
namespace Opm {
|
|
|
|
|
|
|
|
|
2016-07-12 11:47:52 -05:00
|
|
|
/// a simulator for the blackoil model
|
2017-06-07 02:29:31 -05:00
|
|
|
template<class TypeTag>
|
2016-07-12 11:47:52 -05:00
|
|
|
class SimulatorFullyImplicitBlackoilEbos
|
2016-06-06 08:40:06 -05:00
|
|
|
{
|
2016-07-12 11:47:52 -05:00
|
|
|
public:
|
2016-08-08 08:12:51 -05:00
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
|
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
|
2016-08-23 02:45:37 -05:00
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
|
2016-11-14 03:16:57 -06:00
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
|
2016-08-23 02:45:37 -05:00
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, Indices) BlackoilIndices;
|
2017-05-03 06:34:15 -05:00
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
|
2017-04-06 07:21:59 -05:00
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
|
2017-08-08 01:10:55 -05:00
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, SolutionVector) SolutionVector ;
|
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
|
2017-04-06 07:21:59 -05:00
|
|
|
|
2017-06-07 02:29:31 -05:00
|
|
|
typedef Ewoms::BlackOilPolymerModule<TypeTag> PolymerModule;
|
2016-08-23 02:45:37 -05:00
|
|
|
|
2017-10-06 03:59:42 -05:00
|
|
|
typedef WellStateFullyImplicitBlackoil WellState;
|
2016-06-06 08:40:06 -05:00
|
|
|
typedef BlackoilState ReservoirState;
|
2017-12-07 08:25:21 -06:00
|
|
|
typedef BlackoilOutputEbos<TypeTag> OutputWriter;
|
2017-06-07 02:29:31 -05:00
|
|
|
typedef BlackoilModelEbos<TypeTag> Model;
|
2016-07-12 11:47:52 -05:00
|
|
|
typedef BlackoilModelParameters ModelParameters;
|
2016-06-06 08:40:06 -05:00
|
|
|
typedef NonlinearSolver<Model> Solver;
|
2017-09-26 03:52:05 -05:00
|
|
|
typedef BlackoilWellModel<TypeTag> WellModel;
|
2016-06-06 08:40:06 -05:00
|
|
|
|
2016-07-12 11:47:52 -05:00
|
|
|
|
|
|
|
/// Initialise from parameters and objects to observe.
|
|
|
|
/// \param[in] param parameters, this class accepts the following:
|
|
|
|
/// parameter (default) effect
|
|
|
|
/// -----------------------------------------------------------
|
|
|
|
/// output (true) write output to files?
|
|
|
|
/// output_dir ("output") output directoty
|
|
|
|
/// output_interval (1) output every nth step
|
|
|
|
/// nl_pressure_residual_tolerance (0.0) pressure solver residual tolerance (in Pascal)
|
|
|
|
/// nl_pressure_change_tolerance (1.0) pressure solver change tolerance (in Pascal)
|
|
|
|
/// nl_pressure_maxiter (10) max nonlinear iterations in pressure
|
|
|
|
/// nl_maxiter (30) max nonlinear iterations in transport
|
|
|
|
/// nl_tolerance (1e-9) transport solver absolute residual tolerance
|
|
|
|
/// num_transport_substeps (1) number of transport steps per pressure step
|
|
|
|
/// use_segregation_split (false) solve for gravity segregation (if false,
|
|
|
|
/// segregation is ignored).
|
|
|
|
///
|
|
|
|
/// \param[in] props fluid and rock properties
|
|
|
|
/// \param[in] linsolver linear solver
|
|
|
|
/// \param[in] has_disgas true for dissolved gas option
|
|
|
|
/// \param[in] has_vapoil true for vaporized oil option
|
|
|
|
/// \param[in] eclipse_state the object which represents an internalized ECL deck
|
|
|
|
/// \param[in] output_writer
|
|
|
|
/// \param[in] threshold_pressures_by_face if nonempty, threshold pressures that inhibit flow
|
2016-08-08 08:26:09 -05:00
|
|
|
SimulatorFullyImplicitBlackoilEbos(Simulator& ebosSimulator,
|
2017-04-28 08:36:25 -05:00
|
|
|
const ParameterGroup& param,
|
2016-07-12 11:47:52 -05:00
|
|
|
NewtonIterationBlackoilInterface& linsolver,
|
|
|
|
const bool has_disgas,
|
|
|
|
const bool has_vapoil,
|
2017-11-08 06:57:36 -06:00
|
|
|
OutputWriter& output_writer)
|
2016-08-08 08:26:09 -05:00
|
|
|
: ebosSimulator_(ebosSimulator),
|
|
|
|
param_(param),
|
2016-07-12 11:47:52 -05:00
|
|
|
model_param_(param),
|
|
|
|
solver_param_(param),
|
|
|
|
solver_(linsolver),
|
2017-06-16 06:52:51 -05:00
|
|
|
phaseUsage_(phaseUsageFromDeck(eclState())),
|
2016-07-12 11:47:52 -05:00
|
|
|
has_disgas_(has_disgas),
|
|
|
|
has_vapoil_(has_vapoil),
|
|
|
|
terminal_output_(param.getDefault("output_terminal", true)),
|
|
|
|
output_writer_(output_writer),
|
|
|
|
is_parallel_run_( false )
|
|
|
|
{
|
|
|
|
#if HAVE_MPI
|
|
|
|
if ( solver_.parallelInformation().type() == typeid(ParallelISTLInformation) )
|
|
|
|
{
|
|
|
|
const ParallelISTLInformation& info =
|
|
|
|
boost::any_cast<const ParallelISTLInformation&>(solver_.parallelInformation());
|
|
|
|
// Only rank 0 does print to std::cout
|
|
|
|
terminal_output_ = terminal_output_ && ( info.communicator().rank() == 0 );
|
|
|
|
is_parallel_run_ = ( info.communicator().size() > 1 );
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Run the simulation.
|
|
|
|
/// This will run succesive timesteps until timer.done() is true. It will
|
|
|
|
/// modify the reservoir and well states.
|
|
|
|
/// \param[in,out] timer governs the requested reporting timesteps
|
|
|
|
/// \param[in,out] state state of reservoir: pressure, fluxes
|
|
|
|
/// \return simulation report, with timing data
|
2017-12-04 03:35:13 -06:00
|
|
|
SimulatorReport run(SimulatorTimer& timer)
|
2016-07-12 11:47:52 -05:00
|
|
|
{
|
2017-12-04 03:35:13 -06:00
|
|
|
|
|
|
|
ReservoirState dummy_state(0,0,0);
|
|
|
|
|
2016-07-12 11:47:52 -05:00
|
|
|
WellState prev_well_state;
|
|
|
|
|
2017-02-24 07:52:12 -06:00
|
|
|
ExtraData extra;
|
2017-04-10 08:55:30 -05:00
|
|
|
|
|
|
|
failureReport_ = SimulatorReport();
|
|
|
|
|
2016-07-12 11:47:52 -05:00
|
|
|
if (output_writer_.isRestart()) {
|
2017-12-07 08:25:21 -06:00
|
|
|
// This is a restart, populate WellState
|
2017-12-04 03:35:13 -06:00
|
|
|
ReservoirState stateInit(Opm::UgGridHelpers::numCells(grid()),
|
|
|
|
Opm::UgGridHelpers::numFaces(grid()),
|
|
|
|
phaseUsage_.num_phases);
|
|
|
|
output_writer_.initFromRestartFile(phaseUsage_, grid(), stateInit, prev_well_state, extra);
|
2016-07-12 11:47:52 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// Create timers and file for writing timing info.
|
|
|
|
Opm::time::StopWatch solver_timer;
|
|
|
|
Opm::time::StopWatch total_timer;
|
|
|
|
total_timer.start();
|
|
|
|
|
|
|
|
// adaptive time stepping
|
2017-10-29 15:06:19 -05:00
|
|
|
const auto& events = schedule().getEvents();
|
2016-07-12 11:47:52 -05:00
|
|
|
std::unique_ptr< AdaptiveTimeStepping > adaptiveTimeStepping;
|
2017-11-28 07:25:25 -06:00
|
|
|
const bool useTUNING = param_.getDefault("use_TUNING", false);
|
2016-07-12 11:47:52 -05:00
|
|
|
if( param_.getDefault("timestep.adaptive", true ) )
|
|
|
|
{
|
2017-11-28 07:25:25 -06:00
|
|
|
if (useTUNING) {
|
2017-10-29 15:06:19 -05:00
|
|
|
adaptiveTimeStepping.reset( new AdaptiveTimeStepping( schedule().getTuning(), timer.currentStepNum(), param_, terminal_output_ ) );
|
2017-01-13 11:58:05 -06:00
|
|
|
} else {
|
|
|
|
adaptiveTimeStepping.reset( new AdaptiveTimeStepping( param_, terminal_output_ ) );
|
|
|
|
}
|
2017-02-24 07:52:12 -06:00
|
|
|
|
|
|
|
if (output_writer_.isRestart()) {
|
2017-03-16 07:34:24 -05:00
|
|
|
if (extra.suggested_step > 0.0) {
|
|
|
|
adaptiveTimeStepping->setSuggestedNextStep(extra.suggested_step);
|
|
|
|
}
|
2017-02-24 07:52:12 -06:00
|
|
|
}
|
2016-07-12 11:47:52 -05:00
|
|
|
}
|
|
|
|
|
2016-11-23 14:44:33 -06:00
|
|
|
SimulatorReport report;
|
|
|
|
SimulatorReport stepReport;
|
2016-07-12 11:47:52 -05:00
|
|
|
|
2017-11-08 06:57:36 -06:00
|
|
|
WellModel well_model(ebosSimulator_, model_param_, terminal_output_);
|
|
|
|
if (output_writer_.isRestart()) {
|
|
|
|
well_model.setRestartWellState(prev_well_state); // Neccessary for perfect restarts
|
|
|
|
}
|
|
|
|
|
|
|
|
WellState wellStateDummy; //not used. Only passed to make the old interfaces happy
|
|
|
|
|
2018-03-07 06:54:21 -06:00
|
|
|
if ( model_param_.matrix_add_well_contributions_ ||
|
|
|
|
model_param_.preconditioner_add_well_contributions_ )
|
2018-03-02 13:51:30 -06:00
|
|
|
{
|
2017-05-16 05:28:54 -05:00
|
|
|
ebosSimulator_.model().clearAuxiliaryModules();
|
|
|
|
auto auxMod = std::make_shared<WellConnectionAuxiliaryModule<TypeTag> >(schedule(), grid());
|
|
|
|
ebosSimulator_.model().addAuxiliaryModule(auxMod);
|
2018-03-02 13:51:30 -06:00
|
|
|
}
|
2017-05-16 05:28:54 -05:00
|
|
|
|
2016-07-12 11:47:52 -05:00
|
|
|
// Main simulation loop.
|
|
|
|
while (!timer.done()) {
|
|
|
|
// Report timestep.
|
|
|
|
if ( terminal_output_ )
|
|
|
|
{
|
|
|
|
std::ostringstream ss;
|
|
|
|
timer.report(ss);
|
2017-10-13 07:45:05 -05:00
|
|
|
OpmLog::debug(ss.str());
|
2016-07-12 11:47:52 -05:00
|
|
|
}
|
|
|
|
|
2017-02-22 02:56:43 -06:00
|
|
|
// Run a multiple steps of the solver depending on the time step control.
|
|
|
|
solver_timer.start();
|
|
|
|
|
2017-11-08 06:57:36 -06:00
|
|
|
well_model.beginReportStep(timer.currentStepNum());
|
2017-05-09 01:21:51 -05:00
|
|
|
|
2017-02-22 02:56:43 -06:00
|
|
|
auto solver = createSolver(well_model);
|
|
|
|
|
2016-11-14 03:16:57 -06:00
|
|
|
// write the inital state at the report stage
|
|
|
|
if (timer.initialStep()) {
|
2016-11-23 14:44:33 -06:00
|
|
|
Dune::Timer perfTimer;
|
|
|
|
perfTimer.start();
|
2016-11-14 03:16:57 -06:00
|
|
|
|
2016-11-15 05:23:46 -06:00
|
|
|
// No per cell data is written for initial step, but will be
|
|
|
|
// for subsequent steps, when we have started simulating
|
2017-12-04 03:35:13 -06:00
|
|
|
output_writer_.writeTimeStep( timer, dummy_state, well_model.wellState(), solver->model() );
|
2016-11-23 14:44:33 -06:00
|
|
|
|
|
|
|
report.output_write_time += perfTimer.stop();
|
2016-11-14 03:16:57 -06:00
|
|
|
}
|
|
|
|
|
2016-07-12 11:47:52 -05:00
|
|
|
if( terminal_output_ )
|
|
|
|
{
|
|
|
|
std::ostringstream step_msg;
|
|
|
|
boost::posix_time::time_facet* facet = new boost::posix_time::time_facet("%d-%b-%Y");
|
|
|
|
step_msg.imbue(std::locale(std::locale::classic(), facet));
|
2017-11-16 08:42:01 -06:00
|
|
|
step_msg << "\nReport step " << std::setw(2) <<timer.currentStepNum()
|
|
|
|
<< "/" << timer.numSteps()
|
2016-07-12 11:47:52 -05:00
|
|
|
<< " at day " << (double)unit::convert::to(timer.simulationTimeElapsed(), unit::day)
|
|
|
|
<< "/" << (double)unit::convert::to(timer.totalTime(), unit::day)
|
2017-01-13 11:58:05 -06:00
|
|
|
<< ", date = " << timer.currentDateTime();
|
2016-07-12 11:47:52 -05:00
|
|
|
OpmLog::info(step_msg.str());
|
|
|
|
}
|
|
|
|
|
2016-08-08 07:58:25 -05:00
|
|
|
solver->model().beginReportStep();
|
|
|
|
|
2016-07-12 11:47:52 -05:00
|
|
|
// If sub stepping is enabled allow the solver to sub cycle
|
|
|
|
// in case the report steps are too large for the solver to converge
|
|
|
|
//
|
|
|
|
// \Note: The report steps are met in any case
|
|
|
|
// \Note: The sub stepping will require a copy of the state variables
|
|
|
|
if( adaptiveTimeStepping ) {
|
2017-11-28 07:25:25 -06:00
|
|
|
if (useTUNING) {
|
2017-11-23 06:19:54 -06:00
|
|
|
if(events.hasEvent(ScheduleEvents::TUNING_CHANGE,timer.currentStepNum())) {
|
|
|
|
adaptiveTimeStepping->updateTUNING(schedule().getTuning(), timer.currentStepNum());
|
|
|
|
}
|
2017-11-21 04:12:16 -06:00
|
|
|
}
|
|
|
|
|
2017-02-24 06:51:10 -06:00
|
|
|
bool event = events.hasEvent(ScheduleEvents::NEW_WELL, timer.currentStepNum()) ||
|
|
|
|
events.hasEvent(ScheduleEvents::PRODUCTION_UPDATE, timer.currentStepNum()) ||
|
|
|
|
events.hasEvent(ScheduleEvents::INJECTION_UPDATE, timer.currentStepNum()) ||
|
|
|
|
events.hasEvent(ScheduleEvents::WELL_STATUS_CHANGE, timer.currentStepNum());
|
2018-01-15 06:51:40 -06:00
|
|
|
stepReport = adaptiveTimeStepping->step( timer, *solver, dummy_state, wellStateDummy, event, output_writer_, nullptr );
|
2017-04-06 14:08:21 -05:00
|
|
|
report += stepReport;
|
2017-04-10 08:55:30 -05:00
|
|
|
failureReport_ += adaptiveTimeStepping->failureReport();
|
2016-07-12 11:47:52 -05:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
// solve for complete report step
|
2017-12-04 03:35:13 -06:00
|
|
|
stepReport = solver->step(timer, dummy_state, wellStateDummy);
|
2016-11-23 14:44:33 -06:00
|
|
|
report += stepReport;
|
2017-04-10 08:55:30 -05:00
|
|
|
failureReport_ += solver->failureReport();
|
2016-08-14 14:44:47 -05:00
|
|
|
|
|
|
|
if( terminal_output_ )
|
|
|
|
{
|
2018-03-12 08:48:34 -05:00
|
|
|
std::ostringstream ss;
|
|
|
|
stepReport.reportStep(ss);
|
|
|
|
OpmLog::info(ss.str());
|
2016-08-14 14:44:47 -05:00
|
|
|
}
|
2016-07-12 11:47:52 -05:00
|
|
|
}
|
|
|
|
|
2016-08-08 07:58:25 -05:00
|
|
|
solver->model().endReportStep();
|
2017-11-08 06:57:36 -06:00
|
|
|
well_model.endReportStep();
|
2016-08-08 07:58:25 -05:00
|
|
|
|
2016-07-12 11:47:52 -05:00
|
|
|
// take time that was used to solve system for this reportStep
|
|
|
|
solver_timer.stop();
|
|
|
|
|
2016-11-23 14:44:33 -06:00
|
|
|
// update timing.
|
|
|
|
report.solver_time += solver_timer.secsSinceStart();
|
2016-07-12 11:47:52 -05:00
|
|
|
|
2017-03-13 11:48:19 -05:00
|
|
|
// Increment timer, remember well state.
|
|
|
|
++timer;
|
|
|
|
|
2016-12-22 06:45:31 -06:00
|
|
|
|
2017-01-13 11:58:05 -06:00
|
|
|
if (terminal_output_ )
|
2016-11-08 01:46:42 -06:00
|
|
|
{
|
2018-01-12 08:32:04 -06:00
|
|
|
if (!timer.initialStep()) {
|
|
|
|
const std::string version = moduleVersionName();
|
|
|
|
outputTimestampFIP(timer, version);
|
|
|
|
}
|
2016-07-12 11:47:52 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// write simulation state at the report stage
|
2016-11-23 14:44:33 -06:00
|
|
|
Dune::Timer perfTimer;
|
|
|
|
perfTimer.start();
|
2018-02-14 06:34:35 -06:00
|
|
|
const double nextstep = adaptiveTimeStepping ? adaptiveTimeStepping->suggestedNextStep() : -1.0;
|
|
|
|
|
2017-12-04 03:35:13 -06:00
|
|
|
output_writer_.writeTimeStep( timer, dummy_state, well_model.wellState(), solver->model(), false, nextstep, report);
|
2016-11-23 14:44:33 -06:00
|
|
|
report.output_write_time += perfTimer.stop();
|
2016-07-12 11:47:52 -05:00
|
|
|
|
2018-01-12 08:32:04 -06:00
|
|
|
if (terminal_output_ )
|
|
|
|
{
|
|
|
|
std::string msg =
|
|
|
|
"Time step took " + std::to_string(solver_timer.secsSinceStart()) + " seconds; "
|
|
|
|
"total solver time " + std::to_string(report.solver_time) + " seconds.";
|
|
|
|
OpmLog::debug(msg);
|
|
|
|
}
|
|
|
|
|
2016-07-12 11:47:52 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// Stop timer and create timing report
|
|
|
|
total_timer.stop();
|
|
|
|
report.total_time = total_timer.secsSinceStart();
|
2016-11-23 14:44:33 -06:00
|
|
|
report.converged = true;
|
2016-07-12 11:47:52 -05:00
|
|
|
return report;
|
|
|
|
}
|
|
|
|
|
2017-04-10 08:55:30 -05:00
|
|
|
/** \brief Returns the simulator report for the failed substeps of the simulation.
|
|
|
|
*/
|
|
|
|
const SimulatorReport& failureReport() const { return failureReport_; };
|
|
|
|
|
2016-08-08 08:12:51 -05:00
|
|
|
const Grid& grid() const
|
2018-02-01 09:27:42 -06:00
|
|
|
{ return ebosSimulator_.vanguard().grid(); }
|
2016-08-08 08:12:51 -05:00
|
|
|
|
2016-07-12 11:47:52 -05:00
|
|
|
protected:
|
|
|
|
|
2017-04-05 08:48:23 -05:00
|
|
|
std::unique_ptr<Solver> createSolver(WellModel& well_model)
|
2016-07-12 11:47:52 -05:00
|
|
|
{
|
2016-08-08 08:26:09 -05:00
|
|
|
auto model = std::unique_ptr<Model>(new Model(ebosSimulator_,
|
2016-08-08 07:31:32 -05:00
|
|
|
model_param_,
|
2016-07-12 11:47:52 -05:00
|
|
|
well_model,
|
|
|
|
solver_,
|
|
|
|
terminal_output_));
|
|
|
|
|
|
|
|
return std::unique_ptr<Solver>(new Solver(solver_param_, std::move(model)));
|
|
|
|
}
|
|
|
|
|
2017-11-15 08:55:58 -06:00
|
|
|
void outputTimestampFIP(const SimulatorTimer& timer, const std::string version)
|
2017-10-12 08:36:54 -05:00
|
|
|
{
|
2017-03-13 11:48:19 -05:00
|
|
|
std::ostringstream ss;
|
|
|
|
boost::posix_time::time_facet* facet = new boost::posix_time::time_facet("%d %b %Y");
|
|
|
|
ss.imbue(std::locale(std::locale::classic(), facet));
|
|
|
|
ss << "\n **************************************************************************\n"
|
|
|
|
<< " Balance at" << std::setw(10) << (double)unit::convert::to(timer.simulationTimeElapsed(), unit::day) << " Days"
|
|
|
|
<< " *" << std::setw(30) << eclState().getTitle() << " *\n"
|
|
|
|
<< " Report " << std::setw(4) << timer.reportStepNum() << " " << timer.currentDateTime()
|
|
|
|
<< " * Flow version " << std::setw(11) << version << " *\n"
|
|
|
|
<< " **************************************************************************\n";
|
|
|
|
OpmLog::note(ss.str());
|
|
|
|
}
|
2016-11-08 01:46:42 -06:00
|
|
|
|
2016-10-20 13:16:42 -05:00
|
|
|
const EclipseState& eclState() const
|
2018-02-01 09:27:42 -06:00
|
|
|
{ return ebosSimulator_.vanguard().eclState(); }
|
2016-07-12 11:47:52 -05:00
|
|
|
|
2017-10-29 15:06:19 -05:00
|
|
|
|
|
|
|
const Schedule& schedule() const
|
2018-02-01 09:27:42 -06:00
|
|
|
{ return ebosSimulator_.vanguard().schedule(); }
|
2017-10-29 15:06:19 -05:00
|
|
|
|
2017-06-07 02:29:31 -05:00
|
|
|
|
2016-07-12 11:47:52 -05:00
|
|
|
// Data.
|
2016-08-08 08:26:09 -05:00
|
|
|
Simulator& ebosSimulator_;
|
2016-08-08 07:31:32 -05:00
|
|
|
|
2016-07-12 11:47:52 -05:00
|
|
|
typedef typename Solver::SolverParameters SolverParameters;
|
|
|
|
|
2017-04-10 08:55:30 -05:00
|
|
|
SimulatorReport failureReport_;
|
|
|
|
|
2017-04-28 08:36:25 -05:00
|
|
|
const ParameterGroup param_;
|
2016-07-12 11:47:52 -05:00
|
|
|
ModelParameters model_param_;
|
|
|
|
SolverParameters solver_param_;
|
|
|
|
|
|
|
|
// Observed objects.
|
|
|
|
NewtonIterationBlackoilInterface& solver_;
|
2017-06-16 06:52:51 -05:00
|
|
|
PhaseUsage phaseUsage_;
|
2016-07-12 11:47:52 -05:00
|
|
|
// Misc. data
|
|
|
|
const bool has_disgas_;
|
|
|
|
const bool has_vapoil_;
|
|
|
|
bool terminal_output_;
|
|
|
|
// output_writer
|
|
|
|
OutputWriter& output_writer_;
|
2016-12-02 04:13:06 -06:00
|
|
|
|
2016-07-12 11:47:52 -05:00
|
|
|
// Whether this a parallel simulation or not
|
|
|
|
bool is_parallel_run_;
|
|
|
|
|
2016-06-06 08:40:06 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Opm
|
|
|
|
|
|
|
|
#endif // OPM_SIMULATORFULLYIMPLICITBLACKOIL_HEADER_INCLUDED
|