StandardWellEval.hpp
Go to the documentation of this file.
1/*
2 Copyright 2017 SINTEF Digital, Mathematics and Cybernetics.
3 Copyright 2017 Statoil ASA.
4 Copyright 2016 - 2017 IRIS AS.
5
6 This file is part of the Open Porous Media project (OPM).
7
8 OPM is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 OPM is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with OPM. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22
23#ifndef OPM_STANDARDWELL_EVAL_HEADER_INCLUDED
24#define OPM_STANDARDWELL_EVAL_HEADER_INCLUDED
25
29
30#include <opm/material/densead/Evaluation.hpp>
31
32#include <vector>
33
34namespace Opm
35{
36
37class ConvergenceReport;
38class DeferredLogger;
39class Schedule;
40class SummaryState;
41class WellContributions;
42template<class FluidSystem, class Indices> class WellInterfaceIndices;
43template<class Scalar> class WellState;
44
45template<class FluidSystem, class Indices>
47{
48protected:
49 using Scalar = typename FluidSystem::Scalar;
52 static constexpr int Bhp = PrimaryVariables::Bhp;
53 static constexpr int WQTotal= PrimaryVariables::WQTotal;
55
58 static constexpr int WFrac = PrimaryVariables::WFrac;
59 static constexpr int GFrac = PrimaryVariables::GFrac;
60 static constexpr int SFrac = PrimaryVariables::SFrac;
61
62public:
64 using Eval = DenseAd::Evaluation<Scalar, Indices::numEq>;
66
69 { return linSys_; }
70
71protected:
73
75
76 EvalWell extendEval(const Eval& in) const;
77
78 // computing the accumulation term for later use in well mass equations
80
82 const std::vector<double>& B_avg,
83 const double maxResidualAllowed,
84 const double tol_wells,
85 const double relaxed_tolerance_flow,
86 const bool relax_tolerance,
87 const bool well_is_stopped,
88 std::vector<double>& res,
89 DeferredLogger& deferred_logger) const;
90
91 void init(std::vector<double>& perf_depth,
92 const std::vector<double>& depth_arg,
93 const int num_cells,
94 const bool has_polymermw);
95
96 void updateWellStateFromPrimaryVariables(const bool stop_or_zero_rate_target,
97 WellState<Scalar>& well_state,
98 const SummaryState& summary_state,
99 DeferredLogger& deferred_logger) const;
100
102
103 // the saturations in the well bore under surface conditions at the beginning of the time step
104 std::vector<double> F0_;
105
108};
109
110}
111
112#endif // OPM_STANDARDWELL_EVAL_HEADER_INCLUDED
Definition: ConvergenceReport.hpp:38
Definition: DeferredLogger.hpp:57
Definition: StandardWellConnections.hpp:42
Definition: StandardWellEquations.hpp:47
Definition: StandardWellEval.hpp:47
StandardWellEval(const WellInterfaceIndices< FluidSystem, Indices > &baseif)
static constexpr int numWellConservationEq
Definition: StandardWellEval.hpp:54
static constexpr bool has_gfrac_variable
Definition: StandardWellEval.hpp:57
ConvergenceReport getWellConvergence(const WellState< Scalar > &well_state, const std::vector< double > &B_avg, const double maxResidualAllowed, const double tol_wells, const double relaxed_tolerance_flow, const bool relax_tolerance, const bool well_is_stopped, std::vector< double > &res, DeferredLogger &deferred_logger) const
static constexpr int GFrac
Definition: StandardWellEval.hpp:59
const WellInterfaceIndices< FluidSystem, Indices > & baseif_
Definition: StandardWellEval.hpp:74
const StandardWellEquations< Scalar, Indices::numEq > & linSys() const
Returns a const reference to equation system.
Definition: StandardWellEval.hpp:68
void updateWellStateFromPrimaryVariables(const bool stop_or_zero_rate_target, WellState< Scalar > &well_state, const SummaryState &summary_state, DeferredLogger &deferred_logger) const
static constexpr int WFrac
Definition: StandardWellEval.hpp:58
StdWellConnections connections_
Connection level values.
Definition: StandardWellEval.hpp:107
PrimaryVariables primary_variables_
Primary variables for well.
Definition: StandardWellEval.hpp:101
StandardWellEquations< Scalar, Indices::numEq > linSys_
Linear equation system.
Definition: StandardWellEval.hpp:106
EvalWell extendEval(const Eval &in) const
std::vector< double > F0_
Definition: StandardWellEval.hpp:104
typename StandardWellEquations< Scalar, Indices::numEq >::BVectorWell BVectorWell
Definition: StandardWellEval.hpp:65
typename PrimaryVariables::EvalWell EvalWell
Definition: StandardWellEval.hpp:63
static constexpr int Bhp
Definition: StandardWellEval.hpp:52
DenseAd::Evaluation< Scalar, Indices::numEq > Eval
Definition: StandardWellEval.hpp:64
static constexpr bool has_wfrac_variable
Definition: StandardWellEval.hpp:56
static constexpr int SFrac
Definition: StandardWellEval.hpp:60
static constexpr int WQTotal
Definition: StandardWellEval.hpp:53
typename FluidSystem::Scalar Scalar
Definition: StandardWellEval.hpp:49
void init(std::vector< double > &perf_depth, const std::vector< double > &depth_arg, const int num_cells, const bool has_polymermw)
Class holding primary variables for StandardWell.
Definition: StandardWellPrimaryVariables.hpp:41
static constexpr int SFrac
Definition: StandardWellPrimaryVariables.hpp:83
static constexpr bool has_gfrac_variable
Definition: StandardWellPrimaryVariables.hpp:80
DenseAd::DynamicEvaluation< Scalar, numStaticWellEq+Indices::numEq+1 > EvalWell
Evaluation for the well equations.
Definition: StandardWellPrimaryVariables.hpp:87
static constexpr bool has_wfrac_variable
Definition: StandardWellPrimaryVariables.hpp:79
static constexpr int WQTotal
The index for the weighted total rate.
Definition: StandardWellPrimaryVariables.hpp:72
static constexpr int GFrac
Definition: StandardWellPrimaryVariables.hpp:82
static constexpr int numWellConservationEq
Number of the conservation equations.
Definition: StandardWellPrimaryVariables.hpp:66
static constexpr int WFrac
Definition: StandardWellPrimaryVariables.hpp:81
static constexpr int Bhp
The index for Bhp in primary variables and the index of well control equation.
Definition: StandardWellPrimaryVariables.hpp:77
Definition: WellInterfaceIndices.hpp:35
Definition: WellState.hpp:62
Definition: BlackoilPhases.hpp:27