moving numWellVars from models to Wells.

This commit is contained in:
Kai Bao 2016-05-11 10:35:11 +02:00
parent b3d1c0eabc
commit f2b7f2a56c
7 changed files with 17 additions and 32 deletions

View File

@ -343,8 +343,6 @@ namespace Opm {
/// return true if wells are available on this process
bool localWellsActive() const { return well_model_.localWellsActive(); }
int numWellVars() const;
void
makeConstantState(SolutionState& state) const;

View File

@ -460,19 +460,6 @@ namespace detail {
template <class Grid, class WellModel, class Implementation>
int
BlackoilModelBase<Grid, WellModel, Implementation>::numWellVars() const
{
// For each well, we have a bhp variable, and one flux per phase.
const int nw = wellModel().localWellsActive() ? wells().number_of_wells : 0;
return (numPhases() + 1) * nw;
}
template <class Grid, class WellModel, class Implementation>
void
BlackoilModelBase<Grid, WellModel, Implementation>::
@ -1248,7 +1235,7 @@ namespace detail {
varstart += dxvar.size();
// Extract well parts np phase rates + bhp
const V dwells = subset(dx, Span(asImpl().numWellVars(), 1, varstart));
const V dwells = subset(dx, Span(asImpl().wellModel().numWellVars(), 1, varstart));
varstart += dwells.size();
assert(varstart == dx.size());

View File

@ -170,8 +170,6 @@ namespace Opm {
SolutionState& state,
WellState& well_state);
int numWellVars() const;
void
makeConstantState(SolutionState& state) const;

View File

@ -112,19 +112,6 @@ namespace Opm {
template <class Grid>
int
BlackoilMultiSegmentModel<Grid>::numWellVars() const
{
// For each segment, we have a pressure variable, and one flux per phase.
const int nseg = wellModel().numSegment();
return (numPhases() + 1) * nseg;
}
template <class Grid>
void
BlackoilMultiSegmentModel<Grid>::makeConstantState(SolutionState& state) const

View File

@ -114,7 +114,9 @@ namespace Opm {
void setWellsActive(const bool wells_active) { wells_active_ = wells_active; };
bool localWellsActive() const { return ! wells_multisegment_.empty(); }
bool localWellsActive() const { return ! wells_multisegment_.empty(); };
int numWellVars() const { return (num_phases_ + 1) * nseg_total_; };
template <class ReservoirResidualQuant, class SolutionState>
void extractWellPerfProperties(const SolutionState& state,

View File

@ -81,6 +81,7 @@ namespace Opm {
/// return true if wells are available on this process
bool localWellsActive() const;
int numWellVars() const;
/// Density of each well perforation
Vector& wellPerforationDensities(); // mutable version kept for BlackoilMultisegmentModel

View File

@ -145,6 +145,18 @@ namespace Opm
int
StandardWells::numWellVars() const
{
// For each well, we have a bhp variable, and one flux per phase.
const int nw = localWellsActive() ? wells().number_of_wells : 0;
return (numPhases() + 1) * nw;
}
const StandardWells::WellOps&
StandardWells::wellOps() const
{