Use init. pres. with ROCK and ROCKTAB if ROCKOPTS item 2 = STORE.

OVERBURD keyword will be ignored if STORE is activated.
This commit is contained in:
Svenn Tveit 2024-12-05 12:58:13 +01:00
parent dc19f2d47f
commit b79dee898a
4 changed files with 40 additions and 29 deletions

View File

@ -245,15 +245,6 @@ public:
*/
Scalar rockCompressibility(unsigned globalSpaceIdx) const;
/*!
* Direct access to rock reference pressure.
*
* While the above overload could be implemented in terms of this method,
* that would require always looking up the global space index, which
* is not always needed.
*/
Scalar rockReferencePressure(unsigned globalSpaceIdx) const;
/*!
* \brief Direct indexed access to the porosity.
*

View File

@ -116,6 +116,11 @@ readRockParameters_(const std::vector<Scalar>& cellCenterDepths,
}
}
// Warn that ROCK and ROCKOPTS item 2 = STORE is used together
if (rock_config.store()) {
OpmLog::warning("ROCKOPTS item 2 set to STORE, ROCK item 1 replaced with initial (equilibrated) pressures");
}
// read the parameters for water-induced rock compaction
readRockCompactionParameters_();
@ -152,7 +157,7 @@ readRockParameters_(const std::vector<Scalar>& cellCenterDepths,
// Store overburden pressure pr element
const auto& overburdTables = eclState_.getTableManager().getOverburdTables();
if (!overburdTables.empty()) {
if (!overburdTables.empty() && !rock_config.store()) {
overburdenPressure_.resize(numElem,0.0);
std::size_t numRocktabTables = rock_config.num_rock_tables();
@ -174,6 +179,9 @@ readRockParameters_(const std::vector<Scalar>& cellCenterDepths,
overburdenTables[tableIdx].eval(cellCenterDepths[elemIdx], /*extrapolation=*/true);
}
}
else if (!overburdTables.empty() && rock_config.store()) {
OpmLog::warning("ROCKOPTS item 2 set to STORE, OVERBURD ignored!");
}
}
template<class GridView, class FluidSystem>
@ -284,21 +292,6 @@ rockCompressibility(unsigned globalSpaceIdx) const
return this->rockParams_[tableIdx].compressibility;
}
template<class GridView, class FluidSystem>
typename FlowGenericProblem<GridView,FluidSystem>::Scalar
FlowGenericProblem<GridView,FluidSystem>::
rockReferencePressure(unsigned globalSpaceIdx) const
{
if (this->rockParams_.empty())
return 1e5;
unsigned tableIdx = 0;
if (!this->rockTableIdx_.empty()) {
tableIdx = this->rockTableIdx_[globalSpaceIdx];
}
return this->rockParams_[tableIdx].referencePressure;
}
template<class GridView, class FluidSystem>
typename FlowGenericProblem<GridView,FluidSystem>::Scalar
FlowGenericProblem<GridView,FluidSystem>::

View File

@ -172,7 +172,6 @@ public:
using BaseType::shouldWriteOutput;
using BaseType::shouldWriteRestartFile;
using BaseType::rockCompressibility;
using BaseType::rockReferencePressure;
using BaseType::porosity;
/*!
@ -719,7 +718,28 @@ public:
Scalar rockReferencePressure(const Context& context, unsigned spaceIdx, unsigned timeIdx) const
{
unsigned globalSpaceIdx = context.globalSpaceIndex(spaceIdx, timeIdx);
return this->rockReferencePressure(globalSpaceIdx);
return rockReferencePressure(globalSpaceIdx);
}
/*!
* \copydoc BlackoilProblem::rockReferencePressure
*/
Scalar rockReferencePressure(unsigned globalSpaceIdx) const
{
const auto& rock_config = this->simulator().vanguard().eclState().getSimulationConfig().rock_config();
if (rock_config.store()) {
return asImp_().initialFluidState(globalSpaceIdx).pressure(refPressurePhaseIdx_());
}
else {
if (this->rockParams_.empty())
return 1e5;
unsigned tableIdx = 0;
if (!this->rockTableIdx_.empty()) {
tableIdx = this->rockTableIdx_[globalSpaceIdx];
}
return this->rockParams_[tableIdx].referencePressure;
}
}
/*!
@ -1063,6 +1083,7 @@ public:
const auto& fs = intQuants.fluidState();
LhsEval effectivePressure = decay<LhsEval>(fs.pressure(refPressurePhaseIdx_()));
const auto& rock_config = this->simulator().vanguard().eclState().getSimulationConfig().rock_config();
if (!this->minRefPressure_.empty())
// The pore space change is irreversible
effectivePressure =
@ -1072,6 +1093,9 @@ public:
if (!this->overburdenPressure_.empty())
effectivePressure -= this->overburdenPressure_[elementIdx];
if (rock_config.store()) {
effectivePressure -= asImp_().initialFluidState(elementIdx).pressure(refPressurePhaseIdx_());
}
if (!this->rockCompPoroMult_.empty()) {
return this->rockCompPoroMult_[tableIdx].eval(effectivePressure, /*extrapolation=*/true);
@ -1628,7 +1652,7 @@ protected:
const auto& fs = intQuants.fluidState();
LhsEval effectivePressure = decay<LhsEval>(fs.pressure(refPressurePhaseIdx_()));
const auto& rock_config = this->simulator().vanguard().eclState().getSimulationConfig().rock_config();
if (!this->minRefPressure_.empty())
// The pore space change is irreversible
effectivePressure =
@ -1637,6 +1661,10 @@ protected:
if (!this->overburdenPressure_.empty())
effectivePressure -= this->overburdenPressure_[elementIdx];
if (rock_config.store()) {
effectivePressure -= asImp_().initialFluidState(elementIdx).pressure(refPressurePhaseIdx_());
}
if (!this->rockCompTransMult_.empty())
return this->rockCompTransMult_[tableIdx].eval(effectivePressure, /*extrapolation=*/true);

View File

@ -204,7 +204,6 @@ partiallySupported()
"ROCKOPTS",
{
{1,{true, allow_values<std::string> {"PRESSURE"}, "ROCKOPTS: only the PRESSURE options are supported"}},
{2,{true, allow_values<std::string> {"NOSTORE"}, "ROCKOPTS: only the NOSTORE options are supported"}},
{3,{true, allow_values<std::string> {"PVTNUM", "ROCKNUM"}, "ROCKOPTS: only PVTNUM and ROCKNUM are supported"}},
},
},