BEAVRS v3.0

This commit is contained in:
liangjg 2018-08-29 08:31:36 -07:00
parent 7b35705647
commit 66caecf98b
818 changed files with 104557 additions and 0 deletions

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,456 @@
#!/usr/bin/env python
import sys
import os
try:
base = sys.argv[1]
except:
base = ".."
seq = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q']
node_t = "\\renewcommand{{\Node{0}{1}}}{{{text}}}\n"
node_link_t = "\\renewcommand{{\NodeLink{0}{1}}}{{{link}}}\n"
node_fill_t = "\\renewcommand{{\NodeFill{0}{1}}}{{{fill}}}\n"
fig_str = r"""\begin{{figure}}[htpb]
\centering
\hypertarget{{{label}_target}}{{}}
\begin{{tikzpicture}}[draw=black, x=\Size,y=\Size, scale={scale}]
\foreach \col/\colLetter in \Sequence {{%
\foreach \row/\rowLetter in \Sequence{{%
\pgfmathtruncatemacro{{\value}}{{\col+\NumOfColumns*(\row-1)}}
\def\NodeText{{\expandafter\csname Node\rowLetter\colLetter\endcsname}}
\def\NodeLink{{\expandafter\csname NodeLink\rowLetter\colLetter\endcsname}}
\def\NodeFill{{\expandafter\csname NodeFill\rowLetter\colLetter\endcsname}}
\node [Square, hyperlink node=\NodeLink, fill=\NodeFill] at ($(\col,-\row)-(0.5,0.5)$) {{\NodeText}};
}}
}}
{extra}
\end{{tikzpicture}}
\caption[{altcap}]{{{caption} Source: {source} \label{{{label}}}}}
\end{{figure}}"""
GTU = ("G","fig_guidetube_pin","yellow!40")
INS = ("I","fig_instr_pin","white")
BA = ("B","fig_ba_pin","red!40")
default = ("","fig_fuel_pin","blue!10")
################################################################################
################################################################################
################################################################################
# Cycle 1
######################## 6 BA assembly
outp = os.path.join(base,"specifications{0}assy{0}figs{0}6ba.tex".format(os.sep))
outStr = ""
for r,R in enumerate(seq):
for c,C in enumerate(seq):
node = default
# Guide tube positions
if r+1 == 4 and c+1 == 4: node = BA
if r+1 == 3 and c+1 == 6: node = BA
if r+1 == 3 and c+1 == 9: node = GTU
if r+1 == 3 and c+1 == 12: node = BA
if r+1 == 4 and c+1 == 14: node = BA
if r+1 == 6 and c+1 == 3: node = BA
if r+1 == 6 and c+1 == 6: node = GTU
if r+1 == 6 and c+1 == 9: node = GTU
if r+1 == 6 and c+1 == 12: node = GTU
if r+1 == 6 and c+1 == 15: node = BA
if r+1 == 9 and c+1 == 3: node = GTU
if r+1 == 9 and c+1 == 6: node = GTU
if r+1 == 9 and c+1 == 9: node = INS
if r+1 == 9 and c+1 == 12: node = GTU
if r+1 == 9 and c+1 == 15: node = GTU
if r+1 == 12 and c+1 == 3: node = GTU
if r+1 == 12 and c+1 == 6: node = GTU
if r+1 == 12 and c+1 == 9: node = GTU
if r+1 == 12 and c+1 == 12: node = GTU
if r+1 == 12 and c+1 == 15: node = GTU
if r+1 == 14 and c+1 == 4: node = GTU
if r+1 == 15 and c+1 == 6: node = GTU
if r+1 == 15 and c+1 == 9: node = GTU
if r+1 == 15 and c+1 == 12: node = GTU
if r+1 == 14 and c+1 == 14: node = GTU
outStr += node_t.format(R,C,text=node[0])
outStr += node_link_t.format(R,C,link=node[1])
outStr += node_fill_t.format(R,C,fill=node[2])
e = " \\draw[->,thick] (8.5,-1) -- (8.5,0);\n \\node[anchor=south] at (8.5,0) {Core Center};"
outStr += fig_str.format(extra=e,scale=1,altcap="The 6BA burnable absorber configuration.",caption="The 6BA burnable absorber configuration. Blank locations denote fuel rods, \\textbf{G} denotes a guide tube location, \\textbf{B} denotes a burnable absorber rod, and \\textbf{I} denotes a guide tube position that might contain an instrument tube.",label="ass_6ba",
source=r"\ref{num:sheet_BPs}")
with open(outp,'w') as fh:
fh.write(outStr)
######################## 12 BA assembly
outp = os.path.join(base,"specifications{0}assy{0}figs{0}12ba.tex".format(os.sep))
outStr = ""
for r,R in enumerate(seq):
for c,C in enumerate(seq):
node = default
# Guide tube positions
if r+1 == 4 and c+1 == 4: node = BA
if r+1 == 3 and c+1 == 6: node = BA
if r+1 == 3 and c+1 == 9: node = GTU
if r+1 == 3 and c+1 == 12: node = BA
if r+1 == 4 and c+1 == 14: node = BA
if r+1 == 6 and c+1 == 3: node = BA
if r+1 == 6 and c+1 == 6: node = GTU
if r+1 == 6 and c+1 == 9: node = GTU
if r+1 == 6 and c+1 == 12: node = GTU
if r+1 == 6 and c+1 == 15: node = BA
if r+1 == 9 and c+1 == 3: node = GTU
if r+1 == 9 and c+1 == 6: node = GTU
if r+1 == 9 and c+1 == 9: node = INS
if r+1 == 9 and c+1 == 12: node = GTU
if r+1 == 9 and c+1 == 15: node = GTU
if r+1 == 12 and c+1 == 3: node = BA
if r+1 == 12 and c+1 == 6: node = GTU
if r+1 == 12 and c+1 == 9: node = GTU
if r+1 == 12 and c+1 == 12: node = GTU
if r+1 == 12 and c+1 == 15: node = BA
if r+1 == 14 and c+1 == 4: node = BA
if r+1 == 15 and c+1 == 6: node = BA
if r+1 == 15 and c+1 == 9: node = GTU
if r+1 == 15 and c+1 == 12: node = BA
if r+1 == 14 and c+1 == 14: node = BA
outStr += node_t.format(R,C,text=node[0])
outStr += node_link_t.format(R,C,link=node[1])
outStr += node_fill_t.format(R,C,fill=node[2])
outStr += fig_str.format(extra="",scale=1,altcap="The 12BA burnable absorber configuration for cycle 1.",caption="The 12BA burnable absorber configuration for cycle 1. Blank locations denote fuel rods, \\textbf{G} denotes a guide tube location, \\textbf{B} denotes a burnable absorber rod, and \\textbf{I} denotes a guide tube position that might contain an instrument tube.",label="ass_12ba",
source=r"\ref{num:sheet_BPs}")
with open(outp,'w') as fh:
fh.write(outStr)
######################## 15 BA assembly
outp = os.path.join(base,"specifications{0}assy{0}figs{0}15ba.tex".format(os.sep))
outStr = ""
for r,R in enumerate(seq):
for c,C in enumerate(seq):
node = default
# Guide tube positions
if r+1 == 4 and c+1 == 4: node = BA
if r+1 == 3 and c+1 == 6: node = BA
if r+1 == 3 and c+1 == 9: node = BA
if r+1 == 3 and c+1 == 12: node = BA
if r+1 == 4 and c+1 == 14: node = GTU
if r+1 == 6 and c+1 == 3: node = BA
if r+1 == 6 and c+1 == 6: node = BA
if r+1 == 6 and c+1 == 9: node = BA
if r+1 == 6 and c+1 == 12: node = BA
if r+1 == 6 and c+1 == 15: node = GTU
if r+1 == 9 and c+1 == 3: node = BA
if r+1 == 9 and c+1 == 6: node = BA
if r+1 == 9 and c+1 == 9: node = INS
if r+1 == 9 and c+1 == 12: node = BA
if r+1 == 9 and c+1 == 15: node = GTU
if r+1 == 12 and c+1 == 3: node = BA
if r+1 == 12 and c+1 == 6: node = BA
if r+1 == 12 and c+1 == 9: node = BA
if r+1 == 12 and c+1 == 12: node = BA
if r+1 == 12 and c+1 == 15: node = GTU
if r+1 == 14 and c+1 == 4: node = GTU
if r+1 == 15 and c+1 == 6: node = GTU
if r+1 == 15 and c+1 == 9: node = GTU
if r+1 == 15 and c+1 == 12: node = GTU
if r+1 == 14 and c+1 == 14: node = GTU
outStr += node_t.format(R,C,text=node[0])
outStr += node_link_t.format(R,C,link=node[1])
outStr += node_fill_t.format(R,C,fill=node[2])
e = " \\draw[->,thick] (0,-1) -- (-1,0);\n \\node[anchor=south] at (-1,0) {Core Center};"
outStr += fig_str.format(extra=e,scale=1,altcap="The 15BA burnable absorber configuration.",caption="The 15BA burnable absorber configuration. Blank locations denote fuel rods, \\textbf{G} denotes a guide tube location, \\textbf{B} denotes a burnable absorber rod, and \\textbf{I} denotes a guide tube position that might contain an instrument tube.",label="ass_15ba",
source=r"\ref{num:sheet_BPs}")
with open(outp,'w') as fh:
fh.write(outStr)
######################## 16 BA assembly
outp = os.path.join(base,"specifications{0}assy{0}figs{0}16ba.tex".format(os.sep))
outStr = ""
for r,R in enumerate(seq):
for c,C in enumerate(seq):
node = default
# Guide tube positions
if r+1 == 4 and c+1 == 4: node = BA
if r+1 == 3 and c+1 == 6: node = BA
if r+1 == 3 and c+1 == 9: node = BA
if r+1 == 3 and c+1 == 12: node = BA
if r+1 == 4 and c+1 == 14: node = BA
if r+1 == 6 and c+1 == 3: node = BA
if r+1 == 6 and c+1 == 6: node = GTU
if r+1 == 6 and c+1 == 9: node = GTU
if r+1 == 6 and c+1 == 12: node = GTU
if r+1 == 6 and c+1 == 15: node = BA
if r+1 == 9 and c+1 == 3: node = BA
if r+1 == 9 and c+1 == 6: node = GTU
if r+1 == 9 and c+1 == 9: node = INS
if r+1 == 9 and c+1 == 12: node = GTU
if r+1 == 9 and c+1 == 15: node = BA
if r+1 == 12 and c+1 == 3: node = BA
if r+1 == 12 and c+1 == 6: node = GTU
if r+1 == 12 and c+1 == 9: node = GTU
if r+1 == 12 and c+1 == 12: node = GTU
if r+1 == 12 and c+1 == 15: node = BA
if r+1 == 14 and c+1 == 4: node = BA
if r+1 == 15 and c+1 == 6: node = BA
if r+1 == 15 and c+1 == 9: node = BA
if r+1 == 15 and c+1 == 12: node = BA
if r+1 == 14 and c+1 == 14: node = BA
outStr += node_t.format(R,C,text=node[0])
outStr += node_link_t.format(R,C,link=node[1])
outStr += node_fill_t.format(R,C,fill=node[2])
outStr += fig_str.format(extra="",scale=1,altcap="The 16BA burnable absorber configuration.",caption="The 16BA burnable absorber configuration. Blank locations denote fuel rods, \\textbf{G} denotes a guide tube location, \\textbf{B} denotes a burnable absorber rod, and \\textbf{I} denotes a guide tube position that might contain an instrument tube.",label="ass_16ba",
source=r"\ref{num:sheet_BPs}")
with open(outp,'w') as fh:
fh.write(outStr)
######################## 20 BA assembly
outp = os.path.join(base,"specifications{0}assy{0}figs{0}20ba.tex".format(os.sep))
outStr = ""
for r,R in enumerate(seq):
for c,C in enumerate(seq):
node = default
# Guide tube positions
if r+1 == 4 and c+1 == 4: node = BA
if r+1 == 3 and c+1 == 6: node = BA
if r+1 == 3 and c+1 == 9: node = BA
if r+1 == 3 and c+1 == 12: node = BA
if r+1 == 4 and c+1 == 14: node = BA
if r+1 == 6 and c+1 == 3: node = BA
if r+1 == 6 and c+1 == 6: node = BA
if r+1 == 6 and c+1 == 9: node = GTU
if r+1 == 6 and c+1 == 12: node = BA
if r+1 == 6 and c+1 == 15: node = BA
if r+1 == 9 and c+1 == 3: node = BA
if r+1 == 9 and c+1 == 6: node = GTU
if r+1 == 9 and c+1 == 9: node = INS
if r+1 == 9 and c+1 == 12: node = GTU
if r+1 == 9 and c+1 == 15: node = BA
if r+1 == 12 and c+1 == 3: node = BA
if r+1 == 12 and c+1 == 6: node = BA
if r+1 == 12 and c+1 == 9: node = GTU
if r+1 == 12 and c+1 == 12: node = BA
if r+1 == 12 and c+1 == 15: node = BA
if r+1 == 14 and c+1 == 4: node = BA
if r+1 == 15 and c+1 == 6: node = BA
if r+1 == 15 and c+1 == 9: node = BA
if r+1 == 15 and c+1 == 12: node = BA
if r+1 == 14 and c+1 == 14: node = BA
outStr += node_t.format(R,C,text=node[0])
outStr += node_link_t.format(R,C,link=node[1])
outStr += node_fill_t.format(R,C,fill=node[2])
outStr += fig_str.format(extra="",scale=1,altcap="The 20BA burnable absorber configuration.",caption="The 20BA burnable absorber configuration. Blank locations denote fuel rods, \\textbf{G} denotes a guide tube location, \\textbf{B} denotes a burnable absorber rod, and \\textbf{I} denotes a guide tube position that might contain an instrument tube.",label="ass_20ba",
source=r"\ref{num:sheet_BPs}")
with open(outp,'w') as fh:
fh.write(outStr)
################################################################################
################################################################################
################################################################################
# Cycle 2
######################## 4 BA assembly
nba = 4
outp = os.path.join(base,"specifications{0}assy{0}figs{0}{1}ba.tex".format(os.sep,nba))
outStr = ""
for r,R in enumerate(seq):
for c,C in enumerate(seq):
node = default
# Guide tube positions
if r+1 == 4 and c+1 == 4: node = BA
if r+1 == 3 and c+1 == 6: node = GTU
if r+1 == 3 and c+1 == 9: node = GTU
if r+1 == 3 and c+1 == 12: node = GTU
if r+1 == 4 and c+1 == 14: node = BA
if r+1 == 6 and c+1 == 3: node = GTU
if r+1 == 6 and c+1 == 6: node = GTU
if r+1 == 6 and c+1 == 9: node = GTU
if r+1 == 6 and c+1 == 12: node = GTU
if r+1 == 6 and c+1 == 15: node = GTU
if r+1 == 9 and c+1 == 3: node = GTU
if r+1 == 9 and c+1 == 6: node = GTU
if r+1 == 9 and c+1 == 9: node = INS
if r+1 == 9 and c+1 == 12: node = GTU
if r+1 == 9 and c+1 == 15: node = GTU
if r+1 == 12 and c+1 == 3: node = GTU
if r+1 == 12 and c+1 == 6: node = GTU
if r+1 == 12 and c+1 == 9: node = GTU
if r+1 == 12 and c+1 == 12: node = GTU
if r+1 == 12 and c+1 == 15: node = GTU
if r+1 == 14 and c+1 == 4: node = BA
if r+1 == 15 and c+1 == 6: node = GTU
if r+1 == 15 and c+1 == 9: node = GTU
if r+1 == 15 and c+1 == 12: node = GTU
if r+1 == 14 and c+1 == 14: node = BA
outStr += node_t.format(R,C,text=node[0])
outStr += node_link_t.format(R,C,link=node[1])
outStr += node_fill_t.format(R,C,fill=node[2])
outStr += fig_str.format(extra="",scale=1,altcap="The {0}BA burnable absorber configuration.".format(nba),caption="The {0}BA burnable absorber configuration. Blank locations denote fuel rods, \\textbf{{G}} denotes a guide tube location, \\textbf{{B}} denotes a burnable absorber rod, and \\textbf{{I}} denotes a guide tube position that might contain an instrument tube.".format(nba),label="ass_{0}ba".format(nba),
source=r"\ref{num:sheet_BPs}")
with open(outp,'w') as fh:
fh.write(outStr)
######################## 8 BA assembly
nba = 8
outp = os.path.join(base,"specifications{0}assy{0}figs{0}{1}ba.tex".format(os.sep,nba))
outStr = ""
for r,R in enumerate(seq):
for c,C in enumerate(seq):
node = default
# Guide tube positions
if r+1 == 4 and c+1 == 4: node = BA
if r+1 == 3 and c+1 == 6: node = GTU
if r+1 == 3 and c+1 == 9: node = GTU
if r+1 == 3 and c+1 == 12: node = GTU
if r+1 == 4 and c+1 == 14: node = BA
if r+1 == 6 and c+1 == 3: node = GTU
if r+1 == 6 and c+1 == 6: node = GTU
if r+1 == 6 and c+1 == 9: node = BA
if r+1 == 6 and c+1 == 12: node = GTU
if r+1 == 6 and c+1 == 15: node = GTU
if r+1 == 9 and c+1 == 3: node = GTU
if r+1 == 9 and c+1 == 6: node = BA
if r+1 == 9 and c+1 == 9: node = INS
if r+1 == 9 and c+1 == 12: node = BA
if r+1 == 9 and c+1 == 15: node = GTU
if r+1 == 12 and c+1 == 3: node = GTU
if r+1 == 12 and c+1 == 6: node = GTU
if r+1 == 12 and c+1 == 9: node = BA
if r+1 == 12 and c+1 == 12: node = GTU
if r+1 == 12 and c+1 == 15: node = GTU
if r+1 == 14 and c+1 == 4: node = BA
if r+1 == 15 and c+1 == 6: node = GTU
if r+1 == 15 and c+1 == 9: node = GTU
if r+1 == 15 and c+1 == 12: node = GTU
if r+1 == 14 and c+1 == 14: node = BA
outStr += node_t.format(R,C,text=node[0])
outStr += node_link_t.format(R,C,link=node[1])
outStr += node_fill_t.format(R,C,fill=node[2])
outStr += fig_str.format(extra="",scale=1,altcap="The {0}BA burnable absorber configuration.".format(nba),caption="The {0}BA burnable absorber configuration. Blank locations denote fuel rods, \\textbf{{G}} denotes a guide tube location, \\textbf{{B}} denotes a burnable absorber rod, and \\textbf{{I}} denotes a guide tube position that might contain an instrument tube.".format(nba),label="ass_{0}ba".format(nba),
source=r"\ref{num:sheet_BPs}")
with open(outp,'w') as fh:
fh.write(outStr)
######################## 12 BA assembly
nba = 12
outp = os.path.join(base,"specifications{0}assy{0}figs{0}{1}ba_c2.tex".format(os.sep,nba))
outStr = ""
for r,R in enumerate(seq):
for c,C in enumerate(seq):
node = default
# Guide tube positions
if r+1 == 4 and c+1 == 4: node = GTU
if r+1 == 3 and c+1 == 6: node = BA
if r+1 == 3 and c+1 == 9: node = GTU
if r+1 == 3 and c+1 == 12: node = BA
if r+1 == 4 and c+1 == 14: node = GTU
if r+1 == 6 and c+1 == 3: node = BA
if r+1 == 6 and c+1 == 6: node = GTU
if r+1 == 6 and c+1 == 9: node = BA
if r+1 == 6 and c+1 == 12: node = GTU
if r+1 == 6 and c+1 == 15: node = BA
if r+1 == 9 and c+1 == 3: node = GTU
if r+1 == 9 and c+1 == 6: node = BA
if r+1 == 9 and c+1 == 9: node = INS
if r+1 == 9 and c+1 == 12: node = BA
if r+1 == 9 and c+1 == 15: node = GTU
if r+1 == 12 and c+1 == 3: node = BA
if r+1 == 12 and c+1 == 6: node = GTU
if r+1 == 12 and c+1 == 9: node = BA
if r+1 == 12 and c+1 == 12: node = GTU
if r+1 == 12 and c+1 == 15: node = BA
if r+1 == 14 and c+1 == 4: node = GTU
if r+1 == 15 and c+1 == 6: node = BA
if r+1 == 15 and c+1 == 9: node = GTU
if r+1 == 15 and c+1 == 12: node = BA
if r+1 == 14 and c+1 == 14: node = GTU
outStr += node_t.format(R,C,text=node[0])
outStr += node_link_t.format(R,C,link=node[1])
outStr += node_fill_t.format(R,C,fill=node[2])
outStr += fig_str.format(extra="",scale=1,altcap="The {0}BA burnable absorber configuration for cycle 2.".format(nba),caption="The {0}BA burnable absorber configuration for cycle 2. Blank locations denote fuel rods, \\textbf{{G}} denotes a guide tube location, \\textbf{{B}} denotes a burnable absorber rod, and \\textbf{{I}} denotes a guide tube position that might contain an instrument tube.".format(nba),label="ass_{0}ba_c2".format(nba),
source=r"\ref{num:sheet_BPs}")
with open(outp,'w') as fh:
fh.write(outStr)

View file

@ -0,0 +1,572 @@
#!/usr/bin/env python
from __future__ import division
import sys
import os
fig_t = r"""\begin{{figure}}[htbp]
\centering
\begin{{tikzpicture}}[scale={scale},x=1in,y=1in]{tikzpic}
{matrix}
\end{{tikzpicture}}
\caption[{shortcap}]{{{caption}\label{{{label}}}}}
\end{{figure}}"""
matrix_t = r""" \matrix [matrix of nodes,row sep=0,column sep=0]
{{{rows}
}};
"""
row_t = """\n \draw (-1,{bot}) rectangle (1,{top}); & {fill} \\\\"""
## <!--- axials copied straight from rod_axials.ods
# Core Structures
struct_LowestExtent = "0.00000" #
struct_SupportPlate_bot = "20.0000" # arbitrary amount of water below core
struct_SupportPlate_top = "25.0000" # guessed
struct_LowerNozzle_bot = "25.0000" # same as struct_SupportPlate_top
struct_LowerNozzle_top = "35.0000" # approx from ** NDR of 4.088in for lower nozzle height
struct_UpperNozzle_bot = "423.049" # fig 4.2-3 from Watts Bar Unit 2 safety analysis report
struct_UpperNozzle_top = "431.876" # fig 4.2-3 from Watts Bar Unit 2 safety analysis report
struct_HighestExtent = "460.000" # arbitrary amount of water above core
# Fuel Rod
fuel_Rod_bot = "35.0000" # same as struct_LowerNozzle_top
fuel_LowerFitting_bot = "35.0000" # ML033530020 Fig 2-7
fuel_LowerFitting_top = "36.7480" # ML033530020 Fig 2-7
fuel_ActiveFuel_bot = "36.7480" # ML033530020 Fig 2-7
fuel_ActiveFuel_top = "402.508" # ML033530020 Fig 2-7
fuel_Plenum_bot = "402.508" # ML033530020 Fig 2-7
fuel_Plenum_top = "417.164" # ML033530020 Fig 2-7
fuel_UpperFitting_bot = "417.164" # ML033530020 Fig 2-7
fuel_UpperFitting_top = "419.704" # ML033530020 Fig 2-7
fuel_Rod_top = "419.704" # ML033530020 Fig 2-7
# RCCAs (0 steps withdraw, i.e., fully inserted)
rcca_Rod_bot = "39.9580" # ML033530020 Fig 2-8
rcca_LowerFitting_bot = "39.9580" # ML033530020 Fig 2-8
rcca_LowerFitting_top = "41.8280" # ML033530020 Fig 2-8
rcca_AIC_bot = "41.8280" # ML033530020 Fig 2-8
rcca_AIC_top = "143.428" # ML033530020 Fig 2-8
rcca_B4C_bot = "143.428" # ML033530020 Fig 2-8
rcca_B4C_top = "402.508" # ML033530020 Fig 2-8
rcca_Spacer_bot = "402.508" # ML033530020 Fig 2-8
rcca_Spacer_top = "403.778" # ML033530020 Fig 2-8
rcca_Plenum_bot = "403.778" # ML033530020 Fig 2-8
rcca_Plenum_top = "415.558" # ML033530020 Fig 2-8
rcca_Rod_top = "460.000" # same as struct_HighestExtent
rcca_StepWidth = "1.58193" # Active height divided into 228 steps
# BPRAs
bpra_Rod_bot = "38.6600" # ML033530020 Fig 2-9
bpra_LowerFitting_bot = "38.6600" # ML033530020 Fig 2-9
bpra_LowerFitting_top = "40.5580" # ML033530020 Fig 2-9
bpra_Active_bot = "40.5580" # ML033530020 Fig 2-9
bpra_Active_top = "401.238" # ML033530020 Fig 2-9
bpra_Plenum_bot = "401.238" # ML033530020 Fig 2-9
bpra_Plenum_top = "421.532" # ML033530020 Fig 2-9
bpra_Rod_top = "431.876" # same as struct_UpperNozzle_top
# Guide Tube
gt_Rod_bot = "35.0000" # same as fuel_Rod_bot
gt_Dashpot_bot = "35.0000" #
gt_Dashpot_top = "39.9580" # same as rcca_Rod_bot for full insertion
gt_Upper_bot = "39.9580" #
gt_Upper_top = "423.049" # same as struct_UpperNozzle_bot
gt_Rod_top = "423.049" #
# Intrument Tube
instr_Rod_bot = "35.0000" # same as fuel_Rod_bot
instr_Rod_top = "423.049" # same as struct_UpperNozzle_bot
# Grid Spacers (centers provided by utiliy) (heights 1.65 top/bottom, 2.25 intermediate)
grid1_bot = "37.1621" #
grid1_top = "40.5200" #
grid2_bot = "98.0250" #
grid2_top = "103.740" #
grid3_bot = "150.222" #
grid3_top = "155.937" #
grid4_bot = "202.419" #
grid4_top = "208.134" #
grid5_bot = "254.616" #
grid5_top = "260.331" #
grid6_bot = "306.813" #
grid6_top = "312.528" #
grid7_bot = "359.010" #
grid7_top = "364.725" #
grid8_bot = "411.806" #
grid8_top = "415.164" #
## -- axials copied straight from rod_axials.ods -->
# order doesn't matter here: this will be put into a dictionary
all_planes= [ ['Lowest Extent', struct_LowestExtent],
['Bottom of Support Plate', struct_SupportPlate_bot],
['Top of Support Plate', struct_SupportPlate_top],
['Bottom of Fuel Rod', fuel_Rod_bot],
['Bottom of Active Fuel', fuel_ActiveFuel_bot],
['Grid 1 Bottom', grid1_bot],
['Bot. of BPRA Rod', bpra_Rod_bot],
['Control Rod Step 0', rcca_Rod_bot],
['Bottom of Active Absorber', bpra_Active_bot],
['Grid 1 Top', grid1_top],
['Grid 2 Bottom', grid2_bot],
['Grid 2 Top', grid2_top],
['Grid 3 Bottom', grid3_bot],
['Grid 3 Top', grid3_top],
['Grid 4 Bottom', grid4_bot],
['Grid 4 Top', grid4_top],
['Grid 5 Bottom', grid5_bot],
['Grid 5 Top', grid5_top],
['Grid 6 Bottom', grid6_bot],
['Grid 6 Top', grid6_top],
['Grid 7 Bottom', grid7_bot],
['Grid 7 Top', grid7_top],
['Top of Active Absorber', bpra_Active_top],
['Top of Active Fuel', fuel_ActiveFuel_top],
['Control Rod Step 228', '{:.6g}'.format(float(rcca_StepWidth)*228+float(rcca_Rod_bot))],
['Grid 8 Bottom', grid8_bot],
['Grid 8 Top', grid8_top],
['Top of Fuel Rod Plenum', fuel_UpperFitting_bot],
['Top of BPRA Rod Plenum', bpra_Plenum_top],
['Top of Fuel Rod', fuel_Rod_top],
['Bottom of Upper Nozzle', struct_UpperNozzle_bot],
['Top of Upper Nozzle', struct_UpperNozzle_top],
['Highest Extent', struct_HighestExtent],]
all_planes += [['Bottom of Lower Absorber (AIC)', rcca_AIC_bot],
['Bottom of Upper Absorber (B4C)', rcca_B4C_bot],
['Bottom of Spacer', rcca_Spacer_bot],
['Bottom of Control Rod Plenum', rcca_Plenum_bot],
['Top of Control Rod Plenum', rcca_Plenum_top],]
# convert into a dictionary for use in figures
d = {}
d.update(all_planes)
all_planes = d
def main(base):
make_aggregate_fig(base)
make_fuel_rod(base)
make_gtu_rod(base)
make_instr_rod(base)
make_ba_rod(base)
make_cr_rod(base)
def make_aggregate_fig(base):
outp = os.path.join(base,"specifications{0}axial{0}figs{0}all_axials.tex".format(os.sep))
cap = "\emph{Left}: Scale view of row 8 axial cross section, with highlighted grid spacers and partial insertion of control rod bank D to the bite position. \emph{Right}: exhaustive list of all axial planes used in the model, excluding partial control rod insertion planes."
scap = "Scale view of all axial planes."
l = "fig_all_axials"
s = 1
# if the planes change, this is the only place to update them
axials = [ 'Lowest Extent',
'Bottom of Support Plate',
'Bottom of Fuel Rod',
'Bottom of Active Fuel',
'Grid 1 Bottom',
'Bot. of BPRA Rod',
'Control Rod Step 0',
'Grid 1 Top',
'Bottom of Active Absorber',
'Bottom of Lower Absorber (AIC)',
'Grid 2 Bottom',
'Grid 2 Top',
'Grid 3 Bottom',
'Grid 3 Top',
'Grid 4 Bottom',
'Grid 4 Top',
'Grid 5 Bottom',
'Grid 5 Top',
'Grid 6 Bottom',
'Grid 6 Top',
'Grid 7 Bottom',
'Grid 7 Top',
'Control Rod Step 228',
'Top of Active Absorber',
'Top of Active Fuel',
'Bottom of Control Rod Plenum',
'Grid 8 Bottom',
'Grid 8 Top',
'Top of Control Rod Plenum',
'Top of Fuel Rod Plenum',
'Top of Fuel Rod',
'Top of BPRA Rod Plenum',
'Bottom of Upper Nozzle',
'Top of Upper Nozzle',
'Highest Extent']
# get ordered list
axials = [[a,all_planes[a]] for a in axials]
# desired figure height
figH = 4.0
# actual figure dimentions in inches
picH = 27.774
picW = 27.774
figW = figH*picW/picH
barrelIR = 161.2773*figH/float(axials[-1][1])
tikzpic = r"""
\draw[white] (-{1},-{2}) rectangle ({1},{2});
\node {{\pgftext{{\includegraphics[width={0}in]{{specifications/axial/figs/row_8_mats_axial_grids_enhanced.png}}}}}};""".format(
figW,figW/2,figH/2)
for i,ax in enumerate(axials):
tikzpic += "\n \draw[red] ({0},{1}) -- ({2},{1}) -- ({3},{4}) -- ({6},{4}) node[black,right,anchor=west,font=\scriptsize] {{{5}}};".format(
barrelIR,
float(ax[1])*figH/float(axials[-1][1])-figH/2,
figW/2+0.2,
figW/2+0.4,
figH*i/(len(axials)-1)-figH/2,
"~{0} ~~~~~~~~ {1}".format(ax[1],ax[0]),
figW/2+0.55)
tikzpic += "\n \draw ({0},{1}) node[left,anchor=west,font=\scriptsize] {{\underline{{Elevation (cm)}} ~~~ \underline{{Description}}}};".format(figW/2+0.4,figH/2 + figH/(len(axials)-1))
mat = ""
outStr = fig_t.format(tikzpic=tikzpic,matrix=mat,shortcap=scap,caption=cap,label=l,scale=s)
with open(outp,'w') as fh:
fh.write(outStr)
def make_fuel_rod(base):
outp = os.path.join(base,"specifications{0}axial{0}figs{0}fuel_rod.tex".format(os.sep))
cap = "Fuel rod pincell axial specification."
scap = "Fuel rod pincell axial specification"
l = "fig_fuel_axials"
s = 1
figH = 5.0
width = 3
# the third entry is the text above the specified plane
## changed so the axial height here isn't used - the global all_planes is
axials = [ ['Lowest Extent', '0', 'Water', 'mat_water', r""],
['Bottom of Support Plate', '50.8', 'Nozzle / Support Plate Stainless Steel', 'mat_ss_spn', r"\ref{num:missing}"],
['Bottom of Fuel Rod', '66.18352', 'Zircaloy Pin', 'mat_zirc', r"\ref{num:catawba}"],
['Bottom of Active Fuel', '67.02172', 'Fuel Rod Pincell', 'fig_fuel_pin', r"\ref{num:fuelheight}"],
['Grid 1 Bottom', '68.16472', 'Fuel Rod Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 1 Top', '71.5226', 'Fuel Rod Pincell', 'fig_fuel_pin', r"\ref{num:fuelheight}"],
['Grid 2 Bottom', '130.21692', 'Fuel Rod Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 2 Top', '133.5748', 'Fuel Rod Pincell', 'fig_fuel_pin', r"\ref{num:fuelheight}"],
['Grid 3 Bottom', '182.41392', 'Fuel Rod Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 3 Top', '185.7718', 'Fuel Rod Pincell', 'fig_fuel_pin', r"\ref{num:fuelheight}"],
['Grid 4 Bottom', '234.61092', 'Fuel Rod Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 4 Top', '237.9688', 'Fuel Rod Pincell', 'fig_fuel_pin', r"\ref{num:fuelheight}"],
['Grid 5 Bottom', '286.80792', 'Fuel Rod Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 5 Top', '290.1658', 'Fuel Rod Pincell', 'fig_fuel_pin', r"\ref{num:fuelheight}"],
['Grid 6 Bottom', '339.00492', 'Fuel Rod Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 6 Top', '342.3628', 'Fuel Rod Pincell', 'fig_fuel_pin', r"\ref{num:fuelheight}"],
['Grid 7 Bottom', '391.20192', 'Fuel Rod Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 7 Top', '394.5598', 'Fuel Rod Pincell', 'fig_fuel_pin', r"\ref{num:fuelheight}"],
['Top of Active Fuel', '432.78172', 'Fuel Rod Plenum Pincell', 'fig_fuel_pin', r"\ref{num:catawba}"],
['Grid 8 Bottom', '443.50052', 'Fuel Rod Plenum Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 8 Top', '446.8584', 'Fuel Rod Plenum Pincell', 'fig_fuel_pin', r"\ref{num:catawba}"],
['Top of Fuel Rod Plenum', '452.23812', 'Zircaloy Pin', 'mat_zirc', r"\ref{num:catawba}"],
['Top of Fuel Rod', '454.29552', 'Water', 'mat_water', r"\ref{num:catawba}"],
['Bottom of Upper Nozzle', '457.6407', 'Nozzle / Support Plate Stainless Steel', 'mat_ss_spn', r"\ref{num:watts_bar}"],
['Top of Upper Nozzle', '466.4672', 'Water', 'mat_water', r"\ref{num:watts_bar}"],
['Highest Extent', '517.2672', 'Water', 'mat_water', ''],]
axials = [[a[0],all_planes[a[0]],a[2],a[3],a[4]] for a in axials]
mat = ""
tikzpic = ""
for i,ax in enumerate(axials[:-1]):
tikzpic += """\n \\node[inner sep=0pt,
text width={w} in,
minimum size={h} in,
draw=black,
align=center,
shift={{(0,{s})}},
hyperlink node={hyper}] (n{0}) {{{fill}}};""".format(i,fill=ax[2],w=width,h=figH/(len(axials)-1),s=i*figH/(len(axials)-1),hyper=ax[3])
tikzpic += """\n \draw[->] ({w2},{h}) node[right,anchor=west] {{{text}}} -- ({w},{h});""".format(w=width/2,h=(i-0.5)*figH/(len(axials)-1),w2=width/2+0.2,text="{0} ~~~~~~~ {1}".format(ax[1],ax[0]))
tikzpic += """\n \\node[anchor=east] (s{0}) at (n{0}.west) {{{1}}};""".format(i,ax[4])
tikzpic += """\n \\path let \p1 = (n{0}.west) in node[anchor=west] (source) at (\\x1,{h}) {{\underline{{Source Reference}}}};""".format(i,w=0,h=(len(axials)-0.5)*figH/(len(axials)-1),)
tikzpic += """\n \draw[->] (source.west) -| (s{0}.north);""".format(i)
tikzpic += """\n \draw[->] ({w2},{h}) node[right,anchor=west] {{{text}}} -- ({w},{h});""".format(w=width/2,h=(len(axials)-1.5)*figH/(len(axials)-1),w2=width/2+0.2,text="{0} ~~~~~~~ {1}".format(axials[-1][1],axials[-1][0]))
tikzpic += """\n \draw ({w},{h}) node[right,anchor=west] {{{text}}};""".format(w=width/2,h=(len(axials)-0.5)*figH/(len(axials)-1),
text="\underline{Elevation (cm)} ~ \underline{Description}")
outStr = fig_t.format(tikzpic=tikzpic,matrix=mat,shortcap=scap,caption=cap,label=l,scale=s)
with open(outp,'w') as fh:
fh.write(outStr)
def make_gtu_rod(base):
outp = os.path.join(base,"specifications{0}axial{0}figs{0}guide_tube.tex".format(os.sep))
cap = "Empty guide tube pincell axial specification."
scap = "Empty guide tube pincell axial specification"
l = "fig_gtu_axials"
s = 1
figH = 5.0
width = 3
# the third entry is the text above the specified plane
## changed so the axial height here isn't used - the global all_planes is
axials = [ ['Lowest Extent', '0', 'Water', 'mat_water', r""],
['Bottom of Support Plate', '20.0', 'Nozzle / Support Plate Borated Water', 'mat_water_spn', r"\ref{num:missing}"],
['Bottom of Fuel Rod', '66.18352', 'Dashpot Guide Tube', 'fig_guidetube_da_pin', r"\ref{num:gtu_axials}"],
['Grid 1 Bottom', '68.16472', 'Dashpot Guide Tube w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Control Rod Step 0', '71.5226', 'Guide Tube Pincell', 'fig_guidetube_pin', r"\ref{num:gtu_axials}"],
['Grid 1 Top', '74.59092', 'Dashpot Guide Tube', 'fig_guidetube_da_pin', r"\ref{num:gtu_axials}"],
['Grid 2 Bottom', '130.21692', 'Guide Tube Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 2 Top', '133.5748', 'Guide Tube Pincell', 'fig_guidetube_pin', r"\ref{num:gtu_axials}"],
['Grid 3 Bottom', '182.41392', 'Guide Tube Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 3 Top', '185.7718', 'Guide Tube Pincell', 'fig_guidetube_pin', r"\ref{num:gtu_axials}"],
['Grid 4 Bottom', '234.61092', 'Guide Tube Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 4 Top', '237.9688', 'Guide Tube Pincell', 'fig_guidetube_pin', r"\ref{num:gtu_axials}"],
['Grid 5 Bottom', '286.80792', 'Guide Tube Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 5 Top', '290.1658', 'Guide Tube Pincell', 'fig_guidetube_pin', r"\ref{num:gtu_axials}"],
['Grid 6 Bottom', '339.00492', 'Guide Tube Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 6 Top', '342.3628', 'Guide Tube Pincell', 'fig_guidetube_pin', r"\ref{num:gtu_axials}"],
['Grid 7 Bottom', '391.20192', 'Guide Tube Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 7 Top', '394.5598', 'Guide Tube Pincell', 'fig_guidetube_pin', r"\ref{num:gtu_axials}"],
['Grid 8 Bottom', '443.50052', 'Guide Tube Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 8 Top', '446.8584', 'Guide Tube Pincell', 'fig_guidetube_pin', r"\ref{num:gtu_axials}"],
['Bottom of Upper Nozzle', '517.2672', 'Nozzle / Support Plate Borated Water', 'mat_water_spn', r"\ref{num:watts_bar}"],
['Top of Upper Nozzle', '517.2672', 'Water', 'mat_water', r"\ref{num:watts_bar}"],
['Highest Extent', '517.2672', 'Water', 'mat_water', ''],]
axials = [[a[0],all_planes[a[0]],a[2],a[3],a[4]] for a in axials]
mat = ""
tikzpic = ""
for i,ax in enumerate(axials[:-1]):
tikzpic += """\n \\node[inner sep=0pt,
text width={w} in,
minimum size={h} in,
draw=black,
align=center,
shift={{(0,{s})}},
hyperlink node={hyper}] (n{0}) {{{fill}}};""".format(i,fill=ax[2],w=width,h=figH/(len(axials)-1),s=i*figH/(len(axials)-1),hyper=ax[3])
tikzpic += """\n \draw[->] ({w2},{h}) node[right,anchor=west] {{{text}}} -- ({w},{h});""".format(w=width/2,h=(i-0.5)*figH/(len(axials)-1),w2=width/2+0.2,text="{0} ~~~~~~~ {1}".format(ax[1],ax[0]))
tikzpic += """\n \\node[anchor=east] (s{0}) at (n{0}.west) {{{1}}};""".format(i,ax[4])
tikzpic += """\n \\path let \p1 = (n{0}.west) in node[anchor=west] (source) at (\\x1,{h}) {{\underline{{Source Reference}}}};""".format(i,w=0,h=(len(axials)-0.5)*figH/(len(axials)-1),)
tikzpic += """\n \draw[->] (source.west) -| (s{0}.north);""".format(i)
tikzpic += """\n \draw ({w},{h}) node[right,anchor=west] {{{text}}};""".format(w=width/2,h=(len(axials)-0.5)*figH/(len(axials)-1),
text="\underline{Elevation (cm)} ~ \underline{Description}")
outStr = fig_t.format(tikzpic=tikzpic,matrix=mat,shortcap=scap,caption=cap,label=l,scale=s)
with open(outp,'w') as fh:
fh.write(outStr)
def make_instr_rod(base):
outp = os.path.join(base,"specifications{0}axial{0}figs{0}instr_tube.tex".format(os.sep))
cap = "Instrument tube pincell axial specification."
scap = "Instrument tube pincell axial specification"
l = "fig_instr_axials"
s = 1
figH = 5.0
width = 3
# the third entry is the text above the specified plane
## changed so the axial height here isn't used - the global all_planes is
axials = [ ['Lowest Extent', '0', 'Bare Instr. Tube', 'fig_instr_pin_bare', r"\ref{num:instr_axials}"],
['Bottom of Support Plate', '20.0', 'Support Plate / Nozzle Borated Water', 'mat_water_spn', r"\ref{num:missing}"],
['Bottom of Fuel Rod', '66.18352', 'Instr. Tube Pincell', 'fig_instr_pin', r"\ref{num:instr_axials}"],
['Grid 1 Bottom', '68.16472', 'Instr. Tube Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 1 Top', '71.5226', 'Instr. Tube Pincell', 'fig_instr_pin', r"\ref{num:instr_axials}"],
['Grid 2 Bottom', '130.21692', 'Instr. Tube Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 2 Top', '133.5748', 'Instr. Tube Pincell', 'fig_instr_pin', r"\ref{num:instr_axials}"],
['Grid 3 Bottom', '182.41392', 'Instr. Tube Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 3 Top', '185.7718', 'Instr. Tube Pincell', 'fig_instr_pin', r"\ref{num:instr_axials}"],
['Grid 4 Bottom', '234.61092', 'Instr. Tube Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 4 Top', '237.9688', 'Instr. Tube Pincell', 'fig_instr_pin', r"\ref{num:instr_axials}"],
['Grid 5 Bottom', '286.80792', 'Instr. Tube Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 5 Top', '290.1658', 'Instr. Tube Pincell', 'fig_instr_pin', r"\ref{num:instr_axials}"],
['Grid 6 Bottom', '339.00492', 'Instr. Tube Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 6 Top', '342.3628', 'Instr. Tube Pincell', 'fig_instr_pin', r"\ref{num:instr_axials}"],
['Grid 7 Bottom', '391.20192', 'Instr. Tube Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 7 Top', '394.5598', 'Instr. Tube Pincell', 'fig_instr_pin', r"\ref{num:instr_axials}"],
['Grid 8 Bottom', '443.50052', 'Instr. Tube Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 8 Top', '446.8584', 'Instr. Tube Pincell', 'fig_instr_pin', r"\ref{num:instr_axials}"],
['Bottom of Upper Nozzle', '517.2672', 'Water', 'mat_water', r"\ref{num:watts_bar}"],
['Highest Extent', '517.2672', '', '', ''],]
axials = [[a[0],all_planes[a[0]],a[2],a[3],a[4]] for a in axials]
mat = ""
tikzpic = ""
for i,ax in enumerate(axials[:-1]):
tikzpic += """\n \\node[inner sep=0pt,
text width={w} in,
minimum size={h} in,
draw=black,
align=center,
shift={{(0,{s})}},
hyperlink node={hyper}] (n{0}) {{{fill}}};""".format(i,fill=ax[2],w=width,h=figH/(len(axials)-1),s=i*figH/(len(axials)-1),hyper=ax[3])
tikzpic += """\n \draw[->] ({w2},{h}) node[right,anchor=west] {{{text}}} -- ({w},{h});""".format(w=width/2,h=(i-0.5)*figH/(len(axials)-1),w2=width/2+0.2,text="{0} ~~~~~~~ {1}".format(ax[1],ax[0]))
tikzpic += """\n \\node[anchor=east] (s{0}) at (n{0}.west) {{{1}}};""".format(i,ax[4])
tikzpic += """\n \\path let \p1 = (n{0}.west) in node[anchor=west] (source) at (\\x1,{h}) {{\underline{{Source Reference}}}};""".format(i,w=0,h=(len(axials)-0.5)*figH/(len(axials)-1),)
tikzpic += """\n \draw[->] (source.west) -| (s{0}.north);""".format(i)
tikzpic += """\n \draw[->] ({w2},{h}) node[right,anchor=west] {{{text}}} -- ({w},{h});""".format(w=width/2,h=(len(axials)-1.5)*figH/(len(axials)-1),w2=width/2+0.2,text="{0} ~~~~~~~ {1}".format(axials[-1][1],axials[-1][0]))
tikzpic += """\n \draw ({w},{h}) node[right,anchor=west] {{{text}}};""".format(w=width/2,h=(len(axials)-0.5)*figH/(len(axials)-1),
text="\underline{Elevation (cm)} ~ \underline{Description}")
outStr = fig_t.format(tikzpic=tikzpic,matrix=mat,shortcap=scap,caption=cap,label=l,scale=s)
with open(outp,'w') as fh:
fh.write(outStr)
def make_ba_rod(base):
outp = os.path.join(base,"specifications{0}axial{0}figs{0}ba.tex".format(os.sep))
cap = "Burnable absorber pincell axial specification."
scap = "Burnable absorber pincell axial specification"
l = "fig_ba_axials"
s = 1
figH = 6.0
width = 3
# the third entry is the text above the specified plane
## changed so the axial height here isn't used - the global all_planes is
axials = [ ['Lowest Extent', '0', 'Water', 'mat_water', r""],
['Bottom of Support Plate', '20.0', 'Support Plate / Nozzle Borated Water', 'mat_water_spn', r"\ref{num:missing}"],
['Bottom of Fuel Rod', '', 'Dashpot Guide Tube', 'fig_guidetube_da_pin', r"\ref{num:gtu_axials}"],
['Grid 1 Bottom', '68.16472', 'Dashpot Guide Tube w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Bot. of BPRA Rod', '', 'SS Pin in Dashpot GT w/ Grid', 'mat_SS304', r"\ref{num:ba_axials}"],
['Control Rod Step 0', '74.59092', 'SS Pin in GT w/ Grid', 'mat_SS304', r"\ref{num:ba_axials}"],
['Grid 1 Top', '', 'Stainless Steel Pin in GT', 'mat_SS304', r"\ref{num:ba_axials}"],
['Bottom of Active Absorber', '', 'Burnable Absorber Pincell', 'fig_ba_pin', r"\ref{num:ba_axials}"],
['Grid 2 Bottom', '130.21692', 'Burnable Absorber Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 2 Top', '133.5748', 'Burnable Absorber Pincell', 'fig_ba_pin', r"\ref{num:ba_axials}"],
['Grid 3 Bottom', '182.41392', 'Burnable Absorber Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 3 Top', '185.7718', 'Burnable Absorber Pincell', 'fig_ba_pin', r"\ref{num:ba_axials}"],
['Grid 4 Bottom', '234.61092', 'Burnable Absorber Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 4 Top', '237.9688', 'Burnable Absorber Pincell', 'fig_ba_pin', r"\ref{num:ba_axials}"],
['Grid 5 Bottom', '286.80792', 'Burnable Absorber Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 5 Top', '290.1658', 'Burnable Absorber Pincell', 'fig_ba_pin', r"\ref{num:ba_axials}"],
['Grid 6 Bottom', '339.00492', 'Burnable Absorber Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 6 Top', '342.3628', 'Burnable Absorber Pincell', 'fig_ba_pin', r"\ref{num:ba_axials}"],
['Grid 7 Bottom', '391.20192', 'Burnable Absorber Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 7 Top', '394.5598', 'Burnable Absorber Pincell', 'fig_ba_pin', r"\ref{num:ba_axials}"],
['Top of Active Absorber', '', 'BPRA Rod Plenum Pincell', 'fig_ba_pin_plenum', r"\ref{num:ba_axials}"],
['Grid 8 Bottom', '443.50052', 'BPRA Rod Plenum Pincell w/ Grid', 'grid_spec', r"\ref{num:grid_spacer}"],
['Grid 8 Top', '446.8584', 'BPRA Rod Upper Plenum Pincell', 'fig_ba_pin_plenum', r"\ref{num:ba_axials}"],
['Top of BPRA Rod Plenum', '454.29552', 'Stainless Steel Pin in GT','mat_SS304', r"\ref{num:ba_axials}"],
['Bottom of Upper Nozzle', '', 'Stainless Steel Pin','mat_SS304', r"\ref{num:ba_axials}"],
['Top of Upper Nozzle', '454.29552', 'Water','mat_water', r"\ref{num:watts_bar}"],
['Highest Extent', '517.2672', '', '', ''],]
axials = [[a[0],all_planes[a[0]],a[2],a[3],a[4]] for a in axials]
mat = ""
tikzpic = ""
for i,ax in enumerate(axials[:-1]):
tikzpic += """\n \\node[inner sep=0pt,
text width={w} in,
minimum size={h} in,
draw=black,
align=center,
shift={{(0,{s})}},
hyperlink node={hyper}] (n{0}) {{{fill}}};""".format(i,fill=ax[2],w=width,h=figH/(len(axials)-1),s=i*figH/(len(axials)-1),hyper=ax[3])
tikzpic += """\n \draw[->] ({w2},{h}) node[right,anchor=west] {{{text}}} -- ({w},{h});""".format(w=width/2,h=(i-0.5)*figH/(len(axials)-1),w2=width/2+0.2,text="{0} ~~~~~~~ {1}".format(ax[1],ax[0]))
tikzpic += """\n \\node[anchor=east] (s{0}) at (n{0}.west) {{{1}}};""".format(i,ax[4])
tikzpic += """\n \\path let \p1 = (n{0}.west) in node[anchor=west] (source) at (\\x1,{h}) {{\underline{{Source Reference}}}};""".format(i,w=0,h=(len(axials)-0.5)*figH/(len(axials)-1),)
tikzpic += """\n \draw[->] (source.west) -| (s{0}.north);""".format(i)
tikzpic += """\n \draw[->] ({w2},{h}) node[right,anchor=west] {{{text}}} -- ({w},{h});""".format(w=width/2,h=(len(axials)-1.5)*figH/(len(axials)-1),w2=width/2+0.2,text="{0} ~~~~~~~ {1}".format(axials[-1][1],axials[-1][0]))
tikzpic += """\n \draw ({w},{h}) node[right,anchor=west] {{{text}}};""".format(w=width/2,h=(len(axials)-0.5)*figH/(len(axials)-1),
text="\underline{Elevation (cm)} ~ \underline{Description}")
outStr = fig_t.format(tikzpic=tikzpic,matrix=mat,shortcap=scap,caption=cap,label=l,scale=s)
with open(outp,'w') as fh:
fh.write(outStr)
def make_cr_rod(base):
outp = os.path.join(base,"specifications{0}axial{0}figs{0}cr.tex".format(os.sep))
cap = "Control rod pincell axial specification when fully-inserted. This only shows axial sections for the control rod itself, which is inside one of the guide tubes."
scap = "Control rod pincell axial specification"
l = "fig_cr_axials"
s = 1
figH = 2.0
width = 3.4
# the third entry is the text above the specified plane
## changed so the axial height here isn't used - the global all_planes is
axials = [ ['Lowest Extent', '0', 'Water', 'mat_water', r""],
['Bottom of Support Plate', '20.0', 'Support Plate / Nozzle Borated Water', 'mat_water_spn', r"\ref{num:missing}"],
['Bottom of Fuel Rod', '66.18352', 'Water', 'mat_water', r""],
['Control Rod Step 0', '', 'Stainless Steel Pin', 'mat_SS304', r"\ref{num:control_rod_axials}"],
['Bottom of Lower Absorber (AIC)', '', 'Control Rod Lower Absorber Pincell', 'fig_cr_pin', r"\ref{num:control_rod_axials}"],
['Bottom of Upper Absorber (B4C)', '', 'Control Rod Upper Absorber Pincell', 'fig_cr_pin_upper', r"\ref{num:control_rod_axials}"],
['Bottom of Spacer', '', 'Control Rod Spacer Pincell', 'fig_cr_pin_spacer', r"\ref{num:control_rod_axials}"],
['Bottom of Control Rod Plenum', '', 'Control Rod Upper Plenum', 'fig_cr_pin_plenum', r"\ref{num:control_rod_axials}"],
['Top of Control Rod Plenum', '', 'Stainless Steel Pin', 'mat_SS304', r"\ref{num:control_rod_axials}"],
['Highest Extent', '517.2672', 'Water', 'mat_water', ''],]
axials = [[a[0],all_planes[a[0]],a[2],a[3],a[4]] for a in axials]
mat = ""
tikzpic = ""
for i,ax in enumerate(axials[:-1]):
if ax[0] == 'Control Rod Step 0': ax[0] = 'Bottom of Control Rod'
d = 'black'
tikzpic += """\n \\node[inner sep=0pt,
text width={w} in,
minimum size={h} in,
draw={draw},
align=center,
shift={{(0,{s})}},
hyperlink node={hyper}] (n{0}) {{{fill}}};""".format(i,fill=ax[2],w=width,h=figH/(len(axials)-1),s=i*figH/(len(axials)-1),hyper=ax[3],draw=d)
tikzpic += """\n \draw[->] ({w2},{h}) node[right,anchor=west] {{{text}}} -- ({w},{h});""".format(w=width/2,h=(i-0.5)*figH/(len(axials)-1),w2=width/2+0.2,text="{0} ~~~~~~~ {1}".format(ax[1],ax[0]))
tikzpic += """\n \\node[anchor=east] (s{0}) at (n{0}.west) {{{1}}};""".format(i,ax[4])
tikzpic += """\n \\path let \p1 = (n{0}.west) in node[anchor=west] (source) at (\\x1,{h}) {{\underline{{Source Reference}}}};""".format(i,w=0,h=(len(axials)-0.5)*figH/(len(axials)-1),)
tikzpic += """\n \draw[->] (source.west) -| (s{0}.north);""".format(i)
tikzpic += """\n \draw[->] ({w2},{h}) node[right,anchor=west] {{{text}}} -- ({w},{h});""".format(w=width/2,h=(len(axials)-1.5)*figH/(len(axials)-1),w2=width/2+0.2,text="{0} ~~~~~~~ {1}".format(axials[-1][1],axials[-1][0]))
tikzpic += """\n \draw ({w},{h}) node[right,anchor=west] {{{text}}};""".format(w=width/2,h=(len(axials)-0.5)*figH/(len(axials)-1),
text="\underline{Elevation (cm)} ~ \underline{Description}")
outStr = fig_t.format(tikzpic=tikzpic,matrix=mat,shortcap=scap,caption=cap,label=l,scale=s)
with open(outp,'w') as fh:
fh.write(outStr)
if __name__ == "__main__":
try:
basedir = sys.argv[1]
except:
basedir = ".."
main(basedir)

View file

@ -0,0 +1,361 @@
#!/usr/bin/env python
from corefig import CoreFig
import sys
import os
try:
base = sys.argv[1]
except:
base = ".."
################################################################################
################################################################################
################################################################################
caption = "Control rod and shutdown bank positions. Source: \\ref{num:assycore}"
altcap = "Control rod and shutdown bank positions."
label = "fig_cr_pos"
out = os.path.join(base,"specifications{0}core{0}figs{0}cat_cr_pos".format(os.sep))
fig = CoreFig(caption,label,altcap=altcap)
fig.set_pos('M2','$\mathrm{S}_\mathrm{A}$')
fig.set_pos('K2','$\mathrm{B}$')
fig.set_pos('H2','$\mathrm{C}$')
fig.set_pos('F2','$\mathrm{B}$')
fig.set_pos('D2','$\mathrm{S}_\mathrm{A}$')
fig.set_pos('L3','$\mathrm{S}_\mathrm{D}$')
fig.set_pos('J3','$\mathrm{S}_\mathrm{B}$')
fig.set_pos('G3','$\mathrm{S}_\mathrm{B}$')
fig.set_pos('E3','$\mathrm{S}_\mathrm{C}$')
fig.set_pos('P4','$\mathrm{S}_\mathrm{A}$')
fig.set_pos('M4','$\mathrm{D}$')
fig.set_pos('H4','$\mathrm{S}_\mathrm{E}$')
fig.set_pos('D4','$\mathrm{D}$')
fig.set_pos('B4','$\mathrm{S}_\mathrm{A}$')
fig.set_pos('N5','$\mathrm{S}_\mathrm{C}$')
fig.set_pos('C5','$\mathrm{S}_\mathrm{D}$')
fig.set_pos('P6','$\mathrm{B}$')
fig.set_pos('K6','$\mathrm{C}$')
fig.set_pos('H6','$\mathrm{A}$')
fig.set_pos('F6','$\mathrm{C}$')
fig.set_pos('B6','$\mathrm{B}$')
fig.set_pos('N7','$\mathrm{S}_\mathrm{B}$')
fig.set_pos('C7','$\mathrm{S}_\mathrm{B}$')
fig.set_pos('P8','$\mathrm{C}$')
fig.set_pos('M8','$\mathrm{S}_\mathrm{E}$')
fig.set_pos('K8','$\mathrm{A}$')
fig.set_pos('H8','$\mathrm{D}$')
fig.set_pos('F8','$\mathrm{A}$')
fig.set_pos('D8','$\mathrm{S}_\mathrm{E}$')
fig.set_pos('B8','$\mathrm{C}$')
fig.set_pos('N9','$\mathrm{S}_\mathrm{B}$')
fig.set_pos('C9','$\mathrm{S}_\mathrm{B}$')
fig.set_pos('P10','$\mathrm{B}$')
fig.set_pos('K10','$\mathrm{C}$')
fig.set_pos('H10','$\mathrm{A}$')
fig.set_pos('F10','$\mathrm{C}$')
fig.set_pos('B10','$\mathrm{B}$')
fig.set_pos('N11','$\mathrm{S}_\mathrm{D}$')
fig.set_pos('C11','$\mathrm{S}_\mathrm{C}$')
fig.set_pos('P12','$\mathrm{S}_\mathrm{A}$')
fig.set_pos('M12','$\mathrm{D}$')
fig.set_pos('H12','$\mathrm{S}_\mathrm{E}$')
fig.set_pos('D12','$\mathrm{D}$')
fig.set_pos('B12','$\mathrm{S}_\mathrm{A}$')
fig.set_pos('L13','$\mathrm{S}_\mathrm{C}$')
fig.set_pos('J13','$\mathrm{S}_\mathrm{B}$')
fig.set_pos('G13','$\mathrm{S}_\mathrm{B}$')
fig.set_pos('E13','$\mathrm{S}_\mathrm{D}$')
fig.set_pos('M14','$\mathrm{S}_\mathrm{A}$')
fig.set_pos('K14','$\mathrm{B}$')
fig.set_pos('H14','$\mathrm{C}$')
fig.set_pos('F14','$\mathrm{B}$')
fig.set_pos('D14','$\mathrm{S}_\mathrm{A}$')
fig.write_fig(out+'.tex')
################################################################################
caption = "Instrument tube positions. Source: \\ref{num:instr_locs}"
altcap = "Instrument tube positions."
label = "fig_instr_pos"
out = os.path.join(base,"specifications{0}core{0}figs{0}cat_instr_pos".format(os.sep))
fig = CoreFig(caption,label,altcap=altcap)
fig.set_pos('J1','$\circ$')
fig.set_pos('F1','$\circ$')
fig.set_pos('N2','$\circ$')
fig.set_pos('K2','$\circ$')
fig.set_pos('H2','$\circ$')
fig.set_pos('H3','$\circ$')
fig.set_pos('F3','$\circ$')
fig.set_pos('D3','$\circ$')
fig.set_pos('B3','$\circ$')
fig.set_pos('P4','$\circ$')
fig.set_pos('N4','$\circ$')
fig.set_pos('H4','$\circ$')
fig.set_pos('L5','$\circ$')
fig.set_pos('G5','$\circ$')
fig.set_pos('E5','$\circ$')
fig.set_pos('C5','$\circ$')
fig.set_pos('R6','$\circ$')
fig.set_pos('N6','$\circ$')
fig.set_pos('K6','$\circ$')
fig.set_pos('H6','$\circ$')
fig.set_pos('B6','$\circ$')
fig.set_pos('M7','$\circ$')
fig.set_pos('J7','$\circ$')
fig.set_pos('F7','$\circ$')
fig.set_pos('C7','$\circ$')
fig.set_pos('R8','$\circ$')
fig.set_pos('N8','$\circ$')
fig.set_pos('L8','$\circ$')
fig.set_pos('J8','$\circ$')
fig.set_pos('F8','$\circ$')
fig.set_pos('D8','$\circ$')
fig.set_pos('C8','$\circ$')
fig.set_pos('B8','$\circ$')
fig.set_pos('P9','$\circ$')
fig.set_pos('G9','$\circ$')
fig.set_pos('E9','$\circ$')
fig.set_pos('A9','$\circ$')
fig.set_pos('L10','$\circ$')
fig.set_pos('J10','$\circ$')
fig.set_pos('D10','$\circ$')
fig.set_pos('R11','$\circ$')
fig.set_pos('L11','$\circ$')
fig.set_pos('H11','$\circ$')
fig.set_pos('E11','$\circ$')
fig.set_pos('A11','$\circ$')
fig.set_pos('K12','$\circ$')
fig.set_pos('G12','$\circ$')
fig.set_pos('D12','$\circ$')
fig.set_pos('N13','$\circ$')
fig.set_pos('L13','$\circ$')
fig.set_pos('H13','$\circ$')
fig.set_pos('B13','$\circ$')
fig.set_pos('N14','$\circ$')
fig.set_pos('J14','$\circ$')
fig.set_pos('F14','$\circ$')
fig.set_pos('D14','$\circ$')
fig.set_pos('L15','$\circ$')
fig.set_pos('H15','$\circ$')
fig.write_fig(out+'.tex')
################################################################################
# Cycle 1
caption = "Layout of fuel assemblies showing enrichment loading pattern and burnable absorber positions in cycle 1. Source: \\ref{num:assycore}"
altcap = "Cycle 1 core enrichment zones and burnable absorber positions"
label = "fig_enr_ba_pos"
out = os.path.join(base,"specifications{0}core{0}figs{0}cat_enr_ba_zones".format(os.sep))
fig = CoreFig(caption,label,altcap=altcap)
fig.set_legend()
fig.set_pos('K1','6',hyper='ass_6ba_target')
fig.set_pos('H1','6',hyper='ass_6ba_target')
fig.set_pos('F1','6',hyper='ass_6ba_target')
fig.set_pos('L2','16',hyper='ass_16ba_target')
fig.set_pos('J2','20',hyper='ass_20ba_target')
fig.set_pos('G2','20',hyper='ass_20ba_target')
fig.set_pos('E2','16',hyper='ass_16ba_target')
fig.set_pos('N3','15',hyper='ass_15ba_target')
fig.set_pos('M3','16',hyper='ass_16ba_target')
fig.set_pos('K3','16',hyper='ass_16ba_target')
fig.set_pos('H3','16',hyper='ass_16ba_target')
fig.set_pos('F3','16',hyper='ass_16ba_target')
fig.set_pos('D3','16',hyper='ass_16ba_target')
fig.set_pos('C3','15',hyper='ass_15ba_target')
fig.set_pos('N4','16',hyper='ass_16ba_target')
fig.set_pos('L4','16',hyper='ass_16ba_target')
fig.set_pos('J4','12',hyper='ass_12ba_target')
fig.set_pos('G4','12',hyper='ass_12ba_target')
fig.set_pos('E4','16',hyper='ass_16ba_target')
fig.set_pos('C4','16',hyper='ass_16ba_target')
fig.set_pos('P5','16',hyper='ass_16ba_target')
fig.set_pos('M5','16',hyper='ass_16ba_target')
fig.set_pos('K5','12',hyper='ass_12ba_target')
fig.set_pos('H5','12',hyper='ass_12ba_target')
fig.set_pos('F5','12',hyper='ass_12ba_target')
fig.set_pos('D5','16',hyper='ass_16ba_target')
fig.set_pos('B5','16',hyper='ass_16ba_target')
fig.set_pos('R6','6',hyper='ass_6ba_target')
fig.set_pos('N6','16',hyper='ass_16ba_target')
fig.set_pos('L6','12',hyper='ass_12ba_target')
fig.set_pos('J6','12',hyper='ass_12ba_target')
fig.set_pos('G6','12',hyper='ass_12ba_target')
fig.set_pos('E6','12',hyper='ass_12ba_target')
fig.set_pos('C6','16',hyper='ass_16ba_target')
fig.set_pos('A6','6',hyper='ass_6ba_target')
fig.set_pos('P7','20',hyper='ass_20ba_target')
fig.set_pos('M7','12',hyper='ass_12ba_target')
fig.set_pos('K7','12',hyper='ass_12ba_target')
fig.set_pos('H7','16',hyper='ass_16ba_target')
fig.set_pos('F7','12',hyper='ass_12ba_target')
fig.set_pos('D7','12',hyper='ass_12ba_target')
fig.set_pos('B7','20',hyper='ass_20ba_target')
fig.set_pos('R8','6',hyper='ass_6ba_target')
fig.set_pos('N8','16',hyper='ass_16ba_target')
fig.set_pos('L8','12',hyper='ass_12ba_target')
fig.set_pos('J8','16',hyper='ass_16ba_target')
fig.set_pos('G8','16',hyper='ass_16ba_target')
fig.set_pos('E8','12',hyper='ass_12ba_target')
fig.set_pos('C8','16',hyper='ass_16ba_target')
fig.set_pos('A8','6',hyper='ass_6ba_target')
fig.set_pos('P9','20',hyper='ass_20ba_target')
fig.set_pos('M9','12',hyper='ass_12ba_target')
fig.set_pos('K9','12',hyper='ass_12ba_target')
fig.set_pos('H9','16',hyper='ass_16ba_target')
fig.set_pos('F9','12',hyper='ass_12ba_target')
fig.set_pos('D9','12',hyper='ass_12ba_target')
fig.set_pos('B9','20',hyper='ass_20ba_target')
fig.set_pos('R10','6',hyper='ass_6ba_target')
fig.set_pos('N10','16',hyper='ass_16ba_target')
fig.set_pos('L10','12',hyper='ass_12ba_target')
fig.set_pos('J10','12',hyper='ass_12ba_target')
fig.set_pos('G10','12',hyper='ass_12ba_target')
fig.set_pos('E10','12',hyper='ass_12ba_target')
fig.set_pos('C10','16',hyper='ass_16ba_target')
fig.set_pos('A10','6',hyper='ass_6ba_target')
fig.set_pos('P11','16',hyper='ass_16ba_target')
fig.set_pos('M11','16',hyper='ass_16ba_target')
fig.set_pos('K11','12',hyper='ass_12ba_target')
fig.set_pos('H11','12',hyper='ass_12ba_target')
fig.set_pos('F11','12',hyper='ass_12ba_target')
fig.set_pos('D11','16',hyper='ass_16ba_target')
fig.set_pos('B11','16',hyper='ass_16ba_target')
fig.set_pos('N12','16',hyper='ass_16ba_target')
fig.set_pos('L12','16',hyper='ass_16ba_target')
fig.set_pos('J12','12',hyper='ass_12ba_target')
fig.set_pos('G12','12',hyper='ass_12ba_target')
fig.set_pos('E12','16',hyper='ass_16ba_target')
fig.set_pos('C12','16',hyper='ass_16ba_target')
fig.set_pos('N13','15',hyper='ass_15ba_target')
fig.set_pos('M13','16',hyper='ass_16ba_target')
fig.set_pos('K13','16',hyper='ass_16ba_target')
fig.set_pos('H13','16',hyper='ass_16ba_target')
fig.set_pos('F13','16',hyper='ass_16ba_target')
fig.set_pos('D13','16',hyper='ass_16ba_target')
fig.set_pos('C13','15',hyper='ass_15ba_target')
fig.set_pos('L14','16',hyper='ass_16ba_target')
fig.set_pos('J14','20',hyper='ass_20ba_target')
fig.set_pos('G14','20',hyper='ass_20ba_target')
fig.set_pos('E14','16',hyper='ass_16ba_target')
fig.set_pos('K15','6',hyper='ass_6ba_target')
fig.set_pos('H15','6',hyper='ass_6ba_target')
fig.set_pos('F15','6',hyper='ass_6ba_target')
fig.write_fig(out+'.tex')
################################################################################
# Cycle 2
caption = "Cycle 2 shuffling pattern, burnable absorber positions, and enrichment loading pattern of fresh assemblies. Sources: \\ref{num:assycore}, \\ref{num:c2shuffle}"
altcap = "Cycle 2 shuffling pattern and burnable absorber positions"
label = "fig_enr_ba_pos_c2"
out = os.path.join(base,"specifications{0}core{0}figs{0}cat_enr_ba_zones_c2".format(os.sep))
fig = CoreFig(caption,label,altcap=altcap)
fig.set_cycle_2(True)
fig.set_legend()
# pasted from excel spreadsheet
a = """ L10 F F F F F E10
G10 F F L02 P12 N03 B12 E02 F F J10
F09 F N02 N10 F D11 R10 M11 F C10 C02 F K09
F P03 L08 F M09 E15 G08 L15 D09 F H05 B03 F
F05 F F03 F M04 F M03 A10 D03 F D04 F K03 F K05
F P05 F G04 F N08 R09 G14 A09 H03 F J04 F B05 F
F D02 E12 A11 N04 G01 B09 H15 J14 J01 C04 R11 L12 M02 F
F N13 F15 H07 F01 B07 A08 F14 R08 P09 K15 H09 K01 C03 F
F D14 E04 A05 N12 G15 G02 H01 P07 J15 C12 R05 L04 M14 F
F P11 F G12 F H13 R07 J02 A07 C08 F J12 F B11 F
F11 F F13 F M12 F M13 R06 D13 F D12 F K13 F K11
F P13 H11 F M07 E01 J08 L01 D07 F E08 B13 F
F07 F N14 N06 F D05 A06 M05 F C06 C14 F K07
G06 F F L14 P04 C13 B04 E14 F F J06
L06 F F F F F E06 """
col2lett = { 1:"R", 2:"P", 3:"N", 4:"M", 5:"L", 6:"K", 7:"J", 8:"H", 9:"G", 10:"F", 11:"E", 12:"D", 13:"C", 14:"B", 15:"A" }
col_offsets = {1:4, 2:2, 3:1, 4:1, 5:0, 6:0, 7:0, 8:0, 9:0, 10:0, 11:0, 12:1, 13:1, 14:2, 15:4}
labels = {}
for r in range(1,16):
for c in range(1,16):
labels[(r,c)] = "{}{}".format(col2lett[c],r)
ba4 = ["E14","B11", "L14","P11", "P5","L2", "E2","B5"]
ba8 = ["F11","E10","E6","F5","K5","L6","L10","K11", "F13","C10","C6","F3","K3","N6","N10","K13"]
ba12 = ["E12","D11","D5","E4","L4","M5","M11","L12"]
for r,line in enumerate(a.split('\n')):
cols = line.split()
for c, val in enumerate(cols):
co = col_offsets[r+1]
pos = labels[(r+1,c+1+co)]
if val == "F":
if pos in ba4:
fig.set_pos(pos,"\small {0}".format(4),hyper='ass_4ba_target')
elif pos in ba8:
fig.set_pos(pos,"\small {0}".format(8),hyper='ass_8ba_target')
elif pos in ba12:
fig.set_pos(pos,"\small {0}".format(12),hyper='ass_12ba_c2_target')
else:
fig.set_pos(pos,'')
else:
fig.set_pos(pos,"\\scriptsize {0}".format(val))
fig.write_fig(out+'.tex')

View file

@ -0,0 +1,103 @@
#!/usr/bin/env python
from __future__ import division
import sys
import os
from math import pi, cos, sin, tan
def main(base):
r = r"\ref{{{0}}}"
m = r"\missing"
f = r.format("num:sheet_FL")
g = r.format("num:grid_spacer")
makegrid( [0.39218, 0.40005, 0.45720, 0.61049, 0.629920],
['Fuel','Helium','Zircaloy','Water','Zircaloy'],
['mat_fuel16','mat_helium','mat_zirc','mat_water','mat_inconel'],
[r.format("num:fuelpellrad"),r.format("num:fuelIRrad"),r.format("num:fuelORrad"),g,g],
['red','green!60!black','blue','magenta!80!black','orange!60!black'],
"[Fuel pincell geometry for the intermediate grid spacer inner egg-crate]",
"Fuel pincell geometry for the Zircaloy intermediate grid spacer inner egg-crate, chosen to have a thickness of 0.0194cm. Source: \\ref{num:grid_spacer}",
"fig_grid_pin_i",
5,
os.path.join(base,"specifications{0}assy{0}figs{0}tikz_grid_inter.tex".format(os.sep)))
makegrid( [0.39218, 0.40005, 0.45720, 0.61015, 0.629920],
['Fuel','Helium','Zircaloy','Water','Inconel'],
['mat_fuel16','mat_helium','mat_zirc','mat_water','mat_inconel'],
[r.format("num:fuelpellrad"),r.format("num:fuelIRrad"),r.format("num:fuelORrad"),g,g],
['red','green!60!black','blue','magenta!80!black','orange!60!black'],
"[Fuel pincell geometry for the top/bottom grid spacer inner egg-crate]",
"Fuel pincell geometry for the Inconel 718 top/bottom grid spacer inner egg-crate, chosen to have a thickness of 0.0198cm. Source: \\ref{num:grid_spacer}",
"fig_grid_pin_tb",
5,
os.path.join(base,"specifications{0}assy{0}figs{0}tikz_grid_tb.tex".format(os.sep)))
def makegrid(rs,ms,ls,ss,cols,sc,c,l,s,outp):
arc = pi/6
theta = arc
fig_t = r"""\begin{{figure}}[htbp]
\centering
\begin{{tikzpicture}}[scale={scale},auto]
{fig_mat}
\end{{tikzpicture}}
\begin{{tikzpicture}}
{matrix}
\end{{tikzpicture}}
\caption{shortcap}{{ {caption} \label{{{label}}}}}
\end{{figure}}"""
circ_t = """ \draw (0,0) circle ({r});\n"""
box_t = """ \draw (-{0},-{0}) rectangle ({0},{0}) ;\n"""
arrow_t = """ \draw[->,thick,{color}] (0,0) -- node[pos={pos}] {{{label}}} ({x:.3},{y:.3});\n"""
f = ""
for i,r in enumerate(rs):
if i < len(rs)-2:
f += circ_t.format(r=r)
x = r*cos(pi/2 - theta)
y = r*sin(pi/2 - theta)
f += arrow_t.format(label=i+1,x=round(x,3),y=round(y,3),pos=0.65,color=cols[i])
theta += arc
else:
f += box_t.format(r)
if i < len(rs)-1:
x = 0.0
y = -r
else:
x = -r
y = 0.0
f += arrow_t.format(label=i+1,x=round(x,3),y=round(y,3),pos=0.4,color=cols[i])
theta += arc
mat_t=r""" \matrix [matrix of nodes]
{{
Arrow & Length (cm) & Material & \numrefheader\\{matrows}
}};"""
matrow_t = """\n \\node[{color}]{{{0}}}; & \\node[{color}]{{{1:0<7.5}}}; & \\node[{color},hyperlink node={3}]{{{2}}}; & \\node[{color}]{{{source}}};\\\ """
rows = ""
for i,(r,m,ref,sour,color) in enumerate(zip(rs,ms,ls,ss,cols)):
rows += matrow_t.format(i+1,r,m,ref,source=sour,color=color)
outStr = fig_t.format(fig_mat=f, scale=s, shortcap=sc, caption=c, label=l,
matrix=mat_t.format(matrows=rows))
with open(outp,'w') as fh:
fh.write(outStr)
if __name__ == "__main__":
try:
basedir = sys.argv[1]
except:
basedir = ".."
main(basedir)

View file

@ -0,0 +1,210 @@
#!/usr/bin/env python
import sys
import os
from beavrs.materials import openmc_materials
from openmc.data import NATURAL_ABUNDANCE, atomic_weight
# LaTeX template
latex = """\\begin{{matitem}}{{{title}}}{{{label}}}{{num:{numlabel}_mat}}
\\centering
\\begin{{tabular}}{{l c}}
\\toprule
Density (g/cc) & {density:.9g} \\\\
\\midrule
Isotope & Atom Density (atom/b-cm) \\\\
\\midrule
\\midrule
{isotopes}
\\bottomrule
\\end{{tabular}}
\\end{{matitem}}
"""
latex_2col = """\\begin{{matitem}}{{{title}}}{{{label}}}{{num:{numlabel}_mat}}
\\centering
\\begin{{tabular}}{{l c l c}}
\\toprule
Density (g/cc) & {density:.9g} \\\\
\\midrule
Isotope & Atom Density (atom/b-cm) & Isotope & Atom Density (atom/b-cm) \\\\
\\midrule
\\midrule
{isotopes}
\\bottomrule
\\end{{tabular}}
\\end{{matitem}}
"""
latex_ele_mass = """ \\begin{{longtable}}{{l c l c}}
\\toprule
Element & Mass [amu] & Element & Mass [amu] \\\\
\\midrule
\\midrule
{elements}
\\bottomrule
\\end{{longtable}}"""
latex_nuc_abund = """ \\begin{{longtable}}{{l c l c}}
\\toprule
Isotope & Fractional Abundance & Isotope & Fractional Abundance \\\\
\\midrule
\\midrule
{isotopes}
\\bottomrule
\\end{{longtable}}"""
# converting material name to latex latex file name
mat_table_filename = {
"Air": "air",
"SS304": "SS304",
"Ag-In-Cd": "aic_rod",
"B4C": "b4c_rod",
"Helium": "helium",
"Inconel 718": "inconel",
"Zircaloy 4": "zirc",
"Carbon Steel": "carbonsteel",
"Fuel 1.6%": "fuel16",
"Fuel 2.4%": "fuel24",
"Fuel 3.1%": "fuel31",
"Fuel 3.2%": "fuel32",
"Fuel 3.4%": "fuel34",
"Borosilicate Glass": "borosilicate",
"Borated Water": "water",
"Water SPN": "water_spn",
"SS SPN": "ss_spn"
}
# converting material name to title of material in latex table
mat_table_titles = {
"SS304": "Stainless Steel 304",
"Ag-In-Cd": "Ag-In-Cd Control Rods",
"B4C": "B4C Control Rods",
"Fuel 1.6%": "Fuel 1.6\\% Enriched",
"Fuel 2.4%": "Fuel 2.4\\% Enriched",
"Fuel 3.1%": "Fuel 3.1\\% Enriched",
"Fuel 3.2%": "Fuel 3.2\\% Enriched",
"Fuel 3.4%": "Fuel 3.4\\% Enriched",
"Water SPN": "Nozzle / Support Plate Borated Water",
"SS SPN": "Nozzle / Support Plate Stainless Steel"
}
def write_materials(base):
""" setup all beavrs materials and write them out to latex tables """
# setup all beavrs materials
mats = openmc_materials(ppm=975)
# set of all appeared elements and isotopes
used_elements_set = set()
used_isotopes_set = set()
# Write out material tables
os.chdir(base)
os.chdir('specifications/materials/tables')
for key, mat in mats.items():
# latex table file name
if mat.name in mat_table_filename:
name = mat_table_filename[mat.name]
else:
name = mat.name
name = name.replace(' ','')
name = name.replace('.','')
name = name.replace('%','')
# material title
if mat.name in mat_table_titles:
title = mat_table_titles[mat.name]
else:
title = mat.name
# Set some output parameters
latex_dict = {
'density':mat.density,
'label':"mat_{0}".format(name),
'numlabel':name,
'title':title
}
# Get all nuclides atom density
nuclides = mat.get_nuclide_atom_densities()
# Create isotope string
iso_str = ''
if mat.name == 'Carbon Steel': # this one we want two columns
i = 0
for key, (iso, den) in sorted(nuclides.items()):
if i%2 == 0:
nuc1 = iso.name
den1 = nuclides[iso][1]
else:
iso_str += "{0} & {1:6.4e} & {2} & {3:6.4e}\\\\\n".format(
nuc1, den1, iso.name, nuclides[iso][1])
i += 1
if i%2 == 1:
iso_str += "{0} & {1:6.4e} & {2} & {3}\\\\\n".format(
iso.name, nuclides[iso][1], "", "")
latex_dict.update({'isotopes':iso_str})
else:
for key, (iso, den) in sorted(nuclides.items()):
iso_str += "{0} & {1:6.4e} \\\\\n".format(iso.name, den)
latex_dict.update({'isotopes':iso_str})
# Write latex file
with open('{0}_table.tex'.format(name), 'w') as fh:
if mat.name == 'Carbon Steel':
fh.write(latex_2col.format(**latex_dict))
else:
fh.write(latex.format(**latex_dict))
# Update elements and isotopes set
for ele in mat.elements:
used_elements_set.add(ele[0].name)
for iso in mat.get_nuclides():
used_isotopes_set.add(iso)
os.chdir(base)
# Write out isotope masses and abundances
os.chdir('backmatter')
with open('element_masses.tex', 'w') as fh:
ele_str = ""
flip = False
for ele in sorted(used_elements_set):
ele_str += "{0} & {1:.6f} ".format(ele, atomic_weight(ele))
if not flip:
ele_str += "& "
flip = True
else:
ele_str += "\\\\\n"
flip = False
if flip:
ele_str += "& \\\\\n"
fh.write(latex_ele_mass.format(elements=ele_str))
with open('isotope_abundances.tex', 'w') as fh:
iso_str = ""
flip = False
for iso in sorted(used_isotopes_set):
if iso in NATURAL_ABUNDANCE:
iso_str += "{0} & {1} ".format(iso, NATURAL_ABUNDANCE[iso])
if not flip:
iso_str += "& "
flip = True
else:
iso_str += "\\\\\n"
flip = False
if flip:
ele_str += " & \\\\\n"
fh.write(latex_nuc_abund.format(isotopes=iso_str))
os.chdir(base)
if __name__ == "__main__":
try:
basedir = sys.argv[1]
except:
basedir = ".."
write_materials(basedir)

View file

@ -0,0 +1,182 @@
#!/usr/bin/env python
from __future__ import division
import sys
import os
from math import pi, cos, sin
def main(base):
r = r"\ref{{{0}}}"
# m = r.format("num:missing")
a = r.format("num:assumed_thimble")
f = r.format("num:sheet_FL")
makepin([0.56134, 0.60198],
['Water','Zircaloy'],
['mat_water','mat_zirc'],
[r.format("num:GTIRrad"),r.format("num:GTORrad")],
"Empty guide tube pin geometry above the dashpot.",
"fig_guidetube_pin",
6,
os.path.join(base,"specifications{0}pin{0}figs{0}tikz_guidetube.tex".format(os.sep)),
0.65)
makepin([0.50419, 0.54610],
['Water','Zircaloy'],
['mat_water','mat_zirc'],
[r.format("num:GTDPIRrad"),r.format("num:GTDPORrad")],
"Empty guide tube pin geometry at the dashpot.",
"fig_guidetube_da_pin",
6,
os.path.join(base,"specifications{0}pin{0}figs{0}tikz_guidetube_da.tex".format(os.sep)),
0.65)
makepin([0.39218, 0.40005, 0.45720],
['Fuel','Helium','Zircaloy'],
['mat_fuel16','mat_helium','mat_zirc'],
[r.format("num:fuelpellrad"),r.format("num:fuelIRrad"),r.format("num:fuelORrad")],
"Fuel pin geometry.",
"fig_fuel_pin",
8,
os.path.join(base,"specifications{0}pin{0}figs{0}tikz_fuel.tex".format(os.sep)),
0.65)
makepin([0.06459, 0.40005, 0.45720],
['Inconel','Helium','Zircaloy'],
['mat_inconel','mat_helium','mat_zirc'],
[r.format("num:plenum_spring"),r.format("num:fuelIRrad"),r.format("num:fuelORrad")],
"Upper fuel pin plenum geometry.",
"fig_fuel_pin_plenum",
8,
os.path.join(base,"specifications{0}pin{0}figs{0}tikz_fuel_plenum.tex".format(os.sep)),
0.65)
makepin([0.38227,0.38608, 0.48387, 0.56134, 0.60198],
['Ag-In-Cd','Helium','SS304','Water','Zircaloy'],
['mat_aic_rod','mat_helium','mat_SS304','mat_water','mat_zirc'],
[r.format("num:CRaicOR"), r.format("num:CRthimIR"),r.format("num:CRthimOR"),r.format("num:GTIRrad"),r.format("num:GTORrad")],
"Control rod pin lower region geometry.",
"fig_cr_pin",
6,
os.path.join(base,"specifications{0}pin{0}figs{0}tikz_cr.tex".format(os.sep)),
0.5)
makepin([0.37338,0.38608, 0.48387, 0.56134, 0.60198],
['B4C','Helium','SS304','Water','Zircaloy'],
['mat_b4c_rod','mat_helium','mat_SS304','mat_water','mat_zirc'],
[r.format("num:CRb4cOR"),r.format("num:CRthimIR"),r.format("num:CRthimOR"),r.format("num:GTIRrad"),r.format("num:GTORrad")],
"Control rod pin upper region geometry.",
"fig_cr_pin_upper",
6,
os.path.join(base,"specifications{0}pin{0}figs{0}tikz_cr_upper.tex".format(os.sep)),
0.5)
makepin([0.06459,0.38608, 0.48387, 0.56134, 0.60198],
['Inconel','Helium','SS304','Water','Zircaloy'],
['mat_inconel','mat_helium','mat_SS304','mat_water','mat_zirc'],
[r.format("num:cr_plenum_spring"),r.format("num:CRthimIR"),r.format("num:CRthimOR"),r.format("num:GTIRrad"),r.format("num:GTORrad")],
"Control rod pin plenum geometry.",
"fig_cr_pin_plenum",
6,
os.path.join(base,"specifications{0}pin{0}figs{0}tikz_cr_plenum.tex".format(os.sep)),
0.75)
makepin([0.37845,0.38608, 0.48387, 0.56134, 0.60198],
['SS304','Helium','SS304','Water','Zircaloy'],
['mat_SS304','mat_helium','mat_SS304','mat_water','mat_zirc'],
[r.format("num:CRspacerOR"),r.format("num:CRthimIR"),r.format("num:CRthimOR"),r.format("num:GTIRrad"),r.format("num:GTORrad")],
"Control rod pin spacer geometry.",
"fig_cr_pin_spacer",
6,
os.path.join(base,"specifications{0}pin{0}figs{0}tikz_cr_spacer.tex".format(os.sep)),
0.5)
makepin([0.21400, 0.23051, 0.24130, 0.42672, 0.43688, 0.48387, 0.56134, 0.60198],
['Air','SS304','Helium','Borosilicate Glass','Helium','SS304','Water','Zircaloy'],
['mat_air','mat_SS304','mat_helium','mat_borosilicate','mat_helium','mat_SS304','mat_water','mat_zirc'],
[r.format("num:BPinnercladIR"),r.format("num:BPinnercladOR"),r.format("num:BPpoisonIR"),r.format("num:BPpoisonOR"),r.format("num:BPoutercladIR"),r.format("num:BPoutercladOR"),r.format("num:GTIRrad"),r.format("num:GTORrad")],
"Burnable absorber pin geometry above the dashpot.",
"fig_ba_pin",
8,
os.path.join(base,"specifications{0}pin{0}figs{0}tikz_ba.tex".format(os.sep)),
0.65)
makepin([0.21400, 0.23051, 0.43688, 0.48387, 0.50419, 0.54610],
['Air','SS304','Helium','SS304','Water','Zircaloy'],
['mat_air','mat_SS304','mat_helium','mat_SS304','mat_water','mat_zirc'],
[r.format("num:BPinnercladIR"),r.format("num:BPinnercladOR"),r.format("num:BPoutercladIR"),r.format("num:BPoutercladOR"),r.format("num:GTDPIRrad"),r.format("num:GTDPORrad")],
"Burnable absorber pin plenum geometry",
"fig_ba_pin_plenum",
8,
os.path.join(base,"specifications{0}pin{0}figs{0}tikz_ba_plenum.tex".format(os.sep)),
0.65)
makepin([0.436880, 0.483870, 0.56134, 0.60198],
['Air','Zircaloy','Water','Zircaloy'],
['mat_air','mat_zirc','mat_water','mat_zirc'],
[r.format("num:ITthimIR"),r.format("num:ITthimOR"),r.format("num:GTIRrad"),r.format("num:GTORrad")],
"Instrument tube pin geometry (both above and at the dashpot).",
"fig_instr_pin",
6,
os.path.join(base,"specifications{0}pin{0}figs{0}tikz_instr.tex".format(os.sep)),
0.65)
makepin([0.436880, 0.483870],
['Air','Zircaloy'],
['mat_air','mat_zirc'],
[r.format("num:ITthimIR"),r.format("num:ITthimOR")],
"Bare instrument thimble (below fuel rod region).",
"fig_instr_pin_bare",
6,
os.path.join(base,"specifications{0}pin{0}figs{0}tikz_instr_bare.tex".format(os.sep)),
0.65)
def makepin(rs,ms,ls,ss,c,l,s,outp,pos):
arc = pi/6
theta = arc
fig_t = r"""\begin{{tikzpicture}}[scale={scale},auto]
{fig_mat}
\end{{tikzpicture}}
\begin{{tikzpicture}}
{matrix}
\end{{tikzpicture}}"""
circ_t = """ \draw (0,0) circle ({r});\n"""
arrow_t = """ \draw[->] (0,0) -- node[pos={pos}] {{{label}}} ({x:.3},{y:.3});\n"""
f = ""
for i,r in enumerate(rs):
f += circ_t.format(r=r)
x = r*cos(pi/2 - theta)
y = r*sin(pi/2 - theta)
f += arrow_t.format(label=i+1,x=round(x,3),y=round(y,3),pos=pos)
theta += arc
mat_t=r""" \matrix [matrix of nodes]
{{
Arrow & Radius (cm) & Material & \numrefheader \\{matrows}
}};"""
matrow_t = """\n {0} & {1:0<7.5} & \\node[hyperlink node={3}]{{{2}}}; & {source}\\\ """
rows = ""
for i,(r,m,ref,sour) in enumerate(zip(rs,ms,ls,ss)):
rows += matrow_t.format(i+1,r,m,ref,source=sour)
outStr = fig_t.format(fig_mat=f, scale=s, caption=c,label=l, matrix=mat_t.format(matrows=rows))
with open(outp,'w') as fh:
fh.write(outStr)
if __name__ == "__main__":
try:
basedir = sys.argv[1]
except:
basedir = ".."
main(basedir)

View file

@ -0,0 +1,83 @@
#!/usr/bin/env python
mapp = { 'H08' : [ 'H08' ],
'H09' : [ 'H09','G08','H07','J08' ],
'H10' : [ 'H10','F08','H06','K08' ],
'H11' : [ 'H11','E08','H05','L08' ],
'H12' : [ 'H12','D08','H04','M08' ],
'H13' : [ 'H13','C08','H03','N08' ],
'H14' : [ 'H14','B08','H02','P08' ],
'H15' : [ 'H15','A08','H01','R08' ],
'G08' : [ 'G08','H07','J08','H09' ],
'G09' : [ 'G09','G07','J07','J09' ],
'G10' : [ 'G10','F07','J06','K09' ],
'G11' : [ 'G11','E07','J05','L09' ],
'G12' : [ 'G12','D07','J04','M09' ],
'G13' : [ 'G13','C07','J03','N09' ],
'G14' : [ 'G14','B07','J02','P09' ],
'G15' : [ 'G15','A07','J01','R09' ],
'F08' : [ 'F08','H06','K08','H10' ],
'F09' : [ 'F09','G06','K07','J10' ],
'F10' : [ 'F10','F06','K06','K10' ],
'F11' : [ 'F11','E06','K05','L10' ],
'F12' : [ 'F12','D06','K04','M10' ],
'F13' : [ 'F13','C06','K03','N10' ],
'F14' : [ 'F14','B06','K02','P10' ],
'F15' : [ 'F15','A06','K01','R10' ],
'E08' : [ 'E08','H05','L08','H11' ],
'E09' : [ 'E09','G05','L07','J11' ],
'E10' : [ 'E10','F05','L06','K11' ],
'E11' : [ 'E11','E05','L05','L11' ],
'E12' : [ 'E12','D05','L04','M11' ],
'E13' : [ 'E13','C05','L03','N11' ],
'E14' : [ 'E14','B05','L02','P11' ],
'E15' : [ 'E15','A05','L01','R11' ],
'D08' : [ 'D08','H04','M08','H12' ],
'D09' : [ 'D09','G04','M07','J12' ],
'D10' : [ 'D10','F04','M06','K12' ],
'D11' : [ 'D11','E04','M05','L12' ],
'D12' : [ 'D12','D04','M04','M12' ],
'D13' : [ 'D13','C04','M03','N12' ],
'D14' : [ 'D14','B04','M02','P12' ],
'C08' : [ 'C08','H03','N08','H13' ],
'C09' : [ 'C09','G03','N07','J13' ],
'C10' : [ 'C10','F03','N06','K13' ],
'C11' : [ 'C11','E03','N05','L13' ],
'C12' : [ 'C12','D03','N04','M13' ],
'C13' : [ 'C13','C03','N03','N13' ],
'C14' : [ 'C14','B03','N02','P13' ],
'B08' : [ 'B08','H02','P08','H14' ],
'B09' : [ 'B09','G02','P07','J14' ],
'B10' : [ 'B10','F02','P06','K14' ],
'B11' : [ 'B11','E02','P05','L14' ],
'B12' : [ 'B12','D02','P04','M14' ],
'B13' : [ 'B13','C02','P03','N14' ],
'A08' : [ 'A08','H01','R08','H15' ],
'A09' : [ 'A09','G01','R07','J15' ],
'A10' : [ 'A10','F01','R06','K15' ],
'A11' : [ 'A11','E01','R05','L15' ]
}
output_t = """ fig.set_pos('{pos}','{num}',hyper='ass_{num}ba_target')"""
rows = {8: {'G':16,'E':12,'C':16,'A':8},
9: {'H':16,'F':12,'D':12,'B':20},
}
rcpy = rows
for r,cols in rcpy.items():
for col in cols:
posKey = "{0}{1:0>2}".format(col,r)
print posKey
for key in mapp[posKey]:
print key[0],int(key[1:3])
print
for r in rows:
for col in rows[r]:
p = "{0}{1}".format(col,r)
print output_t.format(pos=p,num=rows[r][col])
print