コード例 #1
0
ファイル: example_2.py プロジェクト: corps-g/nrm
def run() :

    # parameter dictionary
    p = {}                 
    p['number_batches'] = 3       
    p['leakage_penalty'] = 0.04
    p['assembly_width'] = 21.5036
    p['assembly_power'] = 3.4/193
    p['active_height'] = 366.0
    p['fuel_radius'] = 0.4096
    p['cladding_inner_radius'] = 0.4180
    p['cladding_outer_radius'] = 0.4750
    p['number_pins'] = 264
    p['power_share'] = 'reactivity'
    
    T_F = 900*np.ones(p['number_batches'])    # batch fuel temperatures (K)
    T_C = 580*np.ones(p['number_batches'])    # batch moderator temperatures (K)
    
    num_thick = 20
    thick = np.linspace(0.0, 500, num_thick)
    B_c_FeCrAl = np.zeros((2, num_thick))
    B_c_SiC = np.zeros((2, num_thick))
    
    solver = NRM(p, rho=rho, m2=m2, k_cladding=k_cladding)
    
    te = time.time()
    for i in range(num_thick):    
    
        print 'thickness = %f micron' % thick[i]
    
        # FeCrAl
        p['power_share'] = 'equal'
        
        p['t_fecral'] = thick[i]
        p['t_sic'] = 0.0
        p['power_share'] = 'equal'
        B, ppf, T_F, T_C = solver.solve(T_F, T_C)
        B_c_FeCrAl[0, i] = B[-1]/len(T_F)
        p['power_share'] = 'reactivity'
        B, ppf, T_F, T_C = solver.solve(T_F, T_C)
        B_c_FeCrAl[1, i] = B[-1]/len(T_F)
    
        p['t_sic'] = thick[i]
        p['t_fecral'] = 0.0
        p['power_share'] = 'equal'
        B, ppf, T_F, T_C = solver.solve(T_F, T_C)
        B_c_SiC[0, i] = B[-1]/len(T_F)
        p['power_share'] = 'reactivity'
        B, ppf, T_F, T_C = solver.solve(T_F, T_C)
        B_c_SiC[1, i] = B[-1]/len(T_F)
    te = time.time() - te
    
    print "elapsed time: %f seconds" % te
    
    pickle.dump({'thick':thick, 'B_c_FeCrAl': B_c_FeCrAl, 'B_c_SiC': B_c_SiC},\
                open('example_2.p', 'w'))
コード例 #2
0
ファイル: example_3.py プロジェクト: corps-g/nrm
def run():

    # parameter dictionary
    p = {}
    p['number_batches'] = 3
    p['leakage_penalty'] = 0.04
    p['assembly_width'] = 21.5036
    p['assembly_power'] = 3.4 / 193
    p['active_height'] = 366.0
    p['fuel_radius'] = 0.4096
    p['cladding_inner_radius'] = 0.4180
    p['cladding_outer_radius'] = 0.4750
    p['number_pins'] = 264
    p['power_share'] = 'reactivity'

    T_F = 900 * sp.ones(p['number_batches'])  # batch fuel temperatures (K)
    T_C = 580 * sp.ones(
        p['number_batches'])  # batch moderator temperatures (K)

    num_thick = 20
    #thick = sp.linspace(0.0, 500, num_thick)
    thick = sp.logspace(-1, sp.log10(5 * 10**2), num_thick)
    T_F_FeCrAl = sp.zeros((3, num_thick))
    T_C_FeCrAl = sp.zeros((3, num_thick))
    T_F_SiC = sp.zeros((3, num_thick))
    T_C_SiC = sp.zeros((3, num_thick))
    PPF_FeCrAl = sp.zeros((3, num_thick))
    PPF_SiC = sp.zeros((3, num_thick))

    solver = NRM(p, rho=rho, m2=m2, k_cladding=k_cladding)

    for i in range(num_thick):
        p['t_fecral'] = thick[i]
        p['t_sic'] = 0.0
        B, ppf, T_F, T_C = solver.solve(T_F, T_C)
        T_F_FeCrAl[:, i] = T_F[:]
        T_C_FeCrAl[:, i] = T_C[:]
        PPF_FeCrAl[:, i] = ppf[:]

        p['t_fecral'] = 0.0
        p['t_sic'] = thick[i]
        B, ppf, T_F, T_C = solver.solve(T_F, T_C)
        T_F_SiC[:, i] = T_F[:]
        T_C_SiC[:, i] = T_C[:]
        PPF_SiC[:, i] = ppf[:]

    pickle.dump(
        {
            'thick': thick,
            'T_F_FeCrAl': T_F_FeCrAl,
            'T_C_FeCrAl': T_C_FeCrAl,
            'PPF_FeCrAl': PPF_FeCrAl,
            'T_F_SiC': T_F_SiC,
            'T_C_SiC': T_C_SiC,
            'PPF_SiC': PPF_SiC
        }, open('example_3.p', 'wb'))
コード例 #3
0
ファイル: example_3.py プロジェクト: corps-g/nrm
def run() :

    # parameter dictionary
    p = {}                 
    p['number_batches'] = 3       
    p['leakage_penalty'] = 0.04
    p['assembly_width'] = 21.5036
    p['assembly_power'] = 3.4/193
    p['active_height'] = 366.0
    p['fuel_radius'] = 0.4096
    p['cladding_inner_radius'] = 0.4180
    p['cladding_outer_radius'] = 0.4750
    p['number_pins'] = 264
    p['power_share'] = 'reactivity'
        
    T_F = 900*sp.ones(p['number_batches'])    # batch fuel temperatures (K)
    T_C = 580*sp.ones(p['number_batches'])    # batch moderator temperatures (K)
    
    num_thick = 20
    #thick = sp.linspace(0.0, 500, num_thick)
    thick = sp.logspace(-1, sp.log10(5*10**2), num_thick)
    T_F_FeCrAl = sp.zeros((3, num_thick))
    T_C_FeCrAl = sp.zeros((3, num_thick))
    T_F_SiC = sp.zeros((3, num_thick))
    T_C_SiC = sp.zeros((3, num_thick))
    PPF_FeCrAl = sp.zeros((3, num_thick))
    PPF_SiC = sp.zeros((3, num_thick))
    
    solver = NRM(p, rho=rho, m2=m2, k_cladding=k_cladding)

    
    for i in range(num_thick) :    
        p['t_fecral'] = thick[i]
        p['t_sic'] = 0.0
        B, ppf, T_F, T_C = solver.solve(T_F, T_C)
        T_F_FeCrAl[:, i] = T_F[:]
        T_C_FeCrAl[:, i] = T_C[:]
        PPF_FeCrAl[:, i] = ppf[:]
    
        p['t_fecral'] = 0.0
        p['t_sic'] = thick[i]
        B, ppf, T_F, T_C = solver.solve(T_F, T_C)
        T_F_SiC[:, i] = T_F[:]
        T_C_SiC[:, i] = T_C[:]
        PPF_SiC[:, i] = ppf[:]
    
    pickle.dump({'thick': thick,
                 'T_F_FeCrAl': T_F_FeCrAl,
                 'T_C_FeCrAl': T_C_FeCrAl,
                 'PPF_FeCrAl': PPF_FeCrAl,
                 'T_F_SiC': T_F_SiC,
                 'T_C_SiC': T_C_SiC,
                 'PPF_SiC': PPF_SiC}, open('example_3.p', 'w'))
コード例 #4
0
def run() :

    # parameter dictionary
    p = {}                 
    p['number_batches'] = 3       
    p['leakage_penalty'] = 0.04
    p['assembly_width'] = 21.5036
    p['assembly_power'] = 3.4/193
    p['active_height'] = 366.0
    p['fuel_radius'] = 0.4096
    p['cladding_inner_radius'] = 0.4180
    p['cladding_outer_radius'] = 0.4750
    p['number_pins'] = 264
    p['power_share'] = 'reactivity'
    
    T_F = 900*np.ones(p['number_batches'])    # batch fuel temperatures (K)
    T_C = 580*np.ones(p['number_batches'])    # batch moderator temperatures (K)
    
    num_thick = 20
    thick = np.linspace(0.0, 500, num_thick)
    B_c_FeCrAl = np.zeros((2, num_thick))
    B_c_SiC = np.zeros((2, num_thick))
    
    solver = NRM(p, rho=rho, m2=m2, k_cladding=k_cladding)
    
    te = time.time()
    for i in range(num_thick):    
    
        print('thickness = {:.3f} micron'.format(thick[i]))
    
        # FeCrAl
        p['power_share'] = 'equal'
        
        p['t_fecral'] = thick[i]
        p['t_sic'] = 0.0
        p['power_share'] = 'equal'
        B, ppf, T_F, T_C = solver.solve(T_F, T_C)
        B_c_FeCrAl[0, i] = B[-1]/len(T_F)
        p['power_share'] = 'reactivity'
        B, ppf, T_F, T_C = solver.solve(T_F, T_C)
        B_c_FeCrAl[1, i] = B[-1]/len(T_F)
    
        p['t_sic'] = thick[i]
        p['t_fecral'] = 0.0
        p['power_share'] = 'equal'
        B, ppf, T_F, T_C = solver.solve(T_F, T_C)
        B_c_SiC[0, i] = B[-1]/len(T_F)
        p['power_share'] = 'reactivity'
        B, ppf, T_F, T_C = solver.solve(T_F, T_C)
        B_c_SiC[1, i] = B[-1]/len(T_F)
    te = time.time() - te
    
    print("elapsed time: {:.3f} seconds".format(te))
    
    pickle.dump({'thick':thick, 'B_c_FeCrAl': B_c_FeCrAl, 'B_c_SiC': B_c_SiC},\
                open('example_2.p', 'wb'))
コード例 #5
0
num_enrich = 5
enrich = np.linspace(3.0, 5, num_enrich)
B_c_equal = np.zeros(num_enrich)
B_c_reactivity = np.zeros(num_enrich)

for i in range(num_enrich):
    
    # Set enrichment
    p['enrichment'] = enrich[i]

    # Make model
    c = CASMO4(p, degree=1, run=True)
    
    # Make solver
    solver = NRM(p, rho=c.rho, m2=c.m2, tolerance=0.000001)
    
    te = time.time()
    
    print('enrichment = {:.2f}%'.format(enrich[i]))
    
    p['power_share'] = 'equal'
    B, ppf, T_F, T_C = solver.solve(T_F, T_C)
    B_c_equal[i] = B[-1]/p['number_batches']
        
    p['power_share'] = 'reactivity'
    B, ppf, T_F, T_C = solver.solve(T_F, T_C)
    B_c_reactivity[i] = B[-1]/p['number_batches']
    
    te = time.time() - te