pass the simulation timer object instead of the time step size

models may need a more detailed picture of where they are in the
simulation. Note that since the timer objects are available at every
call site, this is also not a very deep change.
This commit is contained in:
Andreas Lauser
2016-07-05 12:20:19 +02:00
parent f54e3ebe38
commit 5410d97701
15 changed files with 70 additions and 53 deletions

View File

@@ -28,6 +28,7 @@
#include <opm/polymer/PolymerBlackoilState.hpp>
#include <opm/polymer/fullyimplicit/WellStateFullyImplicitBlackoilPolymer.hpp>
#include <opm/autodiff/StandardWells.hpp>
#include <opm/core/simulator/SimulatorTimerInterface.hpp>
namespace Opm {
@@ -93,18 +94,18 @@ namespace Opm {
const bool terminal_output);
/// Called once before each time step.
/// \param[in] dt time step size
/// \param[in] timer simulation timer
/// \param[in, out] reservoir_state reservoir state variables
/// \param[in, out] well_state well state variables
void prepareStep(const double dt,
void prepareStep(const SimulatorTimerInterface& timer,
const ReservoirState& reservoir_state,
const WellState& well_state);
/// Called once after each time step.
/// \param[in] dt time step size
/// \param[in] timer simulation timer
/// \param[in, out] reservoir_state reservoir state variables
/// \param[in, out] well_state well state variables
void afterStep(const double dt,
void afterStep(const SimulatorTimerInterface& timer,
ReservoirState& reservoir_state,
WellState& well_state);

View File

@@ -121,11 +121,11 @@ namespace Opm {
template <class Grid>
void
BlackoilPolymerModel<Grid>::
prepareStep(const double dt,
prepareStep(const SimulatorTimerInterface& timer,
const ReservoirState& reservoir_state,
const WellState& well_state)
{
Base::prepareStep(dt, reservoir_state, well_state);
Base::prepareStep(timer, reservoir_state, well_state);
auto& max_concentration = reservoir_state.getCellData( reservoir_state.CMAX );
// Initial max concentration of this time step from PolymerBlackoilState.
@@ -138,7 +138,7 @@ namespace Opm {
template <class Grid>
void
BlackoilPolymerModel<Grid>::
afterStep(const double /* dt */,
afterStep(const SimulatorTimerInterface& /* timer */,
ReservoirState& reservoir_state,
WellState& /* well_state */)
{

View File

@@ -32,6 +32,7 @@
#include <opm/core/grid.h>
#include <opm/core/linalg/LinearSolverInterface.hpp>
#include <opm/core/props/rock/RockCompressibility.hpp>
#include <opm/core/simulator/SimulatorTimerInterface.hpp>
#include <opm/polymer/PolymerBlackoilState.hpp>
#include <opm/common/ErrorMacros.hpp>
#include <opm/core/well_controls.h>
@@ -199,11 +200,12 @@ namespace {
int
FullyImplicitCompressiblePolymerSolver::
step(const double dt,
step(const SimulatorTimerInterface& timer,
PolymerBlackoilState& x ,
WellStateFullyImplicitBlackoilPolymer& xw)
{
const std::vector<double>& polymer_inflow = xw.polymerInflow();
const double dt = timer.currentStepLength();
// Initial max concentration of this time step from PolymerBlackoilState.
cmax_ = Eigen::Map<V>(&x.getCellData( x.CMAX )[0], Opm::AutoDiffGrid::numCells(grid_));

View File

@@ -30,6 +30,7 @@
#include <opm/polymer/fullyimplicit/WellStateFullyImplicitBlackoilPolymer.hpp>
#include <opm/polymer/fullyimplicit/PolymerPropsAd.hpp>
#include <opm/core/utility/parameters/ParameterGroup.hpp>
#include <opm/core/simulator/SimulatorTimerInterface.hpp>
struct UnstructuredGrid;
struct Wells;
@@ -82,7 +83,7 @@ namespace Opm {
/// \param[in] wstate well state
/// \param[in] polymer_inflow polymer influx
int
step(const double dt,
step(const SimulatorTimerInterface& timer,
PolymerBlackoilState& state ,
WellStateFullyImplicitBlackoilPolymer& wstate);