This commit is contained in:
Markus Blatt 2012-10-11 11:25:25 +02:00
commit 230c6320eb
3 changed files with 8 additions and 6 deletions

View File

@ -62,7 +62,7 @@ namespace Opm
/// \return Array of P viscosity values. /// \return Array of P viscosity values.
virtual const double* viscosity() const = 0; virtual const double* viscosity() const = 0;
/// Densities of fluid phases at surface conditions. /// Densities of fluid phases at reservoir conditions.
/// \return Array of P density values. /// \return Array of P density values.
virtual const double* density() const = 0; virtual const double* density() const = 0;

View File

@ -553,6 +553,7 @@ namespace Opm
{ {
const int np = wells.number_of_phases; const int np = wells.number_of_phases;
const int nw = wells.number_of_wells; const int nw = wells.number_of_wells;
ASSERT(int(flow_rates_per_well_cell.size()) == wells.well_connpos[nw]);
phase_flow_per_well.resize(nw * np); phase_flow_per_well.resize(nw * np);
for (int wix = 0; wix < nw; ++wix) { for (int wix = 0; wix < nw; ++wix) {
for (int phase = 0; phase < np; ++phase) { for (int phase = 0; phase < np; ++phase) {

View File

@ -572,6 +572,7 @@ namespace Opm
break; break;
} }
const double total_produced = getTotalProductionFlow(well_surfacerates_phase, phase); const double total_produced = getTotalProductionFlow(well_surfacerates_phase, phase);
const double total_reinjected = - total_produced; // Production negative, injection positive
const double my_guide_rate = injectionGuideRate(true); const double my_guide_rate = injectionGuideRate(true);
for (size_t i = 0; i < children_.size(); ++i) { for (size_t i = 0; i < children_.size(); ++i) {
// Apply for all children. // Apply for all children.
@ -580,11 +581,11 @@ namespace Opm
const double children_guide_rate = children_[i]->injectionGuideRate(true); const double children_guide_rate = children_[i]->injectionGuideRate(true);
#ifdef DIRTY_WELLCTRL_HACK #ifdef DIRTY_WELLCTRL_HACK
children_[i]->applyInjGroupControl(InjectionSpecification::RESV, children_[i]->applyInjGroupControl(InjectionSpecification::RESV,
(children_guide_rate / my_guide_rate) * total_produced * injSpec().reinjection_fraction_target_, (children_guide_rate / my_guide_rate) * total_reinjected * injSpec().reinjection_fraction_target_,
false); false);
#else #else
children_[i]->applyInjGroupControl(InjectionSpecification::RATE, children_[i]->applyInjGroupControl(InjectionSpecification::RATE,
(children_guide_rate / my_guide_rate) * total_produced * injSpec().reinjection_fraction_target_, (children_guide_rate / my_guide_rate) * total_reinjected * injSpec().reinjection_fraction_target_,
false); false);
#endif #endif
} }
@ -600,15 +601,15 @@ namespace Opm
if (phaseUsage().phase_used[BlackoilPhases::Vapour]) { if (phaseUsage().phase_used[BlackoilPhases::Vapour]) {
total_produced += getTotalProductionFlow(well_reservoirrates_phase, BlackoilPhases::Vapour); total_produced += getTotalProductionFlow(well_reservoirrates_phase, BlackoilPhases::Vapour);
} }
const double total_reinjected = - total_produced; // Production negative, injection positive
const double my_guide_rate = injectionGuideRate(true); const double my_guide_rate = injectionGuideRate(true);
for (size_t i = 0; i < children_.size(); ++i) { for (size_t i = 0; i < children_.size(); ++i) {
// Apply for all children. // Apply for all children.
// Note, we do _not_ want to call the applyProdGroupControl in this object, // Note, we do _not_ want to call the applyProdGroupControl in this object,
// as that would check if we're under group control, something we're not. // as that would check if we're under group control, something we're not.
const double children_guide_rate = children_[i]->injectionGuideRate(true); const double children_guide_rate = children_[i]->injectionGuideRate(true);
children_[i]->applyInjGroupControl(InjectionSpecification::RESV, children_[i]->applyInjGroupControl(InjectionSpecification::RESV,
(children_guide_rate / my_guide_rate) * total_produced * injSpec().voidage_replacment_fraction_, (children_guide_rate / my_guide_rate) * total_reinjected * injSpec().voidage_replacment_fraction_,
false); false);
} }