Initial integration of VFP

This commit is contained in:
babrodtk
2015-08-19 13:10:48 +02:00
parent 24f91aa248
commit f320b04c4d
9 changed files with 168 additions and 31 deletions
+39 -7
View File
@@ -452,6 +452,8 @@ namespace Opm
ok = append_well_controls(SURFACE_RATE,
injectionProperties.surfaceInjectionRate,
-1e100,
-1e100,
distr,
well_index,
w_);
@@ -472,6 +474,8 @@ namespace Opm
ok = append_well_controls(RESERVOIR_RATE,
injectionProperties.reservoirInjectionRate,
-1e100,
-1e100,
distr,
well_index,
w_);
@@ -481,14 +485,16 @@ namespace Opm
control_pos[WellsManagerDetail::InjectionControl::BHP] = well_controls_get_num(w_->ctrls[well_index]);
control_pos[WellsManagerDetail::InjectionControl::BHP] = well_controls_get_num(w_->ctrls[well_index]);
ok = append_well_controls(BHP,
injectionProperties.BHPLimit,
injectionProperties.BHPLimit,
-1e100,
-1e100,
NULL,
well_index,
w_);
}
if (ok && injectionProperties.hasInjectionControl(WellInjector::THP)) {
OPM_THROW(std::runtime_error, "We cannot handle THP limit for well " << well_names[well_index]);
OPM_THROW(std::runtime_error, "We cannot handle THP limit for injecting well " << well_names[well_index]);
}
if (!ok) {
@@ -548,7 +554,9 @@ namespace Opm
double distr[3] = { 0.0, 0.0, 0.0 };
distr[phaseUsage.phase_pos[BlackoilPhases::Liquid]] = 1.0;
ok = append_well_controls(SURFACE_RATE,
-productionProperties.OilRate,
-productionProperties.OilRate,
-1e100,
-1e100,
distr,
well_index,
w_);
@@ -563,6 +571,8 @@ namespace Opm
distr[phaseUsage.phase_pos[BlackoilPhases::Aqua]] = 1.0;
ok = append_well_controls(SURFACE_RATE,
-productionProperties.WaterRate,
-1e100,
-1e100,
distr,
well_index,
w_);
@@ -577,6 +587,8 @@ namespace Opm
distr[phaseUsage.phase_pos[BlackoilPhases::Vapour]] = 1.0;
ok = append_well_controls(SURFACE_RATE,
-productionProperties.GasRate,
-1e100,
-1e100,
distr,
well_index,
w_);
@@ -595,6 +607,8 @@ namespace Opm
distr[phaseUsage.phase_pos[BlackoilPhases::Liquid]] = 1.0;
ok = append_well_controls(SURFACE_RATE,
-productionProperties.LiquidRate ,
-1e100,
-1e100,
distr,
well_index,
w_);
@@ -605,11 +619,31 @@ namespace Opm
double distr[3] = { 1.0, 1.0, 1.0 };
ok = append_well_controls(RESERVOIR_RATE,
-productionProperties.ResVRate ,
-1e100,
-1e100,
distr,
well_index,
w_);
}
if (ok && productionProperties.hasProductionControl(WellProducer::THP)) {
const bool has_explicit_limit = productionProperties.hasProductionControl(WellProducer::THP);
if (!has_explicit_limit) {
OPM_THROW(std::runtime_error, "THP specified, but no target THP supplied for well " << well_names[well_index]);
}
const double thp_limit = productionProperties.THPLimit;
const double alq_value = productionProperties.ALQValue;
const int vfp_number = productionProperties.VFPTableNumber;
control_pos[WellsManagerDetail::ProductionControl::THP] = well_controls_get_num(w_->ctrls[well_index]);
ok = append_well_controls(THP,
thp_limit,
alq_value,
vfp_number,
NULL,
well_index,
w_);
}
if (ok) {
// Always append a BHP control.
// If no explicit BHP control given, use a 1 atm control.
@@ -618,15 +652,13 @@ namespace Opm
control_pos[WellsManagerDetail::ProductionControl::BHP] = well_controls_get_num(w_->ctrls[well_index]);
ok = append_well_controls(BHP,
bhp_limit,
-1e100,
-1e100,
NULL,
well_index,
w_);
}
if (ok && productionProperties.hasProductionControl(WellProducer::THP)) {
OPM_THROW(std::runtime_error, "We cannot handle THP limit for well " << well_names[well_index]);
}
if (!ok) {
OPM_THROW(std::runtime_error, "Failure occured appending controls for well " << well_names[well_index]);
}