@@ -391,9 +391,9 @@ namespace Opm
391391 auto & perf_rates = perf_data.phase_rates ;
392392 for (int perf = 0 ; perf < this ->number_of_local_perforations_ ; ++perf) {
393393 // Calculate perforation quantities.
394- std::vector<EvalWell> cq_s (this ->num_conservation_quantities_ , { this -> primary_variables_ . numWellEq () + Indices::numEq, 0.0 } );
395- EvalWell water_flux_s{this -> primary_variables_ . numWellEq () + Indices::numEq, 0.0 };
396- EvalWell cq_s_zfrac_effective{this -> primary_variables_ . numWellEq () + Indices::numEq, 0.0 };
394+ std::vector<EvalWell> cq_s (this ->num_conservation_quantities_ , 0.0 );
395+ EvalWell water_flux_s{0.0 };
396+ EvalWell cq_s_zfrac_effective{0.0 };
397397 calculateSinglePerf (simulator, perf, well_state, connectionRates,
398398 cq_s, water_flux_s, cq_s_zfrac_effective, deferred_logger);
399399
@@ -451,7 +451,7 @@ namespace Opm
451451 for (int componentIdx = 0 ; componentIdx < numWellConservationEq; ++componentIdx) {
452452 // TODO: following the development in MSW, we need to convert the volume of the wellbore to be surface volume
453453 // since all the rates are under surface condition
454- EvalWell resWell_loc (this -> primary_variables_ . numWellEq () + Indices::numEq, 0.0 );
454+ EvalWell resWell_loc (0.0 );
455455 if (FluidSystem::numActivePhases () > 1 ) {
456456 assert (dt > 0 );
457457 resWell_loc += (this ->primary_variables_ .surfaceVolumeFraction (componentIdx) -
@@ -506,7 +506,7 @@ namespace Opm
506506 const EvalWell& bhp = this ->primary_variables_ .eval (Bhp);
507507 const int cell_idx = this ->well_cells_ [perf];
508508 const auto & intQuants = simulator.model ().intensiveQuantities (cell_idx, /* timeIdx=*/ 0 );
509- std::vector<EvalWell> mob (this ->num_conservation_quantities_ , {this -> primary_variables_ . numWellEq () + Indices::numEq, 0 .});
509+ std::vector<EvalWell> mob (this ->num_conservation_quantities_ , {0 .});
510510 getMobility (simulator, perf, mob, deferred_logger);
511511
512512 PerforationRates<Scalar> perf_rates;
@@ -698,7 +698,7 @@ namespace Opm
698698 // as a result, the polymer and water share the same viscosity
699699 if constexpr (!Base::has_polymermw) {
700700 if constexpr (std::is_same_v<Value, Scalar>) {
701- std::vector<EvalWell> mob_eval (this ->num_conservation_quantities_ , { this -> primary_variables_ . numWellEq () + Indices::numEq, 0 .} );
701+ std::vector<EvalWell> mob_eval (this ->num_conservation_quantities_ , 0 . );
702702 for (std::size_t i = 0 ; i < mob.size (); ++i) {
703703 mob_eval[i].setValue (mob[i]);
704704 }
@@ -1899,7 +1899,7 @@ namespace Opm
18991899 const bool allow_cf = this ->getAllowCrossFlow () || openCrossFlowAvoidSingularity (simulator);
19001900 const EvalWell& bhp = this ->primary_variables_ .eval (Bhp);
19011901
1902- std::vector<EvalWell> cq_s (this ->num_conservation_quantities_ , { this -> primary_variables_ . numWellEq () + Indices::numEq, 0 .} );
1902+ std::vector<EvalWell> cq_s (this ->num_conservation_quantities_ , 0 . );
19031903 PerforationRates<Scalar> perf_rates;
19041904 Scalar trans_mult = simulator.problem ().template wellTransMultiplier <Scalar>(int_quant, cell_idx);
19051905 const auto & wellstate_nupcol = simulator.problem ().wellModel ().nupcolWellState ().well (this ->index_of_well_ );
@@ -1974,10 +1974,9 @@ namespace Opm
19741974 deferred_logger);
19751975 }
19761976 const auto & water_table_func = PolymerModule::getSkprwatTable (water_table_id);
1977- const EvalWell throughput_eval ( this -> primary_variables_ . numWellEq () + Indices::numEq, throughput) ;
1977+ const EvalWell throughput_eval{ throughput} ;
19781978 // the skin pressure when injecting water, which also means the polymer concentration is zero
1979- EvalWell pskin_water (this ->primary_variables_ .numWellEq () + Indices::numEq, 0.0 );
1980- pskin_water = water_table_func.eval (throughput_eval, water_velocity);
1979+ EvalWell pskin_water = water_table_func.eval (throughput_eval, water_velocity);
19811980 return pskin_water;
19821981 } else {
19831982 OPM_DEFLOG_THROW (std::runtime_error,
@@ -2013,10 +2012,9 @@ namespace Opm
20132012 }
20142013 const auto & skprpolytable = PolymerModule::getSkprpolyTable (polymer_table_id);
20152014 const Scalar reference_concentration = skprpolytable.refConcentration ;
2016- const EvalWell throughput_eval ( this -> primary_variables_ . numWellEq () + Indices::numEq, throughput) ;
2015+ const EvalWell throughput_eval{ throughput} ;
20172016 // the skin pressure when injecting water, which also means the polymer concentration is zero
2018- EvalWell pskin_poly (this ->primary_variables_ .numWellEq () + Indices::numEq, 0.0 );
2019- pskin_poly = skprpolytable.table_func .eval (throughput_eval, water_velocity_abs);
2017+ const EvalWell pskin_poly = skprpolytable.table_func .eval (throughput_eval, water_velocity_abs);
20202018 if (poly_inj_conc == reference_concentration) {
20212019 return sign * pskin_poly;
20222020 }
@@ -2046,8 +2044,8 @@ namespace Opm
20462044 if constexpr (Base::has_polymermw) {
20472045 const int table_id = this ->polymerInjTable_ ();
20482046 const auto & table_func = PolymerModule::getPlymwinjTable (table_id);
2049- const EvalWell throughput_eval ( this -> primary_variables_ . numWellEq () + Indices::numEq, throughput) ;
2050- EvalWell molecular_weight ( this -> primary_variables_ . numWellEq () + Indices::numEq, 0 .) ;
2047+ const EvalWell throughput_eval{ throughput} ;
2048+ EvalWell molecular_weight{ 0 .} ;
20512049 if (this ->wpolymer () == 0 .) { // not injecting polymer
20522050 return molecular_weight;
20532051 }
@@ -2146,8 +2144,7 @@ namespace Opm
21462144 const Scalar throughput = perf_water_throughput[perf];
21472145 const int pskin_index = Bhp + 1 + this ->number_of_local_perforations_ + perf;
21482146
2149- EvalWell poly_conc (this ->primary_variables_ .numWellEq () + Indices::numEq, 0.0 );
2150- poly_conc.setValue (this ->wpolymer ());
2147+ const EvalWell poly_conc (this ->wpolymer ());
21512148
21522149 // equation for the skin pressure
21532150 const EvalWell eq_pskin = this ->primary_variables_ .eval (pskin_index)
@@ -2621,7 +2618,7 @@ namespace Opm
26212618 }
26222619
26232620 // convert to reservoir conditions
2624- EvalWell cq_r_thermal ( this -> primary_variables_ . numWellEq () + Indices::numEq, 0 .) ;
2621+ EvalWell cq_r_thermal{ 0 .} ;
26252622 const unsigned activeCompIdx = FluidSystem::canonicalToActiveCompIdx (FluidSystem::solventComponentIndex (phaseIdx));
26262623 const bool both_oil_gas = FluidSystem::phaseIsActive (FluidSystem::oilPhaseIdx) && FluidSystem::phaseIsActive (FluidSystem::gasPhaseIdx);
26272624 if (!both_oil_gas || FluidSystem::waterPhaseIdx == phaseIdx) {
0 commit comments