2025-07-10 09:36:05 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "gridfire/engine/engine_abstract.h"
|
2025-10-22 09:54:10 -04:00
|
|
|
#include "gridfire/engine/engine_graph.h"
|
2025-11-24 09:07:49 -05:00
|
|
|
#include "gridfire/types/types.h"
|
2025-07-10 09:36:05 -04:00
|
|
|
|
2025-11-10 10:40:03 -05:00
|
|
|
#include "fourdst/atomic/atomicSpecies.h"
|
2025-07-10 09:36:05 -04:00
|
|
|
|
|
|
|
|
|
2025-11-24 09:07:49 -05:00
|
|
|
namespace gridfire::engine {
|
2025-07-14 14:50:49 -04:00
|
|
|
|
2025-07-24 11:10:45 -04:00
|
|
|
/**
|
|
|
|
|
* @brief Primes absent species in the network to their equilibrium abundances.
|
|
|
|
|
*
|
|
|
|
|
* Executes a network priming algorithm that iteratively rebuilds the reaction network,
|
|
|
|
|
* calculates equilibrium mass fractions for species with zero initial abundance,
|
|
|
|
|
* and applies mass transfers based on reaction flows.
|
|
|
|
|
*
|
|
|
|
|
* Refer to priming.cpp for implementation details on logging, algorithmic steps, and error handling.
|
|
|
|
|
*
|
|
|
|
|
* @param netIn Input network data containing initial composition, temperature, and density.
|
|
|
|
|
* @param engine DynamicEngine used to build and evaluate the reaction network.
|
2025-10-14 13:37:48 -04:00
|
|
|
* @param ignoredReactionTypes Types of reactions to ignore during priming (e.g., weak reactions).
|
2025-07-24 11:10:45 -04:00
|
|
|
* @pre netIn.composition defines species and their mass fractions; engine is constructed with a valid network.
|
|
|
|
|
* @post engine.networkReactions restored to its initial state; returned report contains primedComposition,
|
|
|
|
|
* massFractionChanges for each species, success flag, and status code.
|
|
|
|
|
* @return PrimingReport encapsulating the results of the priming operation.
|
|
|
|
|
*/
|
|
|
|
|
PrimingReport primeNetwork(
|
2025-08-14 13:33:46 -04:00
|
|
|
const NetIn& netIn,
|
2025-10-22 09:54:10 -04:00
|
|
|
GraphEngine& engine,
|
2025-10-14 13:37:48 -04:00
|
|
|
const std::optional<std::vector<reaction::ReactionType>>& ignoredReactionTypes
|
2025-07-24 11:10:45 -04:00
|
|
|
);
|
|
|
|
|
}
|