From 4fd0c2466135e1d752fad50549be80b6dad9c0a7 Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Thu, 21 Jul 2022 12:51:30 +0200 Subject: [PATCH] output drsdtcon values to restart files --- ebos/eclgenericoutputblackoilmodule.cc | 4 ++++ ebos/eclgenericoutputblackoilmodule.hh | 1 + ebos/eclgenericproblem.cc | 15 +++++++++++++++ ebos/eclgenericproblem.hh | 5 +++++ ebos/ecloutputblackoilmodule.hh | 4 ++++ 5 files changed, 29 insertions(+) diff --git a/ebos/eclgenericoutputblackoilmodule.cc b/ebos/eclgenericoutputblackoilmodule.cc index e6582c48b..c11fa7906 100644 --- a/ebos/eclgenericoutputblackoilmodule.cc +++ b/ebos/eclgenericoutputblackoilmodule.cc @@ -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_) diff --git a/ebos/eclgenericoutputblackoilmodule.hh b/ebos/eclgenericoutputblackoilmodule.hh index 6727c026f..e362eaecb 100644 --- a/ebos/eclgenericoutputblackoilmodule.hh +++ b/ebos/eclgenericoutputblackoilmodule.hh @@ -418,6 +418,7 @@ protected: ScalarBuffer rvw_; ScalarBuffer overburdenPressure_; ScalarBuffer oilSaturationPressure_; + ScalarBuffer drsdtcon_; ScalarBuffer sSol_; ScalarBuffer cPolymer_; ScalarBuffer cFoam_; diff --git a/ebos/eclgenericproblem.cc b/ebos/eclgenericproblem.cc index 0ba4d7a59..3d150513b 100644 --- a/ebos/eclgenericproblem.cc +++ b/ebos/eclgenericproblem.cc @@ -572,6 +572,21 @@ solventSaturation(unsigned elemIdx) const return solventSaturation_[elemIdx]; } +template +Scalar EclGenericProblem:: +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 Scalar EclGenericProblem:: polymerConcentration(unsigned elemIdx) const diff --git a/ebos/eclgenericproblem.hh b/ebos/eclgenericproblem.hh index 123aa7400..9283cc82b 100644 --- a/ebos/eclgenericproblem.hh +++ b/ebos/eclgenericproblem.hh @@ -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 */ diff --git a/ebos/ecloutputblackoilmodule.hh b/ebos/ecloutputblackoilmodule.hh index 5c658792d..68acb2022 100644 --- a/ebos/ecloutputblackoilmodule.hh +++ b/ebos/ecloutputblackoilmodule.hh @@ -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(); }