Merge pull request #924 from totto82/drsdtcon_pvtnum

support drsdtcon with pvtnum
This commit is contained in:
Tor Harald Sandve 2024-08-22 14:30:18 +02:00 committed by GitHub
commit fa610b49a3

View File

@ -144,7 +144,7 @@ public:
struct ConvectiveMixingModuleParam
{
bool active_{false};
std::vector<bool> active_;
std::vector<Scalar> Xhi_;
std::vector<Scalar> Psi_;
};
@ -155,19 +155,19 @@ public:
// check that Xhi and Psi didn't change
std::size_t numRegions = eclState.runspec().tabdims().getNumPVTTables();
const auto& control = schedule[episodeIdx].oilvap();
info.active_ = control.drsdtConvective();
if (!info.active_) {
return;
}
if (info.Xhi_.empty()) {
if (info.active_.empty()) {
info.active_.resize(numRegions);
info.Xhi_.resize(numRegions);
info.Psi_.resize(numRegions);
}
for (size_t i = 0; i < numRegions; ++i ) {
info.active_[i] = control.drsdtConvective(i);
if (control.drsdtConvective(i)) {
info.Xhi_[i] = control.getMaxDRSDT(i);
info.Psi_[i] = control.getPsi(i);
}
}
}
#endif
static void modifyAvgDensity(Evaluation& rhoAvg,
@ -176,7 +176,10 @@ public:
const unsigned phaseIdx,
const ConvectiveMixingModuleParam& info) {
if (!info.active_) {
if (info.active_.empty()) {
return;
}
if (!info.active_[ intQuantsIn.pvtRegionIndex()] || !info.active_[ intQuantsEx.pvtRegionIndex()]) {
return;
}
@ -269,7 +272,11 @@ public:
const Scalar faceArea,
const ConvectiveMixingModuleParam& info)
{
if (!info.active_) {
if (info.active_.empty()) {
return;
}
if (!info.active_[ intQuantsIn.pvtRegionIndex()] || !info.active_[ intQuantsEx.pvtRegionIndex()]) {
return;
}