implement rsrv item 10 WCONINJE

MSW not supported yet
This commit is contained in:
Tor Harald Sandve
2022-04-21 11:03:11 +02:00
parent 147fe77779
commit 1f876d1800
5 changed files with 32 additions and 5 deletions

View File

@@ -718,7 +718,16 @@ namespace Opm
switch(current) {
case Well::InjectorCMode::RATE:
{
ws.surface_rates[phasePos] = controls.surface_rate;
ws.surface_rates[phasePos] = (1.0 - this->rsRvInj()) * controls.surface_rate;
if(this->rsRvInj() > 0) {
if (injectorType == InjectorType::OIL && FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx)) {
ws.surface_rates[pu.phase_pos[BlackoilPhases::Vapour]] = controls.surface_rate * this->rsRvInj();
} else if (injectorType == InjectorType::GAS && FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx)) {
ws.surface_rates[pu.phase_pos[BlackoilPhases::Liquid]] = controls.surface_rate * this->rsRvInj();
} else {
OPM_DEFLOG_THROW(std::runtime_error, "Expected OIL or GAS as type for injectors when RS/RV (item 10) is non-zero " + this->name(), deferred_logger );
}
}
break;
}