using well_model_ to represent the WellModel member

This commit is contained in:
Kai Bao
2016-05-10 11:40:43 +02:00
parent 06775ee02c
commit 184bff95ba
11 changed files with 93 additions and 88 deletions

View File

@@ -179,7 +179,7 @@ namespace Opm {
// --------- Protected methods ---------
// Need to declare Base members we want to use here.
using Base::stdWells;
using Base::wellModel;
using Base::wells;
using Base::wellsActive;
using Base::variableState;

View File

@@ -499,7 +499,7 @@ namespace Opm {
// Possibly switch well controls and updating well state to
// get reasonable initial conditions for the wells
// updateWellControls(well_state);
stdWells().updateWellControls(terminal_output_, well_state);
wellModel().updateWellControls(terminal_output_, well_state);
// Create the primary variables.
SolutionState state = variableState(reservoir_state, well_state);
@@ -512,7 +512,7 @@ namespace Opm {
// and well connection pressures.
computeAccum(state0, 0);
// computeWellConnectionPressures(state0, well_state);
stdWells().computeWellConnectionPressures(state0, well_state);
wellModel().computeWellConnectionPressures(state0, well_state);
}
// OPM_AD_DISKVAL(state.pressure);
@@ -552,7 +552,7 @@ namespace Opm {
Base::solveWellEq(mob_perfcells, b_perfcells, state, well_state);
}
stdWells().computeWellFlux(state, mob_perfcells, b_perfcells, aliveWells, cq_s);
wellModel().computeWellFlux(state, mob_perfcells, b_perfcells, aliveWells, cq_s);
if (has_plyshlog_) {
std::vector<double> water_vel_wells;
@@ -571,11 +571,11 @@ namespace Opm {
mob_perfcells[water_pos] = mob_perfcells[water_pos] / shear_mult_wells_adb;
}
stdWells().computeWellFlux(state, mob_perfcells, b_perfcells, aliveWells, cq_s);
stdWells().updatePerfPhaseRatesAndPressures(cq_s, state, well_state);
stdWells().addWellFluxEq(cq_s, state, residual_);
wellModel().computeWellFlux(state, mob_perfcells, b_perfcells, aliveWells, cq_s);
wellModel().updatePerfPhaseRatesAndPressures(cq_s, state, well_state);
wellModel().addWellFluxEq(cq_s, state, residual_);
addWellContributionToMassBalanceEq(cq_s, state, well_state);
stdWells().addWellControlEq(state, well_state, aliveWells, residual_);
wellModel().addWellControlEq(state, well_state, aliveWells, residual_);
}
@@ -734,8 +734,8 @@ namespace Opm {
ADB b_perfcells = subset(rq_[water_pos].b, well_cells);
const ADB& p_perfcells = subset(state.pressure, well_cells);
const V& cdp = stdWells().wellPerforationPressureDiffs();
const ADB perfpressure = (stdWells().wellOps().w2p * state.bhp) + cdp;
const V& cdp = wellModel().wellPerforationPressureDiffs();
const ADB perfpressure = (wellModel().wellOps().w2p * state.bhp) + cdp;
// Pressure drawdown (also used to determine direction of flow)
const ADB drawdown = p_perfcells - perfpressure;

View File

@@ -71,6 +71,8 @@ namespace Opm
template <class GridT>
class SimulatorFullyImplicitCompressiblePolymer;
class StandardWells;
template <class GridT>
struct SimulatorTraits<SimulatorFullyImplicitCompressiblePolymer<GridT> >
{
@@ -79,6 +81,7 @@ namespace Opm
typedef BlackoilOutputWriter OutputWriter;
typedef GridT Grid;
typedef FullyImplicitCompressiblePolymerSolver Solver;
typedef StandardWells WellModel;
/// Dummy class, this Solver does not use a Model.
struct Model
{
@@ -94,6 +97,7 @@ namespace Opm
typedef SimulatorFullyImplicitCompressiblePolymer ThisType;
typedef SimulatorBase<ThisType> BaseType;
typedef typename BaseType::Solver Solver;
typedef typename BaseType::WellModel WellModel;
public:
/// Initialise from parameters and objects to observe.
@@ -109,7 +113,7 @@ namespace Opm
NewtonIterationBlackoilInterface& linsolver,
const double* gravity);
std::unique_ptr<Solver> createSolver(const Wells* wells);
std::unique_ptr<Solver> createSolver(const WellModel& well_model);
void handleAdditionalWellInflow(SimulatorTimer& timer,
WellsManager& wells_manager,

View File

@@ -57,7 +57,7 @@ SimulatorFullyImplicitCompressiblePolymer(const parameter::ParameterGroup& param
template <class GridT>
auto SimulatorFullyImplicitCompressiblePolymer<GridT>::
createSolver(const Wells* wells)
createSolver(const WellModel& well_model)
-> std::unique_ptr<Solver>
{
return std::unique_ptr<Solver>(new Solver(BaseType::grid_,
@@ -65,7 +65,9 @@ createSolver(const Wells* wells)
BaseType::geo_,
BaseType::rock_comp_props_,
polymer_props_,
*wells,
// *wells,
// TODO: it is resulted from refactoring of other simulators.
well_model.wells(),
BaseType::solver_));
}