22 #ifndef OPM_MULTISEGMENTWELL_EVAL_HEADER_INCLUDED 23 #define OPM_MULTISEGMENTWELL_EVAL_HEADER_INCLUDED 25 #include <opm/simulators/wells/MultisegmentWellEquations.hpp> 26 #include <opm/simulators/wells/MultisegmentWellGeneric.hpp> 27 #include <opm/simulators/wells/MultisegmentWellPrimaryVariables.hpp> 28 #include <opm/simulators/wells/MultisegmentWellSegments.hpp> 29 #include <opm/simulators/wells/ParallelWellInfo.hpp> 31 #include <opm/grid/utility/SparseTable.hpp> 33 #include <opm/material/densead/Evaluation.hpp> 40 class ConvergenceReport;
44 template<
class Flu
idSystem,
class Indices>
class WellInterfaceIndices;
45 template<
typename Scalar,
typename IndexTraits>
class WellState;
47 template<
typename Flu
idSystem,
typename Indices>
49 typename FluidSystem::IndexTraitsType>
52 using Scalar =
typename FluidSystem::Scalar;
56 using IndexTraits =
typename FluidSystem::IndexTraitsType;
57 static constexpr
int numWellEq = PrimaryVariables::numWellEq;
58 static constexpr
int SPres = PrimaryVariables::SPres;
59 static constexpr
int WQTotal = PrimaryVariables::WQTotal;
61 static constexpr
bool enable_energy = PrimaryVariables::enable_energy;
62 static constexpr
int Temperature = PrimaryVariables::Temperature;
67 using BVector =
typename Equations::BVector;
68 using BVectorWell =
typename Equations::BVectorWell;
73 using EvalWell =
typename PrimaryVariables::EvalWell;
74 using Eval = DenseAd::Evaluation<Scalar, Indices::numDerivatives>;
81 static constexpr
int numResDofs = Indices::numEq;
82 static constexpr
int numWellDofs = PrimaryVariables::numWellEq;
83 using BMatrix = Dune::BCRSMatrix<Dune::FieldMatrix<Scalar, numWellDofs, numResDofs>>;
84 using CMatrix = Dune::BCRSMatrix<Dune::FieldMatrix<Scalar, numResDofs, numWellDofs>>;
85 using DMatrix = Dune::BCRSMatrix<Dune::FieldMatrix<Scalar, numWellDofs, numWellDofs>>;
86 using WVector = Dune::BlockVector<Dune::FieldVector<Scalar, numWellDofs>>;
88 void addBCDMatrix(std::vector<BMatrix>& b_matrices,
89 std::vector<CMatrix>& c_matrices,
90 std::vector<DMatrix>& d_matrices,
97 void assembleDefaultPressureEq(
const int seg,
99 const bool use_average_density);
102 void assembleICDPressureEq(
const int seg,
103 const UnitSystem& unit_system,
105 const SummaryState& summary_state,
106 const bool use_average_density,
109 void assembleAccelerationAndHydroPressureLosses(
const int seg,
111 const bool use_average_density);
114 void assemblePressureEq(
const int seg,
115 const UnitSystem& unit_system,
117 const SummaryState& summary_state,
118 const bool use_average_density,
123 const std::vector<Scalar>& B_avg,
125 const Scalar max_residual_allowed,
126 const Scalar tolerance_wells,
127 const Scalar relaxed_inner_tolerance_flow_ms_well,
128 const Scalar tolerance_pressure_ms_wells,
129 const Scalar relaxed_inner_tolerance_pressure_ms_well,
130 const bool relax_tolerance,
131 const bool well_is_stopped)
const;
133 std::pair<bool, std::vector<Scalar> >
134 getFiniteWellResiduals(
const std::vector<Scalar>& B_avg,
138 const Scalar tolerance_wells,
139 const Scalar tolerance_pressure_ms_wells,
143 const std::vector<Scalar>& residuals,
144 const Scalar tolerance_wells,
145 const Scalar tolerance_pressure_ms_wells,
148 void assembleAccelerationPressureLoss(
const int seg,
152 EvalWell extendEval(
const Eval& in)
const;
161 std::vector<Scalar> cell_perforation_depth_diffs_;
164 std::vector<Scalar> cell_perforation_pressure_diffs_;
169 #endif // OPM_MULTISEGMENTWELL_GENERIC_HEADER_INCLUDED PrimaryVariables primary_variables_
The primary variables.
Definition: MultisegmentWellEval.hpp:157
Definition: MultisegmentWellAssemble.hpp:35
Structs needed for tpfalinearizer and its gpuparams struct extracted to be defined in one place that ...
Definition: blackoilbioeffectsmodules.hh:45
Equations linSys_
The equation system.
Definition: MultisegmentWellEval.hpp:156
Definition: MultisegmentWellEval.hpp:48
Class encapsulating some information about parallel wells.
Definition: MSWellHelpers.hpp:34
Definition: MultisegmentWellAssemble.hpp:38
Definition: DeferredLogger.hpp:56
MSWSegments segments_
Segment properties.
Definition: MultisegmentWellEval.hpp:158
Definition: MultisegmentWellEquations.hpp:44
const Equations & linSys() const
Returns a const reference to equation system.
Definition: MultisegmentWellEval.hpp:78
Definition: MultisegmentWellSegments.hpp:44
Represents the convergence status of the whole simulator, to make it possible to query and store the ...
Definition: ConvergenceReport.hpp:37
ConvergenceReport getWellConvergence(const WellState< Scalar, IndexTraits > &well_state, const std::vector< Scalar > &B_avg, DeferredLogger &deferred_logger, const Scalar max_residual_allowed, const Scalar tolerance_wells, const Scalar relaxed_inner_tolerance_flow_ms_well, const Scalar tolerance_pressure_ms_wells, const Scalar relaxed_inner_tolerance_pressure_ms_well, const bool relax_tolerance, const bool well_is_stopped) const
check whether the well equations get converged for this well
Definition: MultisegmentWellEval.cpp:135
The state of a set of wells, tailored for use by the fully implicit blackoil simulator.
Definition: TemperatureModel.hpp:65