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

View File

@ -55,7 +55,8 @@ namespace Opm {
predictionMode(true), predictionMode(true),
injectionControls(0), injectionControls(0),
injectorType(InjectorType::WATER), injectorType(InjectorType::WATER),
controlMode(InjectorCMode::CMODE_UNDEFINED) controlMode(InjectorCMode::CMODE_UNDEFINED),
rsRvInj(0.0)
{ {
} }
@ -77,6 +78,7 @@ namespace Opm {
result.injectionControls = 10; result.injectionControls = 10;
result.injectorType = InjectorType::OIL; result.injectorType = InjectorType::OIL;
result.controlMode = InjectorCMode::BHP; result.controlMode = InjectorCMode::BHP;
result.rsRvInj = 11;
return result; return result;
} }
@ -130,6 +132,12 @@ namespace Opm {
throw std::invalid_argument("Tried to set invalid control: " + cmodeString + " for well: " + well_name); 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) { if (VFPTableNumberArg > 0) {
this->VFPTableNumber = VFPTableNumberArg; 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 { bool Well::WellInjectionProperties::operator==(const Well::WellInjectionProperties& other) const {
@ -236,7 +250,8 @@ namespace Opm {
(predictionMode == other.predictionMode) && (predictionMode == other.predictionMode) &&
(injectionControls == other.injectionControls) && (injectionControls == other.injectionControls) &&
(injectorType == other.injectorType) && (injectorType == other.injectorType) &&
(controlMode == other.controlMode)) (controlMode == other.controlMode) &&
(rsRvInj == other.rsRvInj))
return true; return true;
else else
return false; return false;
@ -275,7 +290,8 @@ namespace Opm {
<< "prediction mode: " << wp.predictionMode << ", " << "prediction mode: " << wp.predictionMode << ", "
<< "injection ctrl: " << wp.injectionControls << ", " << "injection ctrl: " << wp.injectionControls << ", "
<< "injector type: " << InjectorType2String(wp.injectorType) << ", " << "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.cmode = this->controlMode;
controls.vfp_table_number = this->VFPTableNumber; controls.vfp_table_number = this->VFPTableNumber;
controls.injector_type = this->injectorType; controls.injector_type = this->injectorType;
controls.rs_rv_inj = this->rsRvInj;
return controls; return controls;
} }

View File

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

View File

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