def run_varying_enrichment(isotopes, iso_names, nat_conc, PuAmCm_conc, mix_ratios, reactor_type): avg_ks = [] for ratio_mox in mix_ratios: conc = nat_conc*(1-ratio_mox) + PuAmCm_conc*(ratio_mox) years = 50 / (35*1e-6*1e3) / 365.25 # MWd/kg / W/g * MW/W * g/kg / days/year steps = int(1e3) conc_over_time, fluxes, ks = main.main_function(isotopes, conc, reactor_type, years, steps) print('mox isotopics') print_isotopics_final(iso_names, conc, conc_over_time[:,-1]) avg_ks.append(np.average(ks)) return avg_ks
def run(): deviceID = request.args.get('deviceID') detect_final_result = main.main_function(deviceID) return "".join(str(x) for x in detect_final_result)
import numpy as np import sys sys.path.append('..') import pandas from main import main_function from plotting import concentration_plot isotopes = ['922350', '922360', '922370', '922380', '922390'] conc = np.zeros(len(isotopes)) conc[0] = 0.05 conc[3] = 0.95 flux = 0 years = 5 steps = 10000 reactor_type = 'fast' conc_over_time = main_function(isotopes, conc, flux, reactor_type, years, steps) data = np.vstack([np.array(isotopes), conc, conc_over_time[:, -1]]) data = data.transpose() headers = ['Isotope', 'Conc-init', 'Conc-final'] df = pandas.DataFrame(data=data, columns=headers) print(df) concentration_plot(isotopes, years, steps, conc_over_time)
conc = np.zeros(len(isotopes) + 2) conc[2] = 0.05 conc[5] = 0.95 nat_conc = copy.deepcopy(conc) nat_conc[2] = 0.00711 # Weight percent nat_conc[5] = (1 - 0.00711) years = 50 / (35 * 1e-6 * 1e3) / 365.25 # MWd/kg / W/g * MW/W * g/kg / days/year steps = int(1e3) # Find thermal avg k reactor_type = 'thermal' conc_over_time, fluxes, ks = main_function(isotopes, conc, reactor_type, years, steps) fresh_ks = ks avg_k_fresh_thermal = np.average(ks) PuAmCm_conc = extract_PuAmCm(isotopes, conc_over_time[:, -1]) print('Plutonium Vector') print_isotopics_final(iso_names, conc, PuAmCm_conc) csv_path = './' + reactor_type + '_fresh_concentrations.csv' # flux_k_plot(years, steps, fluxes, ks) print_isotopics_final(iso_names, conc, conc_over_time[:, -1], csv_path) PuAmCm_thermals = [extract_PuAmCm(isotopes, conc_over_time[:, -1])] print(reactor_type + 'Fresh Average k: ', avg_k_fresh_thermal) if burnup_plot: title = '50 MWd/kg Burnup in ' + reactor_type + ' spectrum' concentration_subplot(iso_names, years, steps, conc_over_time, title) flux_k_plot(years, steps, fluxes, ks)
try: iso_names.append(nucname.serpent(iso)) except: iso_names.append(iso) iso_names.append('Lumped-Act.') iso_names.append('FPs') conc = np.zeros(len(isotopes) + 2) conc[2] = 0.05 conc[5] = 0.95 flux = 0 years = 60 / (35 * 1e-6 * 1e3) / 365.25 # MWd/kg / W/g * MW/W * g/kg / days/year steps = int(1e3) reactor_type = 'thermal' conc_over_time, fluxes, ks = main_function(isotopes, conc, flux, reactor_type, years, steps) data = np.vstack( [np.array(iso_names), conc * 100, conc_over_time[:, -1] * 100]) data = data.transpose() headers = ['Isotope', 'Conc-init', 'Conc-final'] pandas.options.display.float_format = '{:2.4f}'.format df = pandas.DataFrame(data=data, columns=headers) df['Conc-init'] = pandas.to_numeric(df['Conc-init']) df['Conc-final'] = pandas.to_numeric(df['Conc-final']) df.loc['Total'] = pandas.Series(df['Conc-final'].sum(), index=['Conc-final']) df.at['Total', 'Conc-init'] = df['Conc-init'].sum() csv_path = './' + reactor_type + '_concentrations.csv' df.to_csv(csv_path) print(df)
conc = np.zeros(len(isotopes) + 2) conc[2] = 0.05 conc[5] = 0.95 nat_conc = copy.deepcopy(conc) nat_conc[2] = 0.00711 # Weight percent nat_conc[5] = (1 - 0.00711) years = 50 / (35 * 1e-6 * 1e3) / 365.25 # MWd/kg / W/g * MW/W * g/kg / days/year steps = int(1e3) # Make MOX reactor_type = 'thermal' conc_over_time, fluxes, ks = main_function(isotopes, conc, reactor_type, years, steps) PuAmCm_conc = extract_PuAmCm(isotopes, conc_over_time[:, -1]) weight_percent = 0.30 mox_conc = weight_percent * PuAmCm_conc + (1 - weight_percent) * nat_conc # Deplete by 15 atom percent in fast reactor years = 100 # Large number to hit 15 percent atom depletion steps = int(1e4) reactor_type = 'fast' print("Start of 15 deplete function") conc_over_time_fast, fluxes, ks = main_function(isotopes, mox_conc, reactor_type, years, steps,