mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
change reservoir related members to be pointers in StandardWells
to fullfil the requirement of interface design.
This commit is contained in:
parent
89a8f133fd
commit
66cd66e61b
@ -176,7 +176,7 @@ namespace detail {
|
|||||||
, use_threshold_pressure_(false)
|
, use_threshold_pressure_(false)
|
||||||
, rq_ (fluid.numPhases())
|
, rq_ (fluid.numPhases())
|
||||||
, phaseCondition_(AutoDiffGrid::numCells(grid))
|
, phaseCondition_(AutoDiffGrid::numCells(grid))
|
||||||
, std_wells_ (wells_arg, fluid_, active_, phaseCondition_)
|
, std_wells_ (wells_arg)
|
||||||
, isRs_(V::Zero(AutoDiffGrid::numCells(grid)))
|
, isRs_(V::Zero(AutoDiffGrid::numCells(grid)))
|
||||||
, isRv_(V::Zero(AutoDiffGrid::numCells(grid)))
|
, isRv_(V::Zero(AutoDiffGrid::numCells(grid)))
|
||||||
, isSg_(V::Zero(AutoDiffGrid::numCells(grid)))
|
, isSg_(V::Zero(AutoDiffGrid::numCells(grid)))
|
||||||
@ -201,6 +201,8 @@ namespace detail {
|
|||||||
|
|
||||||
assert(numMaterials() == std::accumulate(active_.begin(), active_.end(), 0)); // Due to the material_name_ init above.
|
assert(numMaterials() == std::accumulate(active_.begin(), active_.end(), 0)); // Due to the material_name_ init above.
|
||||||
|
|
||||||
|
std_wells_.init(&fluid_, &active_, &phaseCondition_);
|
||||||
|
|
||||||
#if HAVE_MPI
|
#if HAVE_MPI
|
||||||
if ( linsolver_.parallelInformation().type() == typeid(ParallelISTLInformation) )
|
if ( linsolver_.parallelInformation().type() == typeid(ParallelISTLInformation) )
|
||||||
{
|
{
|
||||||
|
@ -60,10 +60,12 @@ namespace Opm {
|
|||||||
Eigen::Dynamic,
|
Eigen::Dynamic,
|
||||||
Eigen::RowMajor>;
|
Eigen::RowMajor>;
|
||||||
// --------- Public methods ---------
|
// --------- Public methods ---------
|
||||||
StandardWells(const Wells* wells_arg,
|
StandardWells(const Wells* wells_arg);
|
||||||
const BlackoilPropsAdInterface& fluid_arg,
|
|
||||||
const std::vector<bool>& active_arg,
|
void init(const BlackoilPropsAdInterface* fluid_arg,
|
||||||
const std::vector<PhasePresence>& pc_arg);
|
const std::vector<bool>* active_arg,
|
||||||
|
const std::vector<PhasePresence>* pc_arg);
|
||||||
|
|
||||||
|
|
||||||
const WellOps& wellOps() const;
|
const WellOps& wellOps() const;
|
||||||
|
|
||||||
@ -168,9 +170,11 @@ namespace Opm {
|
|||||||
const Wells* wells_;
|
const Wells* wells_;
|
||||||
const WellOps wops_;
|
const WellOps wops_;
|
||||||
const int num_phases_;
|
const int num_phases_;
|
||||||
const BlackoilPropsAdInterface& fluid_;
|
|
||||||
const std::vector<bool>& active_;
|
const BlackoilPropsAdInterface* fluid_;
|
||||||
const std::vector<PhasePresence>& phase_condition_;
|
const std::vector<bool>* active_;
|
||||||
|
const std::vector<PhasePresence>* phase_condition_;
|
||||||
|
|
||||||
Vector well_perforation_densities_;
|
Vector well_perforation_densities_;
|
||||||
Vector well_perforation_pressure_diffs_;
|
Vector well_perforation_pressure_diffs_;
|
||||||
|
|
||||||
|
@ -37,10 +37,7 @@ namespace Opm {
|
|||||||
using Base::computeWellConnectionDensitesPressures;
|
using Base::computeWellConnectionDensitesPressures;
|
||||||
|
|
||||||
// --------- Public methods ---------
|
// --------- Public methods ---------
|
||||||
StandardWellsSolvent(const Wells* wells_arg,
|
StandardWellsSolvent(const Wells* wells_arg);
|
||||||
const BlackoilPropsAdInterface& fluid_arg,
|
|
||||||
const std::vector<bool>& active_arg,
|
|
||||||
const std::vector<PhasePresence>& pc_arg);
|
|
||||||
|
|
||||||
// added the Solvent related
|
// added the Solvent related
|
||||||
void initSolvent(const SolventPropsAdFromDeck* solvent_props,
|
void initSolvent(const SolventPropsAdFromDeck* solvent_props,
|
||||||
|
@ -32,11 +32,8 @@ namespace Opm
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
StandardWellsSolvent::StandardWellsSolvent(const Wells* wells_arg,
|
StandardWellsSolvent::StandardWellsSolvent(const Wells* wells_arg)
|
||||||
const BlackoilPropsAdInterface& fluid_arg,
|
: Base(wells_arg)
|
||||||
const std::vector<bool>& active_arg,
|
|
||||||
const std::vector<PhasePresence>& pc_arg)
|
|
||||||
: Base(wells_arg, fluid_arg, active_arg, pc_arg)
|
|
||||||
, solvent_props_(nullptr)
|
, solvent_props_(nullptr)
|
||||||
, solvent_pos_(-1)
|
, solvent_pos_(-1)
|
||||||
, has_solvent_(false)
|
, has_solvent_(false)
|
||||||
@ -99,46 +96,46 @@ namespace Opm
|
|||||||
const ADB avg_press_ad = ADB::constant(avg_press);
|
const ADB avg_press_ad = ADB::constant(avg_press);
|
||||||
std::vector<PhasePresence> perf_cond(nperf);
|
std::vector<PhasePresence> perf_cond(nperf);
|
||||||
for (int perf = 0; perf < nperf; ++perf) {
|
for (int perf = 0; perf < nperf; ++perf) {
|
||||||
perf_cond[perf] = phase_condition_[well_cells[perf]];
|
perf_cond[perf] = (*phase_condition_)[well_cells[perf]];
|
||||||
}
|
}
|
||||||
|
|
||||||
const PhaseUsage& pu = fluid_.phaseUsage();
|
const PhaseUsage& pu = fluid_->phaseUsage();
|
||||||
DataBlock b(nperf, pu.num_phases);
|
DataBlock b(nperf, pu.num_phases);
|
||||||
|
|
||||||
const Vector bw = fluid_.bWat(avg_press_ad, perf_temp, well_cells).value();
|
const Vector bw = fluid_->bWat(avg_press_ad, perf_temp, well_cells).value();
|
||||||
if (pu.phase_used[BlackoilPhases::Aqua]) {
|
if (pu.phase_used[BlackoilPhases::Aqua]) {
|
||||||
b.col(pu.phase_pos[BlackoilPhases::Aqua]) = bw;
|
b.col(pu.phase_pos[BlackoilPhases::Aqua]) = bw;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(active_[Oil]);
|
assert((*active_)[Oil]);
|
||||||
assert(active_[Gas]);
|
assert((*active_)[Gas]);
|
||||||
const ADB perf_rv = subset(state.rv, well_cells);
|
const ADB perf_rv = subset(state.rv, well_cells);
|
||||||
const ADB perf_rs = subset(state.rs, well_cells);
|
const ADB perf_rs = subset(state.rs, well_cells);
|
||||||
const Vector perf_so = subset(state.saturation[pu.phase_pos[Oil]].value(), well_cells);
|
const Vector perf_so = subset(state.saturation[pu.phase_pos[Oil]].value(), well_cells);
|
||||||
if (pu.phase_used[BlackoilPhases::Liquid]) {
|
if (pu.phase_used[BlackoilPhases::Liquid]) {
|
||||||
const Vector bo = fluid_.bOil(avg_press_ad, perf_temp, perf_rs, perf_cond, well_cells).value();
|
const Vector bo = fluid_->bOil(avg_press_ad, perf_temp, perf_rs, perf_cond, well_cells).value();
|
||||||
//const V bo_eff = subset(rq_[pu.phase_pos[Oil] ].b , well_cells).value();
|
//const V bo_eff = subset(rq_[pu.phase_pos[Oil] ].b , well_cells).value();
|
||||||
b.col(pu.phase_pos[BlackoilPhases::Liquid]) = bo;
|
b.col(pu.phase_pos[BlackoilPhases::Liquid]) = bo;
|
||||||
// const Vector rssat = fluidRsSat(avg_press, perf_so, well_cells);
|
// const Vector rssat = fluidRsSat(avg_press, perf_so, well_cells);
|
||||||
const Vector rssat = fluid_.rsSat(ADB::constant(avg_press), ADB::constant(perf_so), well_cells).value();
|
const Vector rssat = fluid_->rsSat(ADB::constant(avg_press), ADB::constant(perf_so), well_cells).value();
|
||||||
rsmax_perf.assign(rssat.data(), rssat.data() + nperf);
|
rsmax_perf.assign(rssat.data(), rssat.data() + nperf);
|
||||||
} else {
|
} else {
|
||||||
rsmax_perf.assign(0.0, nperf);
|
rsmax_perf.assign(0.0, nperf);
|
||||||
}
|
}
|
||||||
V surf_dens_copy = superset(fluid_.surfaceDensity(0, well_cells), Span(nperf, pu.num_phases, 0), nperf*pu.num_phases);
|
V surf_dens_copy = superset(fluid_->surfaceDensity(0, well_cells), Span(nperf, pu.num_phases, 0), nperf*pu.num_phases);
|
||||||
for (int phase = 1; phase < pu.num_phases; ++phase) {
|
for (int phase = 1; phase < pu.num_phases; ++phase) {
|
||||||
if ( phase == pu.phase_pos[BlackoilPhases::Vapour]) {
|
if ( phase == pu.phase_pos[BlackoilPhases::Vapour]) {
|
||||||
continue; // the gas surface density is added after the solvent is accounted for.
|
continue; // the gas surface density is added after the solvent is accounted for.
|
||||||
}
|
}
|
||||||
surf_dens_copy += superset(fluid_.surfaceDensity(phase, well_cells), Span(nperf, pu.num_phases, phase), nperf*pu.num_phases);
|
surf_dens_copy += superset(fluid_->surfaceDensity(phase, well_cells), Span(nperf, pu.num_phases, phase), nperf*pu.num_phases);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pu.phase_used[BlackoilPhases::Vapour]) {
|
if (pu.phase_used[BlackoilPhases::Vapour]) {
|
||||||
// Unclear wether the effective or the pure values should be used for the wells
|
// Unclear wether the effective or the pure values should be used for the wells
|
||||||
// the current usage of unmodified properties values gives best match.
|
// the current usage of unmodified properties values gives best match.
|
||||||
//V bg_eff = subset(rq_[pu.phase_pos[Gas]].b,well_cells).value();
|
//V bg_eff = subset(rq_[pu.phase_pos[Gas]].b,well_cells).value();
|
||||||
Vector bg = fluid_.bGas(avg_press_ad, perf_temp, perf_rv, perf_cond, well_cells).value();
|
Vector bg = fluid_->bGas(avg_press_ad, perf_temp, perf_rv, perf_cond, well_cells).value();
|
||||||
Vector rhog = fluid_.surfaceDensity(pu.phase_pos[BlackoilPhases::Vapour], well_cells);
|
Vector rhog = fluid_->surfaceDensity(pu.phase_pos[BlackoilPhases::Vapour], well_cells);
|
||||||
// to handle solvent related
|
// to handle solvent related
|
||||||
if (has_solvent_) {
|
if (has_solvent_) {
|
||||||
|
|
||||||
@ -150,7 +147,7 @@ namespace Opm
|
|||||||
|
|
||||||
const ADB zero = ADB::constant(Vector::Zero(nc));
|
const ADB zero = ADB::constant(Vector::Zero(nc));
|
||||||
const ADB& ss = state.solvent_saturation;
|
const ADB& ss = state.solvent_saturation;
|
||||||
const ADB& sg = (active_[ Gas ]
|
const ADB& sg = ((*active_)[ Gas ]
|
||||||
? state.saturation[ pu.phase_pos[ Gas ] ]
|
? state.saturation[ pu.phase_pos[ Gas ] ]
|
||||||
: zero);
|
: zero);
|
||||||
|
|
||||||
@ -181,7 +178,7 @@ namespace Opm
|
|||||||
surf_dens_copy += superset(rhog, Span(nperf, pu.num_phases, pu.phase_pos[BlackoilPhases::Vapour]), nperf*pu.num_phases);
|
surf_dens_copy += superset(rhog, Span(nperf, pu.num_phases, pu.phase_pos[BlackoilPhases::Vapour]), nperf*pu.num_phases);
|
||||||
|
|
||||||
// const Vector rvsat = fluidRvSat(avg_press, perf_so, well_cells);
|
// const Vector rvsat = fluidRvSat(avg_press, perf_so, well_cells);
|
||||||
const Vector rvsat = fluid_.rvSat(ADB::constant(avg_press), ADB::constant(perf_so), well_cells).value();
|
const Vector rvsat = fluid_->rvSat(ADB::constant(avg_press), ADB::constant(perf_so), well_cells).value();
|
||||||
rvmax_perf.assign(rvsat.data(), rvsat.data() + nperf);
|
rvmax_perf.assign(rvsat.data(), rvsat.data() + nperf);
|
||||||
} else {
|
} else {
|
||||||
rvmax_perf.assign(0.0, nperf);
|
rvmax_perf.assign(0.0, nperf);
|
||||||
@ -240,7 +237,7 @@ namespace Opm
|
|||||||
Base::extractWellPerfProperties(state, rq, mob_perfcells, b_perfcells);
|
Base::extractWellPerfProperties(state, rq, mob_perfcells, b_perfcells);
|
||||||
// handle the solvent related
|
// handle the solvent related
|
||||||
if (has_solvent_) {
|
if (has_solvent_) {
|
||||||
const Opm::PhaseUsage& pu = fluid_.phaseUsage();
|
const Opm::PhaseUsage& pu = fluid_->phaseUsage();
|
||||||
int gas_pos = pu.phase_pos[Gas];
|
int gas_pos = pu.phase_pos[Gas];
|
||||||
const std::vector<int>& well_cells = wellOps().well_cells;
|
const std::vector<int>& well_cells = wellOps().well_cells;
|
||||||
const int nperf = well_cells.size();
|
const int nperf = well_cells.size();
|
||||||
@ -256,7 +253,7 @@ namespace Opm
|
|||||||
|
|
||||||
const ADB zero = ADB::constant(Vector::Zero(nc));
|
const ADB zero = ADB::constant(Vector::Zero(nc));
|
||||||
const ADB& ss = state.solvent_saturation;
|
const ADB& ss = state.solvent_saturation;
|
||||||
const ADB& sg = (active_[ Gas ]
|
const ADB& sg = ((*active_)[ Gas ]
|
||||||
? state.saturation[ pu.phase_pos[ Gas ] ]
|
? state.saturation[ pu.phase_pos[ Gas ] ]
|
||||||
: zero);
|
: zero);
|
||||||
|
|
||||||
|
@ -71,16 +71,10 @@ namespace Opm
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
StandardWells::StandardWells(const Wells* wells_arg,
|
StandardWells::StandardWells(const Wells* wells_arg)
|
||||||
const BlackoilPropsAdInterface& fluid_arg,
|
|
||||||
const std::vector<bool>& active_arg,
|
|
||||||
const std::vector<PhasePresence>& pc_arg)
|
|
||||||
: wells_(wells_arg)
|
: wells_(wells_arg)
|
||||||
, wops_(wells_arg)
|
, wops_(wells_arg)
|
||||||
, num_phases_(wells_arg->number_of_phases)
|
, num_phases_(wells_arg->number_of_phases)
|
||||||
, fluid_(fluid_arg)
|
|
||||||
, active_(active_arg)
|
|
||||||
, phase_condition_(pc_arg)
|
|
||||||
, well_perforation_densities_(Vector())
|
, well_perforation_densities_(Vector())
|
||||||
, well_perforation_pressure_diffs_(Vector())
|
, well_perforation_pressure_diffs_(Vector())
|
||||||
{
|
{
|
||||||
@ -90,6 +84,20 @@ namespace Opm
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
StandardWells::init(const BlackoilPropsAdInterface* fluid_arg,
|
||||||
|
const std::vector<bool>* active_arg,
|
||||||
|
const std::vector<PhasePresence>* pc_arg)
|
||||||
|
{
|
||||||
|
fluid_ = fluid_arg;
|
||||||
|
active_ = active_arg;
|
||||||
|
phase_condition_ = pc_arg;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const Wells& StandardWells::wells() const
|
const Wells& StandardWells::wells() const
|
||||||
{
|
{
|
||||||
assert(wells_ != 0);
|
assert(wells_ != 0);
|
||||||
@ -211,31 +219,31 @@ namespace Opm
|
|||||||
std::vector<PhasePresence> perf_cond(nperf);
|
std::vector<PhasePresence> perf_cond(nperf);
|
||||||
// const std::vector<PhasePresence>& pc = phaseCondition();
|
// const std::vector<PhasePresence>& pc = phaseCondition();
|
||||||
for (int perf = 0; perf < nperf; ++perf) {
|
for (int perf = 0; perf < nperf; ++perf) {
|
||||||
perf_cond[perf] = phase_condition_[well_cells[perf]];
|
perf_cond[perf] = (*phase_condition_)[well_cells[perf]];
|
||||||
}
|
}
|
||||||
const PhaseUsage& pu = fluid_.phaseUsage();
|
const PhaseUsage& pu = fluid_->phaseUsage();
|
||||||
DataBlock b(nperf, pu.num_phases);
|
DataBlock b(nperf, pu.num_phases);
|
||||||
if (pu.phase_used[BlackoilPhases::Aqua]) {
|
if (pu.phase_used[BlackoilPhases::Aqua]) {
|
||||||
const Vector bw = fluid_.bWat(avg_press_ad, perf_temp, well_cells).value();
|
const Vector bw = fluid_->bWat(avg_press_ad, perf_temp, well_cells).value();
|
||||||
b.col(pu.phase_pos[BlackoilPhases::Aqua]) = bw;
|
b.col(pu.phase_pos[BlackoilPhases::Aqua]) = bw;
|
||||||
}
|
}
|
||||||
assert(active_[Oil]);
|
assert((*active_)[Oil]);
|
||||||
const Vector perf_so = subset(state.saturation[pu.phase_pos[Oil]].value(), well_cells);
|
const Vector perf_so = subset(state.saturation[pu.phase_pos[Oil]].value(), well_cells);
|
||||||
if (pu.phase_used[BlackoilPhases::Liquid]) {
|
if (pu.phase_used[BlackoilPhases::Liquid]) {
|
||||||
const ADB perf_rs = (state.rs.size() > 0) ? subset(state.rs, well_cells) : ADB::null();
|
const ADB perf_rs = (state.rs.size() > 0) ? subset(state.rs, well_cells) : ADB::null();
|
||||||
const Vector bo = fluid_.bOil(avg_press_ad, perf_temp, perf_rs, perf_cond, well_cells).value();
|
const Vector bo = fluid_->bOil(avg_press_ad, perf_temp, perf_rs, perf_cond, well_cells).value();
|
||||||
b.col(pu.phase_pos[BlackoilPhases::Liquid]) = bo;
|
b.col(pu.phase_pos[BlackoilPhases::Liquid]) = bo;
|
||||||
}
|
}
|
||||||
if (pu.phase_used[BlackoilPhases::Vapour]) {
|
if (pu.phase_used[BlackoilPhases::Vapour]) {
|
||||||
const ADB perf_rv = (state.rv.size() > 0) ? subset(state.rv, well_cells) : ADB::null();
|
const ADB perf_rv = (state.rv.size() > 0) ? subset(state.rv, well_cells) : ADB::null();
|
||||||
const Vector bg = fluid_.bGas(avg_press_ad, perf_temp, perf_rv, perf_cond, well_cells).value();
|
const Vector bg = fluid_->bGas(avg_press_ad, perf_temp, perf_rv, perf_cond, well_cells).value();
|
||||||
b.col(pu.phase_pos[BlackoilPhases::Vapour]) = bg;
|
b.col(pu.phase_pos[BlackoilPhases::Vapour]) = bg;
|
||||||
}
|
}
|
||||||
if (pu.phase_used[BlackoilPhases::Liquid] && pu.phase_used[BlackoilPhases::Vapour]) {
|
if (pu.phase_used[BlackoilPhases::Liquid] && pu.phase_used[BlackoilPhases::Vapour]) {
|
||||||
const Vector rssat = fluid_.rsSat(ADB::constant(avg_press), ADB::constant(perf_so), well_cells).value();
|
const Vector rssat = fluid_->rsSat(ADB::constant(avg_press), ADB::constant(perf_so), well_cells).value();
|
||||||
rsmax_perf.assign(rssat.data(), rssat.data() + nperf);
|
rsmax_perf.assign(rssat.data(), rssat.data() + nperf);
|
||||||
|
|
||||||
const Vector rvsat = fluid_.rvSat(ADB::constant(avg_press), ADB::constant(perf_so), well_cells).value();
|
const Vector rvsat = fluid_->rvSat(ADB::constant(avg_press), ADB::constant(perf_so), well_cells).value();
|
||||||
rvmax_perf.assign(rvsat.data(), rvsat.data() + nperf);
|
rvmax_perf.assign(rvsat.data(), rvsat.data() + nperf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,9 +253,9 @@ namespace Opm
|
|||||||
// Surface density.
|
// Surface density.
|
||||||
// The compute density segment wants the surface densities as
|
// The compute density segment wants the surface densities as
|
||||||
// an np * number of wells cells array
|
// an np * number of wells cells array
|
||||||
Vector rho = superset(fluid_.surfaceDensity(0 , well_cells), Span(nperf, pu.num_phases, 0), nperf*pu.num_phases);
|
Vector rho = superset(fluid_->surfaceDensity(0 , well_cells), Span(nperf, pu.num_phases, 0), nperf*pu.num_phases);
|
||||||
for (int phase = 1; phase < pu.num_phases; ++phase) {
|
for (int phase = 1; phase < pu.num_phases; ++phase) {
|
||||||
rho += superset(fluid_.surfaceDensity(phase , well_cells), Span(nperf, pu.num_phases, phase), nperf*pu.num_phases);
|
rho += superset(fluid_->surfaceDensity(phase , well_cells), Span(nperf, pu.num_phases, phase), nperf*pu.num_phases);
|
||||||
}
|
}
|
||||||
surf_dens_perf.assign(rho.data(), rho.data() + nperf * pu.num_phases);
|
surf_dens_perf.assign(rho.data(), rho.data() + nperf * pu.num_phases);
|
||||||
|
|
||||||
@ -271,7 +279,7 @@ namespace Opm
|
|||||||
// Compute densities
|
// Compute densities
|
||||||
std::vector<double> cd =
|
std::vector<double> cd =
|
||||||
WellDensitySegmented::computeConnectionDensities(
|
WellDensitySegmented::computeConnectionDensities(
|
||||||
wells(), xw, fluid_.phaseUsage(),
|
wells(), xw, fluid_->phaseUsage(),
|
||||||
b_perf, rsmax_perf, rvmax_perf, surf_dens_perf);
|
b_perf, rsmax_perf, rvmax_perf, surf_dens_perf);
|
||||||
|
|
||||||
const int nperf = wells().well_connpos[wells().number_of_wells];
|
const int nperf = wells().well_connpos[wells().number_of_wells];
|
||||||
@ -420,8 +428,8 @@ namespace Opm
|
|||||||
const ADB cq_p = -(selectProducingPerforations * Tw) * (mob_perfcells[phase] * drawdown);
|
const ADB cq_p = -(selectProducingPerforations * Tw) * (mob_perfcells[phase] * drawdown);
|
||||||
cq_ps[phase] = b_perfcells[phase] * cq_p;
|
cq_ps[phase] = b_perfcells[phase] * cq_p;
|
||||||
}
|
}
|
||||||
const Opm::PhaseUsage& pu = fluid_.phaseUsage();
|
const Opm::PhaseUsage& pu = fluid_->phaseUsage();
|
||||||
if (active_[Oil] && active_[Gas]) {
|
if ((*active_)[Oil] && (*active_)[Gas]) {
|
||||||
const int oilpos = pu.phase_pos[Oil];
|
const int oilpos = pu.phase_pos[Oil];
|
||||||
const int gaspos = pu.phase_pos[Gas];
|
const int gaspos = pu.phase_pos[Gas];
|
||||||
const ADB cq_psOil = cq_ps[oilpos];
|
const ADB cq_psOil = cq_ps[oilpos];
|
||||||
@ -468,12 +476,12 @@ namespace Opm
|
|||||||
// compute volume ratio between connection at standard conditions
|
// compute volume ratio between connection at standard conditions
|
||||||
ADB volumeRatio = ADB::constant(Vector::Zero(nperf));
|
ADB volumeRatio = ADB::constant(Vector::Zero(nperf));
|
||||||
|
|
||||||
if (active_[Water]) {
|
if ((*active_)[Water]) {
|
||||||
const int watpos = pu.phase_pos[Water];
|
const int watpos = pu.phase_pos[Water];
|
||||||
volumeRatio += cmix_s[watpos] / b_perfcells[watpos];
|
volumeRatio += cmix_s[watpos] / b_perfcells[watpos];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (active_[Oil] && active_[Gas]) {
|
if ((*active_)[Oil] && (*active_)[Gas]) {
|
||||||
// Incorporate RS/RV factors if both oil and gas active
|
// Incorporate RS/RV factors if both oil and gas active
|
||||||
const ADB& rv_perfcells = subset(state.rv, well_cells);
|
const ADB& rv_perfcells = subset(state.rv, well_cells);
|
||||||
const ADB& rs_perfcells = subset(state.rs, well_cells);
|
const ADB& rs_perfcells = subset(state.rs, well_cells);
|
||||||
@ -489,11 +497,11 @@ namespace Opm
|
|||||||
volumeRatio += tmp_gas / b_perfcells[gaspos];
|
volumeRatio += tmp_gas / b_perfcells[gaspos];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (active_[Oil]) {
|
if ((*active_)[Oil]) {
|
||||||
const int oilpos = pu.phase_pos[Oil];
|
const int oilpos = pu.phase_pos[Oil];
|
||||||
volumeRatio += cmix_s[oilpos] / b_perfcells[oilpos];
|
volumeRatio += cmix_s[oilpos] / b_perfcells[oilpos];
|
||||||
}
|
}
|
||||||
if (active_[Gas]) {
|
if ((*active_)[Gas]) {
|
||||||
const int gaspos = pu.phase_pos[Gas];
|
const int gaspos = pu.phase_pos[Gas];
|
||||||
volumeRatio += cmix_s[gaspos] / b_perfcells[gaspos];
|
volumeRatio += cmix_s[gaspos] / b_perfcells[gaspos];
|
||||||
}
|
}
|
||||||
@ -597,7 +605,7 @@ namespace Opm
|
|||||||
std::copy(&bhp[0], &bhp[0] + bhp.size(), well_state.bhp().begin());
|
std::copy(&bhp[0], &bhp[0] + bhp.size(), well_state.bhp().begin());
|
||||||
|
|
||||||
|
|
||||||
const Opm::PhaseUsage& pu = fluid_.phaseUsage();
|
const Opm::PhaseUsage& pu = fluid_->phaseUsage();
|
||||||
//Loop over all wells
|
//Loop over all wells
|
||||||
#pragma omp parallel for schedule(static)
|
#pragma omp parallel for schedule(static)
|
||||||
for (int w = 0; w < nw; ++w) {
|
for (int w = 0; w < nw; ++w) {
|
||||||
@ -612,13 +620,13 @@ namespace Opm
|
|||||||
double liquid = 0.0;
|
double liquid = 0.0;
|
||||||
double vapour = 0.0;
|
double vapour = 0.0;
|
||||||
|
|
||||||
if (active_[ Water ]) {
|
if ((*active_)[ Water ]) {
|
||||||
aqua = wr[w*np + pu.phase_pos[ Water ] ];
|
aqua = wr[w*np + pu.phase_pos[ Water ] ];
|
||||||
}
|
}
|
||||||
if (active_[ Oil ]) {
|
if ((*active_)[ Oil ]) {
|
||||||
liquid = wr[w*np + pu.phase_pos[ Oil ] ];
|
liquid = wr[w*np + pu.phase_pos[ Oil ] ];
|
||||||
}
|
}
|
||||||
if (active_[ Gas ]) {
|
if ((*active_)[ Gas ]) {
|
||||||
vapour = wr[w*np + pu.phase_pos[ Gas ] ];
|
vapour = wr[w*np + pu.phase_pos[ Gas ] ];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -723,15 +731,15 @@ namespace Opm
|
|||||||
double liquid = 0.0;
|
double liquid = 0.0;
|
||||||
double vapour = 0.0;
|
double vapour = 0.0;
|
||||||
|
|
||||||
const Opm::PhaseUsage& pu = fluid_.phaseUsage();
|
const Opm::PhaseUsage& pu = fluid_->phaseUsage();
|
||||||
|
|
||||||
if (active_[ Water ]) {
|
if ((*active_)[ Water ]) {
|
||||||
aqua = xw.wellRates()[w*np + pu.phase_pos[ Water ] ];
|
aqua = xw.wellRates()[w*np + pu.phase_pos[ Water ] ];
|
||||||
}
|
}
|
||||||
if (active_[ Oil ]) {
|
if ((*active_)[ Oil ]) {
|
||||||
liquid = xw.wellRates()[w*np + pu.phase_pos[ Oil ] ];
|
liquid = xw.wellRates()[w*np + pu.phase_pos[ Oil ] ];
|
||||||
}
|
}
|
||||||
if (active_[ Gas ]) {
|
if ((*active_)[ Gas ]) {
|
||||||
vapour = xw.wellRates()[w*np + pu.phase_pos[ Gas ] ];
|
vapour = xw.wellRates()[w*np + pu.phase_pos[ Gas ] ];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -858,13 +866,13 @@ namespace Opm
|
|||||||
ADB liquid = ADB::constant(Vector::Zero(nw));
|
ADB liquid = ADB::constant(Vector::Zero(nw));
|
||||||
ADB vapour = ADB::constant(Vector::Zero(nw));
|
ADB vapour = ADB::constant(Vector::Zero(nw));
|
||||||
|
|
||||||
if (active_[Water]) {
|
if ((*active_)[Water]) {
|
||||||
aqua += subset(state.qs, Span(nw, 1, BlackoilPhases::Aqua*nw));
|
aqua += subset(state.qs, Span(nw, 1, BlackoilPhases::Aqua*nw));
|
||||||
}
|
}
|
||||||
if (active_[Oil]) {
|
if ((*active_)[Oil]) {
|
||||||
liquid += subset(state.qs, Span(nw, 1, BlackoilPhases::Liquid*nw));
|
liquid += subset(state.qs, Span(nw, 1, BlackoilPhases::Liquid*nw));
|
||||||
}
|
}
|
||||||
if (active_[Gas]) {
|
if ((*active_)[Gas]) {
|
||||||
vapour += subset(state.qs, Span(nw, 1, BlackoilPhases::Vapour*nw));
|
vapour += subset(state.qs, Span(nw, 1, BlackoilPhases::Vapour*nw));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1024,7 +1032,7 @@ namespace Opm
|
|||||||
if (compute_well_potentials) {
|
if (compute_well_potentials) {
|
||||||
const int nw = wells().number_of_wells;
|
const int nw = wells().number_of_wells;
|
||||||
const int np = wells().number_of_phases;
|
const int np = wells().number_of_phases;
|
||||||
const Opm::PhaseUsage& pu = fluid_.phaseUsage();
|
const Opm::PhaseUsage& pu = fluid_->phaseUsage();
|
||||||
|
|
||||||
Vector bhps = Vector::Zero(nw);
|
Vector bhps = Vector::Zero(nw);
|
||||||
for (int w = 0; w < nw; ++w) {
|
for (int w = 0; w < nw; ++w) {
|
||||||
@ -1044,13 +1052,13 @@ namespace Opm
|
|||||||
double liquid = 0.0;
|
double liquid = 0.0;
|
||||||
double vapour = 0.0;
|
double vapour = 0.0;
|
||||||
|
|
||||||
if (active_[ Water ]) {
|
if ((*active_)[ Water ]) {
|
||||||
aqua = well_state.wellRates()[w*np + pu.phase_pos[ Water ] ];
|
aqua = well_state.wellRates()[w*np + pu.phase_pos[ Water ] ];
|
||||||
}
|
}
|
||||||
if (active_[ Oil ]) {
|
if ((*active_)[ Oil ]) {
|
||||||
liquid = well_state.wellRates()[w*np + pu.phase_pos[ Oil ] ];
|
liquid = well_state.wellRates()[w*np + pu.phase_pos[ Oil ] ];
|
||||||
}
|
}
|
||||||
if (active_[ Gas ]) {
|
if ((*active_)[ Gas ]) {
|
||||||
vapour = well_state.wellRates()[w*np + pu.phase_pos[ Gas ] ];
|
vapour = well_state.wellRates()[w*np + pu.phase_pos[ Gas ] ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user