Skip to content

Commit

Permalink
First add of basic examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Roberts committed Sep 10, 2012
1 parent 0944bb8 commit 6f756f3
Show file tree
Hide file tree
Showing 20 changed files with 1,809 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@
*.lai
*.la
*.a

# Compile Python
*.pyc

# Binaries
*.h5
*.silo
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
detran-examples
===============

Examples (and benchmarks) for libdetran
Examples (and benchmarks) for libdetran using the
Python front end. I'm keeping these separate from
the main code so that updating and validating them
is a bit easier.

Current examples include

slab-reactor
------------

Simple two-group slab reactor problems used as
benchmarks in several papers by Rahnema and his
students at Georgia Tech


104 changes: 104 additions & 0 deletions c5g7/assemblies_c5g7.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# pyexamples/assemblies_c5g7.py
#
# 2-D assemblies definitions for the C5G7 benchmark

from pins_c5g7 import *
from detran import *

def get_assemblies(number, flag) :
""" Return the assemblies for the C5G7 benchmark.
See get_pincells for parameter definition.
"""

# Shared things
G = 4 # guide tube
F = 5 # fission chamber
pin0, pin1, pin2, pin3, pin4, pin5, pin6 = get_pins(number, flag)

# Assembly 1 -- UO2
assem1 = Assembly.Create(17)
assem1.add_pincell(pin0)
assem1.add_pincell(pin1)
assem1.add_pincell(pin2)
assem1.add_pincell(pin3)
assem1.add_pincell(pin4)
assem1.add_pincell(pin5)
assem1.add_pincell(pin6)
pin_map1 = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,G,0,0,G,0,0,G,0,0,0,0,0,
0,0,0,G,0,0,0,0,0,0,0,0,0,G,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,G,0,0,G,0,0,G,0,0,G,0,0,G,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,G,0,0,G,0,0,F,0,0,G,0,0,G,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,G,0,0,G,0,0,G,0,0,G,0,0,G,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,G,0,0,0,0,0,0,0,0,0,G,0,0,0,
0,0,0,0,0,G,0,0,G,0,0,G,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
assem1.finalize(pin_map1)

# Assembly 2 - MOX
assem2 = Assembly.Create(17)
assem2.add_pincell(pin0)
assem2.add_pincell(pin1)
assem2.add_pincell(pin2)
assem2.add_pincell(pin3)
assem2.add_pincell(pin4)
assem2.add_pincell(pin5)
assem2.add_pincell(pin6)
pin_map2 = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,
1,2,2,2,2,G,2,2,G,2,2,G,2,2,2,2,1,
1,2,2,G,2,3,3,3,3,3,3,3,2,G,2,2,1,
1,2,2,2,3,3,3,3,3,3,3,3,3,2,2,2,1,
1,2,G,3,3,G,3,3,G,3,3,G,3,3,G,2,1,
1,2,2,3,3,3,3,3,3,3,3,3,3,3,2,2,1,
1,2,2,3,3,3,3,3,3,3,3,3,3,3,2,2,1,
1,2,G,3,3,G,3,3,F,3,3,G,3,3,G,2,1,
1,2,2,3,3,3,3,3,3,3,3,3,3,3,2,2,1,
1,2,2,3,3,3,3,3,3,3,3,3,3,3,2,2,1,
1,2,G,3,3,G,3,3,G,3,3,G,3,3,G,2,1,
1,2,2,2,3,3,3,3,3,3,3,3,3,2,2,2,1,
1,2,2,G,2,3,3,3,3,3,3,3,2,G,2,2,1,
1,2,2,2,2,G,2,2,G,2,2,G,2,2,2,2,1,
1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
assem2.finalize(pin_map2)

# Assembly 3 - Moderator
assem3 = Assembly.Create(17)
assem3.add_pincell(pin0)
assem3.add_pincell(pin1)
assem3.add_pincell(pin2)
assem3.add_pincell(pin3)
assem3.add_pincell(pin4)
assem3.add_pincell(pin5)
assem3.add_pincell(pin6)
pin_map3 = [6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6];
assem3.finalize(pin_map3)

return assem1, assem2, assem3

25 changes: 25 additions & 0 deletions c5g7/core_c5g7.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# pyexamples/core_c5g7.py
#
# 2-D core definition for the C5G7 benchmark

from assemblies_c5g7 import get_assemblies
from detran import *

def get_core(number, flag) :
""" Return the core for the C5G7 benchmark.
See get_pincells for parameter definition.
"""

assemblies = get_assemblies(number, flag)
core = Core.Create(3)
core.add_assembly(assemblies[0])
core.add_assembly(assemblies[1])
core.add_assembly(assemblies[2])
core_map = [0,1,2,
1,0,2,
2,2,2]
core.finalize(core_map)
return core


Loading

0 comments on commit 6f756f3

Please sign in to comment.