Fix distribcell hex lattice bug, see #411

This commit is contained in:
Sterling Harper 2015-07-16 23:13:37 -06:00
parent bab8c19e2c
commit 6beb18f5a3
7 changed files with 106 additions and 12 deletions

View file

@ -2398,10 +2398,24 @@ contains
end if
if (final >= lat % offset(map, k, l, m) + offset) then
old_m = m
old_l = l
old_k = k
cycle
if (k == lat % n_rings .and. l == n_y .and. m == n_z) then
! This is last lattice cell, so target must be here
lat_offset = lat % offset(map, k, l, m)
offset = offset + lat_offset
next_univ => universes(lat % universes(k, l, m))
path = trim(path) // "(" // &
trim(to_str(k - lat % n_rings)) // "," // &
trim(to_str(l - lat % n_rings)) // "," // &
trim(to_str(m)) // ")"
call find_offset(map, goal, next_univ, final, offset, &
path)
return
else
old_m = m
old_l = l
old_k = k
cycle
end if
else
! Target is at this lattice position
lat_offset = lat % offset(map, old_k, old_l, old_m)

View file

@ -0,0 +1,23 @@
<?xml version='1.0' encoding='utf-8'?>
<geometry>
<cell fill="5" id="1" name="Cell 1" surfaces="1 -2 3 -4" universe="0" />
<cell id="101" material="1" name="cell 2" surfaces="-5" universe="1" />
<cell id="102" material="2" name="cell 3" surfaces="5" universe="1" />
<cell id="500" material="2" name="cell 4" surfaces="" universe="3" />
<hex_lattice id="5" n_rings="2">
<pitch>1.0</pitch>
<outer>3</outer>
<center>0.0 0.0</center>
<universes>
1
1 1
1
1 1
1</universes>
</hex_lattice>
<surface boundary="vacuum" coeffs="-3" id="1" name="left" type="x-plane" />
<surface boundary="vacuum" coeffs="3" id="2" name="right" type="x-plane" />
<surface boundary="vacuum" coeffs="-4" id="3" name="bottom" type="y-plane" />
<surface boundary="vacuum" coeffs="4" id="4" name="top" type="y-plane" />
<surface boundary="transmission" coeffs="0 0 0.4" id="5" type="z-cylinder" />
</geometry>

View file

@ -0,0 +1,18 @@
<?xml version='1.0' encoding='utf-8'?>
<materials>
<default_xs>71c</default_xs>
<material id="1" name="fuel">
<density units="g/cc" value="4.5" />
<nuclide ao="1.0" name="U-235" />
</material>
<material id="2" name="moderator">
<density units="g/cc" value="1.0" />
<nuclide ao="1.0" name="O-16" />
<nuclide ao="2.0" name="H-1" />
<sab name="HH2O" xs="71t" />
</material>
<material id="3" name="iron">
<density units="g/cc" value="7.9" />
<nuclide ao="1.0" name="Fe-56" />
</material>
</materials>

View file

@ -0,0 +1,17 @@
k-combined:
0.000000E+00 0.000000E+00
tally 1:
2.166056E-02
4.691799E-04
2.281665E-02
5.205994E-04
1.938848E-02
3.759132E-04
3.055366E-02
9.335264E-04
2.338209E-02
5.467222E-04
2.719869E-02
7.397689E-04
1.895698E-02
3.593670E-04

View file

@ -0,0 +1,13 @@
<?xml version='1.0' encoding='utf-8'?>
<settings>
<eigenvalue>
<particles>1000</particles>
<batches>1</batches>
<inactive>0</inactive>
</eigenvalue>
<source>
<space type="box">
<parameters>-1 -1 -1 1 1 1</parameters>
</space>
</source>
</settings>

View file

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<tallies>
<tally id="1">
<filter bins="101" type="distribcell" />
<scores>total</scores>
</tally>
</tallies>

View file

@ -18,10 +18,11 @@ class DistribcellTestHarness(TestHarness):
"""Run OpenMC with the appropriate arguments and check the outputs."""
base_dir = os.getcwd()
try:
dirs = ('case-1', '../case-2', '../case-3')
sps = ('statepoint.1.*', 'statepoint.1.*', 'statepoint.3.*')
tallies_out_present = (True, True, False)
hash_out = (False, False, True)
dirs = ('case-1', '../case-2', '../case-3', '../case-4')
sps = ('statepoint.1.*', 'statepoint.1.*', 'statepoint.3.*',
'statepoint.1.*')
tallies_out_present = (True, True, False, True)
hash_out = (False, False, True, False)
for i in range(len(dirs)):
os.chdir(dirs[i])
self._sp_name = sps[i]
@ -41,10 +42,11 @@ class DistribcellTestHarness(TestHarness):
"""Update the results_true using the current version of OpenMC."""
base_dir = os.getcwd()
try:
dirs = ('case-1', '../case-2', '../case-3')
sps = ('statepoint.1.*', 'statepoint.1.*', 'statepoint.3.*')
tallies_out_present = (True, True, False)
hash_out = (False, False, True)
dirs = ('case-1', '../case-2', '../case-3', '../case-4')
sps = ('statepoint.1.*', 'statepoint.1.*', 'statepoint.3.*',
'statepoint.1.*')
tallies_out_present = (True, True, False, True)
hash_out = (False, False, True, False)
for i in range(len(dirs)):
os.chdir(dirs[i])
self._sp_name = sps[i]