Merge pull request #851 from joakim-hove/uda-wconprod-resv
Use UDA for WCONPROD::RESV
This commit is contained in:
commit
a4b9b0d460
@ -603,7 +603,7 @@ inline quantity res_vol_production_target( const fn_args& args ) {
|
||||
double sum = 0.0;
|
||||
for( const Well2& sched_well : args.schedule_wells )
|
||||
if (sched_well.getProductionProperties().predictionMode)
|
||||
sum += sched_well.getProductionProperties().ResVRate;
|
||||
sum += sched_well.getProductionProperties().ResVRate.get<double>();
|
||||
|
||||
return { sum, measure::rate };
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ namespace Opm {
|
||||
this->ALQValue = record.getItem("ALQ" ).get< double >(0); //NOTE: Unit of ALQ is never touched
|
||||
this->VFPTableNumber = record.getItem("VFP_TABLE").get< int >(0);
|
||||
this->LiquidRate = record.getItem("LRAT").getSIDouble(0);
|
||||
this->ResVRate = record.getItem("RESV").getSIDouble(0);
|
||||
this->ResVRate = record.getItem("RESV").get<UDAValue>(0);
|
||||
|
||||
namespace wp = WellProducer;
|
||||
using mode = std::pair< const std::string, wp::ControlModeEnum >;
|
||||
@ -158,7 +158,7 @@ namespace Opm {
|
||||
{
|
||||
this->init_rates(record);
|
||||
this->LiquidRate = 0;
|
||||
this->ResVRate = 0;
|
||||
this->ResVRate.reset(0);
|
||||
|
||||
// when the well is switching to history matching producer from prediction mode
|
||||
// or switching from injector to producer
|
||||
@ -189,7 +189,8 @@ namespace Opm {
|
||||
this->LiquidRate = newValue * siFactorL;
|
||||
}
|
||||
else if (cmode == WellTarget::RESV){
|
||||
this->ResVRate = newValue * siFactorL;
|
||||
this->ResVRate.assert_numeric("Can not combine UDA and WELTARG");
|
||||
this->ResVRate.reset( newValue * siFactorL );
|
||||
}
|
||||
else if (cmode == WellTarget::BHP){
|
||||
this->BHPLimit = newValue * siFactorP;
|
||||
@ -279,9 +280,9 @@ namespace Opm {
|
||||
controls.water_rate = this->WaterRate;
|
||||
controls.gas_rate = this->GasRate;
|
||||
controls.liquid_rate = this->LiquidRate;
|
||||
controls.resv_rate = this->ResVRate;
|
||||
controls.bhp_limit = this->BHPLimit;
|
||||
controls.thp_limit= this->THPLimit;
|
||||
controls.resv_rate = UDA::eval_well_uda(this->ResVRate, this->name, st, udq_undefined);
|
||||
controls.bhp_history = this->BHPH;
|
||||
controls.thp_history = this->THPH;
|
||||
controls.vfp_table_number = this->VFPTableNumber;
|
||||
|
@ -42,7 +42,7 @@ namespace Opm {
|
||||
double WaterRate = 0.0;
|
||||
double GasRate = 0.0;
|
||||
double LiquidRate = 0.0;
|
||||
double ResVRate = 0.0;
|
||||
UDAValue ResVRate;
|
||||
// BHP and THP limit
|
||||
double BHPLimit = 0.0;
|
||||
double THPLimit = 0.0;
|
||||
|
@ -6,7 +6,7 @@
|
||||
{"name" : "WRAT" , "value_type" : "DOUBLE" , "default" : 0.0 , "dimension" : "LiquidSurfaceVolume/Time"},
|
||||
{"name" : "GRAT" , "value_type" : "DOUBLE" , "default" : 0.0 , "dimension" : "GasSurfaceVolume/Time"},
|
||||
{"name" : "LRAT" , "value_type" : "DOUBLE" , "default" : 0.0 , "dimension" : "LiquidSurfaceVolume/Time"},
|
||||
{"name" : "RESV" , "value_type" : "DOUBLE" , "default" : 0.0 , "dimension" : "LiquidSurfaceVolume/Time"},
|
||||
{"name" : "RESV" , "value_type" : "UDA" , "default" : 0.0 , "dimension" : "LiquidSurfaceVolume/Time"},
|
||||
{"name" : "BHP" , "value_type" : "DOUBLE" , "default" : 1.01325 , "dimension" : "Pressure"},
|
||||
{"name" : "THP" , "value_type" : "DOUBLE" , "default" : 0.0 , "dimension" : "Pressure"},
|
||||
{"name" : "VFP_TABLE" , "value_type" : "INT" , "default" : 0 },
|
||||
|
@ -962,9 +962,9 @@ BOOST_AUTO_TEST_CASE(createDeckWithWeltArg) {
|
||||
BOOST_CHECK_EQUAL(wpp_2.WaterRate, 1400 * siFactorL);
|
||||
BOOST_CHECK_EQUAL(wpp_2.GasRate, 1500.52 * siFactorG);
|
||||
BOOST_CHECK_EQUAL(wpp_2.LiquidRate, 1600.58 * siFactorL);
|
||||
BOOST_CHECK_EQUAL(wpp_2.ResVRate, 1801.05 * siFactorL);
|
||||
BOOST_CHECK_EQUAL(wpp_2.BHPLimit, 1900 * siFactorP);
|
||||
BOOST_CHECK_EQUAL(wpp_2.THPLimit, 2000 * siFactorP);
|
||||
BOOST_CHECK_EQUAL(wpp_2.ResVRate.get<double>(), 1801.05 * siFactorL);
|
||||
BOOST_CHECK_EQUAL(wpp_2.VFPTableNumber, 2100);
|
||||
BOOST_CHECK_EQUAL(well_2.getGuideRate(), 2300.14);
|
||||
}
|
||||
|
@ -317,7 +317,7 @@ BOOST_AUTO_TEST_CASE(WellHaveProductionControlLimit) {
|
||||
BOOST_CHECK( !well.getProductionProperties().hasProductionControl( Opm::WellProducer::RESV ));
|
||||
|
||||
auto properties2 = std::make_shared<Opm::WellProductionProperties>(well.getProductionProperties());
|
||||
properties2->ResVRate = 100;
|
||||
properties2->ResVRate.reset( 100 );
|
||||
properties2->addProductionControl(Opm::WellProducer::RESV);
|
||||
well.updateProduction(properties2);
|
||||
BOOST_CHECK( well.getProductionProperties().hasProductionControl( Opm::WellProducer::RESV ));
|
||||
@ -327,9 +327,9 @@ BOOST_AUTO_TEST_CASE(WellHaveProductionControlLimit) {
|
||||
properties3->WaterRate = 100;
|
||||
properties3->GasRate = 100;
|
||||
properties3->LiquidRate = 100;
|
||||
properties3->ResVRate = 100;
|
||||
properties3->BHPLimit = 100;
|
||||
properties3->THPLimit = 100;
|
||||
properties3->ResVRate.reset(100);
|
||||
properties3->addProductionControl(Opm::WellProducer::ORAT);
|
||||
properties3->addProductionControl(Opm::WellProducer::LRAT);
|
||||
properties3->addProductionControl(Opm::WellProducer::BHP);
|
||||
|
@ -145,8 +145,8 @@ BOOST_AUTO_TEST_CASE(WellTesting) {
|
||||
BOOST_CHECK(sched.hasWell("W_2"));
|
||||
BOOST_CHECK(sched.hasWell("W_3"));
|
||||
|
||||
BOOST_CHECK_CLOSE( 777/Metric::Time , sched.getWell2("W_2", 7).getProductionProperties().ResVRate , 0.0001);
|
||||
BOOST_CHECK_EQUAL( 0 , sched.getWell2("W_2", 8).getProductionProperties().ResVRate);
|
||||
BOOST_CHECK_CLOSE( 777/Metric::Time , sched.getWell2("W_2", 7).getProductionProperties().ResVRate.get<double>() , 0.0001);
|
||||
BOOST_CHECK_EQUAL( 0 , sched.getWell2("W_2", 8).getProductionProperties().ResVRate.get<double>());
|
||||
|
||||
BOOST_CHECK_EQUAL( WellCommon::SHUT , sched.getWell2("W_2", 3).getStatus());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user