mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #5770 from vkip/thpres_rst_rstout
Write correct THRESHPR values also from restart
This commit is contained in:
commit
e936a224a2
@ -88,6 +88,7 @@ public:
|
|||||||
if (this->enableThresholdPressure_ && !this->thpresDefault_.empty() && !this->restart_) {
|
if (this->enableThresholdPressure_ && !this->thpresDefault_.empty() && !this->restart_) {
|
||||||
this->computeDefaultThresholdPressures_();
|
this->computeDefaultThresholdPressures_();
|
||||||
this->applyExplicitThresholdPressures_();
|
this->applyExplicitThresholdPressures_();
|
||||||
|
simulator_.vanguard().gridView().comm().max(&this->thpres_[0], this->thpres_.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,24 +226,7 @@ getRestartVector() const
|
|||||||
if (!enableThresholdPressure_)
|
if (!enableThresholdPressure_)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
std::vector<Scalar> result(numEquilRegions_ * numEquilRegions_, 0.0);
|
return this->thpres_;
|
||||||
const auto& simConfig = eclState_.getSimulationConfig();
|
|
||||||
const auto& thpres = simConfig.getThresholdPressure();
|
|
||||||
|
|
||||||
std::size_t idx = 0;
|
|
||||||
for (unsigned j = 1; j <= numEquilRegions_; ++j) {
|
|
||||||
for (unsigned i = 1; i <= numEquilRegions_; ++i, ++idx) {
|
|
||||||
if (thpres.hasRegionBarrier(i, j)) {
|
|
||||||
if (thpres.hasThresholdPressure(i, j)) {
|
|
||||||
result[idx] = thpres.getThresholdPressure(i, j);
|
|
||||||
} else {
|
|
||||||
result[idx] = this->thpresDefault_[idx];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class Grid, class GridView, class ElementMapper, class Scalar>
|
template<class Grid, class GridView, class ElementMapper, class Scalar>
|
||||||
|
Loading…
Reference in New Issue
Block a user