1 #ifndef OPM_FLOW_NONLINEAR_SYSTEM_HEADER_INCLUDED 2 #define OPM_FLOW_NONLINEAR_SYSTEM_HEADER_INCLUDED 23 #include <opm/input/eclipse/Schedule/Tuning.hpp> 27 #include <opm/simulators/flow/BlackoilModelParameters.hpp> 30 #include <opm/simulators/timestepping/ConvergenceReport.hpp> 31 #include <opm/simulators/timestepping/SimulatorReport.hpp> 32 #include <opm/simulators/timestepping/SimulatorTimerInterface.hpp> 33 #include <opm/simulators/utils/ComponentName.hpp> 34 #include <opm/simulators/utils/ParallelCommunication.hpp> 36 #include <string_view> 42 template <
class TypeTag>
60 bool isParallel()
const 61 {
return grid_.comm().size() > 1; }
63 const Simulator& simulator()
const 64 {
return simulator_; }
66 Simulator& simulator()
67 {
return simulator_; }
69 bool terminalOutputEnabled()
const 70 {
return terminal_output_; }
73 {
return Indices::numPhases; }
76 {
return failureReport_; }
78 const std::vector<StepReport>& stepReports()
const 79 {
return convergence_reports_; }
82 {
return compNames_; }
87 WellModel& wellModel()
88 {
return well_model_; }
90 const WellModel& wellModel()
const 91 {
return well_model_; }
93 void beginReportStep()
94 { simulator_.problem().beginEpisode(); }
97 { simulator_.problem().endEpisode(); }
101 void updateTUNING(
const Tuning& tuning);
103 void updateTUNINGDP(
const TuningDp& tuning_dp);
105 void updateSolution(
const GlobalEqVector& dx);
107 template <
class LogFailure>
109 const int componentIdx,
110 const std::string_view componentName,
111 const std::span<const Scalar> residuals,
112 const std::span<const ConvergenceReport::ReservoirFailure::Type> types,
113 const std::span<const Scalar> tolerances,
114 const Scalar maxResidualAllowed,
115 LogFailure&& logFailure)
const;
120 WellModel& wellModel,
121 const bool terminal_output);
128 virtual bool shouldStoreSolutionUpdate()
const 131 virtual void prepareSolutionUpdate()
134 virtual void storeSolutionUpdate(
const GlobalEqVector&)
139 template <
class WellModelType>
142 template <
class ModelParametersType>
143 void applyTUNING(ModelParametersType& param,
144 const Tuning& tuning);
146 template <
class ModelParametersType>
147 void applyTUNINGDP(ModelParametersType& param,
148 const TuningDp& tuning_dp);
150 template <
class ValueType>
151 std::tuple<ValueType, ValueType>
152 convergenceReduction(Parallel::Communication comm,
153 const ValueType primaryVolumeLocal,
154 const ValueType secondaryVolumeLocal,
155 std::vector<ValueType>& sumValues,
156 std::vector<ValueType>& maxValues,
157 std::vector<ValueType>& averagedValues);
159 void popLastStepReport()
160 { convergence_reports_.back().report.pop_back(); }
163 Simulator& simulator_;
165 bool terminal_output_;
167 WellModel& well_model_;
169 std::vector<StepReport> convergence_reports_;
171 std::vector<std::vector<Scalar>> residual_norms_history_;
172 Scalar current_relaxation_;
173 GlobalEqVector dx_old_;
178 #include <opm/simulators/flow/NonlinearSystem_impl.hpp> 180 #endif // OPM_FLOW_NONLINEAR_SYSTEM_HEADER_INCLUDED typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(...))
Definition: propertysystem.hh:233
Structs needed for tpfalinearizer and its gpuparams struct extracted to be defined in one place that ...
Definition: blackoilbioeffectsmodules.hh:45
Solver parameters for the NonlinearSystemBlackOilReservoir.
Definition: BlackoilModelParameters.hpp:200
A struct for returning timing data from a simulator to its caller.
Definition: SimulatorReport.hpp:33
Interface class for SimulatorTimer objects, to be improved.
Definition: SimulatorTimerInterface.hpp:33
The Opm property system, traits with inheritance.
Represents the convergence status of the whole simulator, to make it possible to query and store the ...
Definition: ConvergenceReport.hpp:37
Definition: NonlinearSystem.hpp:43
Declares the properties required by the black oil model.
Definition: ComponentName.hpp:33