예제 #1
0
def test_u235_fast_constructor():
    n = 11
    nuc = "u235"
    e = "fast"
    d = decay_heat.DecayData(nuc=nuc, e=e, n=n)
    assert_equal(d._n, n)
    assert_equal(d._e, e)
    assert_equal(d._nuc, nuc)
예제 #2
0
def test_pu239_fast_constructor():
    # TODO This should actually test for a warning to be issued
    n = 11
    nuc = "pu239"
    e = "fast"
    d = decay_heat.DecayData(nuc=nuc, e=e, n=n)
    assert_equal(d._n, n)
    assert_equal(d._e, e)
    assert_equal(d._nuc, nuc)
예제 #3
0
파일: neutronics.py 프로젝트: joshia55/pyrk
    def __init__(self,
                 iso="u235",
                 e="thermal",
                 n_precursors=6,
                 n_decay=11,
                 timer=Timer(),
                 rho_ext=None,
                 feedback=False):
        """
        Creates a Neutronics object that holds the neutronics simulation
        information.

        :param iso: The fissioning isotope. 'u235' or 'pu239' are supported.
        :type iso: str.
        :param e: The energy spectrum 'thermal' or 'fast' are supported.
        :type e: str.
        :param n_precursors: Number of neutron precursor groups. 6 is supported.
        :type n_precursors: int.
        :param n_decay: The number of decay heat groups. 11 is supported.
        :type n_decay: int.
        :param rho_ext: External reactivity, a function of time
        :type rho_ext: function
        :returns: A Neutronics object that holds neutronics simulation info
        """

        self._iso = v.validate_supported("iso", iso, ['u235', 'pu239', 'sfr'])
        """_iso (str): Fissioning isotope. 'u235', 'pu239', or 'sfr' are supported."""

        self._e = v.validate_supported("e", e, ['thermal', 'fast'])
        """_e (str): Energy spectrum 'thermal' or 'fast' are supported."""

        self._npg = v.validate_supported("n_precursors", n_precursors, [6, 0])
        """_npg (int): Number of neutron precursor groups. 6 is supported."""

        self._ndg = v.validate_supported("n_decay", n_decay, [11, 0])
        """_ndg (int): Number of decay heat groups. 11 is supported."""

        self._pd = pr.PrecursorData(iso, e, n_precursors)
        """_pd (PrecursorData): A data.precursors.PrecursorData object"""

        self._dd = dh.DecayData(iso, e, n_decay)
        """_dd (DecayData): A data.decay_heat.DecayData object"""

        self._timer = timer
        """_timer: the time instance object"""

        self._rho = np.zeros(self._timer.timesteps())
        """_rho (ndarray): An array of reactivity values for each timestep."""

        self._rho_ext = self.init_rho_ext(rho_ext).reactivity
        """_rho_ext (ReactivityInsertion): Reactivity function from the
        reactivity insertion model"""

        self.feedback = feedback
        """feedback (bool): False if no reactivity feedbacks, true otherwise"""
예제 #4
0
def test_u235_thermal_constructor():
    n = 11
    nuc = "u235"
    e = "thermal"
    d = decay_heat.DecayData(nuc=nuc, e=e, n=n)
    assert_equal(d._n, n)
    assert_equal(d._e, e)
    assert_equal(d._nuc, nuc)
    assert_equal(len(d._lambdas), n)
    assert_equal(d._lambdas, d.lambdas())
    assert_equal(d._kappas, d.kappas())