SimulatorFullyImplicitBlackoil.hpp
Go to the documentation of this file.
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
27#include <opm/input/eclipse/Units/UnitSystem.hpp>
28
29#include <opm/grid/utility/StopWatch.hpp>
30
43
44#if HAVE_HDF5
46#endif
47
48#include <fmt/format.h>
49
50#include <cstddef>
51#include <filesystem>
52#include <memory>
53#include <optional>
54#include <string>
55#include <string_view>
56#include <thread>
57#include <utility>
58#include <vector>
59
60namespace Opm::Properties {
61
62template<class TypeTag, class MyTypeTag>
64 using type = UndefinedProperty;
65};
66
67template <class TypeTag, class MyTypeTag>
69{
70 using type = UndefinedProperty;
71};
72
73template <class TypeTag, class MyTypeTag>
75{
76 using type = UndefinedProperty;
77};
78
79template <class TypeTag, class MyTypeTag>
81{
82 using type = UndefinedProperty;
83};
84
85template <class TypeTag, class MyTypeTag>
87{
88 using type = UndefinedProperty;
89};
90
91template <class TypeTag, class MyTypeTag>
93{
94 using type = UndefinedProperty;
95};
96
97template<class TypeTag>
98struct EnableTerminalOutput<TypeTag, TTag::FlowProblem> {
99 static constexpr bool value = true;
100};
101template<class TypeTag>
103 static constexpr bool value = true;
104};
105
106template <class TypeTag>
108{
109 static constexpr auto* value = "none";
110};
111
112template <class TypeTag>
113struct SaveStep<TypeTag, TTag::FlowProblem>
114{
115 static constexpr auto* value = "";
116};
117
118template <class TypeTag>
119struct SaveFile<TypeTag, TTag::FlowProblem>
120{
121 static constexpr auto* value = "";
122};
123
124template <class TypeTag>
125struct LoadFile<TypeTag, TTag::FlowProblem>
126{
127 static constexpr auto* value = "";
128};
129
130template <class TypeTag>
131struct LoadStep<TypeTag, TTag::FlowProblem>
132{
133 static constexpr int value = -1;
134};
135
136} // namespace Opm::Properties
137
138namespace Opm {
139
141template<class TypeTag>
143{
144public:
145 using Simulator = GetPropType<TypeTag, Properties::Simulator>;
146 using Grid = GetPropType<TypeTag, Properties::Grid>;
147 using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
148 using ElementContext = GetPropType<TypeTag, Properties::ElementContext>;
149 using BlackoilIndices = GetPropType<TypeTag, Properties::Indices>;
150 using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>;
151 using MaterialLaw = GetPropType<TypeTag, Properties::MaterialLaw>;
152 using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>;
153 using MaterialLawParams = GetPropType<TypeTag, Properties::MaterialLawParams>;
154 using AquiferModel = GetPropType<TypeTag, Properties::AquiferModel>;
155
157 using PolymerModule = BlackOilPolymerModule<TypeTag>;
158 using MICPModule = BlackOilMICPModule<TypeTag>;
159
165
188 : simulator_(simulator)
189 , serializer_(*this,
190 FlowGenericVanguard::comm(),
191 simulator_.vanguard().eclState().getIOConfig(),
192 Parameters::get<TypeTag, Properties::SaveStep>(),
193 Parameters::get<TypeTag, Properties::LoadStep>(),
194 Parameters::get<TypeTag, Properties::SaveFile>(),
195 Parameters::get<TypeTag, Properties::LoadFile>())
196 {
198
199 // Only rank 0 does print to std::cout, and only if specifically requested.
200 this->terminalOutput_ = false;
201 if (this->grid().comm().rank() == 0) {
202 this->terminalOutput_ = Parameters::get<TypeTag, Properties::EnableTerminalOutput>();
203
204 this->startConvergenceOutputThread(Parameters::get<TypeTag, Properties::OutputExtraConvergenceInfo>(),
205 R"(OutputExtraConvergenceInfo (--output-extra-convergence-info))");
206 }
207 }
208
210 {
211 // Safe to call on all ranks, not just the I/O rank.
213 }
214
215 static void registerParameters()
216 {
217 ModelParameters::registerParameters();
218 SolverParameters::registerParameters();
220
221 Parameters::registerParam<TypeTag, Properties::EnableTerminalOutput>
222 ("Print high-level information about the simulation's progress to the terminal");
223 Parameters::registerParam<TypeTag, Properties::EnableAdaptiveTimeStepping>
224 ("Use adaptive time stepping between report steps");
225 Parameters::registerParam<TypeTag, Properties::OutputExtraConvergenceInfo>
226 ("Provide additional convergence output "
227 "files for diagnostic purposes. "
228 "\"none\" gives no extra output and "
229 "overrides all other options, "
230 "\"steps\" generates an INFOSTEP file, "
231 "\"iterations\" generates an INFOITER file. "
232 "Combine options with commas, e.g., "
233 "\"steps,iterations\" for multiple outputs.");
234 Parameters::registerParam<TypeTag, Properties::SaveStep>
235 ("Save serialized state to .OPMRST file. "
236 "Either a specific report step, \"all\" to save "
237 "all report steps or \":x\" to save every x'th step."
238 "Use negative values of \"x\" to keep only the last "
239 "written step, or \"last\" to save every step, keeping "
240 "only the last.");
241 Parameters::registerParam<TypeTag, Properties::LoadStep>
242 ("Load serialized state from .OPMRST file. "
243 "Either a specific report step, or 0 to load last "
244 "stored report step.");
245 Parameters::registerParam<TypeTag, Properties::SaveFile>
246 ("FileName for .OPMRST file used for saving serialized state. "
247 "If empty, CASENAME.OPMRST is used.");
248 Parameters::hideParam<TypeTag, Properties::SaveFile>();
249 Parameters::registerParam<TypeTag, Properties::LoadFile>
250 ("FileName for .OPMRST file used to load serialized state. "
251 "If empty, CASENAME.OPMRST is used.");
252 Parameters::hideParam<TypeTag, Properties::LoadFile>();
253 }
254
262 {
263 init(timer);
264 // Make cache up to date. No need for updating it in elementCtx.
265 simulator_.model().invalidateAndUpdateIntensiveQuantities(/*timeIdx=*/0);
266 // Main simulation loop.
267 while (!timer.done()) {
268 bool continue_looping = runStep(timer);
269 if (!continue_looping) break;
270 }
271 return finalize();
272 }
273
274 void init(SimulatorTimer &timer)
275 {
276 simulator_.setEpisodeIndex(-1);
277
278 // Create timers and file for writing timing info.
279 solverTimer_ = std::make_unique<time::StopWatch>();
280 totalTimer_ = std::make_unique<time::StopWatch>();
281 totalTimer_->start();
282
283 // adaptive time stepping
284 bool enableAdaptive = Parameters::get<TypeTag, Properties::EnableAdaptiveTimeStepping>();
285 bool enableTUNING = Parameters::get<TypeTag, Properties::EnableTuning>();
286 if (enableAdaptive) {
287 const UnitSystem& unitSystem = this->simulator_.vanguard().eclState().getUnits();
288 const auto& sched_state = schedule()[timer.currentStepNum()];
289 auto max_next_tstep = sched_state.max_next_tstep(enableTUNING);
290 if (enableTUNING) {
291 adaptiveTimeStepping_ = std::make_unique<TimeStepper>(max_next_tstep,
292 sched_state.tuning(),
293 unitSystem, terminalOutput_);
294 }
295 else {
296 adaptiveTimeStepping_ = std::make_unique<TimeStepper>(unitSystem, max_next_tstep, terminalOutput_);
297 }
298
299 if (isRestart()) {
300 // For restarts the simulator may have gotten some information
301 // about the next timestep size from the OPMEXTRA field
302 adaptiveTimeStepping_->setSuggestedNextStep(simulator_.timeStepSize());
303 }
304 }
305 }
306
307 void updateTUNING(const Tuning& tuning)
308 {
309 modelParam_.tolerance_mb_ = tuning.XXXMBE;
310 if (terminalOutput_) {
311 OpmLog::debug(fmt::format("Setting SimulatorFullyImplicitBlackoil mass balance limit (XXXMBE) to {:.2e}", tuning.XXXMBE));
312 }
313 }
314
316 {
317 if (schedule().exitStatus().has_value()) {
318 if (terminalOutput_) {
319 OpmLog::info("Stopping simulation since EXIT was triggered by an action keyword.");
320 }
321 report_.success.exit_status = schedule().exitStatus().value();
322 return false;
323 }
324
325 if (serializer_.shouldLoad()) {
327 }
328
329 // Report timestep.
330 if (terminalOutput_) {
331 std::ostringstream ss;
332 timer.report(ss);
333 OpmLog::debug(ss.str());
334 }
335
336 if (terminalOutput_) {
338 }
339
340 // write the inital state at the report stage
341 if (timer.initialStep()) {
342 Dune::Timer perfTimer;
343 perfTimer.start();
344
345 simulator_.setEpisodeIndex(-1);
346 simulator_.setEpisodeLength(0.0);
347 simulator_.setTimeStepSize(0.0);
349 simulator_.problem().writeOutput(timer);
350
351 report_.success.output_write_time += perfTimer.stop();
352 }
353
354 // Run a multiple steps of the solver depending on the time step control.
355 solverTimer_->start();
356
357 if (!solver_) {
359 }
360
361 simulator_.startNextEpisode(
362 simulator_.startTime()
363 + schedule().seconds(timer.currentStepNum()),
364 timer.currentStepLength());
365 simulator_.setEpisodeIndex(timer.currentStepNum());
366
367 if (serializer_.shouldLoad()) {
370 simulator_.model().invalidateAndUpdateIntensiveQuantities(/*timeIdx=*/0);
371 }
372
373 this->solver_->model().beginReportStep();
374
375 const bool enableTUNING = Parameters::get<TypeTag, Properties::EnableTuning>();
376
377 // If sub stepping is enabled allow the solver to sub cycle
378 // in case the report steps are too large for the solver to converge
379 //
380 // \Note: The report steps are met in any case
381 // \Note: The sub stepping will require a copy of the state variables
383 auto tuningUpdater = [enableTUNING, this, reportStep = timer.currentStepNum()]()
384 {
385 auto& schedule = this->simulator_.vanguard().schedule();
386 auto& events = this->schedule()[reportStep].events();
387
388 if (events.hasEvent(ScheduleEvents::TUNING_CHANGE)) {
389 // Unset the event to not trigger it again on the next sub step
390 schedule.clear_event(ScheduleEvents::TUNING_CHANGE, reportStep);
391 const auto& sched_state = schedule[reportStep];
392 const auto& max_next_tstep = sched_state.max_next_tstep(enableTUNING);
393 const auto& tuning = sched_state.tuning();
394
395 if (enableTUNING) {
396 adaptiveTimeStepping_->updateTUNING(max_next_tstep, tuning);
397 // \Note: Assumes TUNING is only used with adaptive time-stepping
398 // \Note: Need to update both solver (model) and simulator since solver is re-created each report step.
399 solver_->model().updateTUNING(tuning);
400 this->updateTUNING(tuning);
401 } else {
402 this->adaptiveTimeStepping_->updateNEXTSTEP(max_next_tstep);
403 }
404 return max_next_tstep >0;
405 }
406 return false;
407 };
408 tuningUpdater();
409 const auto& events = schedule()[timer.currentStepNum()].events();
410 bool event = events.hasEvent(ScheduleEvents::NEW_WELL) ||
411 events.hasEvent(ScheduleEvents::INJECTION_TYPE_CHANGED) ||
412 events.hasEvent(ScheduleEvents::WELL_SWITCHED_INJECTOR_PRODUCER) ||
413 events.hasEvent(ScheduleEvents::PRODUCTION_UPDATE) ||
414 events.hasEvent(ScheduleEvents::INJECTION_UPDATE) ||
415 events.hasEvent(ScheduleEvents::WELL_STATUS_CHANGE);
416 auto stepReport = adaptiveTimeStepping_->step(timer, *solver_, event, nullptr, tuningUpdater);
417 report_ += stepReport;
418 //Pass simulation report to eclwriter for summary output
419 simulator_.problem().setSimulationReport(report_);
420 } else {
421 // solve for complete report step
422 auto stepReport = solver_->step(timer);
423 report_ += stepReport;
424 if (terminalOutput_) {
425 std::ostringstream ss;
426 stepReport.reportStep(ss);
427 OpmLog::info(ss.str());
428 }
429 }
430
431 // write simulation state at the report stage
432 Dune::Timer perfTimer;
433 perfTimer.start();
434 const double nextstep = adaptiveTimeStepping_ ? adaptiveTimeStepping_->suggestedNextStep() : -1.0;
435 simulator_.problem().setNextTimeStepSize(nextstep);
436 simulator_.problem().writeOutput(timer);
437 report_.success.output_write_time += perfTimer.stop();
438
439 solver_->model().endReportStep();
440
441 // take time that was used to solve system for this reportStep
442 solverTimer_->stop();
443
444 // update timing.
445 report_.success.solver_time += solverTimer_->secsSinceStart();
446
447 if (this->grid().comm().rank() == 0) {
448 // Grab the step convergence reports that are new since last we
449 // were here.
450 const auto& reps = this->solver_->model().stepReports();
451
452 auto reports = std::vector<StepReport> {
453 reps.begin() + this->already_reported_steps_, reps.end()
454 };
455
456 this->writeConvergenceOutput(std::move(reports));
457
458 this->already_reported_steps_ = reps.size();
459 }
460
461 // Increment timer, remember well state.
462 ++timer;
463
464 if (terminalOutput_) {
465 std::string msg =
466 "Time step took " + std::to_string(solverTimer_->secsSinceStart()) + " seconds; "
467 "total solver time " + std::to_string(report_.success.solver_time) + " seconds.";
468 OpmLog::debug(msg);
469 }
470
471 serializer_.save(timer);
472
473 return true;
474 }
475
477 {
478 // make sure all output is written to disk before run is finished
479 {
480 Dune::Timer finalOutputTimer;
481 finalOutputTimer.start();
482
483 simulator_.problem().finalizeOutput();
484 report_.success.output_write_time += finalOutputTimer.stop();
485 }
486
487 // Stop timer and create timing report
488 totalTimer_->stop();
489 report_.success.total_time = totalTimer_->secsSinceStart();
491
492 return report_;
493 }
494
495 const Grid& grid() const
496 { return simulator_.vanguard().grid(); }
497
498 template<class Serializer>
499 void serializeOp(Serializer& serializer)
500 {
501 serializer(simulator_);
502 serializer(report_);
503 serializer(adaptiveTimeStepping_);
504 }
505
506 const Model& model() const
507 { return solver_->model(); }
508
509protected:
511 void loadState([[maybe_unused]] HDF5Serializer& serializer,
512 [[maybe_unused]] const std::string& groupName) override
513 {
514#if HAVE_HDF5
515 serializer.read(*this, groupName, "simulator_data");
516#endif
517 }
518
520 void saveState([[maybe_unused]] HDF5Serializer& serializer,
521 [[maybe_unused]] const std::string& groupName) const override
522 {
523#if HAVE_HDF5
524 serializer.write(*this, groupName, "simulator_data");
525#endif
526 }
527
529 std::array<std::string,5> getHeader() const override
530 {
531 std::ostringstream str;
532 Parameters::printValues<TypeTag>(str);
533 return {"OPM Flow",
536 simulator_.vanguard().caseName(),
537 str.str()};
538 }
539
541 const std::vector<int>& getCellMapping() const override
542 {
543 return simulator_.vanguard().globalCell();
544 }
545
546
547 std::unique_ptr<Solver> createSolver(WellModel& wellModel)
548 {
549 auto model = std::make_unique<Model>(simulator_,
551 wellModel,
553
554 if (this->modelParam_.write_partitions_) {
555 const auto& iocfg = this->eclState().cfg().io();
556
557 const auto odir = iocfg.getOutputDir()
558 / std::filesystem::path { "partition" }
559 / iocfg.getBaseName();
560
561 if (this->grid().comm().rank() == 0) {
562 create_directories(odir);
563 }
564
565 this->grid().comm().barrier();
566
567 model->writePartitions(odir);
568
569 this->modelParam_.write_partitions_ = false;
570 }
571
572 return std::make_unique<Solver>(solverParam_, std::move(model));
573 }
574
575 const EclipseState& eclState() const
576 { return simulator_.vanguard().eclState(); }
577
578
579 const Schedule& schedule() const
580 { return simulator_.vanguard().schedule(); }
581
582 bool isRestart() const
583 {
584 const auto& initconfig = eclState().getInitConfig();
585 return initconfig.restartRequested();
586 }
587
589 { return simulator_.problem().wellModel(); }
590
591 const WellModel& wellModel_() const
592 { return simulator_.problem().wellModel(); }
593
594 void startConvergenceOutputThread(std::string_view convOutputOptions,
595 std::string_view optionName)
596 {
597 const auto config = ConvergenceOutputConfiguration {
598 convOutputOptions, optionName
599 };
601 return;
602 }
603
605 [compNames = typename Model::ComponentName{}](const int compIdx)
606 { return std::string_view { compNames.name(compIdx) }; }
607 };
608
610 [usys = this->eclState().getUnits()](const double time)
611 { return usys.from_si(UnitSystem::measure::time, time); }
612 };
613
614 this->convergenceOutputQueue_.emplace();
615 this->convergenceOutputObject_.emplace
616 (this->eclState().getIOConfig().getOutputDir(),
617 this->eclState().getIOConfig().getBaseName(),
618 std::move(getPhaseName),
619 std::move(convertTime),
620 config, *this->convergenceOutputQueue_);
621
624 &this->convergenceOutputObject_.value());
625 }
626
627 void writeConvergenceOutput(std::vector<StepReport>&& reports)
628 {
629 if (! this->convergenceOutputThread_.has_value()) {
630 return;
631 }
632
633 auto requests = std::vector<ConvergenceReportQueue::OutputRequest>{};
634 requests.reserve(reports.size());
635
636 for (auto&& report : reports) {
637 requests.push_back({ report.report_step, report.current_step, std::move(report.report) });
638 }
639
640 this->convergenceOutputQueue_->enqueue(std::move(requests));
641 }
642
644 {
645 if (! this->convergenceOutputThread_.has_value()) {
646 return;
647 }
648
649 this->convergenceOutputQueue_->signalLastOutputRequest();
650 this->convergenceOutputThread_->join();
651 }
652
653 // Data.
655
658
659 std::unique_ptr<Solver> solver_;
660
661 // Observed objects.
663 // Misc. data
665
667 std::size_t already_reported_steps_ = 0;
668 std::unique_ptr<time::StopWatch> solverTimer_;
669 std::unique_ptr<time::StopWatch> totalTimer_;
670 std::unique_ptr<TimeStepper> adaptiveTimeStepping_;
671
672 std::optional<ConvergenceReportQueue> convergenceOutputQueue_{};
673 std::optional<ConvergenceOutputThread> convergenceOutputObject_{};
674 std::optional<std::thread> convergenceOutputThread_{};
675
677};
678
679} // namespace Opm
680
681#endif // OPM_SIMULATOR_FULLY_IMPLICIT_BLACKOIL_HEADER_INCLUDED
Definition: AdaptiveTimeStepping.hpp:223
static void registerParameters()
Definition: AdaptiveTimeStepping.hpp:304
Definition: BlackoilModel.hpp:164
void writePartitions(const std::filesystem::path &odir) const
Definition: BlackoilModel.hpp:1097
BlackoilModelParameters< TypeTag > ModelParameters
Definition: BlackoilModel.hpp:167
Class for handling the blackoil well model.
Definition: BlackoilWellModel.hpp:101
void prepareDeserialize(const int report_step)
Definition: BlackoilWellModel.hpp:252
void beginReportStep(const int time_step)
Definition: BlackoilWellModel_impl.hpp:248
Definition: ComponentName.hpp:34
Definition: ConvergenceOutputConfiguration.hpp:46
std::function< std::string_view(int)> ComponentToPhaseName
Definition: ExtraConvergenceOutputThread.hpp:109
std::function< double(double)> ConvertToTimeUnits
Definition: ExtraConvergenceOutputThread.hpp:115
Definition: FlowGenericVanguard.hpp:60
This problem simulates an input file given in the data format used by the commercial ECLiPSE simulato...
Definition: FlowProblem.hpp:112
Class for (de-)serializing using HDF5.
Definition: HDF5Serializer.hpp:37
Definition: NonlinearSolver.hpp:108
a simulator for the blackoil model
Definition: SimulatorFullyImplicitBlackoil.hpp:143
SolverParameters solverParam_
Definition: SimulatorFullyImplicitBlackoil.hpp:657
GetPropType< TypeTag, Properties::Simulator > Simulator
Definition: SimulatorFullyImplicitBlackoil.hpp:145
void loadState(HDF5Serializer &serializer, const std::string &groupName) override
Load simulator state from hdf5 serializer.
Definition: SimulatorFullyImplicitBlackoil.hpp:511
void endConvergenceOutputThread()
Definition: SimulatorFullyImplicitBlackoil.hpp:643
PhaseUsage phaseUsage_
Definition: SimulatorFullyImplicitBlackoil.hpp:662
const WellModel & wellModel_() const
Definition: SimulatorFullyImplicitBlackoil.hpp:591
GetPropType< TypeTag, Properties::FluidSystem > FluidSystem
Definition: SimulatorFullyImplicitBlackoil.hpp:147
std::unique_ptr< TimeStepper > adaptiveTimeStepping_
Definition: SimulatorFullyImplicitBlackoil.hpp:670
GetPropType< TypeTag, Properties::MaterialLawParams > MaterialLawParams
Definition: SimulatorFullyImplicitBlackoil.hpp:153
std::unique_ptr< Solver > createSolver(WellModel &wellModel)
Definition: SimulatorFullyImplicitBlackoil.hpp:547
void startConvergenceOutputThread(std::string_view convOutputOptions, std::string_view optionName)
Definition: SimulatorFullyImplicitBlackoil.hpp:594
bool isRestart() const
Definition: SimulatorFullyImplicitBlackoil.hpp:582
GetPropType< TypeTag, Properties::MaterialLaw > MaterialLaw
Definition: SimulatorFullyImplicitBlackoil.hpp:151
typename Model::ModelParameters ModelParameters
Definition: SimulatorFullyImplicitBlackoil.hpp:162
void init(SimulatorTimer &timer)
Definition: SimulatorFullyImplicitBlackoil.hpp:274
void updateTUNING(const Tuning &tuning)
Definition: SimulatorFullyImplicitBlackoil.hpp:307
SimulatorReport run(SimulatorTimer &timer)
Definition: SimulatorFullyImplicitBlackoil.hpp:261
void serializeOp(Serializer &serializer)
Definition: SimulatorFullyImplicitBlackoil.hpp:499
typename Solver::SolverParameters SolverParameters
Definition: SimulatorFullyImplicitBlackoil.hpp:163
SimulatorSerializer serializer_
Definition: SimulatorFullyImplicitBlackoil.hpp:676
const std::vector< int > & getCellMapping() const override
Returns local-to-global cell mapping.
Definition: SimulatorFullyImplicitBlackoil.hpp:541
BlackOilMICPModule< TypeTag > MICPModule
Definition: SimulatorFullyImplicitBlackoil.hpp:158
GetPropType< TypeTag, Properties::PrimaryVariables > PrimaryVariables
Definition: SimulatorFullyImplicitBlackoil.hpp:150
const EclipseState & eclState() const
Definition: SimulatorFullyImplicitBlackoil.hpp:575
std::unique_ptr< time::StopWatch > totalTimer_
Definition: SimulatorFullyImplicitBlackoil.hpp:669
void saveState(HDF5Serializer &serializer, const std::string &groupName) const override
Save simulator state using hdf5 serializer.
Definition: SimulatorFullyImplicitBlackoil.hpp:520
const Grid & grid() const
Definition: SimulatorFullyImplicitBlackoil.hpp:495
void writeConvergenceOutput(std::vector< StepReport > &&reports)
Definition: SimulatorFullyImplicitBlackoil.hpp:627
std::optional< std::thread > convergenceOutputThread_
Definition: SimulatorFullyImplicitBlackoil.hpp:674
GetPropType< TypeTag, Properties::SolutionVector > SolutionVector
Definition: SimulatorFullyImplicitBlackoil.hpp:152
static void registerParameters()
Definition: SimulatorFullyImplicitBlackoil.hpp:215
GetPropType< TypeTag, Properties::Indices > BlackoilIndices
Definition: SimulatorFullyImplicitBlackoil.hpp:149
const Model & model() const
Definition: SimulatorFullyImplicitBlackoil.hpp:506
SimulatorFullyImplicitBlackoil(Simulator &simulator)
Definition: SimulatorFullyImplicitBlackoil.hpp:187
std::optional< ConvergenceOutputThread > convergenceOutputObject_
Definition: SimulatorFullyImplicitBlackoil.hpp:673
std::unique_ptr< time::StopWatch > solverTimer_
Definition: SimulatorFullyImplicitBlackoil.hpp:668
std::optional< ConvergenceReportQueue > convergenceOutputQueue_
Definition: SimulatorFullyImplicitBlackoil.hpp:672
std::unique_ptr< Solver > solver_
Definition: SimulatorFullyImplicitBlackoil.hpp:659
bool terminalOutput_
Definition: SimulatorFullyImplicitBlackoil.hpp:664
ModelParameters modelParam_
Definition: SimulatorFullyImplicitBlackoil.hpp:656
bool runStep(SimulatorTimer &timer)
Definition: SimulatorFullyImplicitBlackoil.hpp:315
BlackOilPolymerModule< TypeTag > PolymerModule
Definition: SimulatorFullyImplicitBlackoil.hpp:157
GetPropType< TypeTag, Properties::AquiferModel > AquiferModel
Definition: SimulatorFullyImplicitBlackoil.hpp:154
std::size_t already_reported_steps_
Definition: SimulatorFullyImplicitBlackoil.hpp:667
GetPropType< TypeTag, Properties::Grid > Grid
Definition: SimulatorFullyImplicitBlackoil.hpp:146
SimulatorReport finalize()
Definition: SimulatorFullyImplicitBlackoil.hpp:476
SimulatorReport report_
Definition: SimulatorFullyImplicitBlackoil.hpp:666
WellModel & wellModel_()
Definition: SimulatorFullyImplicitBlackoil.hpp:588
const Schedule & schedule() const
Definition: SimulatorFullyImplicitBlackoil.hpp:579
GetPropType< TypeTag, Properties::ElementContext > ElementContext
Definition: SimulatorFullyImplicitBlackoil.hpp:148
~SimulatorFullyImplicitBlackoil()
Definition: SimulatorFullyImplicitBlackoil.hpp:209
std::array< std::string, 5 > getHeader() const override
Returns header data.
Definition: SimulatorFullyImplicitBlackoil.hpp:529
Simulator & simulator_
Definition: SimulatorFullyImplicitBlackoil.hpp:654
Class handling simulator serialization.
Definition: SimulatorSerializer.hpp:55
void loadState()
Load state from file.
void loadTimerInfo(SimulatorTimer &timer)
Loads time step info from file.
bool shouldLoad() const
Returns whether or not a state should be loaded.
Definition: SimulatorSerializer.hpp:71
void save(SimulatorTimer &timer)
Save data to file if appropriate.
int loadStep() const
Returns step to load.
Definition: SimulatorSerializer.hpp:74
Definition: SimulatorTimer.hpp:39
double currentStepLength() const override
bool initialStep() const override
Whether the current step is the first step.
void report(std::ostream &os) const
int currentStepNum() const override
bool done() const override
Return true if op++() has been called numSteps() times.
Definition: AluGridVanguard.hpp:57
void outputReportStep(const SimulatorTimer &timer)
Definition: BlackoilPhases.hpp:27
std::string compileTimestamp()
std::string moduleVersion()
PhaseUsage phaseUsageFromDeck(const EclipseState &eclipseState)
std::string to_string(const ConvergenceReport::ReservoirFailure::Type t)
Definition: NonlinearSolver.hpp:114
Definition: BlackoilPhases.hpp:46
Definition: SimulatorFullyImplicitBlackoil.hpp:63
UndefinedProperty type
Definition: SimulatorFullyImplicitBlackoil.hpp:64
Definition: BlackoilWellModel.hpp:84
Definition: SimulatorFullyImplicitBlackoil.hpp:93
UndefinedProperty type
Definition: SimulatorFullyImplicitBlackoil.hpp:94
Definition: SimulatorFullyImplicitBlackoil.hpp:81
UndefinedProperty type
Definition: SimulatorFullyImplicitBlackoil.hpp:82
Definition: SimulatorFullyImplicitBlackoil.hpp:69
UndefinedProperty type
Definition: SimulatorFullyImplicitBlackoil.hpp:70
Definition: SimulatorFullyImplicitBlackoil.hpp:87
UndefinedProperty type
Definition: SimulatorFullyImplicitBlackoil.hpp:88
Definition: SimulatorFullyImplicitBlackoil.hpp:75
UndefinedProperty type
Definition: SimulatorFullyImplicitBlackoil.hpp:76
Abstract interface for simulator serialization ops.
Definition: SimulatorSerializer.hpp:36
Definition: SimulatorReport.hpp:100
SimulatorReportSingle success
Definition: SimulatorReport.hpp:101
double solver_time
Definition: SimulatorReport.hpp:38
bool converged
Definition: SimulatorReport.hpp:54
double total_time
Definition: SimulatorReport.hpp:37
int exit_status
Definition: SimulatorReport.hpp:56
double output_write_time
Definition: SimulatorReport.hpp:45