Merge pull request #4681 from GitPaean/fixing_solvent_perf_rate

fixing the fraction calculation when initializing perf rates
This commit is contained in:
Kai Bao 2023-06-04 23:09:26 +02:00 committed by GitHub
commit 5ae64fea25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -513,6 +513,9 @@ computeProperties(const WellState& well_state,
{
total_tw = comm.sum(total_tw);
}
// for producers where all perforations have zero rates we
// approximate the perforation mixture ration using the (invB * mobility) ratio,
// and weight the perforation rates using the well transmissibility.
for (int perf = 0; perf < nperf; ++perf) {
const int cell_idx = well_.cells()[perf];
const double well_tw_fraction = well_.wellIndex()[perf] / total_tw;
@ -526,10 +529,12 @@ computeProperties(const WellState& well_state,
}
for (int p = 0; p < np; ++p) {
int ebosPhaseIdx = well_.flowPhaseToEbosPhaseIdx(p);
perfRates[perf * well_.numComponents() + p] = well_tw_fraction * mobility(cell_idx, ebosPhaseIdx) / total_mobility;
perfRates[perf * well_.numComponents() + p] = well_tw_fraction *
invB(cell_idx, ebosPhaseIdx) * mobility(cell_idx, ebosPhaseIdx) / total_mobility;
}
if constexpr (Indices::enableSolvent) {
perfRates[perf * well_.numComponents() + Indices::contiSolventEqIdx] = well_tw_fraction * solventInverseFormationVolumeFactor(cell_idx) / total_mobility;
perfRates[perf * well_.numComponents() + Indices::contiSolventEqIdx] = well_tw_fraction *
solventInverseFormationVolumeFactor(cell_idx) * solventMobility(cell_idx) / total_mobility;
}
}
}