My Project
Loading...
Searching...
No Matches
StandardWellEval.hpp
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
26#include <opm/simulators/wells/StandardWellConnections.hpp>
27#include <opm/simulators/wells/StandardWellEquations.hpp>
28#include <opm/simulators/wells/StandardWellPrimaryVariables.hpp>
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;
41template<class Scalar> class 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;
54 static constexpr int numWellConservationEq = PrimaryVariables::numWellConservationEq;
55
56 static constexpr bool has_wfrac_variable = PrimaryVariables::has_wfrac_variable;
57 static constexpr bool has_gfrac_variable = PrimaryVariables::has_gfrac_variable;
58 static constexpr int WFrac = PrimaryVariables::WFrac;
59 static constexpr int GFrac = PrimaryVariables::GFrac;
60 static constexpr int SFrac = PrimaryVariables::SFrac;
61
62public:
63 using EvalWell = typename PrimaryVariables::EvalWell;
64 using Eval = DenseAd::Evaluation<Scalar, Indices::numEq>;
65 using BVectorWell = typename StandardWellEquations<Scalar,Indices::numEq>::BVectorWell;
66
70
71protected:
73
75
76 EvalWell extendEval(const Eval& in) const;
77
78 // computing the accumulation term for later use in well mass equations
79 void computeAccumWell();
80
81 ConvergenceReport getWellConvergence(const WellState<Scalar>& well_state,
82 const std::vector<Scalar>& B_avg,
83 const Scalar maxResidualAllowed,
84 const Scalar tol_wells,
85 const Scalar relaxed_tolerance_flow,
86 const bool relax_tolerance,
87 const bool well_is_stopped,
88 std::vector<Scalar>& res,
89 DeferredLogger& deferred_logger) const;
90
91 void init(std::vector<Scalar>& perf_depth,
92 const std::vector<Scalar>& depth_arg,
93 const bool has_polymermw);
94
95 void updateWellStateFromPrimaryVariables(WellState<Scalar>& well_state,
96 const SummaryState& summary_state,
97 DeferredLogger& deferred_logger) const;
98
100
101 // the saturations in the well bore under surface conditions at the beginning of the time step
102 std::vector<Scalar> F0_;
103
106};
107
108}
109
110#endif // OPM_STANDARDWELL_EVAL_HEADER_INCLUDED
Represents the convergence status of the whole simulator, to make it possible to query and store the ...
Definition ConvergenceReport.hpp:38
Definition DeferredLogger.hpp:57
Definition StandardWellConnections.hpp:45
Definition StandardWellEquations.hpp:47
Definition StandardWellEval.hpp:47
const StandardWellEquations< Scalar, Indices::numEq > & linSys() const
Returns a const reference to equation system.
Definition StandardWellEval.hpp:68
StdWellConnections connections_
Connection level values.
Definition StandardWellEval.hpp:105
PrimaryVariables primary_variables_
Primary variables for well.
Definition StandardWellEval.hpp:99
StandardWellEquations< Scalar, Indices::numEq > linSys_
Linear equation system.
Definition StandardWellEval.hpp:104
Class holding primary variables for StandardWell.
Definition StandardWellPrimaryVariables.hpp:41
DenseAd::DynamicEvaluation< Scalar, numStaticWellEq+Indices::numEq+1 > EvalWell
Evaluation for the well equations.
Definition StandardWellPrimaryVariables.hpp:87
static constexpr int WQTotal
The index for the weighted total rate.
Definition StandardWellPrimaryVariables.hpp:72
static constexpr int numWellConservationEq
Number of the conservation equations.
Definition StandardWellPrimaryVariables.hpp:66
static constexpr int Bhp
The index for Bhp in primary variables and the index of well control equation.
Definition StandardWellPrimaryVariables.hpp:77
This class serves to eliminate the need to include the WellContributions into the matrix (with –matri...
Definition StandardWellEval.hpp:41
Definition WellInterfaceIndices.hpp:34
The state of a set of wells, tailored for use by the fully implicit blackoil simulator.
Definition WellState.hpp:62
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilboundaryratevector.hh:37