GridFire 0.0.1a
General Purpose Nuclear Network
|
A network solver that uses a Quasi-Steady-State Equilibrium (QSE) approach. More...
#include <solver.h>
Classes | |
struct | EigenFunctor |
Functor for calculating the residual and Jacobian for the QSE species using Eigen. More... | |
struct | JacobianFunctor |
Functor for calculating the Jacobian matrix of the ODEs for the dynamic species. More... | |
struct | RHSFunctor |
Functor for calculating the right-hand side of the ODEs for the dynamic species. More... | |
Public Member Functions | |
NetOut | evaluate (const NetIn &netIn) override |
Evaluates the network for a given timestep using the QSE approach. | |
![]() | |
NetworkSolverStrategy (DynamicEngine &engine) | |
Constructor for the NetworkSolverStrategy. | |
virtual | ~NetworkSolverStrategy ()=default |
Virtual destructor. | |
NetworkSolverStrategy (DynamicEngine &engine) | |
Constructor for the NetworkSolverStrategy. | |
virtual | ~NetworkSolverStrategy ()=default |
Virtual destructor. | |
Private Member Functions | |
dynamicQSESpeciesIndices | packSpeciesTypeIndexVectors (const std::vector< double > &Y, const double T9, const double rho) const |
Packs the species indices into vectors based on their type (dynamic or QSE). | |
Eigen::VectorXd | calculateSteadyStateAbundances (const std::vector< double > &Y, const double T9, const double rho, const dynamicQSESpeciesIndices &indices) const |
Calculates the steady-state abundances of the QSE species. | |
NetOut | initializeNetworkWithShortIgnition (const NetIn &netIn) const |
Initializes the network with a short ignition phase. | |
bool | shouldUpdateView (const NetIn &conditions) const |
Determines whether the adaptive engine view should be updated. | |
Private Attributes | |
quill::Logger * | m_logger = fourdst::logging::LogManager::getInstance().getLogger("log") |
Logger instance. | |
fourdst::config::Config & | m_config = fourdst::config::Config::getInstance() |
Configuration instance. | |
bool | m_isViewInitialized = false |
Flag indicating whether the adaptive engine view has been initialized. | |
NetIn | m_lastSeenConditions |
The last seen input conditions. | |
Additional Inherited Members | |
![]() | |
DynamicEngine & | m_engine |
The engine used by this solver strategy. | |
DynamicEngine & | m_engine |
The engine used by this solver strategy. | |
A network solver that uses a Quasi-Steady-State Equilibrium (QSE) approach.
This solver partitions the network into "fast" species in QSE and "slow" (dynamic) species. The abundances of the fast species are determined by solving a system of algebraic equations, while the abundances of the slow species are integrated using an ODE solver. This hybrid approach is highly effective for stiff networks with disparate timescales.
The QSE solver uses an AdaptiveEngineView to dynamically cull unimportant species and reactions, which significantly improves performance for large networks.
|
private |
Calculates the steady-state abundances of the QSE species.
Y | Vector of current abundances for all species. |
T9 | Temperature in units of 10^9 K. |
rho | Density in g/cm^3. |
indices | A dynamicQSESpeciesIndices struct containing the indices of the dynamic and QSE species. |
This method solves a system of algebraic equations to determine the steady-state abundances of the QSE species.
std::runtime_error | If the steady-state abundances cannot be calculated. |
Definition at line 205 of file solver.cpp.
Evaluates the network for a given timestep using the QSE approach.
netIn | The input conditions for the network. |
This method performs the following steps:
std::runtime_error | If the steady-state abundances cannot be calculated. |
Implements gridfire::solver::NetworkSolverStrategy< DynamicEngine >.
Definition at line 26 of file solver.cpp.
|
private |
Initializes the network with a short ignition phase.
netIn | The input conditions for the network. |
This method performs a short integration of the network at a high temperature and density to ignite the network and bring it closer to equilibrium. This can improve the convergence of the QSE solver.
Definition at line 264 of file solver.cpp.
|
private |
Packs the species indices into vectors based on their type (dynamic or QSE).
Y | Vector of current abundances for all species. |
T9 | Temperature in units of 10^9 K. |
rho | Density in g/cm^3. |
This method determines whether each species should be treated dynamically or as being in QSE based on its timescale and abundance. Species with short timescales or low abundances are assumed to be in QSE.
Definition at line 137 of file solver.cpp.
|
private |
Determines whether the adaptive engine view should be updated.
conditions | The current input conditions. |
This method implements a policy for determining when the adaptive engine view should be updated. The view is updated if the temperature or density has changed significantly, or if a primary fuel source has been depleted.
Definition at line 308 of file solver.cpp.
|
private |
|
private |
|
private |
|
private |