From 2ca8496510bfd61de12082379d5517dc2ff1eb4c Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Fri, 28 Feb 2025 16:28:23 +0100 Subject: [PATCH] fixing compilation warnings. --- flowexperimental/comp/wells/CompWell.hpp | 12 ++++------- .../comp/wells/CompWellInterface.hpp | 3 +-- flowexperimental/comp/wells/CompWellState.hpp | 3 +-- .../comp/wells/CompWellState_impl.hpp | 5 ++--- flowexperimental/comp/wells/CompWell_impl.hpp | 20 +++++++------------ .../comp/wells/CompositionalWellModel.hpp | 2 +- .../wells/CompositionalWellModel_impl.hpp | 8 ++++---- .../comp/wells/SingleCompWellState.hpp | 2 +- .../comp/wells/SingleCompWellState_impl.hpp | 4 ++-- 9 files changed, 23 insertions(+), 36 deletions(-) diff --git a/flowexperimental/comp/wells/CompWell.hpp b/flowexperimental/comp/wells/CompWell.hpp index bd35039ad5..5d8bb7359f 100644 --- a/flowexperimental/comp/wells/CompWell.hpp +++ b/flowexperimental/comp/wells/CompWell.hpp @@ -97,20 +97,17 @@ public: // TODO: control should be passed in later void assembleWellEq(const Simulator& simulator, - const double dt, - const SingleCompWellState& well_state); + const double dt); bool iterateWellEq(const Simulator& simulator, const Scalar dt, SingleCompWellState& well_state); - void solveEqAndUpdateWellState(const Simulator& simulator, - SingleCompWellState& well_state); + void solveEqAndUpdateWellState(SingleCompWellState& well_state); void apply(BVector& r) const override; - void recoverWellSolutionAndUpdateWellState(const Simulator& simulator, - const BVector& x, + void recoverWellSolutionAndUpdateWellState(const BVector& x, SingleCompWellState& well_state); bool getConvergence() const override; @@ -159,8 +156,7 @@ private: // with passing in the SurfaceCondition, we should be able to do this in the primary variable class void updateWellState(SingleCompWellState& well_state) const; - void updateWellState(const Simulator& simulator, - const BVectorWell& dwells, + void updateWellState(const BVectorWell& dwells, SingleCompWellState& well_state); }; diff --git a/flowexperimental/comp/wells/CompWellInterface.hpp b/flowexperimental/comp/wells/CompWellInterface.hpp index cf39b8b018..387646bbfc 100644 --- a/flowexperimental/comp/wells/CompWellInterface.hpp +++ b/flowexperimental/comp/wells/CompWellInterface.hpp @@ -76,8 +76,7 @@ public: /// using the solution x to recover the solution xw for wells and applying /// xw to update Well State - virtual void recoverWellSolutionAndUpdateWellState(const Simulator& simulator, - const BVector& x, + virtual void recoverWellSolutionAndUpdateWellState(const BVector& x, SingleCompWellState& well_state) = 0; virtual bool getConvergence() const = 0; diff --git a/flowexperimental/comp/wells/CompWellState.hpp b/flowexperimental/comp/wells/CompWellState.hpp index 0e19663d4c..de773c8821 100644 --- a/flowexperimental/comp/wells/CompWellState.hpp +++ b/flowexperimental/comp/wells/CompWellState.hpp @@ -42,8 +42,7 @@ public: explicit CompWellState(const PhaseUsage& phase_usage, const CompositionalConfig& comp_config); - void init(const Schedule& schedule, - const std::vector& wells_ecl, + void init(const std::vector& wells_ecl, const std::vector& cell_pressures, const std::vector>& cell_mole_fractions, const std::vector > >& well_connection_data, diff --git a/flowexperimental/comp/wells/CompWellState_impl.hpp b/flowexperimental/comp/wells/CompWellState_impl.hpp index 8799cab5eb..6a8ad329c5 100644 --- a/flowexperimental/comp/wells/CompWellState_impl.hpp +++ b/flowexperimental/comp/wells/CompWellState_impl.hpp @@ -32,13 +32,12 @@ CompWellState(const PhaseUsage& phase_usage, template void CompWellState:: -init(const Schedule& schedule, - const std::vector& wells_ecl, +init(const std::vector& wells_ecl, const std::vector& cell_pressures, const std::vector>& cell_mole_fractions, const std::vector > >& well_connection_data, const SummaryState& summary_state, - const CompWellState* prev_well_state) + const CompWellState* /*prev_well_state*/) { this->base_init(wells_ecl, cell_pressures, cell_mole_fractions, well_connection_data, summary_state); diff --git a/flowexperimental/comp/wells/CompWell_impl.hpp b/flowexperimental/comp/wells/CompWell_impl.hpp index 38f0e5b142..b0baab78f6 100644 --- a/flowexperimental/comp/wells/CompWell_impl.hpp +++ b/flowexperimental/comp/wells/CompWell_impl.hpp @@ -418,8 +418,7 @@ template void CompWell:: assembleWellEq(const Simulator& simulator, - const double dt, - const SingleCompWellState& well_state) + const double dt) { this->well_equations_.clear(); @@ -435,7 +434,6 @@ assembleWellEq(const Simulator& simulator, con_rates[comp_idx] = PrimaryVariables::restrictEval(connection_rates[comp_idx]); } - const unsigned cell_idx = this->well_cells_[0]; // here we use perf index, need to check how the things are done in the StandardWellAssemble // assebmle the well equations related to the produciton/injection mass rates for each component for (unsigned comp_idx = 0; comp_idx < FluidSystem::numComponents; ++comp_idx) { @@ -484,7 +482,6 @@ assembleSourceTerm(const Scalar dt) const EvalWell total_mass_rate = total_surface_rate * density; std::array component_mass_rates; for (unsigned comp_idx = 0; comp_idx < FluidSystem::numComponents; ++comp_idx) { - const auto& val = this->surface_conditions_.massFraction(comp_idx); component_mass_rates[comp_idx] = total_mass_rate * this->surface_conditions_.massFraction(comp_idx); } @@ -511,7 +508,7 @@ iterateWellEq(const Simulator& simulator, bool converged = false; do { - assembleWellEq(simulator, dt, well_state); + assembleWellEq(simulator, dt); std::cout << std::endl << " residuals "; for (const auto& val : this->well_equations_.residual()[0]) { @@ -532,7 +529,7 @@ iterateWellEq(const Simulator& simulator, ++it; - solveEqAndUpdateWellState(simulator, well_state); + solveEqAndUpdateWellState(well_state); } while (it < max_iter); std::cout << "converged " << converged << " after " << it << " iterations" << std::endl; return converged; @@ -541,8 +538,7 @@ iterateWellEq(const Simulator& simulator, template void CompWell:: -solveEqAndUpdateWellState(const Simulator& simulator, - SingleCompWellState& well_state) +solveEqAndUpdateWellState(SingleCompWellState& well_state) { BVectorWell dx_well(1); @@ -564,14 +560,13 @@ apply(BVector& r) const template void CompWell:: -recoverWellSolutionAndUpdateWellState(const Simulator& simulator, - const BVector& x, +recoverWellSolutionAndUpdateWellState(const BVector& x, SingleCompWellState& well_state) { BVectorWell xw(1); this->well_equations_.recoverSolutionWell(x, xw); - updateWellState(simulator, xw, well_state); + updateWellState(xw, well_state); } template @@ -585,8 +580,7 @@ updatePrimaryVariablesNewton(const BVectorWell& dwells) template void CompWell:: -updateWellState(const Simulator& simulator, - const BVectorWell& xw, +updateWellState(const CompWell::BVectorWell& xw, SingleCompWellState& well_state) { this->primary_variables_.updateNewton(xw); diff --git a/flowexperimental/comp/wells/CompositionalWellModel.hpp b/flowexperimental/comp/wells/CompositionalWellModel.hpp index de769f939b..b9c64d23ef 100644 --- a/flowexperimental/comp/wells/CompositionalWellModel.hpp +++ b/flowexperimental/comp/wells/CompositionalWellModel.hpp @@ -161,7 +161,7 @@ private: void initWellContainer(); void initWellConnectionData(); - void initWellState(std::size_t report_step); + void initWellState(); void assemble(const int iterationIdx, const double dt); diff --git a/flowexperimental/comp/wells/CompositionalWellModel_impl.hpp b/flowexperimental/comp/wells/CompositionalWellModel_impl.hpp index 08d0149072..9625b85eae 100644 --- a/flowexperimental/comp/wells/CompositionalWellModel_impl.hpp +++ b/flowexperimental/comp/wells/CompositionalWellModel_impl.hpp @@ -31,7 +31,7 @@ beginReportStep(unsigned report_step) // TODO: not considering the parallel running yet wells_ecl_ = schedule_.getWells(report_step); initWellConnectionData(); - initWellState(report_step); + initWellState(); } template @@ -116,7 +116,7 @@ initWellConnectionData() template void CompositionalWellModel:: -initWellState(const std::size_t report_step) +initWellState() { // TODO: not sure the following is correct const auto pressIx = [this]() @@ -155,7 +155,7 @@ initWellState(const std::size_t report_step) this->simulator_.vanguard().grid().comm()); /* TODO: no prev well state for now */ - this->comp_well_states_.init(this->schedule_, this->wells_ecl_, + this->comp_well_states_.init(this->wells_ecl_, cell_pressure, cell_mole_fractions, this->well_connection_data_, this->summary_state_); } @@ -260,7 +260,7 @@ recoverWellSolutionAndUpdateWellState(const BVector& x) x_local_[i] = x[cells[i]]; } auto& ws = this->comp_well_states_[well->name()]; - well->recoverWellSolutionAndUpdateWellState(simulator_, x_local_, ws); + well->recoverWellSolutionAndUpdateWellState(x_local_, ws); } } } diff --git a/flowexperimental/comp/wells/SingleCompWellState.hpp b/flowexperimental/comp/wells/SingleCompWellState.hpp index 7bf014dbc2..b7a70f476a 100644 --- a/flowexperimental/comp/wells/SingleCompWellState.hpp +++ b/flowexperimental/comp/wells/SingleCompWellState.hpp @@ -57,7 +57,7 @@ class SingleCompWellState { public: SingleCompWellState(const std::string& name, const CompositionalConfig& comp_config, - const PhaseUsage& phase_usage, + const PhaseUsage& phase_usage_input, const std::vector >& connections, bool is_producer); diff --git a/flowexperimental/comp/wells/SingleCompWellState_impl.hpp b/flowexperimental/comp/wells/SingleCompWellState_impl.hpp index 9cfab52f92..7e87ef9477 100644 --- a/flowexperimental/comp/wells/SingleCompWellState_impl.hpp +++ b/flowexperimental/comp/wells/SingleCompWellState_impl.hpp @@ -54,11 +54,11 @@ template SingleCompWellState:: SingleCompWellState(const std::string& well_name, const CompositionalConfig& comp_config, - const PhaseUsage& phase_usage, + const PhaseUsage& phase_usage_input, const std::vector>& connections, bool is_producer) : name(well_name) - , phase_usage(phase_usage) + , phase_usage(phase_usage_input) , producer(is_producer) , surface_phase_rates(phase_usage.num_phases) , phase_fractions(phase_usage.num_phases)