mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-12 17:31:55 -06:00
fixed: output of thresholdpressure to restart file in parallel
This commit is contained in:
parent
44b23af154
commit
153c4f486a
@ -220,6 +220,34 @@ configureThpresft_()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class Grid, class GridView, class ElementMapper, class Scalar>
|
||||||
|
std::vector<Scalar>
|
||||||
|
EclGenericThresholdPressure<Grid,GridView,ElementMapper,Scalar>::
|
||||||
|
getRestartVector() const
|
||||||
|
{
|
||||||
|
if (!enableThresholdPressure_)
|
||||||
|
return {};
|
||||||
|
|
||||||
|
std::vector<Scalar> result(numEquilRegions_ * numEquilRegions_, 0.0);
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
#if HAVE_DUNE_FEM
|
#if HAVE_DUNE_FEM
|
||||||
template class EclGenericThresholdPressure<Dune::CpGrid,
|
template class EclGenericThresholdPressure<Dune::CpGrid,
|
||||||
Dune::GridView<Dune::Fem::GridPart2GridViewTraits<Dune::Fem::AdaptiveLeafGridPart<Dune::CpGrid, Dune::PartitionIteratorType(4), false>>>,
|
Dune::GridView<Dune::Fem::GridPart2GridViewTraits<Dune::Fem::AdaptiveLeafGridPart<Dune::CpGrid, Dune::PartitionIteratorType(4), false>>>,
|
||||||
|
@ -72,6 +72,10 @@ public:
|
|||||||
void setFromRestart(const std::vector<Scalar>& values)
|
void setFromRestart(const std::vector<Scalar>& values)
|
||||||
{ thpres_ = values; }
|
{ thpres_ = values; }
|
||||||
|
|
||||||
|
//! \brief Returns a fully expanded vector for restart file writing.
|
||||||
|
//! \details Returns the union of explicitly configured entries and defaulted values.
|
||||||
|
std::vector<Scalar> getRestartVector() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/*!
|
/*!
|
||||||
* \brief Actually compute the threshold pressures over a face as a pre-compute step.
|
* \brief Actually compute the threshold pressures over a face as a pre-compute step.
|
||||||
@ -90,7 +94,7 @@ protected:
|
|||||||
const EclipseState& eclState_;
|
const EclipseState& eclState_;
|
||||||
std::vector<Scalar> thpresDefault_;
|
std::vector<Scalar> thpresDefault_;
|
||||||
std::vector<Scalar> thpres_;
|
std::vector<Scalar> thpres_;
|
||||||
unsigned numEquilRegions_;
|
unsigned numEquilRegions_{};
|
||||||
std::vector<unsigned char> elemEquilRegion_;
|
std::vector<unsigned char> elemEquilRegion_;
|
||||||
|
|
||||||
// threshold pressure accross faults. EXPERIMENTAL!
|
// threshold pressure accross faults. EXPERIMENTAL!
|
||||||
|
@ -377,7 +377,7 @@ public:
|
|||||||
this->actionState(),
|
this->actionState(),
|
||||||
this->udqState(),
|
this->udqState(),
|
||||||
this->summaryState(),
|
this->summaryState(),
|
||||||
simulator_.problem().thresholdPressure().data(),
|
simulator_.problem().thresholdPressure().getRestartVector(),
|
||||||
curTime, nextStepSize,
|
curTime, nextStepSize,
|
||||||
EWOMS_GET_PARAM(TypeTag, bool, EclOutputDoublePrecision),
|
EWOMS_GET_PARAM(TypeTag, bool, EclOutputDoublePrecision),
|
||||||
isFlowsn,
|
isFlowsn,
|
||||||
|
Loading…
Reference in New Issue
Block a user