Update example Python inputs, fix exporting to XML for <cell>

This commit is contained in:
Paul Romano 2015-09-28 16:53:27 +07:00
parent 6beee729cb
commit f093429ced
7 changed files with 46 additions and 61 deletions

View file

@ -1,5 +1,5 @@
import openmc
from openmc.region import Intersection
###############################################################################
# Simulation Input File Parameters
@ -55,11 +55,10 @@ cell3 = openmc.Cell(cell_id=101, name='cell 3')
cell4 = openmc.Cell(cell_id=2, name='cell 4')
# Register Surfaces with Cells
cell1.add_surface(surface=surf2, halfspace=-1)
cell2.add_surface(surface=surf1, halfspace=-1)
cell3.add_surface(surface=surf1, halfspace=+1)
cell4.add_surface(surface=surf2, halfspace=+1)
cell4.add_surface(surface=surf3, halfspace=-1)
cell1.region = surf2.negative
cell2.region = surf1.negative
cell3.region = surf1.positive
cell4.region = Intersection(surf2.positive, surf3.negative)
# Register Materials with Cells
cell2.fill = fuel

View file

@ -1,4 +1,5 @@
import openmc
from openmc.region import Intersection
###############################################################################
@ -68,14 +69,12 @@ cell5 = openmc.Cell(cell_id=600, name='cell 5')
cell6 = openmc.Cell(cell_id=601, name='cell 6')
# Register Surfaces with Cells
cell1.add_surface(left, halfspace=+1)
cell1.add_surface(right, halfspace=-1)
cell1.add_surface(bottom, halfspace=+1)
cell1.add_surface(top, halfspace=-1)
cell2.add_surface(fuel_surf, halfspace=-1)
cell3.add_surface(fuel_surf, halfspace=+1)
cell5.add_surface(fuel_surf, halfspace=-1)
cell6.add_surface(fuel_surf, halfspace=+1)
cell1.region = Intersection(left.positive, right.negative,
bottom.positive, top.negative)
cell2.region = fuel_surf.negative
cell3.region = fuel_surf.positive
cell5.region = fuel_surf.negative
cell6.region = fuel_surf.positive
# Register Materials with Cells
cell2.fill = fuel

View file

@ -1,4 +1,5 @@
import openmc
from openmc.region import Intersection
###############################################################################
@ -67,20 +68,16 @@ cell7 = openmc.Cell(cell_id=301, name='cell 7')
cell8 = openmc.Cell(cell_id=302, name='cell 8')
# Register Surfaces with Cells
cell1.add_surface(left, halfspace=+1)
cell1.add_surface(right, halfspace=-1)
cell1.add_surface(bottom, halfspace=+1)
cell1.add_surface(top, halfspace=-1)
cell2.add_surface(left, halfspace=+1)
cell2.add_surface(right, halfspace=-1)
cell2.add_surface(bottom, halfspace=+1)
cell2.add_surface(top, halfspace=-1)
cell3.add_surface(fuel1, halfspace=-1)
cell4.add_surface(fuel1, halfspace=+1)
cell5.add_surface(fuel2, halfspace=-1)
cell6.add_surface(fuel2, halfspace=+1)
cell7.add_surface(fuel3, halfspace=-1)
cell8.add_surface(fuel3, halfspace=+1)
cell1.region = Intersection(left.positive, right.negative,
bottom.positive, top.negative)
cell2.region = Intersection(left.positive, right.negative,
bottom.positive, top.negative)
cell3.region = fuel1.negative
cell4.region = fuel1.positive
cell5.region = fuel2.negative
cell6.region = fuel2.positive
cell7.region = fuel3.negative
cell8.region = fuel3.positive
# Register Materials with Cells
cell3.fill = fuel

View file

@ -1,5 +1,5 @@
import openmc
from openmc.region import Intersection
###############################################################################
# Simulation Input File Parameters
@ -65,17 +65,15 @@ cell5 = openmc.Cell(cell_id=202, name='cell 5')
cell6 = openmc.Cell(cell_id=301, name='cell 6')
cell7 = openmc.Cell(cell_id=302, name='cell 7')
# Register Surfaces with Cells
cell1.add_surface(left, halfspace=+1)
cell1.add_surface(right, halfspace=-1)
cell1.add_surface(bottom, halfspace=+1)
cell1.add_surface(top, halfspace=-1)
cell2.add_surface(fuel1, halfspace=-1)
cell3.add_surface(fuel1, halfspace=+1)
cell4.add_surface(fuel2, halfspace=-1)
cell5.add_surface(fuel2, halfspace=+1)
cell6.add_surface(fuel3, halfspace=-1)
cell7.add_surface(fuel3, halfspace=+1)
# Register Regions with Cells
cell1.region = Intersection(left.positive, right.negative,
bottom.positive, top.negative)
cell2.region = fuel1.negative
cell3.region = fuel1.positive
cell4.region = fuel2.negative
cell5.region = fuel2.positive
cell6.region = fuel3.negative
cell7.region = fuel3.positive
# Register Materials with Cells
cell2.fill = fuel

View file

@ -1,5 +1,5 @@
import openmc
from openmc.region import Intersection
###############################################################################
# Simulation Input File Parameters
@ -133,16 +133,11 @@ clad = openmc.Cell(cell_id=3, name='cell 3')
water = openmc.Cell(cell_id=4, name='cell 4')
# Register Surfaces with Cells
fuel.add_surface(fuel_or, halfspace=-1)
gap.add_surface(fuel_or, halfspace=+1)
gap.add_surface(clad_ir, halfspace=-1)
clad.add_surface(clad_ir, halfspace=+1)
clad.add_surface(clad_or, halfspace=-1)
water.add_surface(clad_or, halfspace=+1)
water.add_surface(left, halfspace=+1)
water.add_surface(right, halfspace=-1)
water.add_surface(bottom, halfspace=+1)
water.add_surface(top, halfspace=-1)
fuel.region = fuel_or.negative
gap.region = Intersection(fuel_or.positive, clad_ir.negative)
clad.region = Intersection(clad_ir.positive, clad_or.negative)
water.region = Intersection(clad_or.positive, left.positive, right.negative,
bottom.positive, top.negative)
# Register Materials with Cells
fuel.fill = uo2

View file

@ -1,5 +1,5 @@
import openmc
from openmc.region import Intersection
###############################################################################
# Simulation Input File Parameters
@ -52,13 +52,10 @@ surf6.boundary_type = 'reflective'
# Instantiate Cell
cell = openmc.Cell(cell_id=1, name='cell 1')
# Register Surfaces with Cell
cell.add_surface(surface=surf1, halfspace=+1)
cell.add_surface(surface=surf2, halfspace=-1)
cell.add_surface(surface=surf3, halfspace=+1)
cell.add_surface(surface=surf4, halfspace=-1)
cell.add_surface(surface=surf5, halfspace=+1)
cell.add_surface(surface=surf6, halfspace=-1)
# Register Region with Cell
cell.region = Intersection(surf1.positive, surf2.negative,
surf3.positive, surf4.negative,
surf5.positive, surf6.negative)
# Register Material with Cell
cell.fill = fuel