mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-24 12:05:32 -04:00
1653 lines
69 KiB
Text
1653 lines
69 KiB
Text
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"This IPython Notebook illustrates the use of the **`openmc.mgxs.Library`** class. The `Library` class is designed to automate the calculation of multi-group cross sections for use cases with one or more domains, cross section types, and/or nuclides. In particular, this Notebook illustrates the following features:\n",
|
|
"\n",
|
|
"* Calculation of multi-group cross sections for a **fuel assembly**\n",
|
|
"* Automated creation, manipulation and storage of `MGXS` with **`openmc.mgxs.Library`**\n",
|
|
"* **Validation** of multi-group cross sections with **[OpenMOC](https://mit-crpg.github.io/OpenMOC/)**\n",
|
|
"* Steady-state pin-by-pin **fission rates comparison** between OpenMC and [OpenMOC](https://mit-crpg.github.io/OpenMOC/)\n",
|
|
"\n",
|
|
"**Note:** This Notebook was created using [OpenMOC](https://mit-crpg.github.io/OpenMOC/) to verify the multi-group cross-sections generated by OpenMC. In order to run this Notebook in its entirety, you must have [OpenMOC](https://mit-crpg.github.io/OpenMOC/) installed on your system, along with OpenCG to convert the OpenMC geometries into OpenMOC geometries. In addition, this Notebook illustrates the use of [Pandas](http://pandas.pydata.org/) `DataFrames` to containerize multi-group cross section data. We recommend using [Pandas](http://pandas.pydata.org/) >v0.15.0 or later since OpenMC's Python API leverages the multi-indexing feature included in the most recent releases of [Pandas](http://pandas.pydata.org/)."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Generate Input Files"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {
|
|
"collapsed": false
|
|
},
|
|
"outputs": [
|
|
{
|
|
"name": "stderr",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"/usr/lib/pymodules/python2.7/matplotlib/__init__.py:1173: UserWarning: This call to matplotlib.use() has no effect\n",
|
|
"because the backend has already been chosen;\n",
|
|
"matplotlib.use() must be called *before* pylab, matplotlib.pyplot,\n",
|
|
"or matplotlib.backends is imported for the first time.\n",
|
|
"\n",
|
|
" warnings.warn(_use_error_msg)\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"import math\n",
|
|
"import pickle\n",
|
|
"from IPython.display import Image\n",
|
|
"import matplotlib.pylab as pylab\n",
|
|
"import numpy as np\n",
|
|
"\n",
|
|
"import openmc\n",
|
|
"import openmc.mgxs\n",
|
|
"from openmc.statepoint import StatePoint\n",
|
|
"from openmc.summary import Summary\n",
|
|
"\n",
|
|
"import openmoc\n",
|
|
"import openmoc.process\n",
|
|
"from openmoc.compatible import get_openmoc_geometry\n",
|
|
"from openmoc.materialize import load_openmc_mgxs_lib\n",
|
|
"\n",
|
|
"%matplotlib inline"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"First we need to define materials that will be used in the problem. Before defining a material, we must create nuclides that are used in the material."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 2,
|
|
"metadata": {
|
|
"collapsed": false
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Instantiate some Nuclides\n",
|
|
"h1 = openmc.Nuclide('H-1')\n",
|
|
"b10 = openmc.Nuclide('B-10')\n",
|
|
"o16 = openmc.Nuclide('O-16')\n",
|
|
"u235 = openmc.Nuclide('U-235')\n",
|
|
"u238 = openmc.Nuclide('U-238')\n",
|
|
"zr90 = openmc.Nuclide('Zr-90')"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"With the nuclides we defined, we will now create three materials for the fuel, water, and cladding of the fuel pins."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 3,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# 1.6 enriched fuel\n",
|
|
"fuel = openmc.Material(name='1.6% Fuel')\n",
|
|
"fuel.set_density('g/cm3', 10.31341)\n",
|
|
"fuel.add_nuclide(u235, 3.7503e-4)\n",
|
|
"fuel.add_nuclide(u238, 2.2625e-2)\n",
|
|
"fuel.add_nuclide(o16, 4.6007e-2)\n",
|
|
"\n",
|
|
"# borated water\n",
|
|
"water = openmc.Material(name='Borated Water')\n",
|
|
"water.set_density('g/cm3', 0.740582)\n",
|
|
"water.add_nuclide(h1, 4.9457e-2)\n",
|
|
"water.add_nuclide(o16, 2.4732e-2)\n",
|
|
"water.add_nuclide(b10, 8.0042e-6)\n",
|
|
"\n",
|
|
"# zircaloy\n",
|
|
"zircaloy = openmc.Material(name='Zircaloy')\n",
|
|
"zircaloy.set_density('g/cm3', 6.55)\n",
|
|
"zircaloy.add_nuclide(zr90, 7.2758e-3)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"With our three materials, we can now create a `MaterialsFile` object that can be exported to an actual XML file."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 4,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Instantiate a MaterialsFile, add Materials\n",
|
|
"materials_file = openmc.MaterialsFile()\n",
|
|
"materials_file.add_material(fuel)\n",
|
|
"materials_file.add_material(water)\n",
|
|
"materials_file.add_material(zircaloy)\n",
|
|
"materials_file.default_xs = '71c'\n",
|
|
"\n",
|
|
"# Export to \"materials.xml\"\n",
|
|
"materials_file.export_to_xml()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Now let's move on to the geometry. This problem will be a square array of fuel pins and control rod guide tubes for which we can use OpenMC's lattice/universe feature. The basic universe will have three regions for the fuel, the clad, and the surrounding coolant. The first step is to create the bounding surfaces for fuel and clad, as well as the outer bounding surfaces of the problem."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 5,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Create cylinders for the fuel and clad\n",
|
|
"fuel_outer_radius = openmc.ZCylinder(x0=0.0, y0=0.0, R=0.39218)\n",
|
|
"clad_outer_radius = openmc.ZCylinder(x0=0.0, y0=0.0, R=0.45720)\n",
|
|
"\n",
|
|
"# Create boundary planes to surround the geometry\n",
|
|
"min_x = openmc.XPlane(x0=-10.71, boundary_type='reflective')\n",
|
|
"max_x = openmc.XPlane(x0=+10.71, boundary_type='reflective')\n",
|
|
"min_y = openmc.YPlane(y0=-10.71, boundary_type='reflective')\n",
|
|
"max_y = openmc.YPlane(y0=+10.71, boundary_type='reflective')\n",
|
|
"min_z = openmc.ZPlane(z0=-10., boundary_type='reflective')\n",
|
|
"max_z = openmc.ZPlane(z0=+10., boundary_type='reflective')"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"With the surfaces defined, we can now construct a fuel pin cell from cells that are defined by intersections of half-spaces created by the surfaces."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 6,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Create a Universe to encapsulate a fuel pin\n",
|
|
"fuel_pin_universe = openmc.Universe(name='1.6% Fuel Pin')\n",
|
|
"\n",
|
|
"# Create fuel Cell\n",
|
|
"fuel_cell = openmc.Cell(name='1.6% Fuel')\n",
|
|
"fuel_cell.fill = fuel\n",
|
|
"fuel_cell.region = -fuel_outer_radius\n",
|
|
"fuel_pin_universe.add_cell(fuel_cell)\n",
|
|
"\n",
|
|
"# Create a clad Cell\n",
|
|
"clad_cell = openmc.Cell(name='1.6% Clad')\n",
|
|
"clad_cell.fill = zircaloy\n",
|
|
"clad_cell.region = +fuel_outer_radius & -clad_outer_radius\n",
|
|
"fuel_pin_universe.add_cell(clad_cell)\n",
|
|
"\n",
|
|
"# Create a moderator Cell\n",
|
|
"moderator_cell = openmc.Cell(name='1.6% Moderator')\n",
|
|
"moderator_cell.fill = water\n",
|
|
"moderator_cell.region = +clad_outer_radius\n",
|
|
"fuel_pin_universe.add_cell(moderator_cell)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Likewise, we can construct a control rod guide tube with the same surfaces."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 7,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Create a Universe to encapsulate a control rod guide tube\n",
|
|
"guide_tube_universe = openmc.Universe(name='Guide Tube')\n",
|
|
"\n",
|
|
"# Create guide tube Cell\n",
|
|
"guide_tube_cell = openmc.Cell(name='Guide Tube Water')\n",
|
|
"guide_tube_cell.fill = water\n",
|
|
"guide_tube_cell.region = -fuel_outer_radius\n",
|
|
"guide_tube_universe.add_cell(guide_tube_cell)\n",
|
|
"\n",
|
|
"# Create a clad Cell\n",
|
|
"clad_cell = openmc.Cell(name='Guide Clad')\n",
|
|
"clad_cell.fill = zircaloy\n",
|
|
"clad_cell.region = +fuel_outer_radius & -clad_outer_radius\n",
|
|
"guide_tube_universe.add_cell(clad_cell)\n",
|
|
"\n",
|
|
"# Create a moderator Cell\n",
|
|
"moderator_cell = openmc.Cell(name='Guide Tube Moderator')\n",
|
|
"moderator_cell.fill = water\n",
|
|
"moderator_cell.region = +clad_outer_radius\n",
|
|
"guide_tube_universe.add_cell(moderator_cell)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Using the pin cell universe, we can construct a 17x17 rectangular lattice with a 1.26 cm pitch."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 8,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Create fuel assembly Lattice\n",
|
|
"assembly = openmc.RectLattice(name='1.6% Fuel Assembly')\n",
|
|
"assembly.dimension = (17, 17)\n",
|
|
"assembly.pitch = (1.26, 1.26)\n",
|
|
"assembly.lower_left = [-1.26 * 17. / 2.0] * 2"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Next, we create a NumPy array of fuel pin and guide tube universes for the lattice."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 9,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Create array indices for guide tube locations in lattice\n",
|
|
"template_x = np.array([5, 8, 11, 3, 13, 2, 5, 8, 11, 14, 2, 5, 8,\n",
|
|
" 11, 14, 2, 5, 8, 11, 14, 3, 13, 5, 8, 11])\n",
|
|
"template_y = np.array([2, 2, 2, 3, 3, 5, 5, 5, 5, 5, 8, 8, 8, 8,\n",
|
|
" 8, 11, 11, 11, 11, 11, 13, 13, 14, 14, 14])\n",
|
|
"\n",
|
|
"# Initialize an empty 17x17 array of the lattice universes\n",
|
|
"universes = np.empty((17, 17), dtype=openmc.Universe)\n",
|
|
"\n",
|
|
"# Fill the array with the fuel pin and guide tube universes\n",
|
|
"universes[:,:] = fuel_pin_universe\n",
|
|
"universes[template_x, template_y] = guide_tube_universe\n",
|
|
"\n",
|
|
"# Store the array of universes in the lattice\n",
|
|
"assembly.universes = universes"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"OpenMC requires that there is a \"root\" universe. Let us create a root cell that is filled by the pin cell universe and then assign it to the root universe."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 10,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Create root Cell\n",
|
|
"root_cell = openmc.Cell(name='root cell')\n",
|
|
"root_cell.fill = assembly\n",
|
|
"\n",
|
|
"# Add boundary planes\n",
|
|
"root_cell.region = +min_x & -max_x & +min_y & -max_y & +min_z & -max_z\n",
|
|
"\n",
|
|
"# Create root Universe\n",
|
|
"root_universe = openmc.Universe(universe_id=0, name='root universe')\n",
|
|
"root_universe.add_cell(root_cell)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"We now must create a geometry that is assigned a root universe, put the geometry into a `GeometryFile` object, and export it to XML."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 11,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Create Geometry and set root Universe\n",
|
|
"geometry = openmc.Geometry()\n",
|
|
"geometry.root_universe = root_universe"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 12,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Instantiate a GeometryFile\n",
|
|
"geometry_file = openmc.GeometryFile()\n",
|
|
"geometry_file.geometry = geometry\n",
|
|
"\n",
|
|
"# Export to \"geometry.xml\"\n",
|
|
"geometry_file.export_to_xml()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"With the geometry and materials finished, we now just need to define simulation parameters. In this case, we will use 10 inactive batches and 40 active batches each with 2500 particles."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 13,
|
|
"metadata": {
|
|
"collapsed": false
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# OpenMC simulation parameters\n",
|
|
"batches = 50\n",
|
|
"inactive = 10\n",
|
|
"particles = 2500\n",
|
|
"\n",
|
|
"# Instantiate a SettingsFile\n",
|
|
"settings_file = openmc.SettingsFile()\n",
|
|
"settings_file.batches = batches\n",
|
|
"settings_file.inactive = inactive\n",
|
|
"settings_file.particles = particles\n",
|
|
"settings_file.output = {'tallies': False, 'summary': True}\n",
|
|
"source_bounds = [-10.71, -10.71, -10, 10.71, 10.71, 10.]\n",
|
|
"settings_file.set_source_space('fission', source_bounds)\n",
|
|
"\n",
|
|
"# Export to \"settings.xml\"\n",
|
|
"settings_file.export_to_xml()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Let us also create a `PlotsFile` that we can use to verify that our fuel assembly geometry was created successfully."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 14,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Instantiate a Plot\n",
|
|
"plot = openmc.Plot(plot_id=1)\n",
|
|
"plot.filename = 'materials-xy'\n",
|
|
"plot.origin = [0, 0, 0]\n",
|
|
"plot.width = [21.5, 21.5]\n",
|
|
"plot.pixels = [250, 250]\n",
|
|
"plot.color = 'mat'\n",
|
|
"\n",
|
|
"# Instantiate a PlotsFile, add Plot, and export to \"plots.xml\"\n",
|
|
"plot_file = openmc.PlotsFile()\n",
|
|
"plot_file.add_plot(plot)\n",
|
|
"plot_file.export_to_xml()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"With the plots.xml file, we can now generate and view the plot. OpenMC outputs plots in .ppm format, which can be converted into a compressed format like .png with the convert utility."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 15,
|
|
"metadata": {
|
|
"collapsed": false
|
|
},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"0"
|
|
]
|
|
},
|
|
"execution_count": 15,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Run openmc in plotting mode\n",
|
|
"executor = openmc.Executor()\n",
|
|
"executor.plot_geometry(output=False)"
|
|
]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
|
},
|
|
"execution_count": 16,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Convert OpenMC's funky ppm to png\n",
|
|
"!convert materials-xy.ppm materials-xy.png\n",
|
|
"\n",
|
|
"# Display the materials plot inline\n",
|
|
"Image(filename='materials-xy.png')"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"As we can see from the plot, we have a nice array of fuel and guide tube pin cells with fuel, cladding, and water!"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Create an MGXS Library"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Now we are ready to generate multi-group cross sections! First, let's define a 2-group structure using the built-in `EnergyGroups` class."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 17,
|
|
"metadata": {
|
|
"collapsed": false
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Instantiate a 2-group EnergyGroups object\n",
|
|
"groups = openmc.mgxs.EnergyGroups()\n",
|
|
"groups.group_edges = np.array([0., 0.625e-6, 20.])"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Next, we will instantiate an `openmc.mgxs.Library` for the energy groups with our the fuel assembly geometry."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 18,
|
|
"metadata": {
|
|
"collapsed": false
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Initialize an 2-group MGXS Library for OpenMOC\n",
|
|
"mgxs_lib = openmc.mgxs.Library(geometry)\n",
|
|
"mgxs_lib.energy_groups = groups"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Now, we must specify to the `Library` which types of cross sections to compute. In particular, the following are the multi-group cross section `MGXS` subclasses that are mapped to string codes accepted by the `Library` class:\n",
|
|
"\n",
|
|
"* `TotalXS` (`\"total\"`)\n",
|
|
"* `TransportXS` (`\"transport\"`)\n",
|
|
"* `AbsorptionXS` (`\"absorption\"`)\n",
|
|
"* `CaptureXS` (`\"capture\"`)\n",
|
|
"* `FissionXS` (`\"fission\"`)\n",
|
|
"* `NuFissionXS` (`\"nu-fission\"`)\n",
|
|
"* `ScatterXS` (`\"scatter\"`)\n",
|
|
"* `NuScatterXS` (`\"nu-scatter\"`)\n",
|
|
"* `ScatterMatrixXS` (`\"scatter matrix\"`)\n",
|
|
"* `NuScatterMatrixXS` (`\"nu-scatter matrix\"`)\n",
|
|
"* `Chi` (`\"chi\"`)\n",
|
|
"\n",
|
|
"In this case, let's create the multi-group cross sections needed to run an OpenMOC simulation to verify the accuracy of our cross sections. In particular, we will define `\"transport\"`, `\"nu-fission\"`, `\"nu-scatter matrix\"` and `\"chi\"` cross sections for our `Library`.\n",
|
|
"\n",
|
|
"**Note**: A variety of different approximate transport-corrected total multi-group cross sections (and corresponding scattering matrices) can be found in the literature. At the present time, the `openmc.mgxs` module only supports the `\"P0\"` transport correction. This correction can be turned on and off through the boolean `Library.correction` property which may take values of `\"P0\"` (default) or `None`."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 19,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Specify multi-group cross section types to compute\n",
|
|
"mgxs_lib.mgxs_types = ['transport', 'nu-fission', 'nu-scatter matrix', 'chi']"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Now we must specify the type of domain over which we would like the `Library` to compute multi-group cross sections. The domain type corresponds to the type of tally filter to be used in the tallies created to compute multi-group cross sections. At the present time, the `Library` supports `\"material,\"` `\"cell,\"` and `\"universe\"` domain types. We will use a `\"cell\"` domain type here to compute cross sections in each of the cells in the fuel assembly geometry.\n",
|
|
"\n",
|
|
"**Note:** By default, the `Library` class will instantiate `MGXS` objects for each and every domain (material, cell or universe) in the geometry of interest. However, one may specify a subset of these domains to the `Library.domains` property. In our case, we wish to compute multi-group cross sections in each and every cell since they will be needed in our downstream OpenMOC calculation on the identical combinatorial geometry mesh."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 20,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Specify a \"cell\" domain type for the cross section tally filters\n",
|
|
"mgxs_lib.domain_type = \"cell\"\n",
|
|
"\n",
|
|
"# Specify the cell domains over which to compute multi-group cross sections\n",
|
|
"mgxs_lib.domains = geometry.get_all_material_cells()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"We can easily instruct the `Library` to compute multi-group cross sections on a nuclide-by-nuclide basis with the boolean `Library.by_nuclide` property. By default, `by_nuclide` is set to `False`, but we will set it to `True` here."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 21,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Compute cross sections on a nuclide-by-nuclide basis\n",
|
|
"mgxs_lib.by_nuclide = True"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Lastly, we use the `Library` to construct the tallies needed to compute all of the requested multi-group cross sections in each domain and nuclide."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 22,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Construct all tallies needed for the multi-group cross section library\n",
|
|
"mgxs_lib.build_library()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"The tallies can now be export to a \"tallies.xml\" input file for OpenMC. \n",
|
|
"\n",
|
|
"**NOTE**: At this point the `Library` has constructed nearly 100 distinct `Tally` objects. The overhead to tally in OpenMC scales as $O(N)$ for $N$ tallies, which can become a bottleneck for large tally datasets. To compensate for this, the Python API's `Tally`, `Filter` and `TalliesFile` classes allow for the smart *merging* of tallies when possible. The `Library` class supports this runtime optimization with the use of the optional `merge` paramter (`False` by default) for the `Library.add_to_tallies_file(...)` method, as shown below."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 23,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Create a \"tallies.xml\" file for the MGXS Library\n",
|
|
"tallies_file = openmc.TalliesFile()\n",
|
|
"mgxs_lib.add_to_tallies_file(tallies_file, merge=True)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"In addition, we instantiate a fission rate mesh tally to compare with OpenMOC."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 24,
|
|
"metadata": {
|
|
"collapsed": false
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Instantiate a tally Mesh\n",
|
|
"mesh = openmc.Mesh(mesh_id=1)\n",
|
|
"mesh.type = 'regular'\n",
|
|
"mesh.dimension = [17, 17]\n",
|
|
"mesh.lower_left = [-10.71, -10.71]\n",
|
|
"mesh.width = [1.26, 1.26]\n",
|
|
"\n",
|
|
"# Instantiate tally Filter\n",
|
|
"mesh_filter = openmc.Filter()\n",
|
|
"mesh_filter.mesh = mesh\n",
|
|
"\n",
|
|
"# Instantiate the Tally\n",
|
|
"tally = openmc.Tally(name='mesh tally')\n",
|
|
"tally.add_filter(mesh_filter)\n",
|
|
"tally.add_score('fission')\n",
|
|
"tally.add_score('nu-fission')\n",
|
|
"\n",
|
|
"# Add mesh and Tally to TalliesFile\n",
|
|
"tallies_file.add_mesh(mesh)\n",
|
|
"tallies_file.add_tally(tally)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 25,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Export all tallies to a \"tallies.xml\" file\n",
|
|
"tallies_file.export_to_xml()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 26,
|
|
"metadata": {
|
|
"collapsed": false
|
|
},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"\n",
|
|
" .d88888b. 888b d888 .d8888b.\n",
|
|
" d88P\" \"Y88b 8888b d8888 d88P Y88b\n",
|
|
" 888 888 88888b.d88888 888 888\n",
|
|
" 888 888 88888b. .d88b. 88888b. 888Y88888P888 888 \n",
|
|
" 888 888 888 \"88b d8P Y8b 888 \"88b 888 Y888P 888 888 \n",
|
|
" 888 888 888 888 88888888 888 888 888 Y8P 888 888 888\n",
|
|
" Y88b. .d88P 888 d88P Y8b. 888 888 888 \" 888 Y88b d88P\n",
|
|
" \"Y88888P\" 88888P\" \"Y8888 888 888 888 888 \"Y8888P\"\n",
|
|
"__________________888______________________________________________________\n",
|
|
" 888\n",
|
|
" 888\n",
|
|
"\n",
|
|
" Copyright: 2011-2015 Massachusetts Institute of Technology\n",
|
|
" License: http://mit-crpg.github.io/openmc/license.html\n",
|
|
" Version: 0.7.0\n",
|
|
" Git SHA1: c4b14a5ef87f004528d35cbf33fef3ed15a386ca\n",
|
|
" Date/Time: 2015-11-30 21:20:07\n",
|
|
" MPI Processes: 1\n",
|
|
"\n",
|
|
" ===========================================================================\n",
|
|
" ========================> INITIALIZATION <=========================\n",
|
|
" ===========================================================================\n",
|
|
"\n",
|
|
" Reading settings XML file...\n",
|
|
" Reading cross sections XML file...\n",
|
|
" Reading geometry XML file...\n",
|
|
" Reading materials XML file...\n",
|
|
" Reading tallies XML file...\n",
|
|
" Building neighboring cells lists for each surface...\n",
|
|
" Loading ACE cross section table: 92235.71c\n",
|
|
" Loading ACE cross section table: 92238.71c\n",
|
|
" Loading ACE cross section table: 8016.71c\n",
|
|
" Loading ACE cross section table: 1001.71c\n",
|
|
" Loading ACE cross section table: 5010.71c\n",
|
|
" Loading ACE cross section table: 40090.71c\n",
|
|
" Maximum neutron transport energy: 20.0000 MeV for 92235.71c\n",
|
|
" Initializing source particles...\n",
|
|
"\n",
|
|
" ===========================================================================\n",
|
|
" ====================> K EIGENVALUE SIMULATION <====================\n",
|
|
" ===========================================================================\n",
|
|
"\n",
|
|
" Bat./Gen. k Average k \n",
|
|
" ========= ======== ==================== \n",
|
|
" 1/1 1.02650 \n",
|
|
" 2/1 1.01386 \n",
|
|
" 3/1 1.01045 \n",
|
|
" 4/1 1.05511 \n",
|
|
" 5/1 1.04873 \n",
|
|
" 6/1 1.04558 \n",
|
|
" 7/1 1.03840 \n",
|
|
" 8/1 1.02086 \n",
|
|
" 9/1 1.08845 \n",
|
|
" 10/1 1.03932 \n",
|
|
" 11/1 1.01271 \n",
|
|
" 12/1 1.03448 1.02360 +/- 0.01088\n",
|
|
" 13/1 1.04395 1.03038 +/- 0.00925\n",
|
|
" 14/1 1.05477 1.03648 +/- 0.00894\n",
|
|
" 15/1 1.00485 1.03015 +/- 0.00938\n",
|
|
" 16/1 1.04523 1.03267 +/- 0.00806\n",
|
|
" 17/1 1.01328 1.02990 +/- 0.00735\n",
|
|
" 18/1 1.01476 1.02800 +/- 0.00664\n",
|
|
" 19/1 1.01490 1.02655 +/- 0.00604\n",
|
|
" 20/1 1.00926 1.02482 +/- 0.00567\n",
|
|
" 21/1 0.98504 1.02120 +/- 0.00627\n",
|
|
" 22/1 1.00397 1.01977 +/- 0.00591\n",
|
|
" 23/1 1.02556 1.02021 +/- 0.00545\n",
|
|
" 24/1 0.99808 1.01863 +/- 0.00529\n",
|
|
" 25/1 0.99638 1.01715 +/- 0.00514\n",
|
|
" 26/1 0.99615 1.01584 +/- 0.00499\n",
|
|
" 27/1 1.01843 1.01599 +/- 0.00469\n",
|
|
" 28/1 1.00315 1.01528 +/- 0.00447\n",
|
|
" 29/1 1.00633 1.01480 +/- 0.00426\n",
|
|
" 30/1 1.02159 1.01514 +/- 0.00405\n",
|
|
" 31/1 1.03395 1.01604 +/- 0.00396\n",
|
|
" 32/1 1.02672 1.01652 +/- 0.00381\n",
|
|
" 33/1 1.03778 1.01745 +/- 0.00375\n",
|
|
" 34/1 1.03807 1.01831 +/- 0.00369\n",
|
|
" 35/1 1.07854 1.02072 +/- 0.00428\n",
|
|
" 36/1 1.03524 1.02128 +/- 0.00415\n",
|
|
" 37/1 1.03100 1.02164 +/- 0.00401\n",
|
|
" 38/1 1.03853 1.02224 +/- 0.00391\n",
|
|
" 39/1 1.04089 1.02288 +/- 0.00383\n",
|
|
" 40/1 1.02150 1.02284 +/- 0.00370\n",
|
|
" 41/1 0.98470 1.02161 +/- 0.00379\n",
|
|
" 42/1 1.00658 1.02114 +/- 0.00370\n",
|
|
" 43/1 0.98652 1.02009 +/- 0.00373\n",
|
|
" 44/1 1.02787 1.02032 +/- 0.00363\n",
|
|
" 45/1 0.98800 1.01939 +/- 0.00364\n",
|
|
" 46/1 1.00286 1.01893 +/- 0.00357\n",
|
|
" 47/1 1.02559 1.01911 +/- 0.00348\n",
|
|
" 48/1 1.03729 1.01959 +/- 0.00342\n",
|
|
" 49/1 1.02538 1.01974 +/- 0.00333\n",
|
|
" 50/1 1.01478 1.01962 +/- 0.00325\n",
|
|
" Creating state point statepoint.50.h5...\n",
|
|
"\n",
|
|
" ===========================================================================\n",
|
|
" ======================> SIMULATION FINISHED <======================\n",
|
|
" ===========================================================================\n",
|
|
"\n",
|
|
"\n",
|
|
" =======================> TIMING STATISTICS <=======================\n",
|
|
"\n",
|
|
" Total time for initialization = 4.2800E-01 seconds\n",
|
|
" Reading cross sections = 9.1000E-02 seconds\n",
|
|
" Total time in simulation = 4.1240E+01 seconds\n",
|
|
" Time in transport only = 4.1215E+01 seconds\n",
|
|
" Time in inactive batches = 4.0230E+00 seconds\n",
|
|
" Time in active batches = 3.7217E+01 seconds\n",
|
|
" Time synchronizing fission bank = 8.0000E-03 seconds\n",
|
|
" Sampling source sites = 6.0000E-03 seconds\n",
|
|
" SEND/RECV source sites = 2.0000E-03 seconds\n",
|
|
" Time accumulating tallies = 2.0000E-03 seconds\n",
|
|
" Total time for finalization = 0.0000E+00 seconds\n",
|
|
" Total time elapsed = 4.1683E+01 seconds\n",
|
|
" Calculation Rate (inactive) = 6214.27 neutrons/second\n",
|
|
" Calculation Rate (active) = 2686.94 neutrons/second\n",
|
|
"\n",
|
|
" ============================> RESULTS <============================\n",
|
|
"\n",
|
|
" k-effective (Collision) = 1.01805 +/- 0.00261\n",
|
|
" k-effective (Track-length) = 1.01962 +/- 0.00325\n",
|
|
" k-effective (Absorption) = 1.01554 +/- 0.00339\n",
|
|
" Combined k-effective = 1.01711 +/- 0.00235\n",
|
|
" Leakage Fraction = 0.00000 +/- 0.00000\n",
|
|
"\n"
|
|
]
|
|
},
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"0"
|
|
]
|
|
},
|
|
"execution_count": 26,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Run OpenMC\n",
|
|
"executor.run_simulation()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Tally Data Processing"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Our simulation ran successfully and created statepoint and summary output files. We begin our analysis by instantiating a `StatePoint` object. "
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 27,
|
|
"metadata": {
|
|
"collapsed": false
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Load the last statepoint file\n",
|
|
"sp = openmc.StatePoint('statepoint.50.h5')"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"In addition to the statepoint file, our simulation also created a summary file which encapsulates information about the materials and geometry. This is necessary for the `openmc.mgxs` module to properly process the tally data. We first create a `Summary` object and link it with the statepoint."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 28,
|
|
"metadata": {
|
|
"collapsed": false
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"su = openmc.Summary('summary.h5')\n",
|
|
"sp.link_with_summary(su)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"The statepoint is now ready to be analyzed by the `Library`. We simply have to load the tallies from the statepoint into the `Library` and our `MGXS` objects will compute the cross sections for us under-the-hood."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 29,
|
|
"metadata": {
|
|
"collapsed": false
|
|
},
|
|
"outputs": [
|
|
{
|
|
"name": "stderr",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"/usr/local/lib/python2.7/dist-packages/openmc-0.7.0-py2.7.egg/openmc/tallies.py:1514: RuntimeWarning: invalid value encountered in true_divide\n",
|
|
"/usr/local/lib/python2.7/dist-packages/openmc-0.7.0-py2.7.egg/openmc/tallies.py:1515: RuntimeWarning: invalid value encountered in true_divide\n",
|
|
"/usr/local/lib/python2.7/dist-packages/openmc-0.7.0-py2.7.egg/openmc/tallies.py:1516: RuntimeWarning: invalid value encountered in true_divide\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"# Initialize MGXS Library with OpenMC statepoint data\n",
|
|
"mgxs_lib.load_from_statepoint(sp)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Voila! Our multi-group cross sections are now ready to rock 'n roll!"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Extracting and Storing MGXS Data"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"The `Library` supports a rich API to automate a variety of tasks, including multi-group cross section data retrieval and storage. We will highlight a few of these features here. First, the `Library.get_mgxs(...)` method allows one to extract an `MGXS` object from the `Library` for a particular domain and cross section type. The following cell illustrates how one may extract the `NuFissionXS` object for the fuel cell.\n",
|
|
"\n",
|
|
"**Note:** The `MGXS.get_mgxs(...)` method will accept either the domain *or* the integer domain ID of interest."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 30,
|
|
"metadata": {
|
|
"collapsed": false
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Retrieve the NuFissionXS object for the fuel cell from the library\n",
|
|
"fuel_mgxs = mgxs_lib.get_mgxs(fuel_cell, 'nu-fission')"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"The `NuFissionXS` object supports all of the methods described previously the `openmc.mgxs` tutorials, such as [Pandas](http://pandas.pydata.org/) `DataFrames`:"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 31,
|
|
"metadata": {
|
|
"collapsed": false
|
|
},
|
|
"outputs": [
|
|
{
|
|
"name": "stderr",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"/usr/local/lib/python2.7/dist-packages/openmc-0.7.0-py2.7.egg/openmc/mgxs/mgxs.py:1254: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison\n"
|
|
]
|
|
},
|
|
{
|
|
"data": {
|
|
"text/html": [
|
|
"<div>\n",
|
|
"<table border=\"1\" class=\"dataframe\">\n",
|
|
" <thead>\n",
|
|
" <tr style=\"text-align: right;\">\n",
|
|
" <th></th>\n",
|
|
" <th>cell</th>\n",
|
|
" <th>group in</th>\n",
|
|
" <th>nuclide</th>\n",
|
|
" <th>mean</th>\n",
|
|
" <th>std. dev.</th>\n",
|
|
" </tr>\n",
|
|
" </thead>\n",
|
|
" <tbody>\n",
|
|
" <tr>\n",
|
|
" <th>3</th>\n",
|
|
" <td>10000</td>\n",
|
|
" <td>1</td>\n",
|
|
" <td>U-235</td>\n",
|
|
" <td>8.063513e-03</td>\n",
|
|
" <td>4.062984e-05</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>4</th>\n",
|
|
" <td>10000</td>\n",
|
|
" <td>1</td>\n",
|
|
" <td>U-238</td>\n",
|
|
" <td>7.335515e-03</td>\n",
|
|
" <td>4.459335e-05</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>5</th>\n",
|
|
" <td>10000</td>\n",
|
|
" <td>1</td>\n",
|
|
" <td>O-16</td>\n",
|
|
" <td>0.000000e+00</td>\n",
|
|
" <td>0.000000e+00</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>0</th>\n",
|
|
" <td>10000</td>\n",
|
|
" <td>2</td>\n",
|
|
" <td>U-235</td>\n",
|
|
" <td>3.613274e-01</td>\n",
|
|
" <td>1.902492e-03</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>1</th>\n",
|
|
" <td>10000</td>\n",
|
|
" <td>2</td>\n",
|
|
" <td>U-238</td>\n",
|
|
" <td>6.738424e-07</td>\n",
|
|
" <td>3.536787e-09</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>2</th>\n",
|
|
" <td>10000</td>\n",
|
|
" <td>2</td>\n",
|
|
" <td>O-16</td>\n",
|
|
" <td>0.000000e+00</td>\n",
|
|
" <td>0.000000e+00</td>\n",
|
|
" </tr>\n",
|
|
" </tbody>\n",
|
|
"</table>\n",
|
|
"</div>"
|
|
],
|
|
"text/plain": [
|
|
" cell group in nuclide mean std. dev.\n",
|
|
"3 10000 1 U-235 8.063513e-03 4.062984e-05\n",
|
|
"4 10000 1 U-238 7.335515e-03 4.459335e-05\n",
|
|
"5 10000 1 O-16 0.000000e+00 0.000000e+00\n",
|
|
"0 10000 2 U-235 3.613274e-01 1.902492e-03\n",
|
|
"1 10000 2 U-238 6.738424e-07 3.536787e-09\n",
|
|
"2 10000 2 O-16 0.000000e+00 0.000000e+00"
|
|
]
|
|
},
|
|
"execution_count": 31,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"df = fuel_mgxs.get_pandas_dataframe()\n",
|
|
"df"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Similarly, we can use the `MGXS.print_xs(...)` method to view a string representation of the multi-group cross section data."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 32,
|
|
"metadata": {
|
|
"collapsed": false
|
|
},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"Multi-Group XS\n",
|
|
"\tReaction Type =\tnu-fission\n",
|
|
"\tDomain Type =\tcell\n",
|
|
"\tDomain ID =\t10000\n",
|
|
"\tNuclide =\tU-235\n",
|
|
"\tCross Sections [cm^-1]:\n",
|
|
" Group 1 [6.25e-07 - 20.0 MeV]:\t8.06e-03 +/- 5.04e-01%\n",
|
|
" Group 2 [0.0 - 6.25e-07 MeV]:\t3.61e-01 +/- 5.27e-01%\n",
|
|
"\n",
|
|
"\tNuclide =\tU-238\n",
|
|
"\tCross Sections [cm^-1]:\n",
|
|
" Group 1 [6.25e-07 - 20.0 MeV]:\t7.34e-03 +/- 6.08e-01%\n",
|
|
" Group 2 [0.0 - 6.25e-07 MeV]:\t6.74e-07 +/- 5.25e-01%\n",
|
|
"\n",
|
|
"\tNuclide =\tO-16\n",
|
|
"\tCross Sections [cm^-1]:\n",
|
|
" Group 1 [6.25e-07 - 20.0 MeV]:\t0.00e+00 +/- nan%\n",
|
|
" Group 2 [0.0 - 6.25e-07 MeV]:\t0.00e+00 +/- nan%\n",
|
|
"\n",
|
|
"\n",
|
|
"\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"fuel_mgxs.print_xs()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"One can export the entire `Library` to HDF5 with the `Library.build_hdf5_store(...)` method as follows:"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 33,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Store the cross section data in an \"mgxs/mgxs.h5\" HDF5 binary file\n",
|
|
"mgxs_lib.build_hdf5_store(filename='mgxs.h5', directory='mgxs')"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"The HDF5 store will contain the numerical multi-group cross section data indexed by domain, nuclide and cross section type. Some data workflows may be optimized by storing and retrieving binary representations of the `MGXS` objects in the `Library`. This feature is supported through the `Library.dump_to_file(...)` and `Library.load_from_file(...)` routines which use Python's [`pickle`](https://docs.python.org/2/library/pickle.html) module. This is illustrated as follows."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 34,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Store a Library and its MGXS objects in a pickled binary file \"mgxs/mgxs.pkl\"\n",
|
|
"mgxs_lib.dump_to_file(filename='mgxs', directory='mgxs')"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 35,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Instantiate a new MGXS Library from the pickled binary file \"mgxs/mgxs.pkl\"\n",
|
|
"mgxs_lib = openmc.mgxs.Library.load_from_file(filename='mgxs', directory='mgxs')"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"The `Library` class may be used to leverage the energy condensation features supported by the `MGXS` class. In particular, one can use the `Library.get_condensed_library(...)` with a coarse group structure which is a subset of the original \"fine\" group structure as shown below."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 36,
|
|
"metadata": {
|
|
"collapsed": true
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Create a 1-group structure\n",
|
|
"coarse_groups = openmc.mgxs.EnergyGroups(group_edges=[0., 20.])\n",
|
|
"\n",
|
|
"# Create a new MGXS Library on the coarse 1-group structure\n",
|
|
"coarse_mgxs_lib = mgxs_lib.get_condensed_library(coarse_groups)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 37,
|
|
"metadata": {
|
|
"collapsed": false
|
|
},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/html": [
|
|
"<div>\n",
|
|
"<table border=\"1\" class=\"dataframe\">\n",
|
|
" <thead>\n",
|
|
" <tr style=\"text-align: right;\">\n",
|
|
" <th></th>\n",
|
|
" <th>cell</th>\n",
|
|
" <th>group in</th>\n",
|
|
" <th>nuclide</th>\n",
|
|
" <th>mean</th>\n",
|
|
" <th>std. dev.</th>\n",
|
|
" </tr>\n",
|
|
" </thead>\n",
|
|
" <tbody>\n",
|
|
" <tr>\n",
|
|
" <th>0</th>\n",
|
|
" <td>10000</td>\n",
|
|
" <td>1</td>\n",
|
|
" <td>U-235</td>\n",
|
|
" <td>0.074383</td>\n",
|
|
" <td>0.000280</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>1</th>\n",
|
|
" <td>10000</td>\n",
|
|
" <td>1</td>\n",
|
|
" <td>U-238</td>\n",
|
|
" <td>0.005959</td>\n",
|
|
" <td>0.000036</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>2</th>\n",
|
|
" <td>10000</td>\n",
|
|
" <td>1</td>\n",
|
|
" <td>O-16</td>\n",
|
|
" <td>0.000000</td>\n",
|
|
" <td>0.000000</td>\n",
|
|
" </tr>\n",
|
|
" </tbody>\n",
|
|
"</table>\n",
|
|
"</div>"
|
|
],
|
|
"text/plain": [
|
|
" cell group in nuclide mean std. dev.\n",
|
|
"0 10000 1 U-235 0.074383 0.000280\n",
|
|
"1 10000 1 U-238 0.005959 0.000036\n",
|
|
"2 10000 1 O-16 0.000000 0.000000"
|
|
]
|
|
},
|
|
"execution_count": 37,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Retrieve the NuFissionXS object for the fuel cell from the 1-group library\n",
|
|
"coarse_fuel_mgxs = coarse_mgxs_lib.get_mgxs(fuel_cell, 'nu-fission')\n",
|
|
"\n",
|
|
"# Show the Pandas DataFrame for the 1-group MGXS\n",
|
|
"coarse_fuel_mgxs.get_pandas_dataframe()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Verification with OpenMOC"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Of course it is always a good idea to verify that one's cross sections are accurate. We can easily do so here with the deterministic transport code [OpenMOC](https://mit-crpg.github.io/OpenMOC/). We will extract an OpenCG geometry from the summary file and convert it into an equivalent OpenMOC geometry."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 38,
|
|
"metadata": {
|
|
"collapsed": false
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Create an OpenMOC Geometry from the OpenCG Geometry\n",
|
|
"openmoc_geometry = get_openmoc_geometry(mgxs_lib.opencg_geometry)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Now, we can inject the multi-group cross sections into the equivalent fuel assembly OpenMOC geometry. The `openmoc.materialize` module supports the loading of `Library` objects from OpenMC as illustrated below."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 39,
|
|
"metadata": {
|
|
"collapsed": false
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Load the library into the OpenMOC geometry\n",
|
|
"materials = load_openmc_mgxs_lib(mgxs_lib, openmoc_geometry)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"We are now ready to run OpenMOC to verify our cross-sections from OpenMC."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 40,
|
|
"metadata": {
|
|
"collapsed": false,
|
|
"scrolled": true
|
|
},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"[ NORMAL ] Ray tracing for track segmentation...\n",
|
|
"[ NORMAL ] Dumping tracks to file...\n",
|
|
"[ NORMAL ] Computing the eigenvalue...\n",
|
|
"[ NORMAL ] Iteration 0:\tk_eff = 0.854316\tres = 0.000E+00\n",
|
|
"[ NORMAL ] Iteration 1:\tk_eff = 0.801593\tres = 1.522E-01\n",
|
|
"[ NORMAL ] Iteration 2:\tk_eff = 0.761131\tres = 6.380E-02\n",
|
|
"[ NORMAL ] Iteration 3:\tk_eff = 0.731467\tres = 5.066E-02\n",
|
|
"[ NORMAL ] Iteration 4:\tk_eff = 0.709897\tres = 3.910E-02\n",
|
|
"[ NORMAL ] Iteration 5:\tk_eff = 0.695110\tres = 2.954E-02\n",
|
|
"[ NORMAL ] Iteration 6:\tk_eff = 0.685966\tres = 2.085E-02\n",
|
|
"[ NORMAL ] Iteration 7:\tk_eff = 0.681511\tres = 1.317E-02\n",
|
|
"[ NORMAL ] Iteration 8:\tk_eff = 0.680926\tres = 6.520E-03\n",
|
|
"[ NORMAL ] Iteration 9:\tk_eff = 0.683509\tres = 1.046E-03\n",
|
|
"[ NORMAL ] Iteration 10:\tk_eff = 0.688659\tres = 3.848E-03\n",
|
|
"[ NORMAL ] Iteration 11:\tk_eff = 0.695860\tres = 7.565E-03\n",
|
|
"[ NORMAL ] Iteration 12:\tk_eff = 0.704674\tres = 1.048E-02\n",
|
|
"[ NORMAL ] Iteration 13:\tk_eff = 0.714726\tres = 1.269E-02\n",
|
|
"[ NORMAL ] Iteration 14:\tk_eff = 0.725700\tres = 1.428E-02\n",
|
|
"[ NORMAL ] Iteration 15:\tk_eff = 0.737329\tres = 1.537E-02\n",
|
|
"[ NORMAL ] Iteration 16:\tk_eff = 0.749388\tres = 1.604E-02\n",
|
|
"[ NORMAL ] Iteration 17:\tk_eff = 0.761690\tres = 1.637E-02\n",
|
|
"[ NORMAL ] Iteration 18:\tk_eff = 0.774081\tres = 1.643E-02\n",
|
|
"[ NORMAL ] Iteration 19:\tk_eff = 0.786432\tres = 1.628E-02\n",
|
|
"[ NORMAL ] Iteration 20:\tk_eff = 0.798638\tres = 1.597E-02\n",
|
|
"[ NORMAL ] Iteration 21:\tk_eff = 0.810618\tres = 1.553E-02\n",
|
|
"[ NORMAL ] Iteration 22:\tk_eff = 0.822303\tres = 1.501E-02\n",
|
|
"[ NORMAL ] Iteration 23:\tk_eff = 0.833643\tres = 1.443E-02\n",
|
|
"[ NORMAL ] Iteration 24:\tk_eff = 0.844598\tres = 1.380E-02\n",
|
|
"[ NORMAL ] Iteration 25:\tk_eff = 0.855140\tres = 1.315E-02\n",
|
|
"[ NORMAL ] Iteration 26:\tk_eff = 0.865249\tres = 1.249E-02\n",
|
|
"[ NORMAL ] Iteration 27:\tk_eff = 0.874914\tres = 1.183E-02\n",
|
|
"[ NORMAL ] Iteration 28:\tk_eff = 0.884128\tres = 1.118E-02\n",
|
|
"[ NORMAL ] Iteration 29:\tk_eff = 0.892891\tres = 1.054E-02\n",
|
|
"[ NORMAL ] Iteration 30:\tk_eff = 0.901206\tres = 9.920E-03\n",
|
|
"[ NORMAL ] Iteration 31:\tk_eff = 0.909080\tres = 9.320E-03\n",
|
|
"[ NORMAL ] Iteration 32:\tk_eff = 0.916523\tres = 8.745E-03\n",
|
|
"[ NORMAL ] Iteration 33:\tk_eff = 0.923546\tres = 8.194E-03\n",
|
|
"[ NORMAL ] Iteration 34:\tk_eff = 0.930162\tres = 7.669E-03\n",
|
|
"[ NORMAL ] Iteration 35:\tk_eff = 0.936387\tres = 7.171E-03\n",
|
|
"[ NORMAL ] Iteration 36:\tk_eff = 0.942236\tres = 6.698E-03\n",
|
|
"[ NORMAL ] Iteration 37:\tk_eff = 0.947725\tres = 6.252E-03\n",
|
|
"[ NORMAL ] Iteration 38:\tk_eff = 0.952869\tres = 5.830E-03\n",
|
|
"[ NORMAL ] Iteration 39:\tk_eff = 0.957687\tres = 5.433E-03\n",
|
|
"[ NORMAL ] Iteration 40:\tk_eff = 0.962193\tres = 5.060E-03\n",
|
|
"[ NORMAL ] Iteration 41:\tk_eff = 0.966404\tres = 4.710E-03\n",
|
|
"[ NORMAL ] Iteration 42:\tk_eff = 0.970337\tres = 4.381E-03\n",
|
|
"[ NORMAL ] Iteration 43:\tk_eff = 0.974006\tres = 4.073E-03\n",
|
|
"[ NORMAL ] Iteration 44:\tk_eff = 0.977426\tres = 3.785E-03\n",
|
|
"[ NORMAL ] Iteration 45:\tk_eff = 0.980613\tres = 3.515E-03\n",
|
|
"[ NORMAL ] Iteration 46:\tk_eff = 0.983580\tres = 3.264E-03\n",
|
|
"[ NORMAL ] Iteration 47:\tk_eff = 0.986341\tres = 3.029E-03\n",
|
|
"[ NORMAL ] Iteration 48:\tk_eff = 0.988908\tres = 2.809E-03\n",
|
|
"[ NORMAL ] Iteration 49:\tk_eff = 0.991293\tres = 2.605E-03\n",
|
|
"[ NORMAL ] Iteration 50:\tk_eff = 0.993509\tres = 2.415E-03\n",
|
|
"[ NORMAL ] Iteration 51:\tk_eff = 0.995566\tres = 2.238E-03\n",
|
|
"[ NORMAL ] Iteration 52:\tk_eff = 0.997475\tres = 2.073E-03\n",
|
|
"[ NORMAL ] Iteration 53:\tk_eff = 0.999246\tres = 1.920E-03\n",
|
|
"[ NORMAL ] Iteration 54:\tk_eff = 1.000888\tres = 1.777E-03\n",
|
|
"[ NORMAL ] Iteration 55:\tk_eff = 1.002409\tres = 1.645E-03\n",
|
|
"[ NORMAL ] Iteration 56:\tk_eff = 1.003818\tres = 1.522E-03\n",
|
|
"[ NORMAL ] Iteration 57:\tk_eff = 1.005123\tres = 1.408E-03\n",
|
|
"[ NORMAL ] Iteration 58:\tk_eff = 1.006331\tres = 1.302E-03\n",
|
|
"[ NORMAL ] Iteration 59:\tk_eff = 1.007450\tres = 1.203E-03\n",
|
|
"[ NORMAL ] Iteration 60:\tk_eff = 1.008484\tres = 1.112E-03\n",
|
|
"[ NORMAL ] Iteration 61:\tk_eff = 1.009440\tres = 1.028E-03\n",
|
|
"[ NORMAL ] Iteration 62:\tk_eff = 1.010324\tres = 9.496E-04\n",
|
|
"[ NORMAL ] Iteration 63:\tk_eff = 1.011141\tres = 8.771E-04\n",
|
|
"[ NORMAL ] Iteration 64:\tk_eff = 1.011897\tres = 8.100E-04\n",
|
|
"[ NORMAL ] Iteration 65:\tk_eff = 1.012594\tres = 7.478E-04\n",
|
|
"[ NORMAL ] Iteration 66:\tk_eff = 1.013238\tres = 6.903E-04\n",
|
|
"[ NORMAL ] Iteration 67:\tk_eff = 1.013833\tres = 6.371E-04\n",
|
|
"[ NORMAL ] Iteration 68:\tk_eff = 1.014382\tres = 5.879E-04\n",
|
|
"[ NORMAL ] Iteration 69:\tk_eff = 1.014889\tres = 5.424E-04\n",
|
|
"[ NORMAL ] Iteration 70:\tk_eff = 1.015357\tres = 5.004E-04\n",
|
|
"[ NORMAL ] Iteration 71:\tk_eff = 1.015789\tres = 4.615E-04\n",
|
|
"[ NORMAL ] Iteration 72:\tk_eff = 1.016187\tres = 4.255E-04\n",
|
|
"[ NORMAL ] Iteration 73:\tk_eff = 1.016554\tres = 3.923E-04\n",
|
|
"[ NORMAL ] Iteration 74:\tk_eff = 1.016892\tres = 3.617E-04\n",
|
|
"[ NORMAL ] Iteration 75:\tk_eff = 1.017204\tres = 3.333E-04\n",
|
|
"[ NORMAL ] Iteration 76:\tk_eff = 1.017492\tres = 3.072E-04\n",
|
|
"[ NORMAL ] Iteration 77:\tk_eff = 1.017757\tres = 2.831E-04\n",
|
|
"[ NORMAL ] Iteration 78:\tk_eff = 1.018001\tres = 2.608E-04\n",
|
|
"[ NORMAL ] Iteration 79:\tk_eff = 1.018226\tres = 2.403E-04\n",
|
|
"[ NORMAL ] Iteration 80:\tk_eff = 1.018433\tres = 2.213E-04\n",
|
|
"[ NORMAL ] Iteration 81:\tk_eff = 1.018624\tres = 2.038E-04\n",
|
|
"[ NORMAL ] Iteration 82:\tk_eff = 1.018800\tres = 1.877E-04\n",
|
|
"[ NORMAL ] Iteration 83:\tk_eff = 1.018962\tres = 1.728E-04\n",
|
|
"[ NORMAL ] Iteration 84:\tk_eff = 1.019110\tres = 1.591E-04\n",
|
|
"[ NORMAL ] Iteration 85:\tk_eff = 1.019248\tres = 1.465E-04\n",
|
|
"[ NORMAL ] Iteration 86:\tk_eff = 1.019374\tres = 1.348E-04\n",
|
|
"[ NORMAL ] Iteration 87:\tk_eff = 1.019490\tres = 1.241E-04\n",
|
|
"[ NORMAL ] Iteration 88:\tk_eff = 1.019597\tres = 1.142E-04\n",
|
|
"[ NORMAL ] Iteration 89:\tk_eff = 1.019695\tres = 1.051E-04\n",
|
|
"[ NORMAL ] Iteration 90:\tk_eff = 1.019786\tres = 9.670E-05\n",
|
|
"[ NORMAL ] Iteration 91:\tk_eff = 1.019869\tres = 8.895E-05\n",
|
|
"[ NORMAL ] Iteration 92:\tk_eff = 1.019946\tres = 8.183E-05\n",
|
|
"[ NORMAL ] Iteration 93:\tk_eff = 1.020016\tres = 7.528E-05\n",
|
|
"[ NORMAL ] Iteration 94:\tk_eff = 1.020081\tres = 6.922E-05\n",
|
|
"[ NORMAL ] Iteration 95:\tk_eff = 1.020141\tres = 6.368E-05\n",
|
|
"[ NORMAL ] Iteration 96:\tk_eff = 1.020195\tres = 5.857E-05\n",
|
|
"[ NORMAL ] Iteration 97:\tk_eff = 1.020246\tres = 5.385E-05\n",
|
|
"[ NORMAL ] Iteration 98:\tk_eff = 1.020292\tres = 4.954E-05\n",
|
|
"[ NORMAL ] Iteration 99:\tk_eff = 1.020335\tres = 4.553E-05\n",
|
|
"[ NORMAL ] Iteration 100:\tk_eff = 1.020374\tres = 4.185E-05\n",
|
|
"[ NORMAL ] Iteration 101:\tk_eff = 1.020410\tres = 3.848E-05\n",
|
|
"[ NORMAL ] Iteration 102:\tk_eff = 1.020443\tres = 3.537E-05\n",
|
|
"[ NORMAL ] Iteration 103:\tk_eff = 1.020474\tres = 3.253E-05\n",
|
|
"[ NORMAL ] Iteration 104:\tk_eff = 1.020502\tres = 2.989E-05\n",
|
|
"[ NORMAL ] Iteration 105:\tk_eff = 1.020527\tres = 2.746E-05\n",
|
|
"[ NORMAL ] Iteration 106:\tk_eff = 1.020551\tres = 2.526E-05\n",
|
|
"[ NORMAL ] Iteration 107:\tk_eff = 1.020573\tres = 2.319E-05\n",
|
|
"[ NORMAL ] Iteration 108:\tk_eff = 1.020593\tres = 2.134E-05\n",
|
|
"[ NORMAL ] Iteration 109:\tk_eff = 1.020611\tres = 1.960E-05\n",
|
|
"[ NORMAL ] Iteration 110:\tk_eff = 1.020628\tres = 1.800E-05\n",
|
|
"[ NORMAL ] Iteration 111:\tk_eff = 1.020643\tres = 1.652E-05\n",
|
|
"[ NORMAL ] Iteration 112:\tk_eff = 1.020657\tres = 1.518E-05\n",
|
|
"[ NORMAL ] Iteration 113:\tk_eff = 1.020670\tres = 1.398E-05\n",
|
|
"[ NORMAL ] Iteration 114:\tk_eff = 1.020682\tres = 1.283E-05\n",
|
|
"[ NORMAL ] Iteration 115:\tk_eff = 1.020693\tres = 1.178E-05\n",
|
|
"[ NORMAL ] Iteration 116:\tk_eff = 1.020704\tres = 1.083E-05\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"# Generate tracks for OpenMOC\n",
|
|
"openmoc_geometry.initializeFlatSourceRegions()\n",
|
|
"track_generator = openmoc.TrackGenerator(openmoc_geometry, num_azim=32, spacing=0.1)\n",
|
|
"track_generator.generateTracks()\n",
|
|
"\n",
|
|
"# Run OpenMOC\n",
|
|
"solver = openmoc.CPUSolver(track_generator)\n",
|
|
"solver.computeEigenvalue()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"We report the eigenvalues computed by OpenMC and OpenMOC here together to summarize our results."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 41,
|
|
"metadata": {
|
|
"collapsed": false
|
|
},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"openmc keff = 1.017105\n",
|
|
"openmoc keff = 1.020704\n",
|
|
"bias [pcm]: 359.8\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"# Print report of keff and bias with OpenMC\n",
|
|
"openmoc_keff = solver.getKeff()\n",
|
|
"openmc_keff = sp.k_combined[0]\n",
|
|
"bias = (openmoc_keff - openmc_keff) * 1e5\n",
|
|
"\n",
|
|
"print('openmc keff = {0:1.6f}'.format(openmc_keff))\n",
|
|
"print('openmoc keff = {0:1.6f}'.format(openmoc_keff))\n",
|
|
"print('bias [pcm]: {0:1.1f}'.format(bias))"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"There is a non-trivial bias between the eigenvalues computed by OpenMC and OpenMOC. One can show that these biases do not converge to <100 pcm with more particle histories. For heterogeneous geometries, additional measures must be taken to address the following three sources of bias:\n",
|
|
"\n",
|
|
"* Appropriate transport-corrected cross sections\n",
|
|
"* Spatial discretization of OpenMOC's mesh\n",
|
|
"* Constant-in-angle multi-group cross sections"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Flux and Pin Power Visualizations"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"We will conclude this tutorial by illustrating how to visualize the fission rates computed by OpenMOC and OpenMC. First, we extract volume-integrated fission rates from OpenMC's mesh fission rate tally for each pin cell in the fuel assembly."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 42,
|
|
"metadata": {
|
|
"collapsed": false
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Get the OpenMC fission rate mesh tally data\n",
|
|
"mesh_tally = sp.get_tally(name='mesh tally')\n",
|
|
"openmc_fission_rates = mesh_tally.get_values(scores=['nu-fission'])\n",
|
|
"\n",
|
|
"# Reshape array to 2D for plotting\n",
|
|
"openmc_fission_rates.shape = (17,17)\n",
|
|
"\n",
|
|
"# Normalize to the average pin power\n",
|
|
"openmc_fission_rates /= np.mean(openmc_fission_rates)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Next, we extract OpenMOC's volume-averaged fission rates into a 2D 17x17 NumPy array."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 43,
|
|
"metadata": {
|
|
"collapsed": false
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"# Export OpenMOC's fission rates for each pin cell instance in the fuel assembly\n",
|
|
"openmoc.process.compute_fission_rates(solver)\n",
|
|
"\n",
|
|
"# Open the pickle file with the fission rates\n",
|
|
"fission_rates = pickle.load(open('fission-rates/fission-rates.pkl', 'rb' ))\n",
|
|
"\n",
|
|
"# Allocate array for fission rates in each fuel pin\n",
|
|
"openmoc_fission_rates = np.zeros((17, 17))\n",
|
|
"\n",
|
|
"# Extract fission rates for each fuel pin\n",
|
|
"for key, value in fission_rates.items():\n",
|
|
" lat_x = int(key.split(':')[1].split()[3][1:-1])\n",
|
|
" lat_y = int(key.split(':')[1].split()[4][:-1]) \n",
|
|
" openmoc_fission_rates[lat_x, lat_y] = value\n",
|
|
"\n",
|
|
"# Normalize to the average pin fission rate\n",
|
|
"openmoc_fission_rates /= np.mean(openmoc_fission_rates)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"Now we can easily use Matplotlib to visualize the fission rates from OpenMC and OpenMOC side-by-side."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 44,
|
|
"metadata": {
|
|
"collapsed": false
|
|
},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"<matplotlib.text.Text at 0x7fb9acb6fc10>"
|
|
]
|
|
},
|
|
"execution_count": 44,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
},
|
|
{
|
|
"data": {
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAWwAAADDCAYAAACmois2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGwRJREFUeJzt3XmYXFWZx/Fvp9MhnUASwpIN6MQxkADKJkFBpR/EGAYe\nBBcQUQlGB+ZBHFcQR6EBHVxQcUbkwdFgWIboOMMi40JAWyLIEoQoIBpIpwl00kBCOiEJJISaP95b\n1u1KVZ23q+tW1wm/z/PU07WcPufcW2+9de+te+4BEREREREREREREREREREREREREZHXtAuA/xzE\n/58O/LpGfRHJ0j7ABqBpEHVsAKbWpDdSM3OBPwMbgVXA94GxdWp7BfAysFvR8w8Br2JBlzcL+AXw\nArAGuA/reylzgW1YwOVv/16bLmeiHVveDcB64G/APw3g/zuBeTXvVVzmEkccHwn8Bnuf1wG3AjOL\n/m8McAXQjcXEE8B3StSf9yrwIoVYX1vdYtTNCmAT1tfVwHXYMnvMBRZn0qsKhtW7wTI+C3wt+TsG\neDPQBiwCWurQfg5YDpyWeu4NQGvyWt5bgDuB3wL/gAXuPwNzKtR9N7BL6vbJmvU6G89g/RwD/AuW\ncA5w/m8uXGSHFlMc/xq4CZgETAOWYrE6LSkzAov1mcC7sJh4C/A8ttFSzhspxPr4QS1N9nLACVhf\nD8LW1ZeGtEcRGIN9w72v6PnRwLPAmcnjDuBnwEJsq+BBLDjyJgP/k/zPcuDc1Gs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ndj0S9hJgOvbDzAjgVODWOrQ7GKOAXZL7o4HZxDOD9q3AGcn9M4Cbh7AvHjHPVK7Yrp/Y4hoiju3j\ngL9iP9BcMMR98ZiG/eL/MPAIjdvnG4EeYAt2LPVM7Nf/O2jM05+K+/tR4FrsFLOl2IcwlmOTeYrt\n2ostrmHHjG0RERERERERERERERERERERERERERERERGR+vh/6pWcKtkPGKMAAAAASUVORK5CYII=\n",
|
|
"text/plain": [
|
|
"<matplotlib.figure.Figure at 0x7fb9acc75890>"
|
|
]
|
|
},
|
|
"metadata": {},
|
|
"output_type": "display_data"
|
|
}
|
|
],
|
|
"source": [
|
|
"# Plot OpenMC's fission rates in the left subplot\n",
|
|
"fig = pylab.subplot(121)\n",
|
|
"pylab.imshow(openmc_fission_rates, interpolation='none', cmap='jet')\n",
|
|
"pylab.title('OpenMC Fission Rates')\n",
|
|
"\n",
|
|
"# Plot OpenMOC's fission rates in the right subplot\n",
|
|
"fig2 = pylab.subplot(122)\n",
|
|
"pylab.imshow(openmoc_fission_rates, interpolation='none', cmap='jet')\n",
|
|
"pylab.title('OpenMOC Fission Rates')"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Python 2",
|
|
"language": "python",
|
|
"name": "python2"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 2
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython2",
|
|
"version": "2.7.6"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 0
|
|
}
|