WellState::report() to make opm-output Well data
This commit is contained in:
parent
8f3829bb76
commit
be0187d512
@ -66,16 +66,16 @@ namespace Opm {
|
|||||||
\param well_state additional well state object
|
\param well_state additional well state object
|
||||||
\param outputWriter writer object to write sub steps
|
\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,
|
void step( const SimulatorTimer& timer,
|
||||||
Solver& solver, State& state, WellState& well_state,
|
Solver& solver, State& state, WellState& well_state,
|
||||||
OutputWriter& outputWriter );
|
Output& outputWriter );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
template <class Solver, class State, class WellState>
|
template <class Solver, class State, class WellState, class Output>
|
||||||
void stepImpl( const SimulatorTimer& timer,
|
void stepImpl( const SimulatorTimer& timer,
|
||||||
Solver& solver, State& state, WellState& well_state,
|
Solver& solver, State& state, WellState& well_state,
|
||||||
OutputWriter* outputWriter);
|
Output* outputWriter);
|
||||||
|
|
||||||
typedef std::unique_ptr< TimeStepControlInterface > TimeStepControlType;
|
typedef std::unique_ptr< TimeStepControlInterface > TimeStepControlType;
|
||||||
|
|
||||||
|
@ -110,20 +110,20 @@ namespace Opm {
|
|||||||
stepImpl( simulatorTimer, solver, state, well_state );
|
stepImpl( simulatorTimer, solver, state, well_state );
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Solver, class State, class WellState>
|
template <class Solver, class State, class WellState, class Output>
|
||||||
void AdaptiveTimeStepping::
|
void AdaptiveTimeStepping::
|
||||||
step( const SimulatorTimer& simulatorTimer, Solver& solver, State& state, WellState& well_state,
|
step( const SimulatorTimer& simulatorTimer, Solver& solver, State& state, WellState& well_state,
|
||||||
OutputWriter& outputWriter )
|
Output& outputWriter )
|
||||||
{
|
{
|
||||||
stepImpl( simulatorTimer, solver, state, well_state, &outputWriter );
|
stepImpl( simulatorTimer, solver, state, well_state, &outputWriter );
|
||||||
}
|
}
|
||||||
|
|
||||||
// implementation of the step method
|
// implementation of the step method
|
||||||
template <class Solver, class State, class WState>
|
template <class Solver, class State, class WState, class Output >
|
||||||
void AdaptiveTimeStepping::
|
void AdaptiveTimeStepping::
|
||||||
stepImpl( const SimulatorTimer& simulatorTimer,
|
stepImpl( const SimulatorTimer& simulatorTimer,
|
||||||
Solver& solver, State& state, WState& well_state,
|
Solver& solver, State& state, WState& well_state,
|
||||||
OutputWriter* outputWriter )
|
Output* outputWriter )
|
||||||
{
|
{
|
||||||
const double timestep = simulatorTimer.currentStepLength();
|
const double timestep = simulatorTimer.currentStepLength();
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#include "BlackoilState.hpp"
|
#include "BlackoilState.hpp"
|
||||||
#include <opm/common/util/numeric/cmp.hpp>
|
#include <opm/common/util/numeric/cmp.hpp>
|
||||||
#include <opm/core/props/BlackoilPropertiesInterface.hpp>
|
#include <opm/core/props/BlackoilPropertiesInterface.hpp>
|
||||||
|
#include <opm/core/simulator/WellState.hpp>
|
||||||
|
#include <opm/output/Wells.hpp>
|
||||||
|
|
||||||
|
|
||||||
using namespace Opm;
|
using namespace Opm;
|
||||||
|
@ -22,6 +22,8 @@
|
|||||||
|
|
||||||
#include <opm/core/wells.h>
|
#include <opm/core/wells.h>
|
||||||
#include <opm/core/well_controls.h>
|
#include <opm/core/well_controls.h>
|
||||||
|
#include <opm/output/Wells.hpp>
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -208,6 +210,18 @@ namespace Opm
|
|||||||
return wellRates().size() / numWells();
|
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:
|
private:
|
||||||
std::vector<double> bhp_;
|
std::vector<double> bhp_;
|
||||||
std::vector<double> thp_;
|
std::vector<double> thp_;
|
||||||
|
@ -117,15 +117,6 @@ inline void solution2sim( const data::Solution& sol,
|
|||||||
state.getCellData( "RV" ) = sol[ ds::RV ];
|
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 ) {
|
inline void wells2state( const data::Wells& wells, WellState& state ) {
|
||||||
state.bhp() = wells.bhp;
|
state.bhp() = wells.bhp;
|
||||||
state.temperature() = wells.temperature;
|
state.temperature() = wells.temperature;
|
||||||
|
Loading…
Reference in New Issue
Block a user