mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Restore threshold pressures from restart
This commit is contained in:
parent
3188ac713a
commit
1c22d18771
@ -85,7 +85,7 @@ public:
|
|||||||
void finishInit()
|
void finishInit()
|
||||||
{
|
{
|
||||||
this->BaseType::finishInit();
|
this->BaseType::finishInit();
|
||||||
if (this->enableThresholdPressure_ && !this->thpresDefault_.empty()) {
|
if (this->enableThresholdPressure_ && !this->thpresDefault_.empty() && !this->restart_) {
|
||||||
this->computeDefaultThresholdPressures_();
|
this->computeDefaultThresholdPressures_();
|
||||||
this->applyExplicitThresholdPressures_();
|
this->applyExplicitThresholdPressures_();
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,11 @@ public:
|
|||||||
* This is used for the restart capability.
|
* This is used for the restart capability.
|
||||||
*/
|
*/
|
||||||
void setFromRestart(const std::vector<double>& values)
|
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.
|
//! \brief Returns a fully expanded vector for restart file writing.
|
||||||
//! \details Returns the union of explicitly configured entries and defaulted values.
|
//! \details Returns the union of explicitly configured entries and defaulted values.
|
||||||
@ -113,6 +117,7 @@ protected:
|
|||||||
std::vector<int> cartElemFaultIdx_;
|
std::vector<int> cartElemFaultIdx_;
|
||||||
|
|
||||||
bool enableThresholdPressure_ {false};
|
bool enableThresholdPressure_ {false};
|
||||||
|
bool restart_ {false};
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Opm
|
} // namespace Opm
|
||||||
|
@ -134,8 +134,8 @@ finishInit()
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
If this is a restart run the ThresholdPressure object will be active,
|
If this is a restart run the ThresholdPressure object will be active,
|
||||||
but it will *not* be properly initialized with numerical values. The
|
and already properly initialized with numerical values from the restart.
|
||||||
values must instead come from the THPRES vector in the restart file.
|
Done using GenericThresholdPressure::setFromRestart() in EclWriter::beginRestart().
|
||||||
*/
|
*/
|
||||||
if (simConfig.getThresholdPressure().restart())
|
if (simConfig.getThresholdPressure().restart())
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user