Made it possible to use group control without gconprod keyword

This commit is contained in:
Kjetil Olsen Lye 2012-04-16 15:26:33 +02:00
parent 29ebfac858
commit bc72ea9a44
3 changed files with 21 additions and 6 deletions

View File

@ -11,7 +11,7 @@ namespace Opm
water_production_target_(1e100),
fluid_volume_max_rate_(1e100),
BHP_limit_(1e100),
guide_rate_(1e100)
guide_rate_(1)
{
}

View File

@ -156,7 +156,6 @@ namespace Opm
if(well_rate[index_of_well] - rate_target > epsilon) {
std::cout << "well_rate not met" << std::endl;
std::cout << "target = " << rate_target << ", well_rate[index_of_well] = " << well_rate[index_of_well] << std::endl;
std::cout << injSpec().fluid_volume_max_rate_ << std::endl;
std::cout << "Group name = " << name() << std::endl;
return false;
}
@ -212,7 +211,17 @@ namespace Opm
rate_diff = std::abs(rate_diff);
break;
}
if(bhp_diff > epsilon || rate_diff > epsilon) {
if(bhp_diff > epsilon) {
std::cout << "BHP exceeded, bhp_diff = " << bhp_diff << std::endl;
std::cout << "BHP_limit = " << prodSpec().BHP_limit_ << std::endl;
std::cout << "BHP = " << well_bhp[self_index_] << std::endl;
return false;
}
if(rate_diff > epsilon) {
std::cout << "Rate exceeded, rate_diff = " << rate_diff << std::endl;
return false;
}
} else {
@ -227,7 +236,12 @@ namespace Opm
break;
}
if(bhp_diff > epsilon || flow_diff > epsilon) {
if(bhp_diff > epsilon) {
std::cout << "BHP exceeded, bhp_diff = " << bhp_diff<<std::endl;
return false;
}
if(flow_diff > epsilon) {
std::cout << "Flow diff exceeded, flow_diff = " << flow_diff << std::endl;
return false;
}

View File

@ -512,12 +512,13 @@ namespace Opm
well_collection_.getLeafNodes()[index]->prodSpec().guide_rate_type_
= lines[i].phase_ == "OIL" ? ProductionSpecification::OIL : ProductionSpecification::RAT;
}
}
well_collection_.calculateGuideRates();
// Apply guide rates:
for (size_t i = 0; i < well_data.size(); i++) {
if (well_collection_.getLeafNodes()[i]->prodSpec().control_mode_ == ProductionSpecification::GRUP) {
std::cout << "hello" << std::endl;
if (well_collection_.getLeafNodes()[i]->prodSpec().guide_rate_type_ == ProductionSpecification::OIL) {
well_data[i].control = RATE;
@ -538,7 +539,7 @@ namespace Opm
}
}
}
// Set up the Wells struct.
w_ = wells_create(num_wells, num_perfs);