mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #2235 from totto82/wellEffFix
Fix bug in the well efficiency factor
This commit is contained in:
commit
c14a991b25
@ -1806,7 +1806,7 @@ namespace Opm
|
|||||||
switch(current) {
|
switch(current) {
|
||||||
case Well::InjectorCMode::RATE:
|
case Well::InjectorCMode::RATE:
|
||||||
{
|
{
|
||||||
control_eq = getSegmentGTotal(0) * efficiencyFactor / scaling - controls.surface_rate;
|
control_eq = getSegmentGTotal(0) / scaling - controls.surface_rate;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1838,7 +1838,7 @@ namespace Opm
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
control_eq = coeff*getSegmentGTotal(0)*efficiencyFactor / scaling - controls.reservoir_rate;
|
control_eq = coeff*getSegmentGTotal(0) / scaling - controls.reservoir_rate;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1892,21 +1892,21 @@ namespace Opm
|
|||||||
{
|
{
|
||||||
assert(FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx));
|
assert(FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx));
|
||||||
const EvalWell& rate = -getSegmentRate(0, Indices::canonicalToActiveComponentIndex(FluidSystem::oilCompIdx));
|
const EvalWell& rate = -getSegmentRate(0, Indices::canonicalToActiveComponentIndex(FluidSystem::oilCompIdx));
|
||||||
control_eq = rate * efficiencyFactor - controls.oil_rate;
|
control_eq = rate - controls.oil_rate;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Well::ProducerCMode::WRAT:
|
case Well::ProducerCMode::WRAT:
|
||||||
{
|
{
|
||||||
assert(FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx));
|
assert(FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx));
|
||||||
const EvalWell& rate = -getSegmentRate(0, Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx));
|
const EvalWell& rate = -getSegmentRate(0, Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx));
|
||||||
control_eq = rate * efficiencyFactor - controls.water_rate;
|
control_eq = rate - controls.water_rate;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Well::ProducerCMode::GRAT:
|
case Well::ProducerCMode::GRAT:
|
||||||
{
|
{
|
||||||
assert(FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx));
|
assert(FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx));
|
||||||
const EvalWell& rate = -getSegmentRate(0, Indices::canonicalToActiveComponentIndex(FluidSystem::gasCompIdx));
|
const EvalWell& rate = -getSegmentRate(0, Indices::canonicalToActiveComponentIndex(FluidSystem::gasCompIdx));
|
||||||
control_eq = rate * efficiencyFactor - controls.gas_rate;
|
control_eq = rate - controls.gas_rate;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1916,7 +1916,7 @@ namespace Opm
|
|||||||
assert(FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx));
|
assert(FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx));
|
||||||
EvalWell rate = -getSegmentRate(0, Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx))
|
EvalWell rate = -getSegmentRate(0, Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx))
|
||||||
-getSegmentRate(0, Indices::canonicalToActiveComponentIndex(FluidSystem::oilCompIdx));
|
-getSegmentRate(0, Indices::canonicalToActiveComponentIndex(FluidSystem::oilCompIdx));
|
||||||
control_eq = rate * efficiencyFactor - controls.liquid_rate;
|
control_eq = rate - controls.liquid_rate;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Well::ProducerCMode::CRAT:
|
case Well::ProducerCMode::CRAT:
|
||||||
@ -1949,7 +1949,7 @@ namespace Opm
|
|||||||
std::vector<double> hrates_resv(number_of_phases_,0.);
|
std::vector<double> hrates_resv(number_of_phases_,0.);
|
||||||
Base::rateConverter_.calcReservoirVoidageRates(/*fipreg*/ 0, Base::pvtRegionIdx_, hrates, hrates_resv);
|
Base::rateConverter_.calcReservoirVoidageRates(/*fipreg*/ 0, Base::pvtRegionIdx_, hrates, hrates_resv);
|
||||||
double target = -std::accumulate(hrates_resv.begin(), hrates_resv.end(), 0.0);
|
double target = -std::accumulate(hrates_resv.begin(), hrates_resv.end(), 0.0);
|
||||||
control_eq = total_rate * efficiencyFactor - target;
|
control_eq = total_rate - target;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -769,7 +769,7 @@ namespace Opm
|
|||||||
switch(current) {
|
switch(current) {
|
||||||
case Well::InjectorCMode::RATE:
|
case Well::InjectorCMode::RATE:
|
||||||
{
|
{
|
||||||
control_eq = getWQTotal() * efficiencyFactor - controls.surface_rate;
|
control_eq = getWQTotal() - controls.surface_rate;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -803,7 +803,7 @@ namespace Opm
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
control_eq = coeff*getWQTotal()*efficiencyFactor - controls.reservoir_rate;
|
control_eq = coeff*getWQTotal() - controls.reservoir_rate;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -854,21 +854,21 @@ namespace Opm
|
|||||||
{
|
{
|
||||||
assert(FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx));
|
assert(FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx));
|
||||||
EvalWell rate = -getQs(Indices::canonicalToActiveComponentIndex(FluidSystem::oilCompIdx));
|
EvalWell rate = -getQs(Indices::canonicalToActiveComponentIndex(FluidSystem::oilCompIdx));
|
||||||
control_eq = rate * efficiencyFactor - controls.oil_rate;
|
control_eq = rate - controls.oil_rate;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Well::ProducerCMode::WRAT:
|
case Well::ProducerCMode::WRAT:
|
||||||
{
|
{
|
||||||
assert(FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx));
|
assert(FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx));
|
||||||
EvalWell rate = -getQs(Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx));
|
EvalWell rate = -getQs(Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx));
|
||||||
control_eq = rate * efficiencyFactor - controls.water_rate;
|
control_eq = rate - controls.water_rate;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Well::ProducerCMode::GRAT:
|
case Well::ProducerCMode::GRAT:
|
||||||
{
|
{
|
||||||
assert(FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx));
|
assert(FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx));
|
||||||
EvalWell rate = -getQs(Indices::canonicalToActiveComponentIndex(FluidSystem::gasCompIdx));
|
EvalWell rate = -getQs(Indices::canonicalToActiveComponentIndex(FluidSystem::gasCompIdx));
|
||||||
control_eq = rate * efficiencyFactor - controls.gas_rate;
|
control_eq = rate - controls.gas_rate;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -878,7 +878,7 @@ namespace Opm
|
|||||||
assert(FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx));
|
assert(FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx));
|
||||||
EvalWell rate = -getQs(Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx))
|
EvalWell rate = -getQs(Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx))
|
||||||
- getQs(Indices::canonicalToActiveComponentIndex(FluidSystem::oilCompIdx));
|
- getQs(Indices::canonicalToActiveComponentIndex(FluidSystem::oilCompIdx));
|
||||||
control_eq = rate * efficiencyFactor - controls.liquid_rate;
|
control_eq = rate - controls.liquid_rate;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Well::ProducerCMode::CRAT:
|
case Well::ProducerCMode::CRAT:
|
||||||
@ -911,7 +911,7 @@ namespace Opm
|
|||||||
std::vector<double> hrates_resv(number_of_phases_,0.);
|
std::vector<double> hrates_resv(number_of_phases_,0.);
|
||||||
Base::rateConverter_.calcReservoirVoidageRates(/*fipreg*/ 0, Base::pvtRegionIdx_, hrates, hrates_resv);
|
Base::rateConverter_.calcReservoirVoidageRates(/*fipreg*/ 0, Base::pvtRegionIdx_, hrates, hrates_resv);
|
||||||
double target = std::accumulate(hrates_resv.begin(), hrates_resv.end(), 0.0);
|
double target = std::accumulate(hrates_resv.begin(), hrates_resv.end(), 0.0);
|
||||||
control_eq = total_rate * efficiencyFactor - target;
|
control_eq = total_rate - target;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user