Merge pull request #1243 from blattms/write-initial-oip

Write the initial OIP values if requested.
This commit is contained in:
Atgeirr Flø Rasmussen
2017-08-01 16:15:46 +02:00
committed by GitHub
5 changed files with 19 additions and 3 deletions

View File

@@ -338,6 +338,11 @@ namespace Opm
if (initConfig.restartRequested() && ((initConfig.getRestartStep()) == (timer.currentStepNum()))) {
std::cout << "Skipping restart write in start of step " << timer.currentStepNum() << std::endl;
} else {
if ( timer.initialStep() )
{
// Set the initial OIP
eclIO_->overwriteInitialOIP(simProps);
}
// ... insert "extra" data (KR, VISC, ...)
eclIO_->writeTimeStep(timer.reportStepNum(),
substep,

View File

@@ -51,6 +51,11 @@ namespace Opm
provideTimeStepEstimate( lastStepTaken );
}
bool AdaptiveSimulatorTimer::initialStep () const
{
return ( report_step_ == 0 ) && ( current_step_ == 0 );
}
AdaptiveSimulatorTimer& AdaptiveSimulatorTimer::operator++ ()
{
++current_step_;

View File

@@ -56,6 +56,9 @@ namespace Opm
/// \brief provide and estimate for new time step size
void provideTimeStepEstimate( const double dt_estimate );
/// \brief Whether this is the first step
bool initialStep () const;
/// \brief \copydoc SimulationTimer::currentStepNum
int currentStepNum () const;

View File

@@ -83,6 +83,9 @@ namespace Opm
/// Return true if timer indicates that simulation of timer interval is finished
virtual bool done() const = 0;
/// Whether the current step is the first step.
virtual bool initialStep() const = 0;
/// Return start date of simulation
virtual boost::posix_time::ptime startDateTime() const = 0;