openmc.IndependentSource

class openmc.IndependentSource(space: Spatial | None = None, angle: UnitSphere | None = None, energy: Univariate | None = None, time: Univariate | None = None, strength: float = 1.0, particle: str = 'neutron', domains: Sequence[Cell | Material | Universe] | None = None, constraints: dict[str, Any] | None = None)[source]

Distribution of phase space coordinates for source sites.

Added in version 0.14.0.

Parameters:
  • space (openmc.stats.Spatial) – Spatial distribution of source sites

  • angle (openmc.stats.UnitSphere) – Angular distribution of source sites

  • energy (openmc.stats.Univariate) – Energy distribution of source sites

  • time (openmc.stats.Univariate) – time distribution of source sites

  • strength (float) – Strength of the source

  • particle ({'neutron', 'photon', 'electron', 'positron'}) – Source particle type

  • domains (iterable of openmc.Cell, openmc.Material, or openmc.Universe) –

    Domains to reject based on, i.e., if a sampled spatial location is not within one of these domains, it will be rejected.

    Deprecated since version 0.15.0: Use the constraints argument instead.

  • constraints (dict) – Constraints on sampled source particles. Valid keys include ‘domains’, ‘time_bounds’, ‘energy_bounds’, ‘fissionable’, and ‘rejection_strategy’. For ‘domains’, the corresponding value is an iterable of openmc.Cell, openmc.Material, or openmc.Universe for which sampled sites must be within. For ‘time_bounds’ and ‘energy_bounds’, the corresponding value is a sequence of floats giving the lower and upper bounds on time in [s] or energy in [eV] that the sampled particle must be within. For ‘fissionable’, the value is a bool indicating that only sites in fissionable material should be accepted. The ‘rejection_strategy’ indicates what should happen when a source particle is rejected: either ‘resample’ (pick a new particle) or ‘kill’ (accept and terminate).

Variables:
  • space (openmc.stats.Spatial or None) – Spatial distribution of source sites

  • angle (openmc.stats.UnitSphere or None) – Angular distribution of source sites

  • energy (openmc.stats.Univariate or None) – Energy distribution of source sites

  • time (openmc.stats.Univariate or None) – time distribution of source sites

  • strength (float) – Strength of the source

  • type (str) – Indicator of source type: ‘independent’

  • versionadded: (..) – 0.14.0:

  • particle ({'neutron', 'photon', 'electron', 'positron'}) – Source particle type

  • constraints (dict) – Constraints on sampled source particles. Valid keys include ‘domain_type’, ‘domain_ids’, ‘time_bounds’, ‘energy_bounds’, ‘fissionable’, and ‘rejection_strategy’.

classmethod from_xml_element(elem: Element, meshes=None) SourceBase[source]

Generate source from an XML element

Parameters:
  • elem (lxml.etree._Element) – XML element

  • meshes (dict) – Dictionary with mesh IDs as keys and openmc.MeshBase instaces as values

Returns:

Source generated from XML element

Return type:

openmc.Source

populate_xml_element(element)[source]

Add necessary source information to an XML element

Returns:

element – XML element containing source data

Return type:

lxml.etree._Element