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 <optional>
33#include <vector>
34
35namespace Opm
36{
37
38class ConvergenceReport;
39class DeferredLogger;
40class GroupState;
41class Schedule;
42class SummaryState;
43class WellContributions;
44template<class FluidSystem, class Indices, class Scalar> class WellInterfaceIndices;
45class WellState;
46
47template<class FluidSystem, class Indices, class Scalar>
49{
50protected:
53 static constexpr int Bhp = PrimaryVariables::Bhp;
54 static constexpr int WQTotal= PrimaryVariables::WQTotal;
55 static constexpr int numWellConservationEq = PrimaryVariables::numWellConservationEq;
56
57 static constexpr bool has_wfrac_variable = PrimaryVariables::has_wfrac_variable;
58 static constexpr bool has_gfrac_variable = PrimaryVariables::has_gfrac_variable;
59 static constexpr int WFrac = PrimaryVariables::WFrac;
60 static constexpr int GFrac = PrimaryVariables::GFrac;
61 static constexpr int SFrac = PrimaryVariables::SFrac;
62
63public:
64 using EvalWell = typename PrimaryVariables::EvalWell;
65 using Eval = DenseAd::Evaluation<Scalar, Indices::numEq>;
66 using BVectorWell = typename StandardWellEquations<Scalar,Indices::numEq>::BVectorWell;
67
71
72protected:
74
76
77 EvalWell extendEval(const Eval& in) const;
78
79 // computing the accumulation term for later use in well mass equations
80 void computeAccumWell();
81
82 ConvergenceReport getWellConvergence(const WellState& well_state,
83 const std::vector<double>& B_avg,
84 const double maxResidualAllowed,
85 const double tol_wells,
86 const double relaxed_tolerance_flow,
87 const bool relax_tolerance,
88 std::vector<double>& res,
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& well_state,
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 AquiferInterface.hpp:35
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 StandardWellEval.hpp:49
StdWellConnections connections_
Connection level values.
Definition StandardWellEval.hpp:107
const StandardWellEquations< Scalar, Indices::numEq > & linSys() const
Returns a const reference to equation system.
Definition StandardWellEval.hpp:69
StandardWellEquations< Scalar, Indices::numEq > linSys_
Linear equation system.
Definition StandardWellEval.hpp:106
PrimaryVariables primary_variables_
Primary variables for well.
Definition StandardWellEval.hpp:101
The state of a set of wells, tailored for use by the fully implicit blackoil simulator.
Definition WellState.hpp:60
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition BlackoilPhases.hpp:27