Merge pull request #2999 from totto82/rsrvinj

implement item 10 WCONINJE
This commit is contained in:
Tor Harald Sandve 2022-06-16 08:30:20 +02:00 committed by GitHub
commit fae7b5ccfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 3 deletions

View File

@ -231,6 +231,7 @@ public:
double temperature;
int vfp_table_number;
bool prediction_mode;
double rs_rv_inj;
bool hasControl(InjectorCMode cmode_arg) const {
return (this->controls & static_cast<int>(cmode_arg)) != 0;
@ -261,6 +262,8 @@ public:
InjectorType injectorType;
InjectorCMode controlMode;
double rsRvInj;
bool operator==(const WellInjectionProperties& other) const;
bool operator!=(const WellInjectionProperties& other) const;
@ -320,6 +323,7 @@ public:
serializer(injectionControls);
serializer(injectorType);
serializer(controlMode);
serializer(rsRvInj);
}
};

View File

@ -55,7 +55,8 @@ namespace Opm {
predictionMode(true),
injectionControls(0),
injectorType(InjectorType::WATER),
controlMode(InjectorCMode::CMODE_UNDEFINED)
controlMode(InjectorCMode::CMODE_UNDEFINED),
rsRvInj(0.0)
{
}
@ -77,6 +78,7 @@ namespace Opm {
result.injectionControls = 10;
result.injectorType = InjectorType::OIL;
result.controlMode = InjectorCMode::BHP;
result.rsRvInj = 11;
return result;
}
@ -130,6 +132,12 @@ namespace Opm {
throw std::invalid_argument("Tried to set invalid control: " + cmodeString + " for well: " + well_name);
}
}
this->rsRvInj = record.getItem("VAPOIL_C").getSIDouble(0);
if (this->injectorType == InjectorType::OIL && this->rsRvInj > 0) {
double factor = record.getItem("VAPOIL_C").getSIDouble(0) / record.getItem("VAPOIL_C").get<double>(0);
// for oil injectors the rsRvInj is Rs and the inverse of the si-conversion factor should be used
this->rsRvInj = record.getItem("VAPOIL_C").get<double>(0) / factor;
}
}
@ -220,6 +228,12 @@ namespace Opm {
if (VFPTableNumberArg > 0) {
this->VFPTableNumber = VFPTableNumberArg;
}
this->rsRvInj = record.getItem("VAPOIL_C").getSIDouble(0);
if (this->injectorType == InjectorType::OIL && this->rsRvInj > 0) {
double factor = record.getItem("VAPOIL_C").getSIDouble(0) / record.getItem("VAPOIL_C").get<double>(0);
// for oil injectors the rsRvInj is Rs and the inverse of the si-conversion factor should be used
this->rsRvInj = record.getItem("VAPOIL_C").get<double>(0) / factor;
}
}
bool Well::WellInjectionProperties::operator==(const Well::WellInjectionProperties& other) const {
@ -236,7 +250,8 @@ namespace Opm {
(predictionMode == other.predictionMode) &&
(injectionControls == other.injectionControls) &&
(injectorType == other.injectorType) &&
(controlMode == other.controlMode))
(controlMode == other.controlMode) &&
(rsRvInj == other.rsRvInj))
return true;
else
return false;
@ -275,7 +290,8 @@ namespace Opm {
<< "prediction mode: " << wp.predictionMode << ", "
<< "injection ctrl: " << wp.injectionControls << ", "
<< "injector type: " << InjectorType2String(wp.injectorType) << ", "
<< "control mode: " << Well::InjectorCMode2String(wp.controlMode) << " }";
<< "control mode: " << Well::InjectorCMode2String(wp.controlMode) << " , "
<< "rs/rv concentration: " << wp.rsRvInj << " }";
}
@ -296,6 +312,7 @@ namespace Opm {
controls.cmode = this->controlMode;
controls.vfp_table_number = this->VFPTableNumber;
controls.injector_type = this->injectorType;
controls.rs_rv_inj = this->rsRvInj;
return controls;
}

View File

@ -60,6 +60,7 @@
"name": "VAPOIL_C",
"value_type": "DOUBLE",
"default": 0,
"dimension": "OilDissolutionFactor",
"comment": "Not supported"
},
{

View File

@ -49,6 +49,7 @@
"name": "VAPOIL_C",
"value_type": "DOUBLE",
"default": 0,
"dimension": "OilDissolutionFactor",
"comment": "Not supported"
},
{