mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-22 15:33:29 -06:00
Merge pull request #5743 from vkip/thpres_restart
Restore threshold pressures from restart
This commit is contained in:
commit
92c9d88c1b
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user