Ejemplo n.º 1
0
def setup_r1g_discharge():
    global r1g
    libfile = os.getenv("BRIGHT_DATA") + '/LWR.h5'
    bright.load_track_nucs_hdf5(libfile)
    r1g = Reactor1G(rp=default_rp, n='r1g')
    r1g.loadlib(libfile)
    r1g.mat_feed = Material({922350: 0.5, 922380: 0.5})
    r1g.calc()
def run_reactormg():
    # Init bright
    libfile = os.getenv("BRIGHT_DATA") + '/lwr_mg.h5'
    load_track_nucs_hdf5(libfile)
    bright_conf.write_text = False
    bright_conf.write_hdf5 = False
    bright_conf.verbosity = 100

    # Init reactor paramters
    rp = lwr_defaults()
    rp.batches = 3
    rp.flux = 4*(10**14)

    rp.fuel_form = {"IHM": 1.0, "O16": 2.0}
    rp.cladding_form = {"ZR93": 0.5, "ZR95": 0.5}
    rp.coolant_form = {"H1": 2.0, "O16": 1.0}

    rp.fuel_density = 10.7
    rp.cladding_density = 5.87
    rp.coolant_density = 0.73

    rp.pnl = 0.9425
    #rp.pnl = 0.98
    #rp.pnl = 1.0
    rp.BUt = 50.0
    rp.use_disadvantage_factor = True
    #rp.lattice_type = 'Spherical'
    rp.lattice_type = 'Cylindrical'
    #rp.lattice_type = 'Planar'
    rp.rescale_hydrogen = True
    rp.burnup_via_constant = 'power'

    rp.fuel_radius = 0.41
    rp.void_radius = 0.4185
    rp.clad_radius = 0.475
    rp.unit_cell_pitch = 1.3127

    rp.open_slots = 25
    rp.total_slots = 289

    bt = list(np.linspace(0.0, 365.0, 10))
    #bt.insert(1, 1.0)
    bt.insert(1, 4.0)
    bt = np.array(bt)
    rp.burn_times = bt

    # Init mass stream
    leu = Material({922350: 0.045, 922380: 0.955})

    # Init ReactorMG
    rmg = ReactorMG(reactor_parameters=rp, name="rmg", tape9='template.tape9')
    rmg.loadlib(libfile)

    # Run the reactor
    #rmg.calc(leu)
    rmg.mat_feed = leu
    rmg.burnup_core()
    return rmg
def setup_ff():
    global mws, ff, u235, u238, r1g, mats
    libfile = os.getenv("BRIGHT_DATA") + '/LWR.h5'
    load_track_nucs_hdf5(libfile)

    r1g = Reactor1G(rp=default_rp)
    r1g.loadlib(libfile)

    u235 = Material({922350: 1.0}, 1.0, name="U-235")
    u238 = Material({922380: 1.0}, 1.0, name="U-238")
    mats = {"U235": u235, "U238": u238}

    mws = {"U235": -1.0, "U238": -1.0}

    ff = FuelFabrication(mats=mats, mws_in=mws, r=r1g)
def test_calc_params():
    lf = os.getenv("BRIGHT_DATA") + "/LWR.h5"
    load_track_nucs_hdf5(lf)
    rp = lwr_defaults()
    rp.BUt = 50.0
    lwr = LightWaterReactor1G(lib=lf, rp=rp, n='lwr')
    lwr.calc(Material({922350: 0.05, 922380:0.95}))
    lwr.calc_params()
    assert_equal(lwr.params_prior_calc["BUd"],  0.0)
    assert_equal(lwr.params_after_calc["BUd"], lwr.BUd)
    assert_equal(lwr.params_prior_calc["U"],  lwr.mat_feed_u.mass)
    assert_equal(lwr.params_after_calc["U"], lwr.mat_prod_u.mass)
    assert_equal(lwr.params_prior_calc["TRU"],  lwr.mat_feed_tru.mass)
    assert_equal(lwr.params_after_calc["TRU"], lwr.mat_prod_tru.mass)
    assert_equal(lwr.params_prior_calc["ACT"],  lwr.mat_feed_act.mass)
    assert_equal(lwr.params_after_calc["ACT"], lwr.mat_prod_act.mass)
    assert_equal(lwr.params_prior_calc["LAN"],  lwr.mat_feed_lan.mass)
    assert_equal(lwr.params_after_calc["LAN"], lwr.mat_prod_lan.mass)
    assert_equal(lwr.params_prior_calc["FP"],  1.0 - lwr.mat_feed_act.mass - lwr.mat_feed_lan.mass)
    assert_equal(lwr.params_after_calc["FP"], 1.0 - lwr.mat_prod_act.mass - lwr.mat_prod_lan.mass)
Ejemplo n.º 5
0
def test_calc_params():
    lf = os.getenv("BRIGHT_DATA") + "/FR.h5"
    load_track_nucs_hdf5(lf)
    rp = fr_defaults()
    rp.BUt = 140.0
    fr = FastReactor1G(lib=lf, rp=rp, n='fr')
    fr.calc(Material({922350: 0.30, 922380: 0.70}))
    fr.calc_params()
    assert_equal(fr.params_prior_calc["BUd"],  0.0)
    assert_equal(fr.params_after_calc["BUd"], fr.BUd)
    assert_equal(fr.params_prior_calc["TRUCR"],  0.0)
    assert_equal(fr.params_after_calc["TRUCR"], fr.tru_cr)
    assert_equal(fr.params_prior_calc["P_NL"],  0.0)
    assert_equal(fr.params_after_calc["P_NL"], fr.P_NL)
    assert_equal(fr.params_prior_calc["U"],  fr.mat_feed_u.mass)
    assert_equal(fr.params_after_calc["U"], fr.mat_prod_u.mass)
    assert_equal(fr.params_prior_calc["TRU"],  fr.mat_feed_tru.mass)
    assert_equal(fr.params_after_calc["TRU"], fr.mat_prod_tru.mass)
    assert_equal(fr.params_prior_calc["ACT"],  fr.mat_feed_act.mass)
    assert_equal(fr.params_after_calc["ACT"], fr.mat_prod_act.mass)
    assert_equal(fr.params_prior_calc["LAN"],  fr.mat_feed_lan.mass)
    assert_equal(fr.params_after_calc["LAN"], fr.mat_prod_lan.mass)
    assert_equal(fr.params_prior_calc["FP"],  1.0 - fr.mat_feed_act.mass - fr.mat_feed_lan.mass)
    assert_equal(fr.params_after_calc["FP"], 1.0 - fr.mat_prod_act.mass - fr.mat_prod_lan.mass)
Ejemplo n.º 6
0
def setup_rmg_attr():
    global rmg
    libfile = os.getenv("BRIGHT_DATA") + '/lwr_base.h5'
    load_track_nucs_hdf5(libfile)
    rmg = ReactorMG()
    rmg.loadlib(libfile)
Ejemplo n.º 7
0
def setup_r1g():
    global r1g
    libfile = os.getenv("BRIGHT_DATA") + '/LWR.h5'
    bright.load_track_nucs_hdf5(libfile)
    r1g = Reactor1G()
    r1g.loadlib(libfile)
Ejemplo n.º 8
0
def test_load_track_nucs_hdf5_1():
    old_isos = bright_conf.track_nucs
    bright_conf.track_nucs = set([80160])
    bright.load_track_nucs_hdf5('isos.h5')
    assert_equal(bright_conf.track_nucs, set([10010, 80160, 922350, 922380]))
    bright_conf.track_nucs = old_isos