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#ifndef OPM_STANDARDWELL_EVAL_HEADER_INCLUDED
23#define OPM_STANDARDWELL_EVAL_HEADER_INCLUDED
24
28
29#include <opm/material/densead/Evaluation.hpp>
30
31#include <vector>
32
33namespace Opm
34{
35
36class ConvergenceReport;
37class DeferredLogger;
38class Schedule;
39class SummaryState;
40template<class Scalar> class WellContributions;
41template<class FluidSystem, class Indices> class WellInterfaceIndices;
42template<class Scalar> class WellState;
43
44template<class FluidSystem, class Indices>
46{
47protected:
48 using Scalar = typename FluidSystem::Scalar;
51 static constexpr int Bhp = PrimaryVariables::Bhp;
52 static constexpr int WQTotal= PrimaryVariables::WQTotal;
54
57 static constexpr int WFrac = PrimaryVariables::WFrac;
58 static constexpr int GFrac = PrimaryVariables::GFrac;
59 static constexpr int SFrac = PrimaryVariables::SFrac;
60
61public:
63 using Eval = DenseAd::Evaluation<Scalar, Indices::numEq>;
65
68 { return linSys_; }
69
70protected:
72
74
75 EvalWell extendEval(const Eval& in) const;
76
77 // computing the accumulation term for later use in well mass equations
79
81 const std::vector<Scalar>& B_avg,
82 const Scalar maxResidualAllowed,
83 const Scalar tol_wells,
84 const Scalar relaxed_tolerance_flow,
85 const bool relax_tolerance,
86 const bool well_is_stopped,
87 std::vector<Scalar>& res,
88 DeferredLogger& deferred_logger) const;
89
90 void init(std::vector<Scalar>& perf_depth,
91 const std::vector<Scalar>& depth_arg,
92 const bool has_polymermw);
93
95 const SummaryState& summary_state,
96 DeferredLogger& deferred_logger) const;
97
99
100 // the saturations in the well bore under surface conditions at the beginning of the time step
101 std::vector<Scalar> F0_;
102
105};
106
107}
108
109#endif // OPM_STANDARDWELL_EVAL_HEADER_INCLUDED
Definition: ConvergenceReport.hpp:38
Definition: DeferredLogger.hpp:57
Definition: StandardWellConnections.hpp:45
Definition: StandardWellEquations.hpp:47
Definition: StandardWellEval.hpp:46
StandardWellEval(const WellInterfaceIndices< FluidSystem, Indices > &baseif)
static constexpr int numWellConservationEq
Definition: StandardWellEval.hpp:53
static constexpr bool has_gfrac_variable
Definition: StandardWellEval.hpp:56
static constexpr int GFrac
Definition: StandardWellEval.hpp:58
const WellInterfaceIndices< FluidSystem, Indices > & baseif_
Definition: StandardWellEval.hpp:73
const StandardWellEquations< Scalar, Indices::numEq > & linSys() const
Returns a const reference to equation system.
Definition: StandardWellEval.hpp:67
static constexpr int WFrac
Definition: StandardWellEval.hpp:57
StdWellConnections connections_
Connection level values.
Definition: StandardWellEval.hpp:104
PrimaryVariables primary_variables_
Primary variables for well.
Definition: StandardWellEval.hpp:98
StandardWellEquations< Scalar, Indices::numEq > linSys_
Linear equation system.
Definition: StandardWellEval.hpp:103
EvalWell extendEval(const Eval &in) const
std::vector< Scalar > F0_
Definition: StandardWellEval.hpp:101
typename StandardWellEquations< Scalar, Indices::numEq >::BVectorWell BVectorWell
Definition: StandardWellEval.hpp:64
typename PrimaryVariables::EvalWell EvalWell
Definition: StandardWellEval.hpp:62
static constexpr int Bhp
Definition: StandardWellEval.hpp:51
DenseAd::Evaluation< Scalar, Indices::numEq > Eval
Definition: StandardWellEval.hpp:63
static constexpr bool has_wfrac_variable
Definition: StandardWellEval.hpp:55
static constexpr int SFrac
Definition: StandardWellEval.hpp:59
void init(std::vector< Scalar > &perf_depth, const std::vector< Scalar > &depth_arg, const bool has_polymermw)
void updateWellStateFromPrimaryVariables(WellState< Scalar > &well_state, const SummaryState &summary_state, DeferredLogger &deferred_logger) const
ConvergenceReport getWellConvergence(const WellState< Scalar > &well_state, const std::vector< Scalar > &B_avg, const Scalar maxResidualAllowed, const Scalar tol_wells, const Scalar relaxed_tolerance_flow, const bool relax_tolerance, const bool well_is_stopped, std::vector< Scalar > &res, DeferredLogger &deferred_logger) const
static constexpr int WQTotal
Definition: StandardWellEval.hpp:52
typename FluidSystem::Scalar Scalar
Definition: StandardWellEval.hpp:48
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:34
Definition: WellState.hpp:65
Definition: blackoilboundaryratevector.hh:39