@@ -388,9 +388,9 @@ namespace Opm
388388 auto & perf_rates = perf_data.phase_rates ;
389389 for (int perf = 0 ; perf < this ->number_of_local_perforations_ ; ++perf) {
390390 // Calculate perforation quantities.
391- std::vector<EvalWell> cq_s (this ->num_conservation_quantities_ , { this -> primary_variables_ . numWellEq () + Indices::numEq, 0.0 } );
392- EvalWell water_flux_s{this -> primary_variables_ . numWellEq () + Indices::numEq, 0.0 };
393- EvalWell cq_s_zfrac_effective{this -> primary_variables_ . numWellEq () + Indices::numEq, 0.0 };
391+ std::vector<EvalWell> cq_s (this ->num_conservation_quantities_ , 0.0 );
392+ EvalWell water_flux_s{0.0 };
393+ EvalWell cq_s_zfrac_effective{0.0 };
394394 calculateSinglePerf (simulator, perf, well_state, connectionRates,
395395 cq_s, water_flux_s, cq_s_zfrac_effective, deferred_logger);
396396
@@ -448,7 +448,7 @@ namespace Opm
448448 for (int componentIdx = 0 ; componentIdx < numWellConservationEq; ++componentIdx) {
449449 // TODO: following the development in MSW, we need to convert the volume of the wellbore to be surface volume
450450 // since all the rates are under surface condition
451- EvalWell resWell_loc (this -> primary_variables_ . numWellEq () + Indices::numEq, 0.0 );
451+ EvalWell resWell_loc (0.0 );
452452 if (FluidSystem::numActivePhases () > 1 ) {
453453 assert (dt > 0 );
454454 resWell_loc += (this ->primary_variables_ .surfaceVolumeFraction (componentIdx) -
@@ -503,7 +503,7 @@ namespace Opm
503503 const EvalWell& bhp = this ->primary_variables_ .eval (Bhp);
504504 const int cell_idx = this ->well_cells_ [perf];
505505 const auto & intQuants = simulator.model ().intensiveQuantities (cell_idx, /* timeIdx=*/ 0 );
506- std::vector<EvalWell> mob (this ->num_conservation_quantities_ , {this -> primary_variables_ . numWellEq () + Indices::numEq, 0 .});
506+ std::vector<EvalWell> mob (this ->num_conservation_quantities_ , {0 .});
507507 getMobility (simulator, perf, mob, deferred_logger);
508508
509509 PerforationRates<Scalar> perf_rates;
@@ -694,7 +694,7 @@ namespace Opm
694694 // as a result, the polymer and water share the same viscosity
695695 if constexpr (!Base::has_polymermw) {
696696 if constexpr (std::is_same_v<Value, Scalar>) {
697- std::vector<EvalWell> mob_eval (this ->num_conservation_quantities_ , { this -> primary_variables_ . numWellEq () + Indices::numEq, 0 .} );
697+ std::vector<EvalWell> mob_eval (this ->num_conservation_quantities_ , 0 . );
698698 for (std::size_t i = 0 ; i < mob.size (); ++i) {
699699 mob_eval[i].setValue (mob[i]);
700700 }
@@ -1872,7 +1872,7 @@ namespace Opm
18721872 const bool allow_cf = this ->getAllowCrossFlow () || openCrossFlowAvoidSingularity (simulator);
18731873 const EvalWell& bhp = this ->primary_variables_ .eval (Bhp);
18741874
1875- std::vector<EvalWell> cq_s (this ->num_conservation_quantities_ , { this -> primary_variables_ . numWellEq () + Indices::numEq, 0 .} );
1875+ std::vector<EvalWell> cq_s (this ->num_conservation_quantities_ , 0 . );
18761876 PerforationRates<Scalar> perf_rates;
18771877 Scalar trans_mult = simulator.problem ().template wellTransMultiplier <Scalar>(int_quant, cell_idx);
18781878 const auto & wellstate_nupcol = simulator.problem ().wellModel ().nupcolWellState ().well (this ->index_of_well_ );
@@ -1947,10 +1947,9 @@ namespace Opm
19471947 deferred_logger);
19481948 }
19491949 const auto & water_table_func = PolymerModule::getSkprwatTable (water_table_id);
1950- const EvalWell throughput_eval ( this -> primary_variables_ . numWellEq () + Indices::numEq, throughput) ;
1950+ const EvalWell throughput_eval{ throughput} ;
19511951 // the skin pressure when injecting water, which also means the polymer concentration is zero
1952- EvalWell pskin_water (this ->primary_variables_ .numWellEq () + Indices::numEq, 0.0 );
1953- pskin_water = water_table_func.eval (throughput_eval, water_velocity);
1952+ EvalWell pskin_water = water_table_func.eval (throughput_eval, water_velocity);
19541953 return pskin_water;
19551954 } else {
19561955 OPM_DEFLOG_THROW (std::runtime_error,
@@ -1986,10 +1985,9 @@ namespace Opm
19861985 }
19871986 const auto & skprpolytable = PolymerModule::getSkprpolyTable (polymer_table_id);
19881987 const Scalar reference_concentration = skprpolytable.refConcentration ;
1989- const EvalWell throughput_eval ( this -> primary_variables_ . numWellEq () + Indices::numEq, throughput) ;
1988+ const EvalWell throughput_eval{ throughput} ;
19901989 // the skin pressure when injecting water, which also means the polymer concentration is zero
1991- EvalWell pskin_poly (this ->primary_variables_ .numWellEq () + Indices::numEq, 0.0 );
1992- pskin_poly = skprpolytable.table_func .eval (throughput_eval, water_velocity_abs);
1990+ const EvalWell pskin_poly = skprpolytable.table_func .eval (throughput_eval, water_velocity_abs);
19931991 if (poly_inj_conc == reference_concentration) {
19941992 return sign * pskin_poly;
19951993 }
@@ -2019,8 +2017,8 @@ namespace Opm
20192017 if constexpr (Base::has_polymermw) {
20202018 const int table_id = this ->polymerInjTable_ ();
20212019 const auto & table_func = PolymerModule::getPlymwinjTable (table_id);
2022- const EvalWell throughput_eval ( this -> primary_variables_ . numWellEq () + Indices::numEq, throughput) ;
2023- EvalWell molecular_weight ( this -> primary_variables_ . numWellEq () + Indices::numEq, 0 .) ;
2020+ const EvalWell throughput_eval{ throughput} ;
2021+ EvalWell molecular_weight{ 0 .} ;
20242022 if (this ->wpolymer () == 0 .) { // not injecting polymer
20252023 return molecular_weight;
20262024 }
@@ -2119,8 +2117,7 @@ namespace Opm
21192117 const Scalar throughput = perf_water_throughput[perf];
21202118 const int pskin_index = Bhp + 1 + this ->number_of_local_perforations_ + perf;
21212119
2122- EvalWell poly_conc (this ->primary_variables_ .numWellEq () + Indices::numEq, 0.0 );
2123- poly_conc.setValue (this ->wpolymer ());
2120+ const EvalWell poly_conc (this ->wpolymer ());
21242121
21252122 // equation for the skin pressure
21262123 const EvalWell eq_pskin = this ->primary_variables_ .eval (pskin_index)
@@ -2582,7 +2579,7 @@ namespace Opm
25822579 }
25832580
25842581 // convert to reservoir conditions
2585- EvalWell cq_r_thermal ( this -> primary_variables_ . numWellEq () + Indices::numEq, 0 .) ;
2582+ EvalWell cq_r_thermal{ 0 .} ;
25862583 const unsigned activeCompIdx = FluidSystem::canonicalToActiveCompIdx (FluidSystem::solventComponentIndex (phaseIdx));
25872584 const bool both_oil_gas = FluidSystem::phaseIsActive (FluidSystem::oilPhaseIdx) && FluidSystem::phaseIsActive (FluidSystem::gasPhaseIdx);
25882585 if (!both_oil_gas || FluidSystem::waterPhaseIdx == phaseIdx) {
0 commit comments