|
ADS-IDAC Engine 5.0.0
|
Abstract interface for thermal-hydraulic solvers. More...
#include <ThermalHydraulicSolver.h>
Public Member Functions | |
| virtual | ~ThermalHydraulicSolver ()=default |
| virtual void | runSequence (SolverCallback &cb)=0 |
Run one complete simulation sequence. Blocks until the sequence completes. The solver calls back into cb at evaluation points during execution. More... | |
| virtual double | currentTime () const =0 |
| Current simulation time [s]. More... | |
| virtual int | stopFlag () const =0 |
| RELAP5 stop flag. 0=running, 3=normal end, 11=crash. More... | |
| virtual bool | isTerminateAll () const =0 |
| True if all simulation should terminate. More... | |
| virtual void | setTerminateAll (bool v)=0 |
| Set the terminate-all flag. More... | |
| virtual void | setBranchCount (int n)=0 |
| Set the number of branches generated at the current branching point. More... | |
| virtual void | setGenNode (bool v)=0 |
| Signal the solver to generate a restart checkpoint at this point. More... | |
| virtual void | setNewRestart (bool v)=0 |
| Set whether this is a fresh start (true) or a restart (false). More... | |
| virtual void | setInputDeck (const std::string &path)=0 |
| Set the input deck file path for the next sequence. More... | |
| virtual std::vector< char > | checkpoint ()=0 |
| Extract the solver's restart checkpoint as an opaque byte buffer. More... | |
| virtual void | restore (const std::vector< char > &data)=0 |
| Restore the solver's state from a buffer returned by checkpoint(). More... | |
| virtual void | setThermoCacheMode (int mode)=0 |
| Set thermodynamic table caching mode (RelapSolver; no-op for RestApiSolver). 2 forces a reload of the steam tables at every sequence; any other value (0 is the default) reuses the cached tables when the table set is unchanged. More... | |
| virtual void | setMembufMode (int mode)=0 |
| Set in-memory restart buffer mode (RelapSolver; no-op for RestApiSolver). 1=enabled, 0=disabled. The engine always passes 1. More... | |
Abstract interface for thermal-hydraulic solvers.
Defines the contract for running simulation sequences, querying state, applying interventions, and managing checkpoints. Concrete implementations:
Both implementations keep their state in the process-global r5pars_ struct, so at most one solver object is meaningful per process, and none of the methods is thread-safe.
Definition at line 70 of file ThermalHydraulicSolver.h.
|
virtualdefault |
|
pure virtual |
Extract the solver's restart checkpoint as an opaque byte buffer.
RelapSolver returns a copy of the accumulated RELAP5 restart buffer (every restart record the lineage has written). RestApiSolver returns a JSON map from restart count to server-side checkpoint id for the checkpoints taken during the current sequence.
Implemented in RelapSolver, and RestApiSolver.
Referenced by AdsidacCallback::onBranchingPoint().
|
pure virtual |
Current simulation time [s].
Implemented in RelapSolver, and RestApiSolver.
|
pure virtual |
True if all simulation should terminate.
Implemented in RelapSolver, and RestApiSolver.
Referenced by AdsidacCallback::restartForNewSequence().
|
pure virtual |
Restore the solver's state from a buffer returned by checkpoint().
An empty data is ignored. The restored state takes effect in the next runSequence(), which restarts at the restart count given on card 103 of indeck.i. RelapSolver loads the buffer into the Fortran restart buffer and calls std::abort() if the buffer lacks a complete restart record and no cached or on-disk base (restart_base.bin) can complete it. RestApiSolver only parses the map; a malformed buffer throws.
Implemented in RelapSolver, and RestApiSolver.
Referenced by AdsidacCallback::restartForNewSequence().
|
pure virtual |
Run one complete simulation sequence. Blocks until the sequence completes. The solver calls back into cb at evaluation points during execution.
Implemented in RelapSolver, and RestApiSolver.
|
pure virtual |
Set the number of branches generated at the current branching point.
Implemented in RelapSolver, and RestApiSolver.
|
pure virtual |
Signal the solver to generate a restart checkpoint at this point.
Implemented in RelapSolver, and RestApiSolver.
|
pure virtual |
Set the input deck file path for the next sequence.
Implemented in RelapSolver, and RestApiSolver.
|
pure virtual |
Set in-memory restart buffer mode (RelapSolver; no-op for RestApiSolver). 1=enabled, 0=disabled. The engine always passes 1.
Implemented in RelapSolver, and RestApiSolver.
|
pure virtual |
Set whether this is a fresh start (true) or a restart (false).
Implemented in RelapSolver, and RestApiSolver.
|
pure virtual |
Set the terminate-all flag.
Implemented in RelapSolver, and RestApiSolver.
Referenced by AdsidacCallback::initiationForRestart(), and AdsidacCallback::restartForNewSequence().
|
pure virtual |
Set thermodynamic table caching mode (RelapSolver; no-op for RestApiSolver). 2 forces a reload of the steam tables at every sequence; any other value (0 is the default) reuses the cached tables when the table set is unchanged.
Implemented in RelapSolver, and RestApiSolver.
|
pure virtual |
RELAP5 stop flag. 0=running, 3=normal end, 11=crash.
Implemented in RelapSolver, and RestApiSolver.