opm-simulators
Loading...
Searching...
No Matches
SimulatorFullyImplicitBlackoil.hpp
1/*
2 Copyright 2013, 2015, 2020 SINTEF Digital, Mathematics and Cybernetics.
3 Copyright 2015 Andreas Lauser
4 Copyright 2017 IRIS
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_SIMULATOR_FULLY_IMPLICIT_BLACKOIL_HEADER_INCLUDED
23#define OPM_SIMULATOR_FULLY_IMPLICIT_BLACKOIL_HEADER_INCLUDED
24
25#include <opm/common/ErrorMacros.hpp>
26#include <opm/simulators/flow/rescoup/ReservoirCouplingEnabled.hpp>
27
28#ifdef RESERVOIR_COUPLING_ENABLED
29#include <opm/input/eclipse/Schedule/ResCoup/ReservoirCouplingInfo.hpp>
30#include <opm/input/eclipse/Schedule/ResCoup/MasterGroup.hpp>
31#include <opm/input/eclipse/Schedule/ResCoup/Slaves.hpp>
32#include <opm/simulators/flow/rescoup/ReservoirCouplingMaster.hpp>
33#include <opm/simulators/flow/rescoup/ReservoirCouplingSlave.hpp>
34#include <opm/common/Exceptions.hpp>
35#endif
36
37#include <opm/input/eclipse/Units/UnitSystem.hpp>
38
39#include <opm/grid/utility/StopWatch.hpp>
40
41#include <opm/models/tpsa/tpsanewtonmethodparams.hpp>
42
43#include <opm/simulators/aquifers/BlackoilAquiferModel.hpp>
44#include <opm/simulators/flow/BlackoilModel.hpp>
45#include <opm/simulators/flow/BlackoilModelParameters.hpp>
46#include <opm/simulators/flow/ConvergenceOutputConfiguration.hpp>
47#include <opm/simulators/flow/ExtraConvergenceOutputThread.hpp>
48#include <opm/simulators/flow/NonlinearSolver.hpp>
49#include <opm/simulators/flow/SimulatorConvergenceOutput.hpp>
50#include <opm/simulators/flow/SimulatorReportBanners.hpp>
51#include <opm/simulators/flow/SimulatorSerializer.hpp>
52#include <opm/simulators/linalg/TPSALinearSolverParameters.hpp>
53#include <opm/simulators/timestepping/AdaptiveTimeStepping.hpp>
54#include <opm/simulators/timestepping/ConvergenceReport.hpp>
55#include <opm/simulators/utils/moduleVersion.hpp>
56#include <opm/simulators/wells/WellState.hpp>
57
58#if HAVE_HDF5
59#include <opm/simulators/utils/HDF5Serializer.hpp>
60#endif
61
62#include <filesystem>
63#include <memory>
64#include <string>
65#include <string_view>
66#include <utility>
67#include <vector>
68
69#include <fmt/format.h>
70
71namespace Opm::Parameters {
72
73struct EnableAdaptiveTimeStepping { static constexpr bool value = true; };
74struct OutputExtraConvergenceInfo { static constexpr auto* value = "none"; };
75struct SaveStep { static constexpr auto* value = ""; };
76struct SaveFile { static constexpr auto* value = ""; };
77struct LoadFile { static constexpr auto* value = ""; };
78struct LoadStep { static constexpr int value = -1; };
79struct Slave { static constexpr bool value = false; };
80
81} // namespace Opm::Parameters
82
83namespace Opm::detail {
84
85void registerSimulatorParameters();
86
87}
88
89namespace Opm {
90
92template<class TypeTag>
94{
95protected:
96 struct MPI_Comm_Deleter;
97public:
102 using BlackoilIndices = GetPropType<TypeTag, Properties::Indices>;
110
111 using TimeStepper = AdaptiveTimeStepping<TypeTag>;
112 using PolymerModule = BlackOilPolymerModule<TypeTag>;
113 using BioeffectsModule = BlackOilBioeffectsModule<TypeTag>;
114
115 using Solver = NonlinearSolver<TypeTag, Model>;
116 using ModelParameters = typename Model::ModelParameters;
117 using SolverParameters = typename Solver::SolverParameters;
118 using WellModel = BlackoilWellModel<TypeTag>;
119
122 explicit SimulatorFullyImplicitBlackoil(Simulator& simulator)
123 : simulator_(simulator)
124 , serializer_(*this,
125 FlowGenericVanguard::comm(),
126 simulator_.vanguard().eclState().getIOConfig(),
127 Parameters::Get<Parameters::SaveStep>(),
128 Parameters::Get<Parameters::LoadStep>(),
129 Parameters::Get<Parameters::SaveFile>(),
130 Parameters::Get<Parameters::LoadFile>())
131 {
132
133 // Only rank 0 does print to std::cout, and only if specifically requested.
134 this->terminalOutput_ = false;
135 if (this->grid().comm().rank() == 0) {
137