@@ -332,20 +332,21 @@ def decay_photon_energy(self) -> Univariate | None:
332332 "version." , FutureWarning )
333333 return self .get_decay_photon_energy (0.0 )
334334
335- def get_decay_photon_energy (
335+ def get_decay_particle_energy (
336336 self ,
337+ particle : str = 'photon' ,
337338 clip_tolerance : float = 1e-6 ,
338339 units : str = 'Bq' ,
339340 volume : float | None = None ,
340341 exclude_nuclides : list [str ] | None = None ,
341342 include_nuclides : list [str ] | None = None
342343 ) -> Univariate | None :
343- r"""Return energy distribution of decay photons from unstable nuclides.
344-
345- .. versionadded:: 0.14.0
344+ r"""Return energy distribution of decay particles from unstable nuclides.
346345
347346 Parameters
348347 ----------
348+ particle : string
349+ Particle type to return the energy distribution for.
349350 clip_tolerance : float
350351 Maximum fraction of :math:`\sum_i x_i p_i` for discrete distributions
351352 that will be discarded.
@@ -355,19 +356,21 @@ def get_decay_photon_energy(
355356 Volume of the material. If not passed, defaults to using the
356357 :attr:`Material.volume` attribute.
357358 exclude_nuclides : list of str, optional
358- Nuclides to exclude from the photon source calculation.
359+ Nuclides to exclude from the particle source calculation.
359360 include_nuclides : list of str, optional
360- Nuclides to include in the photon source calculation. If specified,
361+ Nuclides to include in the particle source calculation. If specified,
361362 only these nuclides are used.
362363
363364 Returns
364365 -------
365366 Univariate or None
366- Decay photon energy distribution. The integral of this distribution is
367- the total intensity of the photon source in the requested units.
367+ Decay particle energy distribution. The integral of this distribution is
368+ the total intensity of the particle source in the requested units.
368369
369370 """
370371 cv .check_value ('units' , units , {'Bq' , 'Bq/g' , 'Bq/kg' , 'Bq/cm3' , 'Bq/m3' })
372+ cv .check_type ('particle' , particle , str )
373+ cv .check_value ('particle' , particle , {'alpha' , 'fragment' , 'neutron' ,'photon' , 'electron' , 'positron' ,'proton' })
371374
372375 if exclude_nuclides is not None and include_nuclides is not None :
373376 raise ValueError ("Cannot specify both exclude_nuclides and include_nuclides" )
@@ -393,12 +396,12 @@ def get_decay_photon_energy(
393396 if include_nuclides is not None and nuc not in include_nuclides :
394397 continue
395398
396- source_per_atom = openmc .data .decay_photon_energy (nuc )
399+ source_per_atom = openmc .data .decay_particle_energy (nuc , particle )
397400 if source_per_atom is not None and atoms_per_bcm > 0.0 :
398401 dists .append (source_per_atom )
399402 probs .append (1e24 * atoms_per_bcm * multiplier )
400403
401- # If no photon sources, exit early
404+ # If no particle sources, exit early
402405 if not dists :
403406 return None
404407
@@ -414,6 +417,54 @@ def get_decay_photon_energy(
414417
415418 return combined
416419
420+ def get_decay_photon_energy (
421+ self ,
422+ clip_tolerance : float = 1e-6 ,
423+ units : str = 'Bq' ,
424+ volume : float | None = None ,
425+ exclude_nuclides : list [str ] | None = None ,
426+ include_nuclides : list [str ] | None = None
427+ ) -> Univariate | None :
428+ r"""Return energy distribution of decay photons from unstable nuclides.
429+
430+ This is a convenience wrapper around :meth:`Material.get_decay_particle_energy`
431+ with ``particle='photon'``.
432+
433+ .. versionadded:: 0.14.0
434+
435+ Parameters
436+ ----------
437+ clip_tolerance : float
438+ Maximum fraction of :math:`\sum_i x_i p_i` for discrete distributions
439+ that will be discarded.
440+ units : {'Bq', 'Bq/g', 'Bq/kg', 'Bq/cm3', 'Bq/m3'}
441+ Specifies the units on the integral of the distribution.
442+ volume : float, optional
443+ Volume of the material. If not passed, defaults to using the
444+ :attr:`Material.volume` attribute.
445+ exclude_nuclides : list of str, optional
446+ Nuclides to exclude from the photon source calculation.
447+ include_nuclides : list of str, optional
448+ Nuclides to include in the photon source calculation. If specified,
449+ only these nuclides are used.
450+
451+ Returns
452+ -------
453+ Univariate or None
454+ Decay photon energy distribution. The integral of this distribution is
455+ the total intensity of the photon source in the requested units.
456+
457+ """
458+
459+ return self .get_decay_particle_energy (
460+ particle = 'photon' ,
461+ clip_tolerance = clip_tolerance ,
462+ units = units ,
463+ volume = volume ,
464+ exclude_nuclides = exclude_nuclides ,
465+ include_nuclides = include_nuclides ,
466+ )
467+
417468 def get_photon_contact_dose_rate (
418469 self ,
419470 dose_quantity : str = "absorbed-air" ,
@@ -540,7 +591,7 @@ def get_photon_contact_dose_rate(
540591 * sv_per_psv * 1e24 )
541592
542593 for nuc , nuc_atoms_per_bcm in self .get_nuclide_atom_densities ().items ():
543- photon_source_per_atom = openmc .data .decay_photon_energy (nuc )
594+ photon_source_per_atom = openmc .data .decay_particle_energy (nuc , 'photon' )
544595
545596 # nuclides with no contribution
546597 if photon_source_per_atom is None or nuc_atoms_per_bcm <= 0.0 :
0 commit comments