Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local angular distributions #36

Open
wants to merge 45 commits into
base: master
Choose a base branch
from

Conversation

Yurlungur
Copy link
Collaborator

PR Summary

Add local angular distributions code in support of neutrino oscillations. This machinery is intended to find electron lepton number crossings. See, e.g.,
https://arxiv.org/abs/2404.17938

PR Checklist

  • Adds a test for any bugs fixed. Adds tests for new features.

@Yurlungur Yurlungur added the enhancement New feature or request label Nov 17, 2024
@Yurlungur Yurlungur self-assigned this Nov 17, 2024
@Yurlungur
Copy link
Collaborator Author

Yurlungur commented Nov 21, 2024

Four species transport now supported. To use do the following:

  1. Clone my fork of NuLib
  2. Modify the file make_example_table.F90 and set mytable_neutrino_scheme to 2 and number_output_species to 4
  3. build with make -j
  4. run the resulting executable make_example_table
  5. NuLib/scripts/table2bhlight.py on the generated hdf5 file
  6. Copy the generated table, which should end with _bhlight.h5 to the location you wish to use for nubhlight
  7. Modify the nublight build.py file or param_template.dat file to point to the file
  8. In the nubhlight build.py file, either add this line bhl.config.set_cparm("RAD_NUM_TYPES", 4) or change RAD_NUM_TYPES to be 4.
  9. build nubhlight and run

Below is the fornax 1 zone equilibrium test run with nue, nuebar, nux, nuxbar:

fornax-equilibrium-comparison

Note that with four species, at fixed particle number, fewer monte carlo packets are carrying electron number, so to get good Ye values, you may need to add roughly 25% more particles.

@Yurlungur
Copy link
Collaborator Author

important paper also for this MR https://arxiv.org/abs/2304.05044

@@ -28,6 +28,11 @@
#define S4THW (S2THW * S2THW)
#define NUSIGMA0 (1.7611737037e-44) // Fundamental neutrino cross section

// Frequency scale of neutrino oscillations
#define ROOT2 (1.4142135623730951)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Square roots are slow in C

Comment on lines +371 to +373
#define LOCAL_NUM_BASES (2)
#define MOMENTS_A (0)
#define MOMENTS_B (1)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might want to move these up...

@@ -1065,6 +1104,7 @@ void set_cooling_time(
void record_lepton_flux(const struct of_photon *ph);
void check_nu_type(const char *location);
int get_lepton_sign(const struct of_photon *ph);
int nu_is_heavy(const int radtype);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needed for generalizing to 4 species transport

Comment on lines +643 to +650
double *local_angles_Xharm = safe_malloc(
(NDIM - 1) * LOCAL_ANGLES_NX1 * LOCAL_ANGLES_NX2 * sizeof(double));
#if METRIC == MKS
double *local_angles_Xbl = safe_malloc(
(NDIM - 1) * LOCAL_ANGLES_NX1 * LOCAL_ANGLES_NX2 * sizeof(double));
#endif // MKS
double *local_angles_Xcart = safe_malloc(
(NDIM - 1) * LOCAL_ANGLES_NX1 * LOCAL_ANGLES_NX2 * sizeof(double));
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are diagnostics.

}

{
double *local_angles_mu = safe_malloc(LOCAL_ANGLES_NMU * sizeof(double));
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diagnostics

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes here are maybe best left as intermediate tests. Should probably undo these changes before merge.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test isn't ready yet.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test isn't ready yet.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should think about the changes here. We may wish to make a new build file rather than continuing to use the old one.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is my configuration. May or may not be wise to keep.

@Yurlungur
Copy link
Collaborator Author

This MR is ready. @kelslund @payelmuk150 please review.

@Yurlungur
Copy link
Collaborator Author

One-zone oscillation test
oscillations_1zone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants