diff --git a/opm/autodiff/BlackoilModelEbos.hpp b/opm/autodiff/BlackoilModelEbos.hpp index 29109fab7..797d67f81 100644 --- a/opm/autodiff/BlackoilModelEbos.hpp +++ b/opm/autodiff/BlackoilModelEbos.hpp @@ -934,8 +934,7 @@ namespace Opm { Vector& R2_idx = R2[ solventCompIdx ]; Vector& B_idx = B[ solventCompIdx ]; B_idx [cell_idx] = 1.0 / intQuants.solventInverseFormationVolumeFactor().value(); - const int ebosCompIdx = flowPhaseToEbosCompIdx(solventCompIdx); - R2_idx[cell_idx] = ebosResid[cell_idx][ebosCompIdx]; + R2_idx[cell_idx] = ebosResid[cell_idx][solventCompIdx]; } } diff --git a/opm/autodiff/StandardWellsDense.hpp b/opm/autodiff/StandardWellsDense.hpp index 6c862d6d0..8ba09e20e 100644 --- a/opm/autodiff/StandardWellsDense.hpp +++ b/opm/autodiff/StandardWellsDense.hpp @@ -126,8 +126,9 @@ enum WellVariablePositions { return 2; } int numComp = FluidSystem::numComponents; - if (has_solvent_) + if (has_solvent_) { numComp ++; + } return numComp; } diff --git a/opm/autodiff/StandardWellsDense_impl.hpp b/opm/autodiff/StandardWellsDense_impl.hpp index 1bd934594..11781c98b 100644 --- a/opm/autodiff/StandardWellsDense_impl.hpp +++ b/opm/autodiff/StandardWellsDense_impl.hpp @@ -1210,7 +1210,7 @@ namespace Opm { 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_) { b_perf[numComp*perf + solventCompIdx] = intQuants.solventInverseFormationVolumeFactor().value(); surf_dens_perf[numComp*perf + solventCompIdx] = intQuants.solventRefDensity(); @@ -1325,7 +1325,8 @@ namespace Opm { 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_){ F[Gas] += F_solvent; } @@ -3029,7 +3030,7 @@ namespace Opm { } } // we didn't find it return 0; - // or should we throw? + assert(false); return 0.0; } diff --git a/opm/autodiff/WellStateFullyImplicitBlackoilDense.hpp b/opm/autodiff/WellStateFullyImplicitBlackoilDense.hpp index f28d79d8b..840c7ed33 100644 --- a/opm/autodiff/WellStateFullyImplicitBlackoilDense.hpp +++ b/opm/autodiff/WellStateFullyImplicitBlackoilDense.hpp @@ -76,7 +76,7 @@ namespace Opm perfRateSolvent_.clear(); perfRateSolvent_.resize(nperf, 0.0); - if(pu.has_solvent) { + if (pu.has_solvent) { // intialize wells that have been there before // order may change so the mapping is based on the well name @@ -196,7 +196,7 @@ namespace Opm if( pu.phase_used[Gas] ) { wellSolutions()[2*nw + w] = wells_->comp_frac[np*w + gaspos]; } - if(pu.has_solvent) { + if (pu.has_solvent) { wellSolutions()[3*nw + w] = 0; } @@ -238,7 +238,7 @@ namespace Opm if (nw == 0) { return res; } - if(pu.has_solvent) { + if (pu.has_solvent) { // add solvent component for( int w = 0; w < nw; ++w ) { using rt = data::Rates::opt;