mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-24 16:30:02 -06:00
Avoid deleting derivatives with zero pressure difference
This commit is contained in:
parent
8cc1a0e3f7
commit
23034c0bee
@ -374,15 +374,13 @@ public:
|
||||
// Use arithmetic average (more accurate with harmonic, but that requires recomputing the transmissbility)
|
||||
const Evaluation transMult = (intQuantsIn.rockCompTransMultiplier() + Toolbox::value(intQuantsEx.rockCompTransMultiplier()))/2;
|
||||
Evaluation darcyFlux;
|
||||
if (pressureDifference == 0) {
|
||||
darcyFlux = 0.0; // NB maybe we could drop calculations
|
||||
} else {
|
||||
if (globalUpIndex == globalIndexIn)
|
||||
if (globalUpIndex == globalIndexIn) {
|
||||
darcyFlux = pressureDifference * up.mobility(phaseIdx, facedir) * transMult * (-trans / faceArea);
|
||||
else
|
||||
darcyFlux = pressureDifference *
|
||||
(Toolbox::value(up.mobility(phaseIdx, facedir)) * transMult * (-trans / faceArea));
|
||||
} else {
|
||||
darcyFlux = pressureDifference *
|
||||
(Toolbox::value(up.mobility(phaseIdx, facedir)) * transMult * (-trans / faceArea));
|
||||
}
|
||||
|
||||
unsigned activeCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::solventComponentIndex(phaseIdx));
|
||||
darcy[conti0EqIdx + activeCompIdx] = darcyFlux.value() * faceArea; // NB! For the FLORES fluxes without derivatives
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user