make writing of substeps work

This commit is contained in:
Robert K 2015-01-06 10:45:15 +01:00
parent 7a3008db72
commit e7e63e1989
2 changed files with 13 additions and 20 deletions

View File

@ -337,7 +337,8 @@ namespace Opm
if (timer.currentStepNum() == 0) {
output_writer_.writeInit(timer);
}
output_writer_.writeTimeStep(timer, state, well_state.basicWellState());
if( ! adaptiveTimeStepping )
output_writer_.writeTimeStep(timer, state, well_state);
}
// Max oil saturation (for VPPARS), hysteresis update.
@ -361,8 +362,9 @@ namespace Opm
// \Note: The report steps are met in any case
// \Note: The sub stepping will require a copy of the state variables
if( adaptiveTimeStepping ) {
adaptiveTimeStepping->step( solver, state, well_state,
timer.simulationTimeElapsed(), timer.currentStepLength() );
//adaptiveTimeStepping->step( solver, state, well_state,
// timer.simulationTimeElapsed(), timer.currentStepLength() );
adaptiveTimeStepping->step( timer, solver, state, well_state, output_writer_ );
}
else {
// solve for complete report step
@ -395,7 +397,9 @@ namespace Opm
}
outputStateMatlab(grid_, state, timer.currentStepNum(), output_dir_);
outputWellStateMatlab(prev_well_state, timer.currentStepNum(), output_dir_);
output_writer_.writeTimeStep(timer, state, prev_well_state.basicWellState());
if( ! adaptiveTimeStepping )
//std::cout << "Write last step" << std::endl;
output_writer_.writeTimeStep(timer, state, prev_well_state);
}
// Stop timer and create timing report

View File

@ -39,11 +39,15 @@ namespace Opm
/// The state of a set of wells, tailored for use by the fully
/// implicit blackoil simulator.
class WellStateFullyImplicitBlackoil
: public WellState
{
typedef WellState BaseType;
public:
typedef std::array< int, 2 > mapentry_t;
typedef std::map< std::string, mapentry_t > WellMapType;
using BaseType :: wellRates;
using BaseType :: bhp;
/// Allocate and initialize if wells is non-null. Also tries
/// to give useful initial values to the bhp(), wellRates()
@ -60,7 +64,7 @@ namespace Opm
// We use the WellState::init() function to do bhp and well rates init.
// The alternative would be to copy that function wholesale.
basic_well_state_.init(wells, state);
BaseType :: init(wells, state);
// Initialize perfphaserates_, which must be done here.
const int nw = wells->number_of_wells;
@ -135,14 +139,6 @@ namespace Opm
}
}
/// One bhp pressure per well.
std::vector<double>& bhp() { return basic_well_state_.bhp(); }
const std::vector<double>& bhp() const { return basic_well_state_.bhp(); }
/// One rate per well and phase.
std::vector<double>& wellRates() { return basic_well_state_.wellRates(); }
const std::vector<double>& wellRates() const { return basic_well_state_.wellRates(); }
/// One rate per phase and well connection.
std::vector<double>& perfPhaseRates() { return perfphaserates_; }
const std::vector<double>& perfPhaseRates() const { return perfphaserates_; }
@ -151,12 +147,6 @@ namespace Opm
std::vector<int>& currentControls() { return current_controls_; }
const std::vector<int>& currentControls() const { return current_controls_; }
/// For interfacing with functions that take a WellState.
const WellState& basicWellState() const
{
return basic_well_state_;
}
/// The number of wells present.
int numWells() const
{
@ -172,7 +162,6 @@ namespace Opm
const WellMapType& wellMap() const { return wellMap_; }
private:
WellState basic_well_state_;
std::vector<double> perfphaserates_;
std::vector<int> current_controls_;
WellMapType wellMap_;