New regression test for lattice with OX orient

This commit is contained in:
dr.yuri 2019-05-30 10:54:08 +03:00
parent b59d5416b1
commit 79f792c09a
4 changed files with 299 additions and 0 deletions

View file

@ -0,0 +1,126 @@
<?xml version='1.0' encoding='utf-8'?>
<geometry>
<cell id="1" material="1" region="-1" universe="1" />
<cell id="2" material="4" region="-2 1" universe="1" />
<cell id="3" material="2" region="2" universe="1" />
<cell id="4" material="2" region="-3" universe="2" />
<cell id="5" material="4" region="-4 3" universe="2" />
<cell id="6" material="2" region="4" universe="2" />
<cell id="7" material="3" region="-5" universe="3" />
<cell id="8" material="4" region="-6 5" universe="3" />
<cell id="9" material="2" region="-7 6" universe="3" />
<cell id="10" material="4" region="-8 7" universe="3" />
<cell id="11" material="2" region="8" universe="3" />
<cell id="12" material="2" universe="4" />
<cell fill="9" id="13" name="container assembly cell" region="-11 12 -13 14 15 -16 9 -10" universe="5" />
<hex_lattice id="9" n_axial="2" n_rings="11" name="regular fuel assembly" orient="OX">
<pitch>1.235 5.0</pitch>
<outer>4</outer>
<center>0.0 0.0 5.0</center>
<universes>
1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 3 1 1 1 1 1 1 1
1 1 1 1 1 3 1 1 1 1 3 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 3 1 1 1 1 3 1 1 1 3 1 1 1 1
1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1
1 1 1 1 1 3 1 1 1 1 2 1 1 1 1 3 1 1 1 1 1
1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1
1 1 1 1 3 1 1 1 3 1 1 1 1 3 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 3 1 1 1 1 3 1 1 1 1 1
1 1 1 1 1 1 1 3 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 3 1 1 1 1 1 1 1
1 1 1 1 1 3 1 1 1 1 3 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 3 1 1 1 1 3 1 1 1 3 1 1 1 1
1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1
1 1 1 1 1 3 1 1 1 1 2 1 1 1 1 3 1 1 1 1 1
1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1
1 1 1 1 3 1 1 1 3 1 1 1 1 3 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 3 1 1 1 1 3 1 1 1 1 1
1 1 1 1 1 1 1 3 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1</universes>
</hex_lattice>
<surface coeffs="0.0 0.0 0.386" id="1" type="z-cylinder" />
<surface coeffs="0.0 0.0 0.4582" id="2" type="z-cylinder" />
<surface coeffs="0.0 0.0 0.45" id="3" type="z-cylinder" />
<surface coeffs="0.0 0.0 0.5177" id="4" type="z-cylinder" />
<surface coeffs="0.0 0.0 0.35" id="5" type="z-cylinder" />
<surface coeffs="0.0 0.0 0.41" id="6" type="z-cylinder" />
<surface coeffs="0.0 0.0 0.545" id="7" type="z-cylinder" />
<surface coeffs="0.0 0.0 0.6323" id="8" type="z-cylinder" />
<surface boundary="reflective" coeffs="0.0" id="9" type="z-plane" />
<surface boundary="reflective" coeffs="10.0" id="10" type="z-plane" />
<surface boundary="reflective" coeffs="11.8" id="11" type="y-plane" />
<surface boundary="reflective" coeffs="-11.8" id="12" type="y-plane" />
<surface boundary="reflective" coeffs="1.7320508075688772 1.0 0.0 23.6" id="13" type="plane" />
<surface boundary="reflective" coeffs="-1.7320508075688772 1.0 0.0 -23.6" id="14" type="plane" />
<surface boundary="reflective" coeffs="1.7320508075688772 1.0 0.0 -23.6" id="15" type="plane" />
<surface boundary="reflective" coeffs="-1.7320508075688772 1.0 0.0 23.6" id="16" type="plane" />
</geometry>
<?xml version='1.0' encoding='utf-8'?>
<materials>
<material depletable="true" id="1" name="UO2">
<density units="sum" />
<nuclide ao="0.0008737" name="U235" />
<nuclide ao="0.018744" name="U238" />
<nuclide ao="0.039235" name="O16" />
</material>
<material id="2" name="borated H2O">
<density units="sum" />
<nuclide ao="0.06694" name="H1" />
<nuclide ao="0.03347" name="O16" />
<nuclide ao="6.6262e-06" name="B10" />
<nuclide ao="2.6839e-05" name="B11" />
</material>
<material id="3" name="pellet B4C">
<density units="sum" />
<nuclide ao="0.01966" name="C0" />
<nuclide ao="4.7344e-06" name="B11" />
<nuclide ao="1.9177e-05" name="B10" />
</material>
<material id="4" name="Zirc4">
<density units="sum" />
<nuclide ao="0.021763349999999997" name="Zr90" />
<nuclide ao="0.00474606" name="Zr91" />
<nuclide ao="0.00725445" name="Zr92" />
<nuclide ao="0.00735174" name="Zr94" />
<nuclide ao="0.0011844" name="Zr96" />
</material>
</materials>
<?xml version='1.0' encoding='utf-8'?>
<settings>
<run_mode>eigenvalue</run_mode>
<particles>1000</particles>
<batches>10</batches>
<inactive>5</inactive>
<source strength="1.0">
<space type="box">
<parameters>-13.62546635287517 -13.62546635287517 0.0 13.62546635287517 13.62546635287517 10.0</parameters>
</space>
</source>
<output>
<summary>false</summary>
</output>
<seed>22</seed>
</settings>

View file

@ -0,0 +1,2 @@
k-combined:
1.355663E+00 2.896562E-02

View file

@ -0,0 +1,171 @@
from tests.testing_harness import PyAPITestHarness
import openmc
import numpy as np
class HexLatticeOXTestHarness(PyAPITestHarness):
def _build_inputs(self):
materials = openmc.Materials()
fuel_mat = openmc.Material(material_id=1,name="UO2")
fuel_mat.set_density('sum')
fuel_mat.add_nuclide('U235',0.87370e-03)
fuel_mat.add_nuclide('U238',1.87440e-02)
fuel_mat.add_nuclide('O16',3.92350e-02)
materials.append(fuel_mat)
coolant = openmc.Material(material_id=2,name="borated H2O")
coolant.set_density('sum')
coolant.add_nuclide('H1',0.06694)
coolant.add_nuclide('O16',0.03347)
coolant.add_nuclide('B10',6.6262e-6)
coolant.add_nuclide('B11',2.6839e-5)
materials.append(coolant)
absorber = openmc.Material(material_id=3,name="pellet B4C")
absorber.set_density('sum')
absorber.add_nuclide('C0',0.01966)
absorber.add_nuclide('B11',4.7344e-6)
absorber.add_nuclide('B10',1.9177e-5)
materials.append(absorber)
zirc = openmc.Material(material_id=4,name="Zirc4")
zirc.set_density('sum')
zirc.add_element('Zr',4.23e-2)
materials.append(zirc)
materials.export_to_xml()
### Geometry ###
pin_rad = 0.7 # cm
assembly_pitch = 1.235 # cm
hexagonal_pitch = 23.6 # cm
length = 10.0 # cm
#Fuel pin surfaces
cylfuelin = openmc.ZCylinder(surface_id=1,r=0.386)
cylfuelout = openmc.ZCylinder(surface_id=2,r=0.4582)
#Fuel cells
infcell = openmc.Cell(cell_id=1)
infcell.region = -cylfuelin
infcell.fill = fuel_mat
clfcell = openmc.Cell(cell_id=2)
clfcell.region = -cylfuelout & +cylfuelin
clfcell.fill = zirc
outfcell = openmc.Cell(cell_id=3)
outfcell.region = +cylfuelout
outfcell.fill = coolant
#Fuel universe
fuel_ch_univ = openmc.Universe(universe_id=1,name="Fuel channel",cells=[infcell, clfcell,outfcell])
#Central tube surfaces
cyltubein = openmc.ZCylinder(surface_id=3,r=0.45)
cyltubeout = openmc.ZCylinder(surface_id=4,r=0.5177)
#Central tube cells
inctcell = openmc.Cell(cell_id=4)
inctcell.region = -cyltubein
inctcell.fill = coolant
clctcell = openmc.Cell(cell_id=5)
clctcell.region = -cyltubeout & +cyltubein
clctcell.fill = zirc
outctcell = openmc.Cell(cell_id=6)
outctcell.region = +cyltubeout
outctcell.fill = coolant
#Central tubel universe
tube_ch_univ = openmc.Universe(universe_id=2,name="Central tube channel",cells=[inctcell, clctcell,outctcell])
#Absorber tube surfaces
cylabsin = openmc.ZCylinder(surface_id=5,r=0.35)
cylabsout = openmc.ZCylinder(surface_id=6,r=0.41)
cylabsclin = openmc.ZCylinder(surface_id=7,r=0.545)
cylabsclout = openmc.ZCylinder(surface_id=8,r=0.6323)
#Absorber tube cells
inabscell = openmc.Cell(cell_id=7)
inabscell.region = -cylabsin
inabscell.fill = absorber
clabscell = openmc.Cell(cell_id=8)
clabscell.region = -cylabsout & +cylabsin
clabscell.fill = zirc
interabscell = openmc.Cell(cell_id=9)
interabscell.region = -cylabsclin & +cylabsout
interabscell.fill = coolant
clatcell = openmc.Cell(cell_id=10)
clatcell.region = -cylabsclout & +cylabsclin
clatcell.fill = zirc
outabscell = openmc.Cell(cell_id=11)
outabscell.region = +cylabsclout
outabscell.fill = coolant
#Absorber tube universe
abs_ch_univ = openmc.Universe(universe_id=3,name="Central tube channel",cells=[inabscell,clabscell,interabscell,clatcell,outabscell])
#Assembly surfaces
edge_length = (1./np.sqrt(3.0)) * hexagonal_pitch
fuel_bottom = openmc.ZPlane(surface_id=9,z0=0.0, boundary_type = 'reflective')
fuel_top = openmc.ZPlane(surface_id=10,z0=length, boundary_type = 'reflective')
# a hex surface for the core to go inside of
hexprism = openmc.model.get_hexagonal_prism(edge_length=edge_length,
origin=(0.0, 0.0),
boundary_type = 'reflective',
orientation='x')
region = hexprism & +fuel_bottom & -fuel_top
inf_mat = openmc.Cell(cell_id=12)
inf_mat.fill = coolant
inf_mat_univ = openmc.Universe(universe_id=4,cells=[inf_mat,])
# Fill lattice by channels
nring = 11
universes = [] # array of rings
for ring in range(nring - 1,-1,-1):
arr = []
arr.append(fuel_ch_univ)
for cell in range(ring * 6 - 1):
arr.append(fuel_ch_univ)
universes.append(arr)
universes[-1] = [tube_ch_univ]
channels = [(7,16),(7,13),(7,10),(7,7),(7,4),(7,1),(5,0),\
(4,33),(5,25),(4,27),(5,20),(4,21),(5,15),\
(4,15),(5,10),(4,9),(5,5),(4,3)]
for i,j in channels:
universes[i][j] = abs_ch_univ
lattice = openmc.HexLattice(name="regular fuel assembly")
lattice.orientation = "ox"
lattice.center = (0., 0., length/2.0)
lattice.pitch = (assembly_pitch,length/2.0)
lattice.universes = 2*[universes]
lattice.outer = inf_mat_univ
assembly_cell = openmc.Cell(cell_id=13,name="container assembly cell")
assembly_cell.region = region
assembly_cell.fill = lattice
root_univ = openmc.Universe(universe_id=5,name="root universe", cells=[assembly_cell,])
geom = openmc.Geometry(root_univ)
geom.export_to_xml()
### Settings ###
settings = openmc.Settings()
settings.run_mode = 'eigenvalue'
source = openmc.Source()
ll = [-edge_length, -edge_length, 0.0]
ur = [edge_length, edge_length, 10.0]
source.space = openmc.stats.Box(ll, ur)
source.strength = 1.0
settings.source = source
settings.output = {'summary' : False}
settings.batches = 10
settings.inactive = 5
settings.particles = 1000
settings.seed = 22
settings.export_to_xml()
def test_lattice_hex_ox_surf():
harness = HexLatticeOXTestHarness('statepoint.10.h5')
harness.main()