In [1]:
# Render our plots inline
%matplotlib inline
%pylab inline
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
# General Plotting Parameters
mpl.rcParams['figure.figsize'] = (8,5)
mpl.rcParams['lines.linewidth'] = 2.5
mpl.rcParams['font.weight'] = 'bold'
mpl.rcParams['axes.linewidth'] = 1.5
mpl.rcParams['font.size'] = 14.
mpl.rcParams['legend.fontsize'] = 12.
mpl.rcParams['axes.labelsize'] = 12.
mpl.rcParams['xtick.labelsize'] = 10.
mpl.rcParams['ytick.labelsize'] = 10.
mpl.rcParams['xtick.minor.pad'] = 4
mpl.rcParams['xtick.direction'] = 'out'
mpl.rcParams['ytick.direction'] = 'out'
#Git says this is patched, but it doesn't work from Pip --upgrade 26-mar-2015
#mpl.rcParams['xtick.minor.visible'] = True
# These are the "Tableau 20" colors as RGB.
tableau20 = [(31, 119, 180), (174, 199, 232), (255, 127, 14),
(255, 187, 120), (44, 160, 44), (152, 223, 138),
(148, 103, 189),
(197, 176, 213), (140, 86, 75), (196, 156, 148),
(227, 119, 194), (247, 182, 210), (127, 127, 127),
(199, 199, 199), (188, 189, 34), (219, 219, 141),
(23, 190, 207), (158, 218, 229),(214, 39, 40), (255, 152, 150)]
# Scale the RGB values to the [0, 1] range,
# which is the format matplotlib accepts.
for i in range(len(tableau20)):
r, g, b = tableau20[i]
tableau20[i] = (r / 255., g / 255., b / 255.)
In [2]:
import calc_enrich
reload(calc_enrich)
from calc_enrich import calc_del_U
from calc_enrich import machines_per_cascade
from calc_enrich import N_product_by_alpha
from calc_enrich import machines_per_enr_stage
from calc_enrich import product_per_enr_stage
from calc_enrich import machines_per_strip_stage
from calc_enrich import N_waste_by_alpha
from calc_enrich import Npc_from_Nstages
from calc_enrich import Nwc_from_Nstages
from calc_enrich import calc_feed_flows
from calc_enrich import find_N_stages
from calc_enrich import design_cascade
In [3]:
# centrifuge params
eff = 1.0 # centrifuge efficiency
d = 0.15 # m
Z = 0.5 # m
F_m = 15/1e6
T = 320.0# K
cut = 0.5
omega = 485/(d/2)
# cascade params
Nfc = 0.0071
Npc = 0.035
Nwc = 0.001
Fc_month = 739 #kg/month
# The feed enrichment to be used when using a cascade designed for LEU to produce HEU.
Nfc_mod = 0.20
Fc_month_mod = Fc_month #kg/month
#unit conversions
kg_sec2kg_month = 30.4*24*60*60
v_a = omega * (d/2.0)
Fc = Fc_month/kg_sec2kg_month
Fc_mod = Fc_month_mod/kg_sec2kg_month
# Comparison numbers (not needed for calculations)
del_U_th_yr = 1.1 #swu/yr
del_U_obs_yr = 0.71 #Swu/yr
del_U_th = del_U_th_yr/(365.25*24*60*60) #kgSWU/sec
del_U_obs = del_U_obs_yr/(365.25*24*60*60)
Pc_month = 77 #kg/month
Pc = Pc_month/kg_sec2kg_month
qty_len = 8
assay_len = 4
In [4]:
alpha, del_U, del_U_yr, dirac = calc_del_U(v_a, Z, d, F_m, T, cut, eff)
print "alpha", alpha
print "del_U", del_U
F_m
Out[4]:
In [5]:
n_mach = machines_per_cascade(del_U, Npc, Nwc, Fc, Pc)
print "machines per cascade", n_mach
In [6]:
nenr, nstr = find_N_stages(alpha, Nfc, Npc, Nwc)
print "N enrich stage", nenr
print "N strip stage", nstr
mod_p_assay = Npc_from_Nstages(alpha, Nfc_mod, nenr)
mod_w_assay = Nwc_from_Nstages(alpha, Nfc_mod, nstr)
print "mod product assay", mod_p_assay
print "mod waste assay", mod_w_assay
In [7]:
product_assay = N_product_by_alpha(alpha, Nfc)
n_enr_mach= machines_per_enr_stage(alpha, del_U, Fc)
stage_product= product_per_enr_stage(alpha, Nfc, product_assay, Fc)
print "product assay stage", product_assay
print "n enrich mach per stage", n_enr_mach
print "stage product", stage_product
enrich_waste = Fc - stage_product
enr_waste_assay = (Fc*Nfc - stage_product*product_assay)/enrich_waste
n_strip_mach = machines_per_strip_stage(alpha, del_U, enrich_waste)
waste_assay = N_waste_by_alpha(alpha, enr_waste_assay)
print "n strip mach", n_strip_mach
print "waste assay", waste_assay
#waste_assay = waste_per_strip_stage(alpha, enr_waste_assay, enrich_waste)
In [8]:
fa = 0.10
pa = 0.20
wa = 0.05
n_enr_st, n_str_st = find_N_stages(alpha, fa, pa, wa)
feed_flows = calc_feed_flows(n_enr_st, n_str_st, Fc, cut)
print "feed flows \n", feed_flows, "\n\n"
tot_stage_info, tot_machiens = design_cascade(cut, alpha, del_U,fa, feed_flows,
n_enr_st, n_str_st,
assay_len=4, qty_len=6, verbose=True, pretty=True)
tot_stages = n_enr_st+n_str_st
In [9]:
## Design Cascade based on available number of centrifuges, determine max Fc
max_centrifuges = 1000
curr_feed = Fc
optimal_feed = Fc
step_size = 1.05 # MUST be a number Greater than 1.
step = 1
#ideal_enrich_stage, ideal_strip_stage = find_N_stages(alpha, fa, pa, wa)
#print "n stages", ideal_enrich_stage, ideal_strip_stage
#feed_flows = calc_feed_flows(ideal_enrich_stage, ideal_strip_stage, curr_feed, cut)
all_stages, n_centrifuges = design_cascade(cut, alpha, del_U, fa, feed_flows, n_enr_st, n_str_st)
optimum_number = False
neg_inc = False
pos_inc = False
if (n_centrifuges < max_centrifuges):
pos_inc = True
step = step_size
elif (n_centrifuges > max_centrifuges):
neg_inc = True
step = 1.0/step_size
else:
optimum_number = True
ntries=0
print "step size is", step
while (optimum_number == False) and (ntries < 100):
ntries+=1
last_feed = curr_feed
curr_feed *= step
feed_flows = calc_feed_flows(n_enr_st, n_str_st, curr_feed, cut)
all_stages, n_centrifuges = design_cascade(cut, alpha, del_U, Nfc, feed_flows, n_enr_st,
n_str_st)
print "curr try", ntries, "Tot mach", n_centrifuges, "# in last stage: ", all_stages[-1][1]
if (all_stages[-1][1] < 1):
print "not enough centrifuges to fill all stages"
optimum_number = True
optimal_feed = last_feed
elif (neg_inc == True) and (n_centrifuges < max_centrifuges):
optimum_number = True
optimal_feed = curr_feed
print "reduced flow to correct #", n_centrifuges
elif (pos_inc == True) and (n_centrifuges > max_centrifuges):
optimum_number = True
optimal_feed = last_feed
print "increased flow to correct #", n_centrifuges
final_feed_flows = calc_feed_flows(n_enr_st, n_str_st, optimal_feed, cut)
final_stages, final_n_mach = design_cascade(cut, alpha, del_U, Nfc, final_feed_flows,
n_enr_st, n_str_st, verbose=True, pretty=True)
print "Cascade can process ", optimal_feed*kg_sec2kg_month, " kg/month"
print "Final total machines", final_n_mach
In [10]:
print "optimal feed ",optimal_feed
In [ ]:
In [ ]:
In [ ]: