output drsdtcon values to restart files

This commit is contained in:
Tor Harald Sandve 2022-07-21 12:51:30 +02:00
parent 412cf1d6cd
commit 4fd0c24661
5 changed files with 29 additions and 0 deletions

View File

@ -693,6 +693,7 @@ assignToSolution(data::Solution& sol)
{"SALTP", UnitSystem::measure::identity, data::TargetType::RESTART_AUXILIARY, pSalt_},
{"PERMFACT", UnitSystem::measure::identity, data::TargetType::RESTART_AUXILIARY, permFact_},
{"SOMAX", UnitSystem::measure::identity, data::TargetType::RESTART_SOLUTION, soMax_},
{"DRSDTCON", UnitSystem::measure::gas_oil_ratio_rate, data::TargetType::RESTART_AUXILIARY, drsdtcon_},
{"SSOLVENT", UnitSystem::measure::identity, data::TargetType::RESTART_SOLUTION, sSol_},
{"SS_X", UnitSystem::measure::identity, data::TargetType::RESTART_SOLUTION, extboX_},
{"SS_Y", UnitSystem::measure::identity, data::TargetType::RESTART_SOLUTION, extboY_},
@ -992,6 +993,9 @@ doAllocBuffers(unsigned bufferSize,
rvw_.resize(bufferSize, 0.0);
rstKeywords["RVW"] = 0;
}
if (schedule_[reportStepNum].oilvap().drsdtConvective())
drsdtcon_.resize(bufferSize, 0.0);
if (enableSolvent_)
sSol_.resize(bufferSize, 0.0);
if (enablePolymer_)

View File

@ -418,6 +418,7 @@ protected:
ScalarBuffer rvw_;
ScalarBuffer overburdenPressure_;
ScalarBuffer oilSaturationPressure_;
ScalarBuffer drsdtcon_;
ScalarBuffer sSol_;
ScalarBuffer cPolymer_;
ScalarBuffer cFoam_;

View File

@ -572,6 +572,21 @@ solventSaturation(unsigned elemIdx) const
return solventSaturation_[elemIdx];
}
template<class GridView, class FluidSystem, class Scalar>
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>::
drsdtcon(unsigned elemIdx, int episodeIdx) const
{
if (convectiveDrs_.empty())
return 0;
// The episode index is set to -1 in the initialization phase.
// Output drsdt value for index 0
episodeIdx = std::max(episodeIdx, 0);
const auto& oilVaporizationControl = schedule_[episodeIdx].oilvap();
int pvtRegionIdx = pvtRegionIndex(elemIdx);
return oilVaporizationControl.getMaxDRSDT(pvtRegionIdx)*convectiveDrs_[elemIdx];
}
template<class GridView, class FluidSystem, class Scalar>
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>::
polymerConcentration(unsigned elemIdx) const

View File

@ -134,6 +134,11 @@ public:
*/
Scalar solventSaturation(unsigned elemIdx) const;
/*!
* \brief Returns the dynamic drsdt convective mixing value
*/
Scalar drsdtcon(unsigned elemIdx, int episodeIdx) const;
/*!
* \brief Returns the initial polymer concentration for a given a cell index
*/

View File

@ -340,6 +340,10 @@ public:
Valgrind::CheckDefined(this->relativePermeability_[phaseIdx][globalDofIdx]);
}
if (!this->drsdtcon_.empty()) {
this->drsdtcon_[globalDofIdx] = problem.drsdtcon(globalDofIdx, elemCtx.simulator().episodeIndex());
}
if (!this->sSol_.empty()) {
this->sSol_[globalDofIdx] = intQuants.solventSaturation().value();
}