clean-up based on review

This commit is contained in:
Tor Harald Sandve 2020-09-14 15:42:48 +02:00
parent d930cc8ad4
commit c2c009ecb6
2 changed files with 9 additions and 9 deletions

View File

@ -59,15 +59,15 @@ namespace Opm
// TODO: we need to have order for the primary variables and also the order for the well equations.
// sometimes, they are similar, while sometimes, they can have very different forms.
// TODO: the following system looks not rather flexible. Looking into all kinds of possibilities
static const bool gasoil = numEq == 2 && (Indices::compositionSwitchIdx >= 0);
static const int GTotal = 0;
static const int WFrac = gasoil? -1000: 1;
//For oilwater system the GFrac is set to 2 (the same as SPres) but it is never used
static const int GFrac = gasoil? 1 : 2;
static const int SPres = numEq;
static const bool has_gas = (Indices::compositionSwitchIdx >= 0);
static const bool has_water = (Indices::waterSaturationIdx >= 0);
/// the number of well equations // TODO: it should have a more general strategy for it
static const int GTotal = 0;
static const int WFrac = has_water? 1: -1000;
static const int GFrac = has_gas? has_water + 1 : -1000;
static const int SPres = has_gas + has_water + 1;
// the number of well equations TODO: it should have a more general strategy for it
static const int numWellEq = getPropValue<TypeTag, Properties::EnablePolymer>() ? numEq : numEq + 1;
using typename Base::Scalar;

View File

@ -2180,7 +2180,7 @@ namespace Opm
resWell_[seg][SPres] -= accelerationPressureLoss.value();
duneD_[seg][seg][SPres][SPres] -= accelerationPressureLoss.derivative(SPres + numEq);
duneD_[seg][seg][SPres][GTotal] -= accelerationPressureLoss.derivative(GTotal + numEq);
if (FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx)) {
if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) {
duneD_[seg][seg_upwind][SPres][WFrac] -= accelerationPressureLoss.derivative(WFrac + numEq);
}
if (FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx)) {