From ba547c8f8e2c692f4572cc4802ec0d0271a4747b Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Fri, 16 Aug 2024 14:50:55 +0200 Subject: [PATCH] remove unused variables and/or unused assignements quells sca warnings --- opm/core/transport/implicit/ImplicitTransport.hpp | 10 +++++----- opm/upscaling/SteadyStateUpscalerImplicit_impl.hpp | 8 -------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/opm/core/transport/implicit/ImplicitTransport.hpp b/opm/core/transport/implicit/ImplicitTransport.hpp index fb2dd97..8cd4833 100644 --- a/opm/core/transport/implicit/ImplicitTransport.hpp +++ b/opm/core/transport/implicit/ImplicitTransport.hpp @@ -119,14 +119,14 @@ namespace Opm { const ImplicitTransportDetails::NRControl& ctrl , ReservoirState& state , LinearSolver& linsolve, - ImplicitTransportDetails::NRReport& rpt ) { - bool init; + ImplicitTransportDetails::NRReport& rpt ) + { typedef typename JacobianSystem::vector_type vector_type; typedef typename JacobianSystem::matrix_type matrix_type; asm_.createSystem(g, sys_); model_.initStep(state, g, sys_); - init = model_.initIteration(state, g, sys_); + model_.initIteration(state, g, sys_); MZero::zero(sys_.writableMatrix()); VZero::zero(sys_.vector().writableResidual()); @@ -157,7 +157,7 @@ namespace Opm { VNorm::norm(sys_.vector().increment()); // Begin line search - double residual=VNorm::norm(sys_.vector().residual()); + double residual; int lin_it=0; bool finished=rpt.norm_res::zero(sys_.writableMatrix()); VZero::zero(sys_.vector().writableResidual()); diff --git a/opm/upscaling/SteadyStateUpscalerImplicit_impl.hpp b/opm/upscaling/SteadyStateUpscalerImplicit_impl.hpp index 0048b70..473aeae 100644 --- a/opm/upscaling/SteadyStateUpscalerImplicit_impl.hpp +++ b/opm/upscaling/SteadyStateUpscalerImplicit_impl.hpp @@ -233,7 +233,6 @@ namespace Opm double ecl_time = 0.0; std::vector ecl_sat; std::vector ecl_press; - std::vector init_saturation(saturation); while ((!stationary) && (it_count < max_it_)) { // && transport_cost < max_transport_cost_) // Run transport solver. std::cout << "Running transport step " << it_count << " with stepsize " @@ -242,7 +241,6 @@ namespace Opm this->flow_solver_.getSolution(), injection); // Run pressure solver. if (converged) { - init_saturation = saturation; // this->flow_solver_.solve(this->res_prop_, saturation, this->bcond_, src, // this->residual_tolerance_, this->linsolver_verbosity_, this->linsolver_type_); // max_mod = this->flow_solver_.postProcessFluxes(); @@ -324,7 +322,6 @@ namespace Opm } } else { std::cerr << "Cutting time step\n"; - init_saturation = saturation_old; stepsize=stepsize/2.0; } ++it_count; @@ -466,9 +463,6 @@ namespace Opm double side1_flux_oil = 0.0; double side2_flux_oil = 0.0; std::map frac_flow_by_bid; - int num_cells = this->ginterf_.numberOfCells(); - std::vector cell_inflows_w(num_cells, 0.0); - std::vector cell_outflows_w(num_cells, 0.0); // Two passes: First pass, deal with outflow, second pass, deal with inflow. // This is for the periodic case, so that we are sure all fractional flows have @@ -497,7 +491,6 @@ namespace Opm assert(sc.isDirichlet()); frac_flow = this->res_prop_.fractionalFlow(c->index(), sc.saturation()); } - cell_inflows_w[c->index()] += flux*frac_flow; side1_flux += flux*frac_flow; side1_flux_oil += flux*(1.0 - frac_flow); } else if (flux >= 0.0 && pass == 0) { @@ -507,7 +500,6 @@ namespace Opm frac_flow_by_bid[f->boundaryId()] = frac_flow; // std::cout << "Inserted bid " << f->boundaryId() << std::endl; } - cell_outflows_w[c->index()] += flux*frac_flow; side2_flux += flux*frac_flow; side2_flux_oil += flux*(1.0 - frac_flow); }