@@ -229,6 +229,16 @@ def expand_macro_neutron_multiplication_xs_into_matrix(
229229 [i]-th bin producing a neutron in the [j]-bin, recorded as the [i,j] element in the
230230 matrix.
231231
232+ Parameters
233+ ----------
234+ discrete_n2n_xs:
235+ The group-wise macroscopic cross-section for the n2n reaction.
236+ A 1D numpy array, with len==number of neutron groups.
237+ group_structure:
238+ The n+1 energy bin boundaries for the n neutron groups, in descending energies.
239+ q_value:
240+ The difference in q-value.
241+
232242 Returns
233243 -------
234244 :
@@ -245,7 +255,7 @@ def expand_macro_neutron_multiplication_xs_into_matrix(
245255
246256def get_material_nuclear_data (
247257 material : str , group_structure : list [float ]
248- ) -> tuple [npt .NDArray [np .float64 ], npt .NDArray ]:
258+ ) -> tuple [npt .NDArray [np .float64 ], npt .NDArray , float ]:
249259 """
250260 The constants that is directly used.
251261
@@ -304,25 +314,18 @@ def get_material_nuclear_data(
304314 discrete_macro_scattering_xs = calculate_average_macro_xs (
305315 composition , micro_scattering_xs , density
306316 )
307- discrete_macro_scattering_xs_matrix = (
317+ source_matrix = (
308318 scattering_weight_matrix (group_structure , avg_atomic_mass ).T
309319 * discrete_macro_scattering_xs
310320 ).T
311- discrete_n2n_xs = calculate_average_macro_xs (
312- composition , micro_n2n_xs , density
313- )
314- discrete_macro_mult_xs_matrix = (
315- expand_macro_neutron_multiplication_xs_into_matrix (
316- discrete_n2n_xs ,
321+ for modified_composition_file , modified_density , q_value in n2n_susceptible_species :
322+ source_matrix += expand_macro_neutron_multiplication_xs_into_matrix (
323+ calculate_average_macro_xs (
324+ composition , micro_n2n_xs , density
325+ ),
317326 group_structure ,
318- N2N_Q_VALUE ,
319- # TODO: need to restructure this as we may have more than one types of (n,2n)
320- # reactions, requiring different values of N2N_Q_VALUE.
327+ q_value ,
321328 )
322- )
323- source_matrix = (
324- discrete_macro_scattering_xs_matrix + discrete_macro_mult_xs_matrix
325- )
326329
327330 return discrete_macro_total_xs , source_matrix , avg_atomic_mass
328331
0 commit comments