Merge pull request #4707 from svenn-t/ppcwmax

Equilibration with PPCWMAX
This commit is contained in:
Bård Skaflestad 2023-06-16 15:15:33 +02:00 committed by GitHub
commit 59e0d9904e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 11 deletions

View File

@ -544,7 +544,7 @@ private:
/// \param[in] pcow O/W capillary pressure value (Po - Pw).
///
/// \return Water saturation value.
double applySwatInit(const double pcow);
std::pair<double, bool> applySwatInit(const double pcow);
/// Derive water saturation from SWATINIT data.
///
@ -558,7 +558,7 @@ private:
///
/// \return Water saturation value. Input value, possibly mollified by
/// current set of material laws.
double applySwatInit(const double pc, const double sw);
std::pair<double, bool> applySwatInit(const double pc, const double sw);
/// Invoke material law container's capillary pressure calculator on
/// current fluid state.

View File

@ -694,9 +694,17 @@ void PhaseSaturations<MaterialLawManager, FluidSystem, Region, CellID>::deriveWa
// cell.
const auto pcow = this->press_.oil - this->press_.water;
sw = this->swatInit_.empty()
? this->invertCapPress(pcow, this->waterPos(), isIncr)
: this->applySwatInit(pcow);
if (this->swatInit_.empty()) {
sw = this->invertCapPress(pcow, this->waterPos(), isIncr);
}
else {
auto [swout, newSwatInit] = this->applySwatInit(pcow);
if (newSwatInit)
sw = this->invertCapPress(pcow, this->waterPos(), isIncr);
else {
sw = swout;
}
}
}
}
@ -718,7 +726,14 @@ fixUnphysicalTransition()
// Re-scale Pc to reflect imposed sw for vanishing oil phase. This
// seems consistent with ECLIPSE, but fails to honour SWATINIT in
// case of non-trivial gas/oil capillary pressure.
sw = this->applySwatInit(pcgw, sw);
auto [swout, newSwatInit] = this->applySwatInit(pcgw, sw);
if (newSwatInit){
const auto isIncr = false; // dPcow/dSw <= 0 for all Sw.
sw = this->invertCapPress(pcgw, this->waterPos(), isIncr);
}
else {
sw = swout;
}
}
sw = satFromSumOfPcs<FluidSystem>
@ -846,18 +861,19 @@ accountForScaledSaturations()
}
template <class MaterialLawManager, class FluidSystem, class Region, typename CellID>
double PhaseSaturations<MaterialLawManager, FluidSystem, Region, CellID>::
std::pair<double, bool>
PhaseSaturations<MaterialLawManager, FluidSystem, Region, CellID>::
applySwatInit(const double pcow)
{
return this->applySwatInit(pcow, this->swatInit_[this->evalPt_.position->cell]);
}
template <class MaterialLawManager, class FluidSystem, class Region, typename CellID>
double PhaseSaturations<MaterialLawManager, FluidSystem, Region, CellID>::
std::pair<double, bool>
PhaseSaturations<MaterialLawManager, FluidSystem, Region, CellID>::
applySwatInit(const double pcow, const double sw)
{
return this->matLawMgr_
.applySwatinit(this->evalPt_.position->cell, pcow, sw);
return this->matLawMgr_.applySwatinit(this->evalPt_.position->cell, pcow, sw);
}
template <class MaterialLawManager, class FluidSystem, class Region, typename CellID>

View File

@ -490,7 +490,6 @@ const KeywordValidation::UnsupportedKeywords& unsupportedKeywords()
{"PLYATEMP", {true, std::nullopt}},
{"PLYCAMAX", {true, std::nullopt}},
{"PLYDHFLF", {true, std::nullopt}},
{"PPCWMAX", {true, std::nullopt}},
{"PRORDER", {true, std::nullopt}},
{"PRVD", {true, std::nullopt}},
{"PVTGWO", {true, std::nullopt}},

View File

@ -509,6 +509,13 @@ add_test_compareECLFiles(CASENAME co2store
REL_TOL ${rel_tol}
DIR co2store)
add_test_compareECLFiles(CASENAME ppcwmax
FILENAME PPCWMAX-01
SIMULATOR flow
ABS_TOL ${abs_tol}
REL_TOL ${rel_tol}
DIR ppcwmax)
add_test_compareECLFiles(CASENAME co2store_diffusive
FILENAME CO2STORE_DIFFUSIVE
SIMULATOR flow