|
opm-simulators
|
Top-level driver for a fully implicit flow simulation. More...
#include <SimulatorFullyImplicit.hpp>
Public Types | |
| using | Simulator = GetPropType< TypeTag, Properties::Simulator > |
| using | Grid = GetPropType< TypeTag, Properties::Grid > |
| using | FluidSystem = GetPropType< TypeTag, Properties::FluidSystem > |
| using | ElementContext = GetPropType< TypeTag, Properties::ElementContext > |
| using | BlackoilIndices = GetPropType< TypeTag, Properties::Indices > |
| using | PrimaryVariables = GetPropType< TypeTag, Properties::PrimaryVariables > |
| using | MaterialLaw = GetPropType< TypeTag, Properties::MaterialLaw > |
| using | SolutionVector = GetPropType< TypeTag, Properties::SolutionVector > |
| using | MaterialLawParams = GetPropType< TypeTag, Properties::MaterialLawParams > |
| using | AquiferModel = GetPropType< TypeTag, Properties::AquiferModel > |
| using | Model = GetPropType< TypeTag, Properties::NonlinearSystem > |
| using | Scalar = GetPropType< TypeTag, Properties::Scalar > |
| using | TimeStepper = AdaptiveTimeStepping< TypeTag > |
| using | PolymerModule = BlackOilPolymerModule< TypeTag, enablePolymer > |
| using | BioeffectsModule = BlackOilBioeffectsModule< TypeTag, enableBioeffects > |
| using | Solver = NonlinearSolver< TypeTag, Model > |
| using | ModelParameters = typename Model::ModelParameters |
| using | SolverParameters = typename Solver::SolverParameters |
| using | WellModel = GetPropType< TypeTag, Properties::WellModel > |
Public Member Functions | |
| SimulatorFullyImplicit (Simulator &simulator) | |
Construct from the surrounding eWoms Simulator. More... | |
| ~SimulatorFullyImplicit () override | |
| Ends the convergence-output thread cleanly on all ranks. | |
| SimulatorReport | run (SimulatorTimer &timer) |
| Run the entire simulation to completion. More... | |
| void | init (const SimulatorTimer &timer) |
| One-shot setup performed before the first runStep. More... | |
| void | updateTUNING (const Tuning &tuning) |
| Apply a TUNING keyword to the cached model parameters. More... | |
| void | updateTUNINGDP (const TuningDp &tuning_dp) |
| Apply a TUNINGDP keyword to the cached model parameters. More... | |
| bool | runStep (SimulatorTimer &timer) |
| Advance the simulation by one report step. More... | |
| SimulatorReport | finalize () |
| Stop the timers and emit the final OPMRST output. More... | |
| const Grid & | grid () const |
| template<class Serializer > | |
| void | serializeOp (Serializer &serializer) |
| Serialize the parts of this class needed for OPMRST round-tripping (the surrounding simulator state, the report, and the adaptive time stepper). More... | |
| const Model & | model () const |
Static Public Member Functions | |
| static void | registerParameters () |
| Register all parameters consumed by this class and its major collaborators. More... | |
Static Public Attributes | |
| static constexpr bool | enablePolymer = getPropValue<TypeTag, Properties::EnablePolymer>() |
| static constexpr bool | enableBioeffects = getPropValue<TypeTag, Properties::EnableBioeffects>() |
Protected Member Functions | |
| void | loadState (HDF5Serializer &serializer, const std::string &groupName) override |
| Load this simulator's data block from an OPMRST file via HDF5. | |
| void | saveState (HDF5Serializer &serializer, const std::string &groupName) const override |
| Save this simulator's data block to an OPMRST file via HDF5. | |
| std::array< std::string, 5 > | getHeader () const override |
| Return the OPMRST header tuple: product name, module version, compile timestamp, deck case name, and parameter dump. More... | |
| const std::vector< int > & | getCellMapping () const override |
| Local-to-global cell index mapping. | |
| std::unique_ptr< Solver > | createSolver (WellModel &wellModel) |
| Build the Solver used during the current report step. More... | |
| const EclipseState & | eclState () const |
| const Schedule & | schedule () const |
| bool | isRestart () const |
| WellModel & | wellModel_ () |
| const WellModel & | wellModel_ () const |
Protected Attributes | |
| Simulator & | simulator_ |
| Surrounding eWoms simulator; observed, not owned. | |
| ModelParameters | modelParam_ |
| Cached model parameters; mutated by TUNING / TUNINGDP application. | |
| SolverParameters | solverParam_ |
| Cached nonlinear-solver parameters. | |
| std::unique_ptr< Solver > | solver_ |
| Built lazily on the first runStep call; reused thereafter. | |
| bool | terminalOutput_ |
| Emit high-level progress to std::cout (rank 0 only). | |
| SimulatorReport | report_ |
| Aggregated report across the entire simulation. | |
| std::unique_ptr< time::StopWatch > | solverTimer_ |
| Wall-clock for the current report step's solve. | |
| std::unique_ptr< time::StopWatch > | totalTimer_ |
| Wall-clock for the entire simulation. | |
| std::unique_ptr< TimeStepper > | adaptiveTimeStepping_ |
| Set iff adaptive time stepping is enabled. | |
| SimulatorConvergenceOutput | convergence_output_ {} |
| Background thread for INFOSTEP / INFOITER files. | |
| SimulatorSerializer | serializer_ |
| OPMRST save / load. | |
Top-level driver for a fully implicit flow simulation.
Owns the per-report-step loop: run repeatedly invokes runStep until timer.done() is reached. Each runStep covers one report step (the interval between dates in the deck SCHEDULE), either as a single Solver::step call or, when adaptive time stepping is enabled (the default), by delegating the substep loop to AdaptiveTimeStepping::step.
Beyond the report-step loop, this class owns:
The class is instantiated once per simulation process. Static configuration is registered via registerParameters during program startup.
|
explicit |
Construct from the surrounding eWoms Simulator.
Initialises the OPMRST serializer from the SaveStep / LoadStep / SaveFile / LoadFile parameters and, on rank 0 with terminal output enabled, starts the background convergence-output thread that writes INFOSTEP / INFOITER files.
| simulator | The surrounding eWoms simulator; observed, not owned. |
|
protected |
Build the Solver used during the current report step.
Wraps a freshly constructed Model in a Solver. Side effect: if write_partitions is set in the model parameters, the partition layout is written under <output_dir>/partition/<case> on the first call only — the flag is cleared after, so subsequent calls skip the dump.
| SimulatorReport Opm::SimulatorFullyImplicit< TypeTag >::finalize | ( | ) |
Stop the timers and emit the final OPMRST output.
Called by run after the report-step loop finishes. Stops the total wall-clock timer and marks the report as converged.
|
overrideprotectedvirtual |
Return the OPMRST header tuple: product name, module version, compile timestamp, deck case name, and parameter dump.
Implements Opm::SerializableSim.
| void Opm::SimulatorFullyImplicit< TypeTag >::init | ( | const SimulatorTimer & | timer | ) |
One-shot setup performed before the first runStep.
Constructs the wall-clock timers and the AdaptiveTimeStepping instance (if adaptive stepping is enabled). For restart runs, the suggested next step is seeded from Simulator::timeStepSize().
| timer | Report-step timer; only its current step is read here. |
|
static |
Register all parameters consumed by this class and its major collaborators.
Forwards to ModelParameters::registerParameters, SolverParameters::registerParameters, AdaptiveTimeStepping::registerParameters, Opm::detail::registerSimulatorParameters, and the TPSA Newton-method / linear-solver parameter sets. Called once during program startup.
| SimulatorReport Opm::SimulatorFullyImplicit< TypeTag >::run | ( | SimulatorTimer & | timer | ) |
Run the entire simulation to completion.
Loops over report steps, calling runStep on each one. Stops early if the schedule triggers an EXIT keyword.
| timer | Outer report-step timer; advanced once per report step. |
| bool Opm::SimulatorFullyImplicit< TypeTag >::runStep | ( | SimulatorTimer & | timer | ) |
Advance the simulation by one report step.
Called by run once per report step. Performs:
| timer | Report-step timer; advanced by one report step on success. |
| void Opm::SimulatorFullyImplicit< TypeTag >::serializeOp | ( | Serializer & | serializer | ) |
Serialize the parts of this class needed for OPMRST round-tripping (the surrounding simulator state, the report, and the adaptive time stepper).
| void Opm::SimulatorFullyImplicit< TypeTag >::updateTUNING | ( | const Tuning & | tuning | ) |
Apply a TUNING keyword to the cached model parameters.
Overwrites convergence tolerances (TRGCNV / XXXCNV / TRGMBE / XXXMBE) and Newton iteration limits (NEWTMX / NEWTMN) on the ModelParameters copy held by this class. Items that are recognised by the parser but not honoured by this simulator are logged at warning level on rank 0.
| void Opm::SimulatorFullyImplicit< TypeTag >::updateTUNINGDP | ( | const TuningDp & | tuning_dp | ) |
Apply a TUNINGDP keyword to the cached model parameters.
Overwrites the maximum allowed pressure (TRGDDP), saturation (TRGDDS), and dissolved-gas / vaporised-oil ratio (TRGDDRS, TRGDDRV) changes per Newton iteration. TRGLCV / XXXLCV are accepted by the parser but logged as unsupported on rank 0.