mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
added tallies.xml file to tally arithmetic test
This commit is contained in:
parent
b17a8e07e3
commit
b81fa69db3
2 changed files with 15 additions and 32 deletions
15
tests/test_tally_arithmetic/tallies.xml
Normal file
15
tests/test_tally_arithmetic/tallies.xml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<tallies>
|
||||
<tally id="10000" name="tally 1">
|
||||
<filter bins="1" type="cell" />
|
||||
<filter bins="0.0 20.0" type="energy" />
|
||||
<nuclides>U-235 U-238</nuclides>
|
||||
<scores>fission nu-fission</scores>
|
||||
</tally>
|
||||
<tally id="10001" name="tally 2">
|
||||
<filter bins="1" type="material" />
|
||||
<filter bins="0.0 20.0" type="energy" />
|
||||
<nuclides>U-235 Pu-239</nuclides>
|
||||
<scores>fission absorption</scores>
|
||||
</tally>
|
||||
</tallies>
|
||||
|
|
@ -10,38 +10,6 @@ import openmc
|
|||
|
||||
|
||||
class TallyArithmeticTestHarness(TestHarness):
|
||||
def _build_inputs(self):
|
||||
|
||||
u235 = openmc.Nuclide('U-235')
|
||||
u238 = openmc.Nuclide('U-238')
|
||||
pu239 = openmc.Nuclide('Pu-239')
|
||||
|
||||
# Instantiate energy filter
|
||||
energy_filter = openmc.Filter(type='energy', bins=[0., 20.])
|
||||
|
||||
# Create tallies
|
||||
tally_1 = openmc.Tally(name='tally 1')
|
||||
tally_1.add_filter(openmc.Filter(type='cell', bins=[1]))
|
||||
tally_1.add_filter(energy_filter)
|
||||
tally_1.add_score('fission')
|
||||
tally_1.add_score('nu-fission')
|
||||
tally_1.add_nuclide(u235)
|
||||
tally_1.add_nuclide(u238)
|
||||
|
||||
tally_2 = openmc.Tally(name='tally 2')
|
||||
tally_2.add_filter(openmc.Filter(type='material', bins=[1]))
|
||||
tally_2.add_filter(energy_filter)
|
||||
tally_2.add_score('fission')
|
||||
tally_2.add_score('absorption')
|
||||
tally_2.add_nuclide(u235)
|
||||
tally_2.add_nuclide(pu239)
|
||||
|
||||
# Export tallies to file
|
||||
tallies_file = openmc.TalliesFile()
|
||||
tallies_file.add_tally(tally_1)
|
||||
tallies_file.add_tally(tally_2)
|
||||
tallies_file.export_to_xml()
|
||||
|
||||
def _get_results(self, hash_output=False):
|
||||
"""Digest info in the statepoint and return as a string."""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue