From c4c7d2e4f53e66b3e5b06671d90b52488d1bc98a Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 6 Feb 2024 12:12:13 +0100 Subject: [PATCH] WellInterfaceIndices: rename ebosCompIdxToFlowCompIdx to modelCompIdxToFlowCompIdx --- .../wells/MultisegmentWellPrimaryVariables.cpp | 10 +++++----- opm/simulators/wells/MultisegmentWell_impl.hpp | 10 +++++----- opm/simulators/wells/StandardWellConnections.cpp | 2 +- opm/simulators/wells/StandardWellPrimaryVariables.cpp | 2 +- opm/simulators/wells/StandardWell_impl.hpp | 8 ++++---- opm/simulators/wells/WellInterfaceIndices.cpp | 2 +- opm/simulators/wells/WellInterfaceIndices.hpp | 2 +- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/opm/simulators/wells/MultisegmentWellPrimaryVariables.cpp b/opm/simulators/wells/MultisegmentWellPrimaryVariables.cpp index a73d0070a..d7435ce3f 100644 --- a/opm/simulators/wells/MultisegmentWellPrimaryVariables.cpp +++ b/opm/simulators/wells/MultisegmentWellPrimaryVariables.cpp @@ -523,7 +523,7 @@ volumeFractionScaled(const int seg, // For reservoir rate control, the distr in well control is used for the // rate conversion coefficients. For the injection well, only the distr of the injection // phase is not zero. - const double scale = well_.scalingFactor(well_.ebosCompIdxToFlowCompIdx(comp_idx)); + const double scale = well_.scalingFactor(well_.modelCompIdxToFlowCompIdx(comp_idx)); if (scale > 0.) { return this->volumeFraction(seg, comp_idx) / scale; } @@ -564,17 +564,17 @@ getSegmentRateUpwinding(const int seg, if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx) && Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx) == comp_idx && phase == InjectorType::WATER) - return evaluation_[seg][WQTotal] / well_.scalingFactor(well_.ebosCompIdxToFlowCompIdx(comp_idx)); + return evaluation_[seg][WQTotal] / well_.scalingFactor(well_.modelCompIdxToFlowCompIdx(comp_idx)); if (FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx) && Indices::canonicalToActiveComponentIndex(FluidSystem::oilCompIdx) == comp_idx && phase == InjectorType::OIL) - return evaluation_[seg][WQTotal] / well_.scalingFactor(well_.ebosCompIdxToFlowCompIdx(comp_idx)); + return evaluation_[seg][WQTotal] / well_.scalingFactor(well_.modelCompIdxToFlowCompIdx(comp_idx)); if (FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx) && Indices::canonicalToActiveComponentIndex(FluidSystem::gasCompIdx) == comp_idx && phase == InjectorType::GAS) - return evaluation_[seg][WQTotal] / well_.scalingFactor(well_.ebosCompIdxToFlowCompIdx(comp_idx)); + return evaluation_[seg][WQTotal] / well_.scalingFactor(well_.modelCompIdxToFlowCompIdx(comp_idx)); return 0.0; } @@ -648,6 +648,7 @@ INSTANCE(BlackOilTwoPhaseIndices<0u,0u,2u,0u,false,false,0u,2u,0u>) INSTANCE(BlackOilTwoPhaseIndices<0u,0u,0u,1u,false,false,0u,0u,0u>) INSTANCE(BlackOilTwoPhaseIndices<0u,0u,0u,1u,false,true,0u,0u,0u>) INSTANCE(BlackOilTwoPhaseIndices<1u,0u,0u,0u,false,false,0u,0u,0u>) + // Blackoil INSTANCE(BlackOilIndices<0u,0u,0u,0u,false,false,0u,0u>) INSTANCE(BlackOilIndices<1u,0u,0u,0u,false,false,0u,0u>) @@ -659,7 +660,6 @@ INSTANCE(BlackOilIndices<0u,0u,0u,0u,false,true,0u,0u>) INSTANCE(BlackOilIndices<0u,0u,0u,1u,false,true,0u,0u>) INSTANCE(BlackOilIndices<0u,0u,0u,0u,false,false,1u,0u>) INSTANCE(BlackOilIndices<0u,0u,0u,0u,false,true,2u,0u>) - INSTANCE(BlackOilIndices<1u,0u,0u,0u,true,false,0u,0u>) } diff --git a/opm/simulators/wells/MultisegmentWell_impl.hpp b/opm/simulators/wells/MultisegmentWell_impl.hpp index 4d3d50675..b0a3b6c69 100644 --- a/opm/simulators/wells/MultisegmentWell_impl.hpp +++ b/opm/simulators/wells/MultisegmentWell_impl.hpp @@ -369,7 +369,7 @@ namespace Opm allow_cf, cq_s, perf_press, perf_rates, deferred_logger); for(int p = 0; p < np; ++p) { - well_flux[this->ebosCompIdxToFlowCompIdx(p)] += cq_s[p]; + well_flux[this->modelCompIdxToFlowCompIdx(p)] += cq_s[p]; } } } @@ -442,7 +442,7 @@ namespace Opm well_flux.resize(np, 0.0); for (int compIdx = 0; compIdx < this->num_components_; ++compIdx) { const EvalWell rate = well_copy.primary_variables_.getQs(compIdx); - well_flux[this->ebosCompIdxToFlowCompIdx(compIdx)] = rate.value(); + well_flux[this->modelCompIdxToFlowCompIdx(compIdx)] = rate.value(); } debug_cost_counter_ += well_copy.debug_cost_counter_; } @@ -562,7 +562,7 @@ namespace Opm well_potentials.resize(np, 0.0); for (int compIdx = 0; compIdx < this->num_components_; ++compIdx) { const EvalWell rate = well_copy.primary_variables_.getQs(compIdx); - well_potentials[this->ebosCompIdxToFlowCompIdx(compIdx)] = rate.value(); + well_potentials[this->modelCompIdxToFlowCompIdx(compIdx)] = rate.value(); } debug_cost_counter_ += well_copy.debug_cost_counter_; return converged; @@ -1361,7 +1361,7 @@ namespace Opm constexpr int num_eq = MSWEval::numWellEq; for (int comp_idx = 0; comp_idx < this->num_components_; ++comp_idx){ const EvalWell comp_rate = this->primary_variables_.getQs(comp_idx); - const int idx = this->ebosCompIdxToFlowCompIdx(comp_idx); + const int idx = this->modelCompIdxToFlowCompIdx(comp_idx); for (size_t pvIdx = 0; pvIdx < num_eq; ++pvIdx) { // well primary variable derivatives in EvalWell start at position Indices::numEq ws.implicit_ipr_b[idx] -= x_well[0][pvIdx]*comp_rate.derivative(pvIdx+Indices::numEq); @@ -1875,7 +1875,7 @@ namespace Opm // store the perf pressure and rates for (int comp_idx = 0; comp_idx < this->num_components_; ++comp_idx) { - perf_rates[perf*this->number_of_phases_ + this->ebosCompIdxToFlowCompIdx(comp_idx)] = cq_s[comp_idx].value(); + perf_rates[perf*this->number_of_phases_ + this->modelCompIdxToFlowCompIdx(comp_idx)] = cq_s[comp_idx].value(); } perf_press_state[perf] = perf_press.value(); diff --git a/opm/simulators/wells/StandardWellConnections.cpp b/opm/simulators/wells/StandardWellConnections.cpp index 04ddafdcc..6cd3360c3 100644 --- a/opm/simulators/wells/StandardWellConnections.cpp +++ b/opm/simulators/wells/StandardWellConnections.cpp @@ -439,7 +439,7 @@ computeProperties(const WellState& well_state, for (int perf = 0; perf < nperf; ++perf) { for (int comp = 0; comp < np; ++comp) { - perfRates[perf * well_.numComponents() + comp] = perf_rates_state[perf * np + well_.ebosCompIdxToFlowCompIdx(comp)]; + perfRates[perf * well_.numComponents() + comp] = perf_rates_state[perf * np + well_.modelCompIdxToFlowCompIdx(comp)]; } } diff --git a/opm/simulators/wells/StandardWellPrimaryVariables.cpp b/opm/simulators/wells/StandardWellPrimaryVariables.cpp index ece8c18b0..b439f8e70 100644 --- a/opm/simulators/wells/StandardWellPrimaryVariables.cpp +++ b/opm/simulators/wells/StandardWellPrimaryVariables.cpp @@ -485,7 +485,7 @@ typename StandardWellPrimaryVariables::EvalWell StandardWellPrimaryVariables:: volumeFractionScaled(const int compIdx) const { - const int legacyCompIdx = well_.ebosCompIdxToFlowCompIdx(compIdx); + const int legacyCompIdx = well_.modelCompIdxToFlowCompIdx(compIdx); const double scal = well_.scalingFactor(legacyCompIdx); if (scal > 0) return this->volumeFraction(compIdx) / scal; diff --git a/opm/simulators/wells/StandardWell_impl.hpp b/opm/simulators/wells/StandardWell_impl.hpp index bea87fae8..4197e9feb 100644 --- a/opm/simulators/wells/StandardWell_impl.hpp +++ b/opm/simulators/wells/StandardWell_impl.hpp @@ -406,7 +406,7 @@ namespace Opm auto& perf_rate_solvent = perf_data.solvent_rates; perf_rate_solvent[perf] = cq_s[componentIdx].value(); } else { - perf_rates[perf*np + this->ebosCompIdxToFlowCompIdx(componentIdx)] = cq_s[componentIdx].value(); + perf_rates[perf*np + this->modelCompIdxToFlowCompIdx(componentIdx)] = cq_s[componentIdx].value(); } } @@ -897,7 +897,7 @@ namespace Opm for (int comp_idx = 0; comp_idx < this->num_components_; ++comp_idx){ EvalWell comp_rate = this->primary_variables_.getQs(comp_idx); - const int idx = this->ebosCompIdxToFlowCompIdx(comp_idx); + const int idx = this->modelCompIdxToFlowCompIdx(comp_idx); for (size_t pvIdx = 0; pvIdx < nEq; ++pvIdx) { // well primary variable derivatives in EvalWell start at position Indices::numEq ws.implicit_ipr_b[idx] -= x_well[0][pvIdx]*comp_rate.derivative(pvIdx+Indices::numEq); @@ -1459,7 +1459,7 @@ namespace Opm cq_s, perf_rates, deferred_logger); for(int p = 0; p < np; ++p) { - well_flux[this->ebosCompIdxToFlowCompIdx(p)] += cq_s[p]; + well_flux[this->modelCompIdxToFlowCompIdx(p)] += cq_s[p]; } // the solvent contribution is added to the gas potentials @@ -1631,7 +1631,7 @@ namespace Opm well_potentials.resize(np, 0.0); for (int compIdx = 0; compIdx < this->num_components_; ++compIdx) { const EvalWell rate = well_copy.primary_variables_.getQs(compIdx); - well_potentials[this->ebosCompIdxToFlowCompIdx(compIdx)] = rate.value(); + well_potentials[this->modelCompIdxToFlowCompIdx(compIdx)] = rate.value(); } return converged; } diff --git a/opm/simulators/wells/WellInterfaceIndices.cpp b/opm/simulators/wells/WellInterfaceIndices.cpp index f89f8ad85..85258f3c3 100644 --- a/opm/simulators/wells/WellInterfaceIndices.cpp +++ b/opm/simulators/wells/WellInterfaceIndices.cpp @@ -76,7 +76,7 @@ flowPhaseToModelCompIdx(const int phaseIdx) const template int WellInterfaceIndices:: -ebosCompIdxToFlowCompIdx(const unsigned compIdx) const +modelCompIdxToFlowCompIdx(const unsigned compIdx) const { const auto& pu = this->phaseUsage(); if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx) && Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx) == compIdx) diff --git a/opm/simulators/wells/WellInterfaceIndices.hpp b/opm/simulators/wells/WellInterfaceIndices.hpp index e42d4dcdd..0dfd62d8b 100644 --- a/opm/simulators/wells/WellInterfaceIndices.hpp +++ b/opm/simulators/wells/WellInterfaceIndices.hpp @@ -40,7 +40,7 @@ public: using Eval = DenseAd::Evaluation; int flowPhaseToModelCompIdx(const int phaseIdx) const; - int ebosCompIdxToFlowCompIdx(const unsigned compIdx) const; + int modelCompIdxToFlowCompIdx(const unsigned compIdx) const; double scalingFactor(const int phaseIdx) const; template