Merge pull request #3774 from plgbrts/expli-salt

allow for explicit initialization of SALT and SALTP
This commit is contained in:
Markus Blatt 2022-02-11 14:35:57 +01:00 committed by GitHub
commit a520733d5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 1 deletions

View File

@ -2573,6 +2573,8 @@ private:
bool has_rs = fp.has_double("RS");
bool has_rv = fp.has_double("RV");
bool has_pressure = fp.has_double("PRESSURE");
bool has_salt = fp.has_double("SALT");
bool has_saltp = fp.has_double("SALTP");
// make sure all required quantities are enables
if (Indices::numPhases > 1) {
@ -2592,6 +2594,12 @@ private:
if (FluidSystem::enableVaporizedOil() && !has_rv)
throw std::runtime_error("The ECL input file requires the RV keyword to be present if"
" vaporized oil is enabled");
if (enableBrine && !has_salt)
throw std::runtime_error("The ECL input file requires the SALT keyword to be present if"
" brine is enabled and the model is initialized explicitly");
if (enableSaltPrecipitation && !has_saltp)
throw std::runtime_error("The ECL input file requires the SALTP keyword to be present if"
" salt precipitation is enabled and the model is initialized explicitly");
size_t numDof = this->model().numGridDof();
@ -2603,6 +2611,8 @@ private:
std::vector<double> rsData;
std::vector<double> rvData;
std::vector<double> tempiData;
std::vector<double> saltData;
std::vector<double> saltpData;
if (FluidSystem::phaseIsActive(waterPhaseIdx) && Indices::numPhases > 1)
waterSaturationData = fp.get_double("SWAT");
@ -2624,6 +2634,14 @@ private:
// initial reservoir temperature
tempiData = fp.get_double("TEMPI");
// initial salt concentration data
if (enableBrine)
saltData = fp.get_double("SALT");
// initial precipitated salt saturation data
if (enableSaltPrecipitation)
saltpData = fp.get_double("SALTP");
// calculate the initial fluid states
for (size_t dofIdx = 0; dofIdx < numDof; ++dofIdx) {
auto& dofFluidState = initialFluidStates_[dofIdx];
@ -2638,6 +2656,18 @@ private:
temperatureLoc = FluidSystem::surfaceTemperature;
dofFluidState.setTemperature(temperatureLoc);
//////
// set salt concentration
//////
if (enableBrine)
dofFluidState.setSaltConcentration(saltData[dofIdx]);
//////
// set precipitated salt saturation
//////
if (enableSaltPrecipitation)
dofFluidState.setSaltSaturation(saltpData[dofIdx]);
//////
// set saturations
//////

View File

@ -555,7 +555,6 @@ const KeywordValidation::UnsupportedKeywords& unsupportedKeywords()
{"SKIP", {false, std::nullopt}},
{"SKIP100", {false, std::nullopt}},
{"SKIP300", {false, std::nullopt}},
{"SALT", {false, std::nullopt}},
{"SALTNODE", {false, std::nullopt}},
{"SALTREST", {false, std::nullopt}},
{"SCALELIM", {false, std::nullopt}},