mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-21 16:57:25 -06:00
Merge pull request #615 from totto82/fixes_solvent_model
Fixes to the solvent model
This commit is contained in:
commit
8c9b17b943
@ -720,6 +720,9 @@ namespace Opm {
|
||||
const ADB& ss = state.solvent_saturation;
|
||||
if (is_miscible_) {
|
||||
|
||||
assert(active_[ Oil ]);
|
||||
assert(active_[ Gas ]);
|
||||
|
||||
std::vector<ADB> relperm = fluid_.relperm(sw, so, sg+ss, cells_);
|
||||
|
||||
Selector<double> zero_selector(ss.value() + sg.value(), Selector<double>::Zero);
|
||||
@ -728,9 +731,6 @@ namespace Opm {
|
||||
const ADB misc = solvent_props_.miscibilityFunction(F_solvent, cells_)
|
||||
* solvent_props_.pressureMiscibilityFunction(po, cells_);
|
||||
|
||||
assert(active_[ Oil ]);
|
||||
assert(active_[ Gas ]);
|
||||
|
||||
const ADB sn = ss + so + sg;
|
||||
|
||||
// adjust endpoints
|
||||
@ -743,15 +743,15 @@ namespace Opm {
|
||||
ADB sor = misc * sorwmis + (ones - misc) * sogcr;
|
||||
ADB sgc = misc * sgcwmis + (ones - misc) * sgcr;
|
||||
|
||||
// avoid negative values
|
||||
Selector<double> negative_selector(sgc.value(), Selector<double>::LessEqualZero);
|
||||
sgc = negative_selector.select(zero, sgc);
|
||||
|
||||
const ADB ssg = ss + sg - sgc;
|
||||
ADB ssg = ss + sg - sgc;
|
||||
const ADB sn_eff = sn - sor - sgc;
|
||||
|
||||
// avoid negative values
|
||||
Selector<double> zeroSn_selector(sn_eff.value(), Selector<double>::Zero);
|
||||
Selector<double> negSsg_selector(ssg.value(), Selector<double>::LessZero);
|
||||
ssg = negSsg_selector.select(zero, ssg);
|
||||
|
||||
// avoid negative value and division on zero
|
||||
Selector<double> zeroSn_selector(sn_eff.value(), Selector<double>::LessEqualZero);
|
||||
const ADB F_totalGas = zeroSn_selector.select( zero, ssg / sn_eff);
|
||||
|
||||
const ADB mkrgt = solvent_props_.miscibleSolventGasRelPermMultiplier(F_totalGas, cells_) * solvent_props_.misicibleHydrocarbonWaterRelPerm(sn, cells_);
|
||||
|
@ -106,9 +106,15 @@ namespace Opm
|
||||
ScheduleConstPtr schedule = BaseType::eclipse_state_->getSchedule();
|
||||
|
||||
for (const auto& well_solvent : schedule->getWells( currentStep )) {
|
||||
if (well_solvent->getStatus( currentStep ) == WellCommon::SHUT) {
|
||||
continue;
|
||||
}
|
||||
|
||||
WellInjectionProperties injection = well_solvent->getInjectionProperties(currentStep);
|
||||
if (injection.injectorType == WellInjector::GAS) {
|
||||
|
||||
double solventFraction = well_solvent->getSolventFraction(currentStep);
|
||||
|
||||
// Find the solvent well in the well list and add properties to it
|
||||
int wix = 0;
|
||||
for (; wix < nw; ++wix) {
|
||||
|
Loading…
Reference in New Issue
Block a user