Merge pull request #4294 from akva2/stdwell_avoid_mutable

StandardWell: avoid mutable primary variables
This commit is contained in:
Bård Skaflestad
2022-11-25 15:12:00 +01:00
committed by GitHub
6 changed files with 24 additions and 24 deletions

View File

@@ -94,7 +94,7 @@ namespace Opm
const std::vector< Scalar >& B_avg,
const bool changed_to_open_this_step) override;
virtual void initPrimaryVariablesEvaluation() const override;
void initPrimaryVariablesEvaluation() override;
/// updating the well state based the current control mode
virtual void updateWellStateWithTarget(const Simulator& ebos_simulator,
@@ -115,9 +115,9 @@ namespace Opm
/// using the solution x to recover the solution xw for wells and applying
/// xw to update Well State
virtual void recoverWellSolutionAndUpdateWellState(const BVector& x,
WellState& well_state,
DeferredLogger& deferred_logger) const override;
void recoverWellSolutionAndUpdateWellState(const BVector& x,
WellState& well_state,
DeferredLogger& deferred_logger) override;
/// computing the well potentials for group control
virtual void computeWellPotentials(const Simulator& ebosSimulator,
@@ -125,7 +125,7 @@ namespace Opm
std::vector<double>& well_potentials,
DeferredLogger& deferred_logger) override;
virtual void updatePrimaryVariables(const WellState& well_state, DeferredLogger& deferred_logger) const override;
void updatePrimaryVariables(const WellState& well_state, DeferredLogger& deferred_logger) override;
virtual void solveEqAndUpdateWellState(WellState& well_state, DeferredLogger& deferred_logger) override; // const?

View File

@@ -127,7 +127,7 @@ namespace Opm
template <typename TypeTag>
void
MultisegmentWell<TypeTag>::
initPrimaryVariablesEvaluation() const
initPrimaryVariablesEvaluation()
{
this->MSWEval::initPrimaryVariablesEvaluation();
}
@@ -139,7 +139,7 @@ namespace Opm
template <typename TypeTag>
void
MultisegmentWell<TypeTag>::
updatePrimaryVariables(const WellState& well_state, DeferredLogger& /* deferred_logger */) const
updatePrimaryVariables(const WellState& well_state, DeferredLogger& /* deferred_logger */)
{
this->MSWEval::updatePrimaryVariables(well_state);
}
@@ -238,7 +238,7 @@ namespace Opm
MultisegmentWell<TypeTag>::
recoverWellSolutionAndUpdateWellState(const BVector& x,
WellState& well_state,
DeferredLogger& deferred_logger) const
DeferredLogger& deferred_logger)
{
if (!this->isOperableAndSolvable() && !this->wellIsStopped()) return;

View File

@@ -144,7 +144,7 @@ namespace Opm
const bool changed_to_open_this_step) override;
virtual void initPrimaryVariablesEvaluation() const override;
void initPrimaryVariablesEvaluation() override;
/// check whether the well equations get converged for this well
virtual ConvergenceReport getWellConvergence(const WellState& well_state,
@@ -159,9 +159,9 @@ namespace Opm
/// using the solution x to recover the solution xw for wells and applying
/// xw to update Well State
virtual void recoverWellSolutionAndUpdateWellState(const BVector& x,
WellState& well_state,
DeferredLogger& deferred_logger) const override;
void recoverWellSolutionAndUpdateWellState(const BVector& x,
WellState& well_state,
DeferredLogger& deferred_logger) override;
/// computing the well potentials for group control
virtual void computeWellPotentials(const Simulator& ebosSimulator,
@@ -169,7 +169,7 @@ namespace Opm
std::vector<double>& well_potentials,
DeferredLogger& deferred_logger) /* const */ override;
virtual void updatePrimaryVariables(const WellState& well_state, DeferredLogger& deferred_logger) const override;
void updatePrimaryVariables(const WellState& well_state, DeferredLogger& deferred_logger) override;
virtual void solveEqAndUpdateWellState(WellState& well_state, DeferredLogger& deferred_logger) override;
@@ -257,7 +257,7 @@ namespace Opm
// updating the well_state based on well solution dwells
void updateWellState(const BVectorWell& dwells,
WellState& well_state,
DeferredLogger& deferred_logger) const;
DeferredLogger& deferred_logger);
// calculate the properties for the well connections
// to calulate the pressure difference between well connections.
@@ -355,7 +355,7 @@ namespace Opm
void updatePrimaryVariablesNewton(const BVectorWell& dwells,
const WellState& well_state,
DeferredLogger& deferred_logger) const;
DeferredLogger& deferred_logger);
void updateWellStateFromPrimaryVariables(WellState& well_state, DeferredLogger& deferred_logger) const;

View File

@@ -105,7 +105,7 @@ protected:
void updateWellStateFromPrimaryVariables(WellState& well_state,
DeferredLogger& deferred_logger) const;
mutable PrimaryVariables primary_variables_; //!< Primary variables for well
PrimaryVariables primary_variables_; //!< Primary variables for well
// the saturations in the well bore under surface conditions at the beginning of the time step
std::vector<double> F0_;

View File

@@ -75,7 +75,7 @@ namespace Opm
template<typename TypeTag>
void StandardWell<TypeTag>::
initPrimaryVariablesEvaluation() const
initPrimaryVariablesEvaluation()
{
this->primary_variables_.init();
}
@@ -932,7 +932,7 @@ namespace Opm
StandardWell<TypeTag>::
updateWellState(const BVectorWell& dwells,
WellState& well_state,
DeferredLogger& deferred_logger) const
DeferredLogger& deferred_logger)
{
if (!this->isOperableAndSolvable() && !this->wellIsStopped()) return;
@@ -951,7 +951,7 @@ namespace Opm
StandardWell<TypeTag>::
updatePrimaryVariablesNewton(const BVectorWell& dwells,
const WellState& /* well_state */,
DeferredLogger& deferred_logger) const
DeferredLogger& deferred_logger)
{
const double dFLimit = this->param_.dwell_fraction_max_;
const double dBHPLimit = this->param_.dbhp_max_rel_;
@@ -1729,7 +1729,7 @@ namespace Opm
StandardWell<TypeTag>::
recoverWellSolutionAndUpdateWellState(const BVector& x,
WellState& well_state,
DeferredLogger& deferred_logger) const
DeferredLogger& deferred_logger)
{
if (!this->isOperableAndSolvable() && !this->wellIsStopped()) return;
@@ -2010,7 +2010,7 @@ namespace Opm
template<typename TypeTag>
void
StandardWell<TypeTag>::
updatePrimaryVariables(const WellState& well_state, DeferredLogger& deferred_logger) const
updatePrimaryVariables(const WellState& well_state, DeferredLogger& deferred_logger)
{
if (!this->isOperableAndSolvable() && !this->wellIsStopped()) return;

View File

@@ -148,7 +148,7 @@ public:
const std::vector< Scalar >& B_avg,
const bool changed_to_open_this_step);
virtual void initPrimaryVariablesEvaluation() const = 0;
virtual void initPrimaryVariablesEvaluation() = 0;
virtual ConvergenceReport getWellConvergence(const WellState& well_state, const std::vector<double>& B_avg, DeferredLogger& deferred_logger, const bool relax_tolerance) const = 0;
@@ -178,7 +178,7 @@ public:
/// xw to update Well State
virtual void recoverWellSolutionAndUpdateWellState(const BVector& x,
WellState& well_state,
DeferredLogger& deferred_logger) const = 0;
DeferredLogger& deferred_logger) = 0;
/// Ax = Ax - C D^-1 B x
virtual void apply(const BVector& x, BVector& Ax) const = 0;
@@ -204,7 +204,7 @@ public:
const GroupState& group_state,
DeferredLogger& deferred_logger) /* const */;
virtual void updatePrimaryVariables(const WellState& well_state, DeferredLogger& deferred_logger) const = 0;
virtual void updatePrimaryVariables(const WellState& well_state, DeferredLogger& deferred_logger) = 0;
virtual void calculateExplicitQuantities(const Simulator& ebosSimulator,
const WellState& well_state,