Clean-up of the solvent implementation

This commit is contained in:
Tor Harald Sandve 2017-05-30 14:33:17 +02:00
parent 8b75e2eedc
commit f671af6cd6
4 changed files with 10 additions and 9 deletions

View File

@ -934,8 +934,7 @@ namespace Opm {
Vector& R2_idx = R2[ solventCompIdx ]; Vector& R2_idx = R2[ solventCompIdx ];
Vector& B_idx = B[ solventCompIdx ]; Vector& B_idx = B[ solventCompIdx ];
B_idx [cell_idx] = 1.0 / intQuants.solventInverseFormationVolumeFactor().value(); B_idx [cell_idx] = 1.0 / intQuants.solventInverseFormationVolumeFactor().value();
const int ebosCompIdx = flowPhaseToEbosCompIdx(solventCompIdx); R2_idx[cell_idx] = ebosResid[cell_idx][solventCompIdx];
R2_idx[cell_idx] = ebosResid[cell_idx][ebosCompIdx];
} }
} }

View File

@ -126,8 +126,9 @@ enum WellVariablePositions {
return 2; return 2;
} }
int numComp = FluidSystem::numComponents; int numComp = FluidSystem::numComponents;
if (has_solvent_) if (has_solvent_) {
numComp ++; numComp ++;
}
return numComp; return numComp;
} }

View File

@ -1210,7 +1210,7 @@ namespace Opm {
surf_dens_perf[numComp*perf + p] = FluidSystem::referenceDensity( flowPhaseToEbosPhaseIdx( p ), fs.pvtRegionIndex()); surf_dens_perf[numComp*perf + p] = FluidSystem::referenceDensity( flowPhaseToEbosPhaseIdx( p ), fs.pvtRegionIndex());
} }
#warning HACK use cell values for solvent injector // We use cell values for solvent injector
if (has_solvent_) { if (has_solvent_) {
b_perf[numComp*perf + solventCompIdx] = intQuants.solventInverseFormationVolumeFactor().value(); b_perf[numComp*perf + solventCompIdx] = intQuants.solventInverseFormationVolumeFactor().value();
surf_dens_perf[numComp*perf + solventCompIdx] = intQuants.solventRefDensity(); surf_dens_perf[numComp*perf + solventCompIdx] = intQuants.solventRefDensity();
@ -1325,7 +1325,8 @@ namespace Opm {
well_state.wellSolutions()[SFrac*nw + w] = F_solvent; well_state.wellSolutions()[SFrac*nw + w] = F_solvent;
} }
# warning F_solvent is added to F_gas. This means that well_rate[Gas] also contains solvent. More testing is needed to make sure this is correct for output, wellControls, well groups, THP etc. // F_solvent is added to F_gas. This means that well_rate[Gas] also contains solvent.
// More testing is needed to make sure this is correct for well groups and THP.
if (has_solvent_){ if (has_solvent_){
F[Gas] += F_solvent; F[Gas] += F_solvent;
} }
@ -3029,7 +3030,7 @@ namespace Opm {
} }
} }
// we didn't find it return 0; // we didn't find it return 0;
// or should we throw? assert(false);
return 0.0; return 0.0;
} }