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#if HAVE_MPI
28#define RESERVOIR_COUPLING_ENABLED
29#endif
30#ifdef RESERVOIR_COUPLING_ENABLED
31#include <opm/input/eclipse/Schedule/ResCoup/ReservoirCouplingInfo.hpp>
32#include <opm/input/eclipse/Schedule/ResCoup/MasterGroup.hpp>
33#include <opm/input/eclipse/Schedule/ResCoup/Slaves.hpp>
36#include <opm/common/Exceptions.hpp>
37#endif
38
39#include <opm/input/eclipse/Units/UnitSystem.hpp>
40
41#include <opm/grid/utility/StopWatch.hpp>
42
56
57#if HAVE_HDF5
59#endif
60
61#include <filesystem>
62#include <memory>
63#include <string>
64#include <string_view>
65#include <utility>
66#include <vector>
67
68#include <fmt/format.h>
69
70namespace Opm::Parameters {
71
72struct EnableAdaptiveTimeStepping { static constexpr bool value = true; };
73struct OutputExtraConvergenceInfo { static constexpr auto* value = "none"; };
74struct SaveStep { static constexpr auto* value = ""; };
75struct SaveFile { static constexpr auto* value = ""; };
76struct LoadFile { static constexpr auto* value = ""; };
77struct LoadStep { static constexpr int value = -1; };
78struct Slave { static constexpr bool value = false; };
79
80} // namespace Opm::Parameters
81
82namespace Opm::detail {
83
85
86}
87
88namespace Opm {
89
91template<class TypeTag>
93{
94protected:
95 struct MPI_Comm_Deleter;
96public:
108
112
113
115 using ModelParameters = typename Model::ModelParameters;
118
122 : simulator_(simulator)
123 , serializer_(*this,
124 FlowGenericVanguard::comm(),
125 simulator_.vanguard().eclState().getIOConfig(),
126 Parameters::Get<Parameters::SaveStep>(),
127 Parameters::Get<Parameters::LoadStep>(),
128 Parameters::Get<Parameters::SaveFile>(),
129 Parameters::Get<Parameters::LoadFile>())
130 {
131
132 // Only rank 0 does print to std::cout, and only if specifically requested.
133 this->terminalOutput_ = false;
134 if (this->grid().comm().rank() == 0) {
135 this->terminalOutput_ = Parameters::Get<Parameters::EnableTerminalOutput>();
136
138 [compNames = typename Model::ComponentName{}](const int compIdx)
139 { return std::string_view { compNames.name(compIdx) }; }
140 };
141
142 if (!simulator_.vanguard().eclState().getIOConfig().initOnly()) {
144 startThread(this->simulator_.vanguard().eclState(),
145 Parameters::Get<Parameters::OutputExtraConvergenceInfo>(),
146 R"(OutputExtraConvergenceInfo (--output-extra-convergence-info))",
147 getPhaseName);
148 }
149 }
150 }
151
153 {
154 // Safe to call on all ranks, not just the I/O rank.
156 }
157
158 static void registerParameters()
159 {
160 ModelParameters::registerParameters();
161 SolverParameters::registerParameters();
164 }
165
172#ifdef RESERVOIR_COUPLING_ENABLED
173 SimulatorReport run(SimulatorTimer& timer, int argc, char** argv)
174 {
175 init(timer, argc, argv);
176#else
178 {
179 init(timer);
180#endif
181 // Make cache up to date. No need for updating it in elementCtx.
182 // NB! Need to be at the correct step in case of restart
183 simulator_.setEpisodeIndex(timer.currentStepNum());
184 simulator_.model().invalidateAndUpdateIntensiveQuantities(/*timeIdx=*/0);
185 // Main simulation loop.
186 while (!timer.done()) {
187 simulator_.problem().writeReports(timer);
188 bool continue_looping = runStep(timer);
189 if (!continue_looping) break;
190 }
191 simulator_.problem().writeReports(timer);
192 return finalize();
193 }
194
195#ifdef RESERVOIR_COUPLING_ENABLED
196 // This method should only be called if slave mode (i.e. Parameters::Get<Parameters::Slave>())
197 // is false. We try to determine if this is a normal flow simulation or a reservoir
198 // coupling master. It is a normal flow simulation if the schedule does not contain
199 // any SLAVES and GRUPMAST keywords.
201 {
202 for (std::size_t report_step = 0; report_step < this->schedule().size(); ++report_step) {
203 auto rescoup = this->schedule()[report_step].rescoup();
204 auto slave_count = rescoup.slaveCount();
205 auto master_group_count = rescoup.masterGroupCount();
206 // - GRUPMAST and SLAVES keywords need to be specified at the same report step
207 // - They can only occur once in the schedule
208 if (slave_count > 0 && master_group_count > 0) {
209 return true;
210 }
211 else if (slave_count > 0 && master_group_count == 0) {
212 throw ReservoirCouplingError(
213 "Inconsistent reservoir coupling master schedule: "
214 "Slave count is greater than 0 but master group count is 0"
215 );
216 }
217 else if (slave_count == 0 && master_group_count > 0) {
218 throw ReservoirCouplingError(
219 "Inconsistent reservoir coupling master schedule: "
220 "Master group count is greater than 0 but slave count is 0"
221 );
222 }
223 }
224 return false;
225 }
226#endif
227
228#ifdef RESERVOIR_COUPLING_ENABLED
229 // NOTE: The argc and argv will be used when launching a slave process
230 void init(const SimulatorTimer& timer, int argc, char** argv)
231 {
232 auto slave_mode = Parameters::Get<Parameters::Slave>();
233 if (slave_mode) {
235 std::make_unique<ReservoirCouplingSlave>(
237 this->schedule(), timer
238 );
239 this->reservoirCouplingSlave_->sendAndReceiveInitialData();
240 this->simulator_.setReservoirCouplingSlave(this->reservoirCouplingSlave_.get());
242 }
243 else {
244 auto master_mode = checkRunningAsReservoirCouplingMaster();
245 if (master_mode) {
247 std::make_unique<ReservoirCouplingMaster>(
249 this->schedule(),
250 argc, argv
251 );
252 this->simulator_.setReservoirCouplingMaster(this->reservoirCouplingMaster_.get());
254 }
255 }
256#else
257 void init(const SimulatorTimer& timer)
258 {
259#endif
260 simulator_.setEpisodeIndex(-1);
261
262 // Create timers and file for writing timing info.
263 solverTimer_ = std::make_unique<time::StopWatch>();
264 totalTimer_ = std::make_unique<time::StopWatch>();
265 totalTimer_->start();
266
267 // adaptive time stepping
268 bool enableAdaptive = Parameters::Get<Parameters::EnableAdaptiveTimeStepping>();
269 bool enableTUNING = Parameters::Get<Parameters::EnableTuning>();
270 if (enableAdaptive) {
271 const UnitSystem& unitSystem = this->simulator_.vanguard().eclState().getUnits();
272 const auto& sched_state = schedule()[timer.currentStepNum()];
273 auto max_next_tstep = sched_state.max_next_tstep(enableTUNING);
274 if (enableTUNING) {
275 adaptiveTimeStepping_ = std::make_unique<TimeStepper>(max_next_tstep,
276 sched_state.tuning(),
277 unitSystem, report_, terminalOutput_);
278 }
279 else {
280 adaptiveTimeStepping_ = std::make_unique<TimeStepper>(unitSystem, report_, max_next_tstep, terminalOutput_);
281 }
282 if (isRestart()) {
283 // For restarts the simulator may have gotten some information
284 // about the next timestep size from the OPMEXTRA field
285 adaptiveTimeStepping_->setSuggestedNextStep(simulator_.timeStepSize());
286 }
287 }
288 }
289
290 void updateTUNING(const Tuning& tuning)
291 {
292 modelParam_.tolerance_cnv_ = tuning.TRGCNV;
293 modelParam_.tolerance_cnv_relaxed_ = tuning.XXXCNV;
294 modelParam_.tolerance_mb_ = tuning.TRGMBE;
295 modelParam_.tolerance_mb_relaxed_ = tuning.XXXMBE;
296 modelParam_.newton_max_iter_ = tuning.NEWTMX;
297 modelParam_.newton_min_iter_ = tuning.NEWTMN;
298 if (terminalOutput_) {
299 const auto msg = fmt::format("Tuning values: "
300 "MB: {:.2e}, CNV: {:.2e}, NEWTMN: {}, NEWTMX: {}",
301 tuning.TRGMBE, tuning.TRGCNV, tuning.NEWTMN, tuning.NEWTMX);
302 OpmLog::debug(msg);
303 if (tuning.TRGTTE_has_value) {
304 OpmLog::warning("Tuning item 2-1 (TRGTTE) is not supported.");
305 }
306 if (tuning.TRGLCV_has_value) {
307 OpmLog::warning("Tuning item 2-4 (TRGLCV) is not supported.");
308 }
309 if (tuning.XXXTTE_has_value) {
310 OpmLog::warning("Tuning item 2-5 (XXXTTE) is not supported.");
311 }
312 if (tuning.XXXLCV_has_value) {
313 OpmLog::warning("Tuning item 2-8 (XXXLCV) is not supported.");
314 }
315 if (tuning.XXXWFL_has_value) {
316 OpmLog::warning("Tuning item 2-9 (XXXWFL) is not supported.");
317 }
318 if (tuning.TRGFIP_has_value) {
319 OpmLog::warning("Tuning item 2-10 (TRGFIP) is not supported.");
320 }
321 if (tuning.TRGSFT_has_value) {
322 OpmLog::warning("Tuning item 2-11 (TRGSFT) is not supported.");
323 }
324 if (tuning.THIONX_has_value) {
325 OpmLog::warning("Tuning item 2-12 (THIONX) is not supported.");
326 }
327 if (tuning.TRWGHT_has_value) {
328 OpmLog::warning("Tuning item 2-13 (TRWGHT) is not supported.");
329 }
330 if (tuning.LITMAX_has_value) {
331 OpmLog::warning("Tuning item 3-3 (LITMAX) is not supported.");
332 }
333 if (tuning.LITMIN_has_value) {
334 OpmLog::warning("Tuning item 3-4 (LITMIN) is not supported.");
335 }
336 if (tuning.MXWSIT_has_value) {
337 OpmLog::warning("Tuning item 3-5 (MXWSIT) is not supported.");
338 }
339 if (tuning.MXWPIT_has_value) {
340 OpmLog::warning("Tuning item 3-6 (MXWPIT) is not supported.");
341 }
342 if (tuning.DDPLIM_has_value) {
343 OpmLog::warning("Tuning item 3-7 (DDPLIM) is not supported.");
344 }
345 if (tuning.DDSLIM_has_value) {
346 OpmLog::warning("Tuning item 3-8 (DDSLIM) is not supported.");
347 }
348 if (tuning.TRGDPR_has_value) {
349 OpmLog::warning("Tuning item 3-9 (TRGDPR) is not supported.");
350 }
351 if (tuning.XXXDPR_has_value) {
352 OpmLog::warning("Tuning item 3-10 (XXXDPR) is not supported.");
353 }
354 if (tuning.MNWRFP_has_value) {
355 OpmLog::warning("Tuning item 3-11 (MNWRFP) is not supported.");
356 }
357 }
358 }
359
361 {
362 if (schedule().exitStatus().has_value()) {
363 if (terminalOutput_) {
364 OpmLog::info("Stopping simulation since EXIT was triggered by an action keyword.");
365 }
366 report_.success.exit_status = schedule().exitStatus().value();
367 return false;
368 }
369
370 if (serializer_.shouldLoad()) {
372 }
373
374 // Report timestep.
375 if (terminalOutput_) {
376 std::ostringstream ss;
377 timer.report(ss);
378 OpmLog::debug(ss.str());
380 }
381
382 // write the inital state at the report stage
383 if (timer.initialStep()) {
384 Dune::Timer perfTimer;
385 perfTimer.start();
386
387 simulator_.setEpisodeIndex(-1);
388 simulator_.setEpisodeLength(0.0);
389 simulator_.setTimeStepSize(0.0);
391 simulator_.problem().writeOutput(true);
392
393 report_.success.output_write_time += perfTimer.stop();
394 }
395
396 // Run a multiple steps of the solver depending on the time step control.
397 solverTimer_->start();
398
399 if (!solver_) {
401 }
402
403 simulator_.startNextEpisode(
404 simulator_.startTime()
405 + schedule().seconds(timer.currentStepNum()),
406 timer.currentStepLength());
407 simulator_.setEpisodeIndex(timer.currentStepNum());
408
409 if (serializer_.shouldLoad()) {
412 simulator_.model().invalidateAndUpdateIntensiveQuantities(/*timeIdx=*/0);
413 }
414
415 this->solver_->model().beginReportStep();
416
417 const bool enableTUNING = Parameters::Get<Parameters::EnableTuning>();
418
419 // If sub stepping is enabled allow the solver to sub cycle
420 // in case the report steps are too large for the solver to converge
421 //
422 // \Note: The report steps are met in any case
423 // \Note: The sub stepping will require a copy of the state variables
425 auto tuningUpdater = [enableTUNING, this,
426 reportStep = timer.currentStepNum()](const double curr_time,
427 double dt, const int timeStep)
428 {
429 auto& schedule = this->simulator_.vanguard().schedule();
430 auto& events = this->schedule()[reportStep].events();
431
432 bool result = false;
433 if (events.hasEvent(ScheduleEvents::TUNING_CHANGE)) {
434 // Unset the event to not trigger it again on the next sub step
435 schedule.clear_event(ScheduleEvents::TUNING_CHANGE, reportStep);
436 const auto& sched_state = schedule[reportStep];
437 const auto& max_next_tstep = sched_state.max_next_tstep(enableTUNING);
438 const auto& tuning = sched_state.tuning();
439
440 if (enableTUNING) {
441 adaptiveTimeStepping_->updateTUNING(max_next_tstep, tuning);
442 // \Note: Assumes TUNING is only used with adaptive time-stepping
443 // \Note: Need to update both solver (model) and simulator since solver is re-created each report step.
444 solver_->model().updateTUNING(tuning);
445 this->updateTUNING(tuning);
446 dt = this->adaptiveTimeStepping_->suggestedNextStep();
447 } else {
448 dt = max_next_tstep;
449 this->adaptiveTimeStepping_->updateNEXTSTEP(max_next_tstep);
450 }
451 result = max_next_tstep > 0;
452 }
453
454 const auto& wcycle = schedule[reportStep].wcycle.get();
455 if (wcycle.empty()) {
456 return result;
457 }
458
459 const auto& wmatcher = schedule.wellMatcher(reportStep);
460 double wcycle_time_step =
461 wcycle.nextTimeStep(curr_time,
462 dt,
463 wmatcher,
464 this->wellModel_().wellOpenTimes(),
465 this->wellModel_().wellCloseTimes(),
466 [timeStep,
467 &wg_events = this->wellModel_().reportStepStartEvents()]
468 (const std::string& name)
469 {
470 if (timeStep != 0) {
471 return false;
472 }
473 return wg_events.hasEvent(name, ScheduleEvents::REQUEST_OPEN_WELL);
474 });
475
476 wcycle_time_step = this->grid().comm().min(wcycle_time_step);
477 if (dt != wcycle_time_step) {
478 this->adaptiveTimeStepping_->updateNEXTSTEP(wcycle_time_step);
479 return true;
480 }
481
482 return result;
483 };
484
485 tuningUpdater(timer.simulationTimeElapsed(),
486 this->adaptiveTimeStepping_->suggestedNextStep(), 0);
487
488#ifdef RESERVOIR_COUPLING_ENABLED
489 if (this->reservoirCouplingMaster_) {
490 this->reservoirCouplingMaster_->maybeSpawnSlaveProcesses(timer.currentStepNum());
491 this->reservoirCouplingMaster_->maybeActivate(timer.currentStepNum());
492 }
493 else if (this->reservoirCouplingSlave_) {
494 this->reservoirCouplingSlave_->maybeActivate(timer.currentStepNum());
495 }
496#endif
497 const auto& events = schedule()[timer.currentStepNum()].events();
498 bool event = events.hasEvent(ScheduleEvents::NEW_WELL) ||
499 events.hasEvent(ScheduleEvents::INJECTION_TYPE_CHANGED) ||
500 events.hasEvent(ScheduleEvents::WELL_SWITCHED_INJECTOR_PRODUCER) ||
501 events.hasEvent(ScheduleEvents::PRODUCTION_UPDATE) ||
502 events.hasEvent(ScheduleEvents::INJECTION_UPDATE) ||
503 events.hasEvent(ScheduleEvents::WELL_STATUS_CHANGE);
504 auto stepReport = adaptiveTimeStepping_->step(timer, *solver_, event, tuningUpdater);
505 report_ += stepReport;
506 //Pass simulation report to eclwriter for summary output
507 simulator_.problem().setSimulationReport(report_);
508 } else {
509 // solve for complete report step
510 auto stepReport = solver_->step(timer, nullptr);
511 report_ += stepReport;
512 if (terminalOutput_) {
513 std::ostringstream ss;
514 stepReport.reportStep(ss);
515 OpmLog::info(ss.str());
516 }
517 }
518
519 // write simulation state at the report stage
520 Dune::Timer perfTimer;
521 perfTimer.start();
522 const double nextstep = adaptiveTimeStepping_ ? adaptiveTimeStepping_->suggestedNextStep() : -1.0;
523 simulator_.problem().setNextTimeStepSize(nextstep);
524 simulator_.problem().writeOutput(true);
525 report_.success.output_write_time += perfTimer.stop();
526
527 solver_->model().endReportStep();
528
529 // take time that was used to solve system for this reportStep
530 solverTimer_->stop();
531
532 // update timing.
533 report_.success.solver_time += solverTimer_->secsSinceStart();
534
535 if (this->grid().comm().rank() == 0) {
536 // Grab the step convergence reports that are new since last we
537 // were here.
538 const auto& reps = this->solver_->model().stepReports();
540 }
541
542 // Increment timer, remember well state.
543 ++timer;
544
545 if (terminalOutput_) {
546 std::string msg =
547 "Time step took " + std::to_string(solverTimer_->secsSinceStart()) + " seconds; "
548 "total solver time " + std::to_string(report_.success.solver_time) + " seconds.";
549 OpmLog::debug(msg);
550 }
551
552 serializer_.save(timer);
553
554 return true;
555 }
556
558 {
559 // make sure all output is written to disk before run is finished
560 {
561 Dune::Timer finalOutputTimer;
562 finalOutputTimer.start();
563
564 simulator_.problem().finalizeOutput();
565 report_.success.output_write_time += finalOutputTimer.stop();
566 }
567
568 // Stop timer and create timing report
569 totalTimer_->stop();
570 report_.success.total_time = totalTimer_->secsSinceStart();
572
573 return report_;
574 }
575
576 const Grid& grid() const
577 { return simulator_.vanguard().grid(); }
578
579 template<class Serializer>
580 void serializeOp(Serializer& serializer)
581 {
582 serializer(simulator_);
583 serializer(report_);
584 serializer(adaptiveTimeStepping_);
585 }
586
587 const Model& model() const
588 { return solver_->model(); }
589
590protected:
592 void loadState([[maybe_unused]] HDF5Serializer& serializer,
593 [[maybe_unused]] const std::string& groupName) override
594 {
595#if HAVE_HDF5
596 serializer.read(*this, groupName, "simulator_data");
597#endif
598 }
599
601 void saveState([[maybe_unused]] HDF5Serializer& serializer,
602 [[maybe_unused]] const std::string& groupName) const override
603 {
604#if HAVE_HDF5
605 serializer.write(*this, groupName, "simulator_data");
606#endif
607 }
608
610 std::array<std::string,5> getHeader() const override
611 {
612 std::ostringstream str;
614 return {"OPM Flow",
617 simulator_.vanguard().caseName(),
618 str.str()};
619 }
620
622 const std::vector<int>& getCellMapping() const override
623 {
624 return simulator_.vanguard().globalCell();
625 }
626
627 std::unique_ptr<Solver> createSolver(WellModel& wellModel)
628 {
629 auto model = std::make_unique<Model>(simulator_,
631 wellModel,
633
634 if (this->modelParam_.write_partitions_) {
635 const auto& iocfg = this->eclState().cfg().io();
636
637 const auto odir = iocfg.getOutputDir()
638 / std::filesystem::path { "partition" }
639 / iocfg.getBaseName();
640
641 if (this->grid().comm().rank() == 0) {
642 create_directories(odir);
643 }
644
645 this->grid().comm().barrier();
646
647 model->writePartitions(odir);
648
649 this->modelParam_.write_partitions_ = false;
650 }
651
652 return std::make_unique<Solver>(solverParam_, std::move(model));
653 }
654
655 const EclipseState& eclState() const
656 { return simulator_.vanguard().eclState(); }
657
658
659 const Schedule& schedule() const
660 { return simulator_.vanguard().schedule(); }
661
662 bool isRestart() const
663 {
664 const auto& initconfig = eclState().getInitConfig();
665 return initconfig.restartRequested();
666 }
667
669 { return simulator_.problem().wellModel(); }
670
671 const WellModel& wellModel_() const
672 { return simulator_.problem().wellModel(); }
673
674 // Data.
676
679
680 std::unique_ptr<Solver> solver_;
681
682 // Observed objects.
683 // Misc. data
685
687 std::unique_ptr<time::StopWatch> solverTimer_;
688 std::unique_ptr<time::StopWatch> totalTimer_;
689 std::unique_ptr<TimeStepper> adaptiveTimeStepping_;
690
692
693#ifdef RESERVOIR_COUPLING_ENABLED
694 bool slaveMode_{false};
695 std::unique_ptr<ReservoirCouplingMaster> reservoirCouplingMaster_{nullptr};
696 std::unique_ptr<ReservoirCouplingSlave> reservoirCouplingSlave_{nullptr};
697#endif
698
700};
701
702} // namespace Opm
703
704#endif // OPM_SIMULATOR_FULLY_IMPLICIT_BLACKOIL_HEADER_INCLUDED
Definition: AdaptiveTimeStepping.hpp:78
static void registerParameters()
Definition: AdaptiveTimeStepping_impl.hpp:184
Contains the high level supplements required to extend the black oil model by MICP.
Definition: blackoilmicpmodules.hh:54
Contains the high level supplements required to extend the black oil model by polymer.
Definition: blackoilpolymermodules.hh:64
Class for handling the blackoil well model.
Definition: BlackoilWellModel.hpp:102
void setReservoirCouplingSlave(ReservoirCouplingSlave *slave)
Definition: BlackoilWellModel.hpp:397
void prepareDeserialize(const int report_step)
Definition: BlackoilWellModel.hpp:205
void beginReportStep(const int time_step)
Definition: BlackoilWellModel_impl.hpp:193
void setReservoirCouplingMaster(ReservoirCouplingMaster *master)
Definition: BlackoilWellModel.hpp:393
std::function< std::string_view(int)> ComponentToPhaseName
Definition: ExtraConvergenceOutputThread.hpp:109
Definition: FlowGenericVanguard.hpp:108
static Parallel::Communication & comm()
Obtain global communicator.
Definition: FlowGenericVanguard.hpp:336
Class for (de-)serializing using HDF5.
Definition: HDF5Serializer.hpp:37
Definition: NonlinearSolver.hpp:96
NonlinearSolverParameters< Scalar > SolverParameters
Definition: NonlinearSolver.hpp:100
Class handling convergence history output for a simulator.
Definition: SimulatorConvergenceOutput.hpp:44
void write(const std::vector< StepReport > &reports)
a simulator for the blackoil model
Definition: SimulatorFullyImplicitBlackoil.hpp:93
SolverParameters solverParam_
Definition: SimulatorFullyImplicitBlackoil.hpp:678
GetPropType< TypeTag, Properties::Simulator > Simulator
Definition: SimulatorFullyImplicitBlackoil.hpp:97
void loadState(HDF5Serializer &serializer, const std::string &groupName) override
Load simulator state from hdf5 serializer.
Definition: SimulatorFullyImplicitBlackoil.hpp:592
const WellModel & wellModel_() const
Definition: SimulatorFullyImplicitBlackoil.hpp:671
GetPropType< TypeTag, Properties::FluidSystem > FluidSystem
Definition: SimulatorFullyImplicitBlackoil.hpp:99
std::unique_ptr< TimeStepper > adaptiveTimeStepping_
Definition: SimulatorFullyImplicitBlackoil.hpp:689
bool slaveMode_
Definition: SimulatorFullyImplicitBlackoil.hpp:694
GetPropType< TypeTag, Properties::MaterialLawParams > MaterialLawParams
Definition: SimulatorFullyImplicitBlackoil.hpp:105
std::unique_ptr< Solver > createSolver(WellModel &wellModel)
Definition: SimulatorFullyImplicitBlackoil.hpp:627
bool isRestart() const
Definition: SimulatorFullyImplicitBlackoil.hpp:662
GetPropType< TypeTag, Properties::MaterialLaw > MaterialLaw
Definition: SimulatorFullyImplicitBlackoil.hpp:103
typename Model::ModelParameters ModelParameters
Definition: SimulatorFullyImplicitBlackoil.hpp:115
void updateTUNING(const Tuning &tuning)
Definition: SimulatorFullyImplicitBlackoil.hpp:290
~SimulatorFullyImplicitBlackoil() override
Definition: SimulatorFullyImplicitBlackoil.hpp:152
void serializeOp(Serializer &serializer)
Definition: SimulatorFullyImplicitBlackoil.hpp:580
typename Solver::SolverParameters SolverParameters
Definition: SimulatorFullyImplicitBlackoil.hpp:116
GetPropType< TypeTag, Properties::NonlinearSystem > Model
Definition: SimulatorFullyImplicitBlackoil.hpp:107
SimulatorSerializer serializer_
Definition: SimulatorFullyImplicitBlackoil.hpp:699
const std::vector< int > & getCellMapping() const override
Returns local-to-global cell mapping.
Definition: SimulatorFullyImplicitBlackoil.hpp:622
std::unique_ptr< ReservoirCouplingSlave > reservoirCouplingSlave_
Definition: SimulatorFullyImplicitBlackoil.hpp:696
GetPropType< TypeTag, Properties::PrimaryVariables > PrimaryVariables
Definition: SimulatorFullyImplicitBlackoil.hpp:102
const EclipseState & eclState() const
Definition: SimulatorFullyImplicitBlackoil.hpp:655
std::unique_ptr< time::StopWatch > totalTimer_
Definition: SimulatorFullyImplicitBlackoil.hpp:688
void saveState(HDF5Serializer &serializer, const std::string &groupName) const override
Save simulator state using hdf5 serializer.
Definition: SimulatorFullyImplicitBlackoil.hpp:601
const Grid & grid() const
Definition: SimulatorFullyImplicitBlackoil.hpp:576
GetPropType< TypeTag, Properties::SolutionVector > SolutionVector
Definition: SimulatorFullyImplicitBlackoil.hpp:104
static void registerParameters()
Definition: SimulatorFullyImplicitBlackoil.hpp:158
GetPropType< TypeTag, Properties::Indices > BlackoilIndices
Definition: SimulatorFullyImplicitBlackoil.hpp:101
const Model & model() const
Definition: SimulatorFullyImplicitBlackoil.hpp:587
SimulatorFullyImplicitBlackoil(Simulator &simulator)
Definition: SimulatorFullyImplicitBlackoil.hpp:121
std::unique_ptr< time::StopWatch > solverTimer_
Definition: SimulatorFullyImplicitBlackoil.hpp:687
std::unique_ptr< ReservoirCouplingMaster > reservoirCouplingMaster_
Definition: SimulatorFullyImplicitBlackoil.hpp:695
SimulatorConvergenceOutput convergence_output_
Definition: SimulatorFullyImplicitBlackoil.hpp:691
std::unique_ptr< Solver > solver_
Definition: SimulatorFullyImplicitBlackoil.hpp:680
bool terminalOutput_
Definition: SimulatorFullyImplicitBlackoil.hpp:684
ModelParameters modelParam_
Definition: SimulatorFullyImplicitBlackoil.hpp:677
bool runStep(SimulatorTimer &timer)
Definition: SimulatorFullyImplicitBlackoil.hpp:360
void init(const SimulatorTimer &timer, int argc, char **argv)
Definition: SimulatorFullyImplicitBlackoil.hpp:230
GetPropType< TypeTag, Properties::AquiferModel > AquiferModel
Definition: SimulatorFullyImplicitBlackoil.hpp:106
GetPropType< TypeTag, Properties::Grid > Grid
Definition: SimulatorFullyImplicitBlackoil.hpp:98
SimulatorReport finalize()
Definition: SimulatorFullyImplicitBlackoil.hpp:557
SimulatorReport report_
Definition: SimulatorFullyImplicitBlackoil.hpp:686
WellModel & wellModel_()
Definition: SimulatorFullyImplicitBlackoil.hpp:668
const Schedule & schedule() const
Definition: SimulatorFullyImplicitBlackoil.hpp:659
GetPropType< TypeTag, Properties::ElementContext > ElementContext
Definition: SimulatorFullyImplicitBlackoil.hpp:100
std::array< std::string, 5 > getHeader() const override
Returns header data.
Definition: SimulatorFullyImplicitBlackoil.hpp:610
SimulatorReport run(SimulatorTimer &timer, int argc, char **argv)
Definition: SimulatorFullyImplicitBlackoil.hpp:173
bool checkRunningAsReservoirCouplingMaster()
Definition: SimulatorFullyImplicitBlackoil.hpp:200
Simulator & simulator_
Definition: SimulatorFullyImplicitBlackoil.hpp:675
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:74
void save(SimulatorTimer &timer)
Save data to file if appropriate.
int loadStep() const
Returns step to load.
Definition: SimulatorSerializer.hpp:77
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
double simulationTimeElapsed() const override
int currentStepNum() const override
bool done() const override
Return true if op++() has been called numSteps() times.
Definition: blackoilnewtonmethodparams.hpp:31
void printValues(std::ostream &os)
Print values of the run-time parameters.
auto Get(bool errorIfNotRegistered=true)
Retrieve a runtime parameter.
Definition: parametersystem.hpp:187
Definition: alignedallocator.hh:32
void registerSimulatorParameters()
void outputReportStep(const SimulatorTimer &timer)
Definition: blackoilboundaryratevector.hh:39
std::string compileTimestamp()
std::string moduleVersion()
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
std::string to_string(const ConvergenceReport::ReservoirFailure::Type t)
Definition: SimulatorFullyImplicitBlackoil.hpp:72
static constexpr bool value
Definition: SimulatorFullyImplicitBlackoil.hpp:72
Definition: SimulatorFullyImplicitBlackoil.hpp:76
static constexpr auto * value
Definition: SimulatorFullyImplicitBlackoil.hpp:76
Definition: SimulatorFullyImplicitBlackoil.hpp:77
static constexpr int value
Definition: SimulatorFullyImplicitBlackoil.hpp:77
Definition: SimulatorFullyImplicitBlackoil.hpp:73
static constexpr auto * value
Definition: SimulatorFullyImplicitBlackoil.hpp:73
Definition: SimulatorFullyImplicitBlackoil.hpp:75
static constexpr auto * value
Definition: SimulatorFullyImplicitBlackoil.hpp:75
Definition: SimulatorFullyImplicitBlackoil.hpp:74
static constexpr auto * value
Definition: SimulatorFullyImplicitBlackoil.hpp:74
Definition: SimulatorFullyImplicitBlackoil.hpp:78
static constexpr bool value
Definition: SimulatorFullyImplicitBlackoil.hpp:78
Abstract interface for simulator serialization ops.
Definition: SimulatorSerializer.hpp:36
Definition: SimulatorReport.hpp:122
SimulatorReportSingle success
Definition: SimulatorReport.hpp:123
double solver_time
Definition: SimulatorReport.hpp:38
bool converged
Definition: SimulatorReport.hpp:55
double total_time
Definition: SimulatorReport.hpp:37
int exit_status
Definition: SimulatorReport.hpp:58
double output_write_time
Definition: SimulatorReport.hpp:46