From 25869026e5a9f180a75c358ade9976a80b3924f8 Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Mon, 21 Aug 2017 14:16:24 +0200 Subject: [PATCH] renaming a few functions to reflect the functions better. No functional change. --- opm/autodiff/BlackoilModelEbos.hpp | 2 +- opm/autodiff/StandardWell.hpp | 21 ++++++++++----------- opm/autodiff/StandardWell_impl.hpp | 13 ++++++------- opm/autodiff/StandardWellsDense.hpp | 4 ++-- opm/autodiff/StandardWellsDense_impl.hpp | 21 +++++++++++---------- opm/autodiff/WellInterface.hpp | 11 +++++------ 6 files changed, 35 insertions(+), 37 deletions(-) diff --git a/opm/autodiff/BlackoilModelEbos.hpp b/opm/autodiff/BlackoilModelEbos.hpp index dcfa15aee..e2bbfdb78 100644 --- a/opm/autodiff/BlackoilModelEbos.hpp +++ b/opm/autodiff/BlackoilModelEbos.hpp @@ -324,7 +324,7 @@ namespace Opm { if( nw > 0 ) { - wellModel().applySolutionWellState(x, well_state); + wellModel().recoverWellSolutionAndUpdateWellState(x, well_state); } report.update_time += perfTimer.stop(); } diff --git a/opm/autodiff/StandardWell.hpp b/opm/autodiff/StandardWell.hpp index df3ffd013..ea79b4bbc 100644 --- a/opm/autodiff/StandardWell.hpp +++ b/opm/autodiff/StandardWell.hpp @@ -105,7 +105,7 @@ namespace Opm const int num_cells); - virtual void setWellVariables(); + virtual void setWellPrimaryVariables(); // TODO: to check whether all the paramters are required void computePerfRate(const IntensiveQuantities& intQuants, @@ -120,11 +120,6 @@ namespace Opm virtual bool crossFlowAllowed(const Simulator& ebosSimulator) const; - /// updating the well_state based on well solution dwells - void updateWellState(const BVectorWell& dwells, - const BlackoilModelParameters& param, - WellState& well_state) const; - /// updating the well state based the control mode specified with current // TODO: later will check wheter we need current virtual void updateWellStateWithTarget(const int current, @@ -153,8 +148,8 @@ namespace Opm /// using the solution x to recover the solution xw for wells and applying /// xw to update Well State - virtual void applySolutionWellState(const BVector& x, const ModelParameters& param, - WellState& well_state) const; + virtual void recoverWellSolutionAndUpdateWellState(const BVector& x, const ModelParameters& param, + WellState& well_state) const; /// computing the well potentials for group control virtual void computeWellPotentials(const Simulator& ebosSimulator, @@ -242,6 +237,11 @@ namespace Opm // xw = inv(D)*(rw - C*x) void recoverSolutionWell(const BVector& x, BVectorWell& xw) const; + // updating the well_state based on well solution dwells + void updateWellState(const BVectorWell& dwells, + const BlackoilModelParameters& param, + WellState& well_state) const; + // calculate the properties for the well connections // to calulate the pressure difference between well connections. void computePropertiesForWellConnectionPressures(const Simulator& ebosSimulator, @@ -267,9 +267,8 @@ namespace Opm const std::vector& rvmax_perf, const std::vector& surf_dens_perf); - virtual void wellEqIteration(Simulator& ebosSimulator, - const ModelParameters& param, - WellState& well_state); + virtual void solveEqAndUpdateWellState(const ModelParameters& param, + WellState& well_state); // TODO: maybe we should provide a light version of computePerfRate, which does not include the // calculation of the derivatives diff --git a/opm/autodiff/StandardWell_impl.hpp b/opm/autodiff/StandardWell_impl.hpp index 2054068e2..a02a6a5c4 100644 --- a/opm/autodiff/StandardWell_impl.hpp +++ b/opm/autodiff/StandardWell_impl.hpp @@ -101,7 +101,7 @@ namespace Opm template void StandardWell:: - setWellVariables() + setWellPrimaryVariables() { // TODO: using numComp here is only to make the 2p + dummy phase work // TODO: in theory, we should use numWellEq here. @@ -1571,9 +1571,8 @@ namespace Opm template void StandardWell:: - wellEqIteration(Simulator& ebosSimulator, - const ModelParameters& param, - WellState& well_state) + solveEqAndUpdateWellState(const ModelParameters& param, + WellState& well_state) { // We assemble the well equations, then we check the convergence, // which is why we do not put the assembleWellEq here. @@ -1660,9 +1659,9 @@ namespace Opm template void StandardWell:: - applySolutionWellState(const BVector& x, - const ModelParameters& param, - WellState& well_state) const + recoverWellSolutionAndUpdateWellState(const BVector& x, + const ModelParameters& param, + WellState& well_state) const { BVectorWell xw(1); recoverSolutionWell(x, xw); diff --git a/opm/autodiff/StandardWellsDense.hpp b/opm/autodiff/StandardWellsDense.hpp index 614719d4d..b8c7e5f0b 100644 --- a/opm/autodiff/StandardWellsDense.hpp +++ b/opm/autodiff/StandardWellsDense.hpp @@ -124,7 +124,7 @@ namespace Opm { // using the solution x to recover the solution xw for wells and applying // xw to update Well State - void applySolutionWellState(const BVector& x, WellState& well_state) const; + void recoverWellSolutionAndUpdateWellState(const BVector& x, WellState& well_state) const; int numWells() const; @@ -234,7 +234,7 @@ namespace Opm { void computeAccumWells() const; - void setWellVariables() const; + void setWellPrimaryVariables() const; // The number of components in the model. int numComponents() const diff --git a/opm/autodiff/StandardWellsDense_impl.hpp b/opm/autodiff/StandardWellsDense_impl.hpp index 3ce6641c7..90294ecf8 100644 --- a/opm/autodiff/StandardWellsDense_impl.hpp +++ b/opm/autodiff/StandardWellsDense_impl.hpp @@ -178,8 +178,8 @@ namespace Opm { } updateWellControls(well_state); - // Set the primary variables for the wells - setWellVariables(); + // Set the well primary variables + setWellPrimaryVariables(); if (iterationIdx == 0) { computeWellConnectionPressures(ebosSimulator, well_state); @@ -285,10 +285,10 @@ namespace Opm { template void StandardWellsDense:: - applySolutionWellState(const BVector& x, WellState& well_state) const + recoverWellSolutionAndUpdateWellState(const BVector& x, WellState& well_state) const { for (auto& well : well_container_) { - well->applySolutionWellState(x, param_, well_state); + well->recoverWellSolutionAndUpdateWellState(x, param_, well_state); } } @@ -377,10 +377,10 @@ namespace Opm { template void StandardWellsDense:: - setWellVariables() const + setWellPrimaryVariables() const { for (auto& well : well_container_) { - well->setWellVariables(); + well->setWellPrimaryVariables(); } } @@ -436,7 +436,7 @@ namespace Opm { if( localWellsActive() ) { for (auto& well : well_container_) { - well->wellEqIteration(ebosSimulator, param_, well_state); + well->solveEqAndUpdateWellState(param_, well_state); } } // updateWellControls uses communication @@ -445,7 +445,7 @@ namespace Opm { if( wellsActive() ) { updateWellControls(well_state); - setWellVariables(); + setWellPrimaryVariables(); } } while (it < 15); @@ -638,10 +638,11 @@ namespace Opm { // calculate the well potentials setWellSolutions(well_state); - setWellVariables(); computeWellConnectionPressures(ebos_simulator, well_state); - // To store well potentials for each well + // set the well primary variables, which is used in computePerfRate for computeWellPotentials + // TODO: for computeWellPotentials, no derivative is required actually + setWellPrimaryVariables(); std::vector well_potentials; computeWellPotentials(ebos_simulator, well_state, well_potentials); diff --git a/opm/autodiff/WellInterface.hpp b/opm/autodiff/WellInterface.hpp index 097fa7695..89d15586e 100644 --- a/opm/autodiff/WellInterface.hpp +++ b/opm/autodiff/WellInterface.hpp @@ -104,15 +104,14 @@ namespace Opm const double gravity_arg, const int num_cells); - virtual void setWellVariables() = 0; + virtual void setWellPrimaryVariables() = 0; virtual bool getWellConvergence(Simulator& ebosSimulator, const std::vector& B_avg, const ModelParameters& param) const = 0; - virtual void wellEqIteration(Simulator& ebosSimulator, - const ModelParameters& param, - WellState& well_state) = 0; + virtual void solveEqAndUpdateWellState(const ModelParameters& param, + WellState& well_state) = 0; virtual void assembleWellEq(Simulator& ebosSimulator, const double dt, @@ -128,8 +127,8 @@ namespace Opm // using the solution x to recover the solution xw for wells and applying // xw to update Well State - virtual void applySolutionWellState(const BVector& x, const ModelParameters& param, - WellState& well_state) const = 0; + virtual void recoverWellSolutionAndUpdateWellState(const BVector& x, const ModelParameters& param, + WellState& well_state) const = 0; // Ax = Ax - C D^-1 B x virtual void apply(const BVector& x, BVector& Ax) const = 0;