Using ReservoirState and WellState consistently.

This means that for extended models the functions in BlackoilModelBase will
be compiled with the types used by those models and not BlackoilState and
WellStateFullyImplicitBlackoil (which are specified by BlackoilModel).
This commit is contained in:
Atgeirr Flø Rasmussen 2015-05-25 23:49:09 +02:00
parent 1cc5643d14
commit 0d7fa1a82c
2 changed files with 28 additions and 30 deletions

View File

@ -162,8 +162,8 @@ namespace Opm {
/// \param[in] reservoir_state reservoir state variables
/// \param[in, out] well_state well state variables
/// \param[in] initial_assembly pass true if this is the first call to assemble() in this timestep
void assemble(const BlackoilState& reservoir_state,
WellStateFullyImplicitBlackoil& well_state,
void assemble(const ReservoirState& reservoir_state,
WellState& well_state,
const bool initial_assembly);
/// \brief Compute the residual norms of the mass balance for each phase,
@ -187,8 +187,8 @@ namespace Opm {
/// \param[in, out] reservoir_state reservoir state variables
/// \param[in, out] well_state well state variables
void updateState(const V& dx,
BlackoilState& reservoir_state,
WellStateFullyImplicitBlackoil& well_state);
ReservoirState& reservoir_state,
WellState& well_state);
/// Return true if output to cout is wanted.
bool terminalOutputEnabled() const;
@ -269,34 +269,34 @@ namespace Opm {
const Wells& wells () const { assert( bool(wells_ != 0) ); return *wells_; }
SolutionState
constantState(const BlackoilState& x,
const WellStateFullyImplicitBlackoil& xw) const;
constantState(const ReservoirState& x,
const WellState& xw) const;
void
makeConstantState(SolutionState& state) const;
SolutionState
variableState(const BlackoilState& x,
const WellStateFullyImplicitBlackoil& xw) const;
variableState(const ReservoirState& x,
const WellState& xw) const;
void
computeAccum(const SolutionState& state,
const int aix );
void computeWellConnectionPressures(const SolutionState& state,
const WellStateFullyImplicitBlackoil& xw);
const WellState& xw);
void
addWellControlEq(const SolutionState& state,
const WellStateFullyImplicitBlackoil& xw,
const WellState& xw,
const V& aliveWells);
void
addWellEq(const SolutionState& state,
WellStateFullyImplicitBlackoil& xw,
WellState& xw,
V& aliveWells);
void updateWellControls(WellStateFullyImplicitBlackoil& xw) const;
void updateWellControls(WellState& xw) const;
std::vector<ADB>
computePressures(const SolutionState& state) const;
@ -386,13 +386,13 @@ namespace Opm {
phaseCondition() const {return phaseCondition_;}
void
classifyCondition(const BlackoilState& state);
classifyCondition(const ReservoirState& state);
/// update the primal variable for Sg, Rv or Rs. The Gas phase must
/// be active to call this method.
void
updatePrimalVariableFromState(const BlackoilState& state);
updatePrimalVariableFromState(const ReservoirState& state);
/// Update the phaseCondition_ member based on the primalVariable_ member.
void

View File

@ -32,13 +32,11 @@
#include <opm/autodiff/BlackoilPropsAdInterface.hpp>
#include <opm/autodiff/GeoProps.hpp>
#include <opm/autodiff/WellDensitySegmented.hpp>
#include <opm/autodiff/WellStateFullyImplicitBlackoil.hpp>
#include <opm/core/grid.h>
#include <opm/core/linalg/LinearSolverInterface.hpp>
#include <opm/core/linalg/ParallelIstlInformation.hpp>
#include <opm/core/props/rock/RockCompressibility.hpp>
#include <opm/core/simulator/BlackoilState.hpp>
#include <opm/core/utility/ErrorMacros.hpp>
#include <opm/core/utility/Exceptions.hpp>
#include <opm/core/utility/Units.hpp>
@ -332,8 +330,8 @@ namespace detail {
template <class Grid, class Implementation>
typename BlackoilModelBase<Grid, Implementation>::SolutionState
BlackoilModelBase<Grid, Implementation>::constantState(const BlackoilState& x,
const WellStateFullyImplicitBlackoil& xw) const
BlackoilModelBase<Grid, Implementation>::constantState(const ReservoirState& x,
const WellState& xw) const
{
auto state = variableState(x, xw);
makeConstantState(state);
@ -375,8 +373,8 @@ namespace detail {
template <class Grid, class Implementation>
typename BlackoilModelBase<Grid, Implementation>::SolutionState
BlackoilModelBase<Grid, Implementation>::variableState(const BlackoilState& x,
const WellStateFullyImplicitBlackoil& xw) const
BlackoilModelBase<Grid, Implementation>::variableState(const ReservoirState& x,
const WellState& xw) const
{
using namespace Opm::AutoDiffGrid;
const int nc = numCells(grid_);
@ -580,7 +578,7 @@ namespace detail {
template <class Grid, class Implementation>
void BlackoilModelBase<Grid, Implementation>::computeWellConnectionPressures(const SolutionState& state,
const WellStateFullyImplicitBlackoil& xw)
const WellState& xw)
{
if( ! wellsActive() ) return ;
@ -674,8 +672,8 @@ namespace detail {
template <class Grid, class Implementation>
void
BlackoilModelBase<Grid, Implementation>::
assemble(const BlackoilState& reservoir_state,
WellStateFullyImplicitBlackoil& well_state,
assemble(const ReservoirState& reservoir_state,
WellState& well_state,
const bool initial_assembly)
{
using namespace Opm::AutoDiffGrid;
@ -766,7 +764,7 @@ namespace detail {
template <class Grid, class Implementation>
void BlackoilModelBase<Grid, Implementation>::addWellEq(const SolutionState& state,
WellStateFullyImplicitBlackoil& xw,
WellState& xw,
V& aliveWells)
{
if( ! wellsActive() ) return ;
@ -1007,7 +1005,7 @@ namespace detail {
template <class Grid, class Implementation>
void BlackoilModelBase<Grid, Implementation>::updateWellControls(WellStateFullyImplicitBlackoil& xw) const
void BlackoilModelBase<Grid, Implementation>::updateWellControls(WellState& xw) const
{
if( ! wellsActive() ) return ;
@ -1084,7 +1082,7 @@ namespace detail {
template <class Grid, class Implementation>
void BlackoilModelBase<Grid, Implementation>::addWellControlEq(const SolutionState& state,
const WellStateFullyImplicitBlackoil& xw,
const WellState& xw,
const V& aliveWells)
{
if( ! wellsActive() ) return;
@ -1223,8 +1221,8 @@ namespace detail {
template <class Grid, class Implementation>
void BlackoilModelBase<Grid, Implementation>::updateState(const V& dx,
BlackoilState& reservoir_state,
WellStateFullyImplicitBlackoil& well_state)
ReservoirState& reservoir_state,
WellState& well_state)
{
using namespace Opm::AutoDiffGrid;
const int np = fluid_.numPhases();
@ -2133,7 +2131,7 @@ namespace detail {
template <class Grid, class Implementation>
void
BlackoilModelBase<Grid, Implementation>::classifyCondition(const BlackoilState& state)
BlackoilModelBase<Grid, Implementation>::classifyCondition(const ReservoirState& state)
{
using namespace Opm::AutoDiffGrid;
const int nc = numCells(grid_);
@ -2171,7 +2169,7 @@ namespace detail {
template <class Grid, class Implementation>
void
BlackoilModelBase<Grid, Implementation>::updatePrimalVariableFromState(const BlackoilState& state)
BlackoilModelBase<Grid, Implementation>::updatePrimalVariableFromState(const ReservoirState& state)
{
using namespace Opm::AutoDiffGrid;
const int nc = numCells(grid_);