Merge pull request #4840 from totto82/solvent_well_fix

Solvent well fix
This commit is contained in:
Bård Skaflestad 2023-09-07 12:45:56 +02:00 committed by GitHub
commit 467671b946
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -255,8 +255,10 @@ updateNewton(const BVectorWell& dwells,
// for injectors, very typical one of the fractions will be one, and it is easy to get zero value
// fractions. not sure what is the best way to handle it yet, so we just use 1.0 here
// The relaxationFactorFractionProducer code does not take into account solvent
// so we use 1.0 for cases with solvent.
[[maybe_unused]] const double relaxation_factor_fractions =
well_.isProducer() ? this->relaxationFactorFractionsProducer(dwells) : 1.0;
(well_.isProducer() && !Indices::enableSolvent) ? this->relaxationFactorFractionsProducer(dwells) : 1.0;
// update the second and third well variable (The flux fractions)

View File

@ -1372,6 +1372,14 @@ namespace Opm
for(int p = 0; p < np; ++p) {
well_flux[this->ebosCompIdxToFlowCompIdx(p)] += cq_s[p];
}
// the solvent contribution is added to the gas potentials
if constexpr (has_solvent) {
const auto& pu = this->phaseUsage();
assert(pu.phase_used[Gas]);
const int gas_pos = pu.phase_pos[Gas];
well_flux[gas_pos] += cq_s[Indices::contiSolventEqIdx];
}
}
this->parallel_well_info_.communication().sum(well_flux.data(), well_flux.size());
}