Erick/scattering - #129
Conversation
…imulations. Multi energy scatterings will be implemented later when monocromatic scattering works.
…s to store scattering integrals
… modify with the propre integral equations
…t initial conditions
…ering: a single beam along the x directions that will be isotropized
in the simulation time
…opic component of the scattering kernel
…d different that one
… in reality number of particles per energy bin per cell when dividing the scattering integral term
…c scattering test script
| # Angular samples per energy bin in particle_input.dat (solid-angle weight 4*pi/N). | ||
| # Must match n_directions used when generating particle_input.dat | ||
| # (rows = n_energy_bins * N). Common value for nphi_equator=16 is 92. | ||
| number_of_particles_per_energy_bin_per_cell = 92 |
There was a problem hiding this comment.
can this not be read from the input file? It would be good to avoid duplicating inputs
|
|
||
| integration.type = 1 | ||
| integration.rk.type = 4 # DormandPrince (0=User, 1=ForwardEuler, 2=Trapezoid, 3=SSPRK3, 4=RK4, 5=DormandPrince) | ||
| integration.use_adaptive_time_step = 1 |
There was a problem hiding this comment.
remove the unused RK45 parameters
| Build the particle file for the monochromatic isotropic scattering test, | ||
| which exercises the isotropic components of the EMU scattering kernel. | ||
|
|
||
| Setup written by this script |
There was a problem hiding this comment.
I would write this full description in only one place. Otherwise, if anything changes, it is difficult to update everywhere. AI tends to be much too verbose for my tastes.
| nu_taubar = 6e32 # 1/ccm | ||
|
|
||
| # Energy bin size | ||
| energy_bin_size_MeV = 0.8339001570751987 # Energy in Mev |
There was a problem hiding this comment.
This parameter seems redundant with that defined in the input file
|
|
||
| Setup | ||
| ----- | ||
| - Domain: ncell = (3,3,3), Lx = Ly = Lz = 3e4 cm (27 cells; |
There was a problem hiding this comment.
again test description - I would place it in one location.
| Real Ye_pp = 0; | ||
| Real rho_pp = 0; // g/ccm | ||
|
|
||
| // Isotropic in-scattering interpolated to the particle (IMFP_method==1). |
There was a problem hiding this comment.
should be scripted as with other quantities
| Ye_pp += vol * sarr(i, j, k, GIdx::Ye); | ||
| rho_pp += vol * sarr(i, j, k, GIdx::rho); | ||
|
|
||
| // Mesh C_in_scat_* exist only for IMFP_method==1 (see GIdx::ncomp). |
There was a problem hiding this comment.
should be scripted as with other quantities.
| // Isotropic in-scattering collision term (complex Hermitian). Layout matches | ||
| // N/Fx/... blocks and PIdx::offset: diagonal _ii_Re only; off-diagonal | ||
| // _ij_Re then _ij_Im; then antineutrino counterparts with Rebar/Imbar. | ||
| #if NUM_FLAVORS == 2 |
There was a problem hiding this comment.
should be scripted, as with other components
| // columns; cells/spatial nppc points are replicated below, not in the file). | ||
| int ndirs_per_loc = particle_data.size(); | ||
| amrex::Print() << "Using " << ndirs_per_loc << " directions." << std::endl; | ||
| if (parms->IMFP_method == 1) { |
There was a problem hiding this comment.
instead of asserting, just set n_dir based on the input data
| lines = [sympy.cxxcode(sympy.simplify(e)) for e in self.expressions()] | ||
| return lines | ||
|
|
||
| def code_accumulate(self): |
There was a problem hiding this comment.
I'm not sure I understand why these functions are necessary. Not saying they're not, but we already do accumulation with the existing code, right?
draft of scattering implementation