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

Added 3 flavor functionality for the sample_inputs test simulations #56

Merged
merged 2 commits into from
Mar 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 57 additions & 4 deletions Source/FlavoredNeutrinoContainerInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ InitParticles(const TestParams* parms)
// set all particles to start in electron state (and anti-state)
// Set N to be small enough that self-interaction is not important
// Set all particle momenta to be such that one oscillation wavelength is 1cm
AMREX_ASSERT(NUM_FLAVORS==2);
AMREX_ASSERT(NUM_FLAVORS==3 or NUM_FLAVORS==2);

// Set particle flavor
p.rdata(PIdx::N) = 1.0;
Expand All @@ -262,6 +262,19 @@ InitParticles(const TestParams* parms)
p.rdata(PIdx::f01_Imbar) = 0.0;
p.rdata(PIdx::f11_Rebar) = 0.0;

#if (NUM_FLAVORS==3)
p.rdata(PIdx::f22_Re) = 0.0;
p.rdata(PIdx::f22_Rebar) = 0.0;
p.rdata(PIdx::f02_Re) = 0.0;
p.rdata(PIdx::f02_Im) = 0.0;
p.rdata(PIdx::f12_Re) = 0.0;
p.rdata(PIdx::f12_Im) = 0.0;
p.rdata(PIdx::f02_Rebar) = 0.0;
p.rdata(PIdx::f02_Imbar) = 0.0;
p.rdata(PIdx::f12_Rebar) = 0.0;
p.rdata(PIdx::f12_Imbar) = 0.0;
#endif

// set momentum so that a vacuum oscillation wavelength occurs over a distance of 1cm
// Set particle velocity to c in a random direction
Real dm2 = (parms->mass2-parms->mass1)*(parms->mass2-parms->mass1); //g^2
Expand All @@ -275,7 +288,7 @@ InitParticles(const TestParams* parms)
// BIPOLAR OSCILLATION TEST //
//==========================//
else if(parms->simulation_type==1){
AMREX_ASSERT(NUM_FLAVORS==2);
AMREX_ASSERT(NUM_FLAVORS==3 or NUM_FLAVORS==2);

// Set particle flavor
p.rdata(PIdx::f00_Re) = 1.0;
Expand All @@ -287,6 +300,19 @@ InitParticles(const TestParams* parms)
p.rdata(PIdx::f01_Imbar) = 0.0;
p.rdata(PIdx::f11_Rebar) = 0.0;

#if (NUM_FLAVORS==3)
p.rdata(PIdx::f22_Re) = 0.0;
p.rdata(PIdx::f22_Rebar) = 0.0;
p.rdata(PIdx::f02_Re) = 0.0;
p.rdata(PIdx::f02_Im) = 0.0;
p.rdata(PIdx::f12_Re) = 0.0;
p.rdata(PIdx::f12_Im) = 0.0;
p.rdata(PIdx::f02_Rebar) = 0.0;
p.rdata(PIdx::f02_Imbar) = 0.0;
p.rdata(PIdx::f12_Rebar) = 0.0;
p.rdata(PIdx::f12_Imbar) = 0.0;
#endif

// set energy to 50 MeV to match Richers+(2019)
p.rdata(PIdx::pupt) = 50. * 1e6*CGSUnitsConst::eV;
p.rdata(PIdx::pupx) = u[0] * p.rdata(PIdx::pupt);
Expand All @@ -307,7 +333,7 @@ InitParticles(const TestParams* parms)
// 2-BEAM FAST FLAVOR TEST//
//========================//
else if(parms->simulation_type==2){
AMREX_ASSERT(NUM_FLAVORS==2);
AMREX_ASSERT(NUM_FLAVORS==3 or NUM_FLAVORS==2);

// Set particle flavor
p.rdata(PIdx::f00_Re) = 1.0;
Expand All @@ -319,6 +345,19 @@ InitParticles(const TestParams* parms)
p.rdata(PIdx::f01_Imbar) = 0.0;
p.rdata(PIdx::f11_Rebar) = 0.0;

#if (NUM_FLAVORS==3)
p.rdata(PIdx::f22_Re) = 0.0;
p.rdata(PIdx::f22_Rebar) = 0.0;
p.rdata(PIdx::f02_Re) = 0.0;
p.rdata(PIdx::f02_Im) = 0.0;
p.rdata(PIdx::f12_Re) = 0.0;
p.rdata(PIdx::f12_Im) = 0.0;
p.rdata(PIdx::f02_Rebar) = 0.0;
p.rdata(PIdx::f02_Imbar) = 0.0;
p.rdata(PIdx::f12_Rebar) = 0.0;
p.rdata(PIdx::f12_Imbar) = 0.0;
#endif

// set energy to 50 MeV to match Richers+(2019)
p.rdata(PIdx::pupt) = 50. * 1e6*CGSUnitsConst::eV;
p.rdata(PIdx::pupx) = u[0] * p.rdata(PIdx::pupt);
Expand All @@ -340,7 +379,7 @@ InitParticles(const TestParams* parms)
// 3- k!=0 BEAM FAST FLAVOR TEST //
//===============================//
else if(parms->simulation_type==3){
AMREX_ASSERT(NUM_FLAVORS==2);
AMREX_ASSERT(NUM_FLAVORS==3 or NUM_FLAVORS==2);

// perturbation parameters
Real lambda = domain_length_z/(Real)parms->st3_wavelength_fraction_of_domain;
Expand All @@ -356,6 +395,20 @@ InitParticles(const TestParams* parms)
p.rdata(PIdx::f01_Imbar) = 0.0;
p.rdata(PIdx::f11_Rebar) = 0.0;

#if (NUM_FLAVORS==3)
//just perturbing the electron-muon flavor state, other terms can stay = 0.0 for simplicity
p.rdata(PIdx::f22_Re) = 0.0;
p.rdata(PIdx::f22_Rebar) = 0.0;
p.rdata(PIdx::f02_Re) = 0.0;
p.rdata(PIdx::f02_Im) = 0.0;
p.rdata(PIdx::f12_Re) = 0.0;
p.rdata(PIdx::f12_Im) = 0.0;
p.rdata(PIdx::f02_Rebar) = 0.0;
p.rdata(PIdx::f02_Imbar) = 0.0;
p.rdata(PIdx::f12_Rebar) = 0.0;
p.rdata(PIdx::f12_Imbar) = 0.0;
#endif

// set energy to 50 MeV to match Richers+(2019)
p.rdata(PIdx::pupt) = 50. * 1e6*CGSUnitsConst::eV;
p.rdata(PIdx::pupx) = u[0] * p.rdata(PIdx::pupt);
Expand Down
3 changes: 2 additions & 1 deletion sample_inputs/inputs_bipolar_test
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ mass1_eV = -0.008596511
mass2_eV = 0

# mass state 3 mass in eV [NO:sqrt(2.449e-3) IO:-sqrt(2.509e-3)]
mass3_eV = 0.049487372
#mass3_eV = 0.049487372
mass3_eV = 0

# 1-2 mixing angle in degrees [NO/IO:33.82]
theta12_degrees = 33.82
Expand Down
3 changes: 2 additions & 1 deletion sample_inputs/inputs_fast_flavor
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ mass1_eV = -0.008596511
mass2_eV = 0

# mass state 3 mass in eV [NO:sqrt(2.449e-3) IO:-sqrt(2.509e-3)]
mass3_eV = 0.049487372
#mass3_eV = 0.049487372
mass3_eV = 0

# 1-2 mixing angle in degrees [NO/IO:33.82]
theta12_degrees = 1e-6
Expand Down
3 changes: 2 additions & 1 deletion sample_inputs/inputs_msw_test
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ mass1_eV = -0.008596511
mass2_eV = 0

# mass state 3 mass in eV [NO:sqrt(2.449e-3) IO:-sqrt(2.509e-3)]
mass3_eV = 0.049487372
# mass3_eV = 0.049487372
mass3_eV = 0

# 1-2 mixing angle in degrees [NO/IO:33.82]
theta12_degrees = 33.82
Expand Down