WellState::report() to make opm-output Well data

This commit is contained in:
Jørgen Kvalsvik 2016-05-20 16:21:14 +02:00
parent 8f3829bb76
commit be0187d512
5 changed files with 24 additions and 17 deletions

View File

@ -66,16 +66,16 @@ namespace Opm {
\param well_state additional well state object
\param outputWriter writer object to write sub steps
*/
template <class Solver, class State, class WellState>
template <class Solver, class State, class WellState, class Output>
void step( const SimulatorTimer& timer,
Solver& solver, State& state, WellState& well_state,
OutputWriter& outputWriter );
Output& outputWriter );
protected:
template <class Solver, class State, class WellState>
template <class Solver, class State, class WellState, class Output>
void stepImpl( const SimulatorTimer& timer,
Solver& solver, State& state, WellState& well_state,
OutputWriter* outputWriter);
Output* outputWriter);
typedef std::unique_ptr< TimeStepControlInterface > TimeStepControlType;

View File

@ -110,20 +110,20 @@ namespace Opm {
stepImpl( simulatorTimer, solver, state, well_state );
}
template <class Solver, class State, class WellState>
template <class Solver, class State, class WellState, class Output>
void AdaptiveTimeStepping::
step( const SimulatorTimer& simulatorTimer, Solver& solver, State& state, WellState& well_state,
OutputWriter& outputWriter )
Output& outputWriter )
{
stepImpl( simulatorTimer, solver, state, well_state, &outputWriter );
}
// implementation of the step method
template <class Solver, class State, class WState>
template <class Solver, class State, class WState, class Output >
void AdaptiveTimeStepping::
stepImpl( const SimulatorTimer& simulatorTimer,
Solver& solver, State& state, WState& well_state,
OutputWriter* outputWriter )
Output* outputWriter )
{
const double timestep = simulatorTimer.currentStepLength();

View File

@ -1,6 +1,8 @@
#include "BlackoilState.hpp"
#include <opm/common/util/numeric/cmp.hpp>
#include <opm/core/props/BlackoilPropertiesInterface.hpp>
#include <opm/core/simulator/WellState.hpp>
#include <opm/output/Wells.hpp>
using namespace Opm;

View File

@ -22,6 +22,8 @@
#include <opm/core/wells.h>
#include <opm/core/well_controls.h>
#include <opm/output/Wells.hpp>
#include <array>
#include <map>
#include <string>
@ -208,6 +210,18 @@ namespace Opm
return wellRates().size() / numWells();
}
virtual data::Wells report() const
{
return { { /* WellState offers no completion data, so that has to be added later */ },
this->bhp(),
this->temperature(),
this->wellRates(),
this->perfPress(),
this->perfRates() };
}
virtual ~WellState() {}
private:
std::vector<double> bhp_;
std::vector<double> thp_;

View File

@ -117,15 +117,6 @@ inline void solution2sim( const data::Solution& sol,
state.getCellData( "RV" ) = sol[ ds::RV ];
}
inline data::Wells state2wells( const WellState& ws ) {
return { {},
ws.bhp(),
ws.temperature(),
ws.wellRates(),
ws.perfPress(),
ws.perfRates() };
}
inline void wells2state( const data::Wells& wells, WellState& state ) {
state.bhp() = wells.bhp;
state.temperature() = wells.temperature;