feat(priming): Priming now uses solver to initialize species abundances

Instead of a complex system of identifying dominate channels and
approximating abundances based on that, priming now simply ignites a
basic network at 1e7K for 1e-15s. This is an effective approach to prime
relevant species while being short enough to not change the abundance of
any fuel species.
This commit is contained in:
2025-11-14 10:55:03 -05:00
parent a9ef20f664
commit 5fd42db394
3 changed files with 106 additions and 376 deletions

View File

@@ -27,13 +27,8 @@ namespace gridfire {
* @see PrimingReport for data associated with each status.
*/
enum class PrimingReportStatus {
FULL_SUCCESS = 0,
NO_SPECIES_TO_PRIME = 1,
MAX_ITERATIONS_REACHED = 2,
FAILED_TO_FINALIZE_COMPOSITION = 3,
FAILED_TO_FIND_CREATION_CHANNEL = 4,
FAILED_TO_FIND_PRIMING_REACTIONS = 5,
BASE_NETWORK_TOO_SHALLOW = 6
SUCCESS,
SOLVER_FAILURE,
};
/**
@@ -43,13 +38,8 @@ namespace gridfire {
* The map contains entries for all PrimingReportStatus values.
*/
inline std::map<PrimingReportStatus, std::string> PrimingReportStatusStrings = {
{PrimingReportStatus::FULL_SUCCESS, "Full Success"},
{PrimingReportStatus::NO_SPECIES_TO_PRIME, "No Species to Prime"},
{PrimingReportStatus::MAX_ITERATIONS_REACHED, "Max Iterations Reached"},
{PrimingReportStatus::FAILED_TO_FINALIZE_COMPOSITION, "Failed to Finalize Composition"},
{PrimingReportStatus::FAILED_TO_FIND_CREATION_CHANNEL, "Failed to Find Creation Channel"},
{PrimingReportStatus::FAILED_TO_FIND_PRIMING_REACTIONS, "Failed to Find Priming Reactions"},
{PrimingReportStatus::BASE_NETWORK_TOO_SHALLOW, "Base Network Too Shallow"}
{PrimingReportStatus::SUCCESS, "SUCCESS"},
{PrimingReportStatus::SOLVER_FAILURE, "SOLVER_FAILURE"},
};
/**
@@ -65,11 +55,6 @@ namespace gridfire {
struct PrimingReport {
/** Finalized composition after priming. */
fourdst::composition::Composition primedComposition;
/**
* List of pairs (species, rate change) representing destruction (<0)
* or creation (>0) rates of species during priming.
*/
std::vector<std::pair<fourdst::atomic::Species, double>> massFractionChanges;
/** True if priming completed without error. */
bool success;
/** Detailed status code indicating the result. */
@@ -93,4 +78,11 @@ namespace gridfire {
}
};
enum class SpeciesStatus {
ACTIVE,
EQUILIBRIUM,
INACTIVE_FLOW,
NOT_PRESENT
};
}