feat(neutrino): Updated neutrino output
GridFire now reports neutrino loss for reaclib reactions. Note this currently is only computed if precomputation is enabled.
This commit is contained in:
9
tests/extern/C/gridfire_evolve.c
vendored
9
tests/extern/C/gridfire_evolve.c
vendored
@@ -46,6 +46,8 @@ int main() {
|
||||
double energy_out;
|
||||
double dEps_dT;
|
||||
double dEps_dRho;
|
||||
double specific_neutrino_energy_loss;
|
||||
double specific_neutrino_flux;
|
||||
double mass_lost;
|
||||
|
||||
ret = gf_evolve(
|
||||
@@ -59,7 +61,10 @@ int main() {
|
||||
Y_out,
|
||||
&energy_out,
|
||||
&dEps_dT,
|
||||
&dEps_dRho, &mass_lost
|
||||
&dEps_dRho,
|
||||
&specific_neutrino_energy_loss,
|
||||
&specific_neutrino_flux,
|
||||
&mass_lost
|
||||
);
|
||||
|
||||
CHECK_RET_CODE(ret, ctx, "EVOLUTION");
|
||||
@@ -72,6 +77,8 @@ int main() {
|
||||
printf("Energy output: %e\n", energy_out);
|
||||
printf("dEps/dT: %e\n", dEps_dT);
|
||||
printf("dEps/dRho: %e\n", dEps_dRho);
|
||||
printf("Specific neutrino energy loss: %e\n", specific_neutrino_energy_loss);
|
||||
printf("Specific neutrino flux: %e\n", specific_neutrino_flux);
|
||||
printf("Mass lost: %e\n", mass_lost);
|
||||
|
||||
gf_free(ctx);
|
||||
|
||||
7
tests/extern/fortran/gridfire_evolve.f90
vendored
7
tests/extern/fortran/gridfire_evolve.f90
vendored
@@ -36,7 +36,7 @@ program main
|
||||
|
||||
! Output buffers
|
||||
real(c_double), dimension(8) :: Y_out
|
||||
real(c_double) :: energy_out, dedt, dedrho, dmass
|
||||
real(c_double) :: energy_out, dedt, dedrho, snu_e_loss, snu_flux, dmass
|
||||
|
||||
! Thermodynamic Conditions (Solar Core-ish)
|
||||
real(c_double) :: T = 1.5e7 ! 15 Million K
|
||||
@@ -60,7 +60,7 @@ program main
|
||||
|
||||
! --- 5. Evolve ---
|
||||
print *, "Evolving system (dt =", dt, "s)..."
|
||||
call net%evolve(Y_in, T, rho, dt, Y_out, energy_out, dedt, dedrho, dmass, ierr)
|
||||
call net%evolve(Y_in, T, rho, dt, Y_out, energy_out, dedt, dedrho, snu_e_loss, snu_flux, dmass, ierr)
|
||||
|
||||
if (ierr /= 0) then
|
||||
print *, "Evolution Failed with error code: ", ierr
|
||||
@@ -74,6 +74,9 @@ program main
|
||||
print *, "--- Results ---"
|
||||
print '(A, ES12.5, A)', "Energy Generation: ", energy_out, " erg/g/s"
|
||||
print '(A, ES12.5)', "dEps/dT: ", dedt
|
||||
print '(A, ES12.5)', "dEps/drho: ", dedrho
|
||||
print '(A, ES12.5)', "Neutrino Energy Loss: ", snu_e_loss
|
||||
print '(A, ES12.5)', "Neutrino Flux: ", snu_flux
|
||||
print '(A, ES12.5)', "Mass Change: ", dmass
|
||||
|
||||
print *, ""
|
||||
|
||||
@@ -96,13 +96,13 @@ void log_results(const gridfire::NetOut& netOut, const gridfire::NetIn& netIn) {
|
||||
fractional.push_back(0.0);
|
||||
|
||||
initial.push_back(0.0);
|
||||
final.push_back(netOut.neutrino_energy_loss_rate);
|
||||
delta.push_back(netOut.neutrino_energy_loss_rate);
|
||||
final.push_back(netOut.specific_neutrino_energy_loss);
|
||||
delta.push_back(netOut.specific_neutrino_energy_loss);
|
||||
fractional.push_back(0.0);
|
||||
|
||||
initial.push_back(0.0);
|
||||
final.push_back(netOut.total_neutrino_flux);
|
||||
delta.push_back(netOut.total_neutrino_flux);
|
||||
final.push_back(netOut.specific_neutrino_flux);
|
||||
delta.push_back(netOut.specific_neutrino_flux);
|
||||
fractional.push_back(0.0);
|
||||
|
||||
initial.push_back(netIn.composition.getMeanParticleMass());
|
||||
@@ -282,10 +282,6 @@ int main(int argc, char** argv) {
|
||||
CLI11_PARSE(app, argc, argv);
|
||||
|
||||
const NetIn netIn = init(temp, rho, tMax);
|
||||
std::println("Starting Integration with T = {} K, ρ = {} g/cm³, tMax = {} s", temp, rho, tMax);
|
||||
std::println("Composition is: {}", utils::iterable_to_delimited_string(netIn.composition, ", ", [&netIn](std::pair<const fourdst::atomic::Species&, double> arg) {
|
||||
return std::format("{:5}: {:10.4E}", arg.first.name(), arg.second);
|
||||
}));
|
||||
|
||||
policy::MainSequencePolicy stellarPolicy(netIn.composition);
|
||||
stellarPolicy.construct();
|
||||
|
||||
Reference in New Issue
Block a user