2016-08-11 06:31:52 -05:00
|
|
|
/*
|
|
|
|
Copyright 2016 SINTEF ICT, Applied Mathematics.
|
2017-03-24 06:19:11 -05:00
|
|
|
Copyright 2016 - 2017 Statoil ASA.
|
|
|
|
Copyright 2017 Dr. Blatt - HPC-Simulation-Software & Services
|
2016-09-13 13:40:30 -05:00
|
|
|
Copyright 2016 IRIS AS
|
2016-08-11 06:31:52 -05:00
|
|
|
|
|
|
|
This file is part of the Open Porous Media project (OPM).
|
|
|
|
|
|
|
|
OPM is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
OPM is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef OPM_STANDARDWELLSDENSE_HEADER_INCLUDED
|
|
|
|
#define OPM_STANDARDWELLSDENSE_HEADER_INCLUDED
|
|
|
|
|
|
|
|
#include <opm/common/OpmLog/OpmLog.hpp>
|
|
|
|
|
|
|
|
#include <opm/common/utility/platform_dependent/disable_warnings.h>
|
|
|
|
#include <opm/common/utility/platform_dependent/reenable_warnings.h>
|
|
|
|
|
|
|
|
#include <cassert>
|
|
|
|
#include <tuple>
|
|
|
|
|
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
|
|
|
|
|
|
|
#include <opm/core/wells.h>
|
|
|
|
#include <opm/core/wells/DynamicListEconLimited.hpp>
|
2017-01-09 03:36:17 -06:00
|
|
|
#include <opm/core/wells/WellCollection.hpp>
|
2016-08-11 06:31:52 -05:00
|
|
|
#include <opm/autodiff/VFPProperties.hpp>
|
2016-08-23 02:45:37 -05:00
|
|
|
#include <opm/autodiff/VFPInjProperties.hpp>
|
|
|
|
#include <opm/autodiff/VFPProdProperties.hpp>
|
|
|
|
#include <opm/autodiff/WellHelpers.hpp>
|
|
|
|
#include <opm/autodiff/BlackoilModelEnums.hpp>
|
|
|
|
#include <opm/autodiff/WellDensitySegmented.hpp>
|
2016-12-29 09:35:24 -06:00
|
|
|
#include <opm/autodiff/BlackoilPropsAdFromDeck.hpp>
|
2016-08-23 02:45:37 -05:00
|
|
|
#include <opm/autodiff/BlackoilDetails.hpp>
|
|
|
|
#include <opm/autodiff/BlackoilModelParameters.hpp>
|
2016-11-01 04:07:28 -05:00
|
|
|
#include <opm/autodiff/WellStateFullyImplicitBlackoilDense.hpp>
|
2017-01-17 06:14:32 -06:00
|
|
|
#include <opm/autodiff/RateConverter.hpp>
|
2016-08-25 08:25:01 -05:00
|
|
|
#include<dune/common/fmatrix.hh>
|
|
|
|
#include<dune/istl/bcrsmatrix.hh>
|
|
|
|
#include<dune/istl/matrixmatrix.hh>
|
2016-08-11 06:31:52 -05:00
|
|
|
|
|
|
|
#include <opm/material/densead/Math.hpp>
|
|
|
|
#include <opm/material/densead/Evaluation.hpp>
|
|
|
|
|
2017-01-24 08:59:41 -06:00
|
|
|
#include <opm/simulators/WellSwitchingLogger.hpp>
|
|
|
|
|
2016-08-11 06:31:52 -05:00
|
|
|
namespace Opm {
|
|
|
|
|
2016-11-18 05:43:53 -06:00
|
|
|
enum WellVariablePositions {
|
|
|
|
XvarWell = 0,
|
|
|
|
WFrac = 1,
|
|
|
|
GFrac = 2
|
|
|
|
};
|
|
|
|
|
2016-08-11 06:31:52 -05:00
|
|
|
|
|
|
|
/// Class for handling the standard well model.
|
2017-04-06 07:21:59 -05:00
|
|
|
template<typename FluidSystem, typename BlackoilIndices, typename ElementContext, typename MaterialLaw>
|
2016-08-11 06:31:52 -05:00
|
|
|
class StandardWellsDense {
|
|
|
|
public:
|
|
|
|
// --------- Types ---------
|
2016-11-01 04:07:28 -05:00
|
|
|
typedef WellStateFullyImplicitBlackoilDense WellState;
|
2016-08-23 02:45:37 -05:00
|
|
|
typedef BlackoilModelParameters ModelParameters;
|
|
|
|
|
2016-08-25 08:25:01 -05:00
|
|
|
typedef double Scalar;
|
2016-11-18 05:43:53 -06:00
|
|
|
static const int blocksize = 3;
|
|
|
|
typedef Dune::FieldVector<Scalar, blocksize > VectorBlockType;
|
|
|
|
typedef Dune::FieldMatrix<Scalar, blocksize, blocksize > MatrixBlockType;
|
2016-11-01 07:41:00 -05:00
|
|
|
typedef Dune::BCRSMatrix <MatrixBlockType> Mat;
|
|
|
|
typedef Dune::BlockVector<VectorBlockType> BVector;
|
2016-11-18 05:43:53 -06:00
|
|
|
typedef DenseAd::Evaluation<double, /*size=*/blocksize*2> EvalWell;
|
|
|
|
|
2017-01-17 06:14:32 -06:00
|
|
|
// For the conversion between the surface volume rate and resrevoir voidage rate
|
|
|
|
using RateConverterType = RateConverter::
|
|
|
|
SurfaceToReservoirVoidage<BlackoilPropsAdFromDeck::FluidSystem, std::vector<int> >;
|
2016-11-01 07:41:00 -05:00
|
|
|
|
2016-08-11 06:31:52 -05:00
|
|
|
// --------- Public methods ---------
|
2016-08-23 02:45:37 -05:00
|
|
|
StandardWellsDense(const Wells* wells_arg,
|
2017-01-09 03:36:17 -06:00
|
|
|
WellCollection* well_collection,
|
2016-08-23 02:45:37 -05:00
|
|
|
const ModelParameters& param,
|
2017-02-13 09:45:06 -06:00
|
|
|
const bool terminal_output);
|
2016-08-23 02:45:37 -05:00
|
|
|
|
2017-01-11 10:02:20 -06:00
|
|
|
void init(const PhaseUsage phase_usage_arg,
|
|
|
|
const std::vector<bool>& active_arg,
|
2016-09-09 07:58:54 -05:00
|
|
|
const VFPProperties* vfp_properties_arg,
|
|
|
|
const double gravity_arg,
|
|
|
|
const std::vector<double>& depth_arg,
|
2017-01-17 06:14:32 -06:00
|
|
|
const std::vector<double>& pv_arg,
|
2017-03-24 09:12:42 -05:00
|
|
|
const RateConverterType* rate_converter,
|
|
|
|
long int global_nc);
|
2016-09-09 07:58:54 -05:00
|
|
|
|
2016-08-23 02:45:37 -05:00
|
|
|
|
|
|
|
template <typename Simulator>
|
2016-11-23 14:44:33 -06:00
|
|
|
SimulatorReport assemble(Simulator& ebosSimulator,
|
2016-08-23 02:45:37 -05:00
|
|
|
const int iterationIdx,
|
|
|
|
const double dt,
|
2017-02-13 09:45:06 -06:00
|
|
|
WellState& well_state);
|
2016-08-25 08:25:01 -05:00
|
|
|
|
2016-09-06 01:27:57 -05:00
|
|
|
template <typename Simulator>
|
|
|
|
void assembleWellEq(Simulator& ebosSimulator,
|
|
|
|
const double dt,
|
2016-09-09 07:58:54 -05:00
|
|
|
WellState& well_state,
|
2017-02-13 09:45:06 -06:00
|
|
|
bool only_wells);
|
2016-09-06 01:27:57 -05:00
|
|
|
|
2017-04-06 07:21:59 -05:00
|
|
|
template <typename Simulator>
|
|
|
|
void
|
|
|
|
getMobility(const Simulator& ebosSimulator,
|
|
|
|
const int perf,
|
|
|
|
const int cell_idx,
|
|
|
|
std::vector<EvalWell>& mob) const;
|
|
|
|
|
2016-10-03 02:54:28 -05:00
|
|
|
template <typename Simulator>
|
2017-02-13 10:07:34 -06:00
|
|
|
bool allow_cross_flow(const int w, Simulator& ebosSimulator) const;
|
2016-10-03 02:54:28 -05:00
|
|
|
|
2017-02-13 10:07:34 -06:00
|
|
|
void localInvert(Mat& istlA) const;
|
2016-08-25 08:25:01 -05:00
|
|
|
|
2017-02-13 10:07:34 -06:00
|
|
|
void print(Mat& istlA) const;
|
2016-08-26 03:17:24 -05:00
|
|
|
|
2016-09-07 06:23:52 -05:00
|
|
|
// substract Binv(D)rw from r;
|
2017-02-13 10:07:34 -06:00
|
|
|
void apply( BVector& r) const;
|
2016-08-25 08:25:01 -05:00
|
|
|
|
2016-09-07 06:23:52 -05:00
|
|
|
// subtract B*inv(D)*C * x from A*x
|
2017-02-13 10:07:34 -06:00
|
|
|
void apply(const BVector& x, BVector& Ax);
|
2016-08-25 08:25:01 -05:00
|
|
|
|
2016-11-17 06:43:39 -06:00
|
|
|
// apply well model with scaling of alpha
|
2017-02-13 10:07:34 -06:00
|
|
|
void applyScaleAdd(const Scalar alpha, const BVector& x, BVector& Ax);
|
2016-11-17 06:43:39 -06:00
|
|
|
|
2016-09-09 04:33:34 -05:00
|
|
|
// xw = inv(D)*(rw - C*x)
|
2017-02-13 10:07:34 -06:00
|
|
|
void recoverVariable(const BVector& x, BVector& xw) const;
|
2016-08-25 08:25:01 -05:00
|
|
|
|
2017-02-13 10:07:34 -06:00
|
|
|
int flowPhaseToEbosCompIdx( const int phaseIdx ) const;
|
2016-08-25 08:25:01 -05:00
|
|
|
|
2017-02-13 10:07:34 -06:00
|
|
|
int flowToEbosPvIdx( const int flowPv ) const;
|
2016-08-23 02:45:37 -05:00
|
|
|
|
2017-02-14 06:39:53 -06:00
|
|
|
int flowPhaseToEbosPhaseIdx( const int phaseIdx ) const;
|
|
|
|
|
2017-02-13 10:07:34 -06:00
|
|
|
int ebosCompToFlowPhaseIdx( const int compIdx ) const;
|
2016-08-11 06:31:52 -05:00
|
|
|
|
2016-09-06 01:27:57 -05:00
|
|
|
std::vector<double>
|
2017-02-13 10:07:34 -06:00
|
|
|
extractPerfData(const std::vector<double>& in) const;
|
2016-08-11 06:31:52 -05:00
|
|
|
|
2017-02-13 10:07:34 -06:00
|
|
|
int numPhases() const;
|
2016-08-23 02:45:37 -05:00
|
|
|
|
2017-02-13 10:07:34 -06:00
|
|
|
int numCells() const;
|
2016-08-11 06:31:52 -05:00
|
|
|
|
2017-02-14 08:06:57 -06:00
|
|
|
void resetWellControlFromState(WellState xw) const;
|
2016-08-19 06:50:27 -05:00
|
|
|
|
2017-02-13 10:07:34 -06:00
|
|
|
const Wells& wells() const;
|
2016-08-11 06:31:52 -05:00
|
|
|
|
2017-02-13 10:07:34 -06:00
|
|
|
const Wells* wellsPointer() const;
|
2016-08-11 06:31:52 -05:00
|
|
|
|
|
|
|
/// return true if wells are available in the reservoir
|
2017-02-13 10:07:34 -06:00
|
|
|
bool wellsActive() const;
|
2016-08-23 02:45:37 -05:00
|
|
|
|
2017-02-13 10:07:34 -06:00
|
|
|
void setWellsActive(const bool wells_active);
|
|
|
|
|
|
|
|
/// return true if wells are available on this process
|
|
|
|
bool localWellsActive() const;
|
2016-08-11 06:31:52 -05:00
|
|
|
|
2017-02-13 10:07:34 -06:00
|
|
|
int numWellVars() const;
|
2016-08-11 06:31:52 -05:00
|
|
|
|
|
|
|
/// Density of each well perforation
|
2017-02-13 10:07:34 -06:00
|
|
|
const std::vector<double>& wellPerforationDensities() const;
|
2016-08-11 06:31:52 -05:00
|
|
|
|
|
|
|
/// Diff to bhp for each well perforation.
|
2017-02-13 10:07:34 -06:00
|
|
|
const std::vector<double>& wellPerforationPressureDiffs() const;
|
2016-09-06 01:27:57 -05:00
|
|
|
|
2016-11-18 05:43:53 -06:00
|
|
|
typedef DenseAd::Evaluation<double, /*size=*/blocksize> Eval;
|
2016-08-23 02:45:37 -05:00
|
|
|
|
2017-02-13 10:07:34 -06:00
|
|
|
EvalWell extendEval(Eval in) const;
|
2016-08-23 02:45:37 -05:00
|
|
|
|
2017-02-13 10:07:34 -06:00
|
|
|
void setWellVariables(const WellState& xw);
|
2016-08-11 06:31:52 -05:00
|
|
|
|
2017-02-13 10:07:34 -06:00
|
|
|
void print(EvalWell in) const;
|
2016-08-23 02:45:37 -05:00
|
|
|
|
2017-02-13 10:07:34 -06:00
|
|
|
void computeAccumWells();
|
2016-08-23 02:45:37 -05:00
|
|
|
|
2017-04-06 07:21:59 -05:00
|
|
|
template<typename FluidState>
|
2016-08-23 02:45:37 -05:00
|
|
|
void
|
2017-04-06 07:21:59 -05:00
|
|
|
computeWellFlux(const int& w, const double& Tw, const FluidState& fs, const std::vector<EvalWell>& mob_perfcells_dense,
|
2017-02-14 04:34:03 -06:00
|
|
|
const EvalWell& bhp, const double& cdp, const bool& allow_cf, std::vector<EvalWell>& cq_s) const;
|
2016-08-23 02:45:37 -05:00
|
|
|
|
|
|
|
template <typename Simulator>
|
2016-11-23 14:44:33 -06:00
|
|
|
SimulatorReport solveWellEq(Simulator& ebosSimulator,
|
2016-08-23 02:45:37 -05:00
|
|
|
const double dt,
|
2017-02-14 04:34:03 -06:00
|
|
|
WellState& well_state);
|
2016-09-07 03:13:24 -05:00
|
|
|
|
2017-02-14 04:34:03 -06:00
|
|
|
void printIf(const int c, const double x, const double y, const double eps, const std::string type) const;
|
2016-09-07 03:13:24 -05:00
|
|
|
|
2017-02-14 04:34:03 -06:00
|
|
|
std::vector<double> residual() const;
|
2016-08-23 02:45:37 -05:00
|
|
|
|
|
|
|
template <typename Simulator>
|
|
|
|
bool getWellConvergence(Simulator& ebosSimulator,
|
2017-02-14 04:34:03 -06:00
|
|
|
const int iteration) const;
|
2016-08-23 02:45:37 -05:00
|
|
|
|
|
|
|
template<typename Simulator>
|
|
|
|
void
|
|
|
|
computeWellConnectionPressures(const Simulator& ebosSimulator,
|
2017-02-14 04:34:03 -06:00
|
|
|
const WellState& xw);
|
2016-08-23 02:45:37 -05:00
|
|
|
|
2017-02-14 04:34:03 -06:00
|
|
|
template<typename Simulator>
|
2016-08-23 02:45:37 -05:00
|
|
|
void
|
|
|
|
computePropertiesForWellConnectionPressures(const Simulator& ebosSimulator,
|
|
|
|
const WellState& xw,
|
|
|
|
std::vector<double>& b_perf,
|
|
|
|
std::vector<double>& rsmax_perf,
|
|
|
|
std::vector<double>& rvmax_perf,
|
2017-02-14 04:34:03 -06:00
|
|
|
std::vector<double>& surf_dens_perf) const;
|
2016-08-11 06:31:52 -05:00
|
|
|
|
2016-09-07 03:13:24 -05:00
|
|
|
void updateWellState(const BVector& dwells,
|
2017-02-14 04:34:03 -06:00
|
|
|
WellState& well_state) const;
|
2016-09-07 03:13:24 -05:00
|
|
|
|
2016-08-23 02:45:37 -05:00
|
|
|
|
2016-08-11 06:31:52 -05:00
|
|
|
|
2017-02-14 04:34:03 -06:00
|
|
|
void updateWellControls(WellState& xw) const;
|
2016-08-23 02:45:37 -05:00
|
|
|
|
2016-08-11 06:31:52 -05:00
|
|
|
/// upate the dynamic lists related to economic limits
|
|
|
|
void
|
2016-10-20 13:16:42 -05:00
|
|
|
updateListEconLimited(const Schedule& schedule,
|
2016-08-11 06:31:52 -05:00
|
|
|
const int current_step,
|
2016-08-23 02:45:37 -05:00
|
|
|
const Wells* wells_struct,
|
2016-08-11 06:31:52 -05:00
|
|
|
const WellState& well_state,
|
2017-02-14 06:39:53 -06:00
|
|
|
DynamicListEconLimited& list_econ_limited) const;
|
2016-08-11 06:31:52 -05:00
|
|
|
|
2016-08-12 07:34:27 -05:00
|
|
|
void computeWellConnectionDensitesPressures(const WellState& xw,
|
|
|
|
const std::vector<double>& b_perf,
|
|
|
|
const std::vector<double>& rsmax_perf,
|
|
|
|
const std::vector<double>& rvmax_perf,
|
|
|
|
const std::vector<double>& surf_dens_perf,
|
|
|
|
const std::vector<double>& depth_perf,
|
2017-02-14 06:39:53 -06:00
|
|
|
const double grav);
|
2017-01-06 09:10:42 -06:00
|
|
|
|
|
|
|
|
|
|
|
// TODO: Later we might want to change the function to only handle one well,
|
|
|
|
// the requirement for well potential calculation can be based on individual wells.
|
|
|
|
// getBhp() will be refactored to reduce the duplication of the code calculating the bhp from THP.
|
|
|
|
template<typename Simulator>
|
|
|
|
void
|
|
|
|
computeWellPotentials(const Simulator& ebosSimulator,
|
2017-02-14 06:39:53 -06:00
|
|
|
WellState& well_state) const;
|
2017-01-09 03:36:17 -06:00
|
|
|
|
2017-02-14 08:06:57 -06:00
|
|
|
WellCollection* wellCollection() const;
|
2017-01-09 04:29:00 -06:00
|
|
|
|
|
|
|
const std::vector<double>&
|
2017-02-14 08:06:57 -06:00
|
|
|
wellPerfEfficiencyFactors() const;
|
2017-01-17 07:27:29 -06:00
|
|
|
|
2017-02-14 08:06:57 -06:00
|
|
|
void calculateEfficiencyFactors();
|
2017-01-17 07:27:29 -06:00
|
|
|
|
|
|
|
void computeWellVoidageRates(const WellState& well_state,
|
|
|
|
std::vector<double>& well_voidage_rates,
|
2017-02-14 08:06:57 -06:00
|
|
|
std::vector<double>& voidage_conversion_coeffs) const;
|
2017-01-17 08:15:23 -06:00
|
|
|
|
2017-02-14 08:06:57 -06:00
|
|
|
void applyVREPGroupControl(WellState& well_state) const;
|
2017-01-17 08:15:23 -06:00
|
|
|
|
|
|
|
|
2016-08-11 06:31:52 -05:00
|
|
|
protected:
|
|
|
|
bool wells_active_;
|
|
|
|
const Wells* wells_;
|
2017-01-09 03:36:17 -06:00
|
|
|
|
|
|
|
// Well collection is used to enforce the group control
|
|
|
|
WellCollection* well_collection_;
|
|
|
|
|
2016-08-23 02:45:37 -05:00
|
|
|
ModelParameters param_;
|
|
|
|
bool terminal_output_;
|
2016-08-11 06:31:52 -05:00
|
|
|
|
2017-01-11 10:02:20 -06:00
|
|
|
PhaseUsage phase_usage_;
|
|
|
|
std::vector<bool> active_;
|
2016-08-11 06:31:52 -05:00
|
|
|
const VFPProperties* vfp_properties_;
|
|
|
|
double gravity_;
|
2017-01-17 06:14:32 -06:00
|
|
|
const RateConverterType* rate_converter_;
|
2017-01-09 04:29:00 -06:00
|
|
|
|
|
|
|
// The efficiency factor for each connection. It is specified based on wells and groups,
|
|
|
|
// We calculate the factor for each connection for the computation of contributions to the mass balance equations.
|
|
|
|
// By default, they should all be one.
|
|
|
|
std::vector<double> well_perforation_efficiency_factors_;
|
2016-08-11 06:31:52 -05:00
|
|
|
// the depth of the all the cell centers
|
|
|
|
// for standard Wells, it the same with the perforation depth
|
2016-09-06 01:27:57 -05:00
|
|
|
std::vector<double> cell_depths_;
|
|
|
|
std::vector<double> pv_;
|
2016-08-11 06:31:52 -05:00
|
|
|
|
2016-09-07 04:21:51 -05:00
|
|
|
std::vector<double> well_perforation_densities_;
|
|
|
|
std::vector<double> well_perforation_pressure_diffs_;
|
2016-08-11 06:31:52 -05:00
|
|
|
|
2016-08-23 02:45:37 -05:00
|
|
|
std::vector<EvalWell> wellVariables_;
|
|
|
|
std::vector<double> F0_;
|
2016-09-06 01:27:57 -05:00
|
|
|
|
2016-08-25 08:25:01 -05:00
|
|
|
Mat duneB_;
|
|
|
|
Mat duneC_;
|
|
|
|
Mat invDuneD_;
|
2016-09-13 13:40:30 -05:00
|
|
|
|
2016-08-25 08:25:01 -05:00
|
|
|
BVector resWell_;
|
2016-08-11 06:31:52 -05:00
|
|
|
|
2017-03-24 09:12:42 -05:00
|
|
|
long int global_nc_;
|
|
|
|
|
2016-11-02 04:43:55 -05:00
|
|
|
mutable BVector Cx_;
|
|
|
|
mutable BVector invDrw_;
|
2016-11-17 06:43:39 -06:00
|
|
|
mutable BVector scaleAddRes_;
|
2016-11-02 04:43:55 -05:00
|
|
|
|
2016-11-25 05:40:33 -06:00
|
|
|
double dbhpMaxRel() const {return param_.dbhp_max_rel_; }
|
|
|
|
double dWellFractionMax() const {return param_.dwell_fraction_max_; }
|
|
|
|
|
2016-08-11 06:31:52 -05:00
|
|
|
// protected methods
|
2017-02-14 08:06:57 -06:00
|
|
|
EvalWell getBhp(const int wellIdx) const;
|
|
|
|
|
|
|
|
EvalWell getQs(const int wellIdx, const int phaseIdx) const;
|
|
|
|
|
|
|
|
EvalWell wellVolumeFraction(const int wellIdx, const int phaseIdx) const;
|
|
|
|
|
|
|
|
EvalWell wellVolumeFractionScaled(const int wellIdx, const int phaseIdx) const;
|
|
|
|
|
2017-03-07 06:31:40 -06:00
|
|
|
// Q_p / (Q_w + Q_g + Q_o) for three phase cases.
|
|
|
|
EvalWell wellSurfaceVolumeFraction(const int well_index, const int phase) const;
|
|
|
|
|
2016-08-11 06:31:52 -05:00
|
|
|
bool checkRateEconLimits(const WellEconProductionLimits& econ_production_limits,
|
|
|
|
const WellState& well_state,
|
2017-02-14 08:06:57 -06:00
|
|
|
const int well_number) const;
|
2016-08-11 06:31:52 -05:00
|
|
|
|
|
|
|
using WellMapType = typename WellState::WellMapType;
|
|
|
|
using WellMapEntryType = typename WellState::mapentry_t;
|
|
|
|
|
|
|
|
// a tuple type for ratio limit check.
|
|
|
|
// first value indicates whether ratio limit is violated, when the ratio limit is not violated, the following three
|
|
|
|
// values should not be used.
|
|
|
|
// second value indicates whehter there is only one connection left.
|
|
|
|
// third value indicates the indx of the worst-offending connection.
|
|
|
|
// the last value indicates the extent of the violation for the worst-offending connection, which is defined by
|
|
|
|
// the ratio of the actual value to the value of the violated limit.
|
|
|
|
using RatioCheckTuple = std::tuple<bool, bool, int, double>;
|
|
|
|
|
|
|
|
enum ConnectionIndex {
|
|
|
|
INVALIDCONNECTION = -10000
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
RatioCheckTuple checkRatioEconLimits(const WellEconProductionLimits& econ_production_limits,
|
|
|
|
const WellState& well_state,
|
2017-02-14 08:06:57 -06:00
|
|
|
const WellMapEntryType& map_entry) const;
|
|
|
|
|
2016-08-11 06:31:52 -05:00
|
|
|
RatioCheckTuple checkMaxWaterCutLimit(const WellEconProductionLimits& econ_production_limits,
|
|
|
|
const WellState& well_state,
|
2017-02-14 08:06:57 -06:00
|
|
|
const WellMapEntryType& map_entry) const;
|
|
|
|
|
2017-01-24 08:30:35 -06:00
|
|
|
void updateWellStateWithTarget(const WellControls* wc,
|
|
|
|
const int current,
|
|
|
|
const int well_index,
|
2017-02-14 08:06:57 -06:00
|
|
|
WellState& xw) const;
|
2017-01-24 08:30:35 -06:00
|
|
|
|
2016-08-11 06:31:52 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace Opm
|
2017-02-13 09:45:06 -06:00
|
|
|
|
|
|
|
#include "StandardWellsDense_impl.hpp"
|
2016-08-11 06:31:52 -05:00
|
|
|
#endif
|