Restore threshold pressures from restart

This commit is contained in:
Vegard Kippe committed 2024-11-18 12:59:48 +01:00
1 parent 3188ac713a
commit 1c22d18771
3 files changed
+9 -4

No files matched your search

@@ -85,7 +85,7 @@ public:
void finishInit()
{
this->BaseType::finishInit();
if (this->enableThresholdPressure_ && !this->thpresDefault_.empty()) {
if (this->enableThresholdPressure_ && !this->thpresDefault_.empty() && !this->restart_) {
this->computeDefaultThresholdPressures_();
this->applyExplicitThresholdPressures_();
}
@@ -75,7 +75,11 @@ public:
* This is used for the restart capability.
*/
void setFromRestart(const std::vector<double>& values)
{ thpres_.assign(values.begin(), values.end()); }
{
this->restart_ = true;
thpres_.assign(values.begin(), values.end());
thpresDefault_.assign(values.begin(), values.end());
}
//! \brief Returns a fully expanded vector for restart file writing.
//! \details Returns the union of explicitly configured entries and defaulted values.
@@ -113,6 +117,7 @@ protected:
std::vector<int> cartElemFaultIdx_;
bool enableThresholdPressure_ {false};
bool restart_ {false};
};
} // namespace Opm
@@ -134,8 +134,8 @@ finishInit()
/*
If this is a restart run the ThresholdPressure object will be active,
but it will *not* be properly initialized with numerical values. The
values must instead come from the THPRES vector in the restart file.
and already properly initialized with numerical values from the restart.
Done using GenericThresholdPressure::setFromRestart() in EclWriter::beginRestart().
*/
if (simConfig.getThresholdPressure().restart())
return;