From b4391296dd8de227ba8e5d4a868aab1a79a714ff Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Sat, 18 Mar 2017 16:34:19 -0400 Subject: [PATCH 01/17] Added a model container and a keff search algorithm --- openmc/__init__.py | 2 + openmc/modelcontainer.py | 126 +++++++++++++++++++++++++++++++++++++++ openmc/search.py | 126 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 254 insertions(+) create mode 100644 openmc/modelcontainer.py create mode 100644 openmc/search.py diff --git a/openmc/__init__.py b/openmc/__init__.py index b355385580..4030063d9f 100644 --- a/openmc/__init__.py +++ b/openmc/__init__.py @@ -28,3 +28,5 @@ from openmc.summary import * from openmc.particle_restart import * from openmc.mixin import * from openmc.plotter import * +from openmc.search import * +from openmc.modelcontainer import * diff --git a/openmc/modelcontainer.py b/openmc/modelcontainer.py new file mode 100644 index 0000000000..384f3f84bf --- /dev/null +++ b/openmc/modelcontainer.py @@ -0,0 +1,126 @@ +import openmc +from openmc.checkvalue import check_type + + +class ModelContainer(object): + """OpenMC model container for the openmc.Geometry, openmc.Materials, + openmc.Settings, openmc.Tallies, and openmc.CMFD objects + + Parameters + ---------- + geometry : openmc.Geometry + Geometry information + materials : openmc.Materials + Materials information + settings : openmc.Settings + Settings information + tallies : openmc.Tallies + Tallies information, optional + cmfd : openmc.CMFD + CMFD information, optional + + Attributes + ---------- + geometry : openmc.Geometry + Geometry information + materials : openmc.Materials + Materials information + settings : openmc.Settings + Settings information + tallies : openmc.Tallies + Tallies information + cmfd : openmc.CMFD + CMFD information + + """ + + def __init__(self, geometry, materials, settings, tallies=None, cmfd=None): + self.geometry = geometry + self.materials = materials + self.settings = settings + if tallies: + self.tallies = tallies + else: + self._tallies = None + if cmfd: + self.cmfd = cmfd + else: + self._cmfd = None + + self.sp = None + + @property + def geometry(self): + return self._geometry + + @geometry.setter + def geometry(self, geometry): + check_type('geometry', geometry, openmc.Geometry) + self._geometry = geometry + + @property + def materials(self): + return self._materials + + @materials.setter + def materials(self, materials): + check_type('materials', materials, openmc.Materials) + self._materials = materials + + @property + def settings(self): + return self._settings + + @settings.setter + def settings(self, settings): + check_type('settings', settings, openmc.Settings) + self._settings = settings + + @property + def tallies(self): + return self._tallies + + @tallies.setter + def tallies(self, tallies): + check_type('tallies', tallies, openmc.Tallies) + self._tallies = tallies + + @property + def cmfd(self): + return self._cmfd + + @cmfd.setter + def cmfd(self, cmfd): + check_type('cmfd', cmfd, openmc.CMFD) + self._cmfd = cmfd + + def export_to_xml(self): + """Export model settings to XML files. + """ + + self.geometry.export_to_xml() + self.materials.export_to_xml() + self.settings.export_to_xml() + if self.tallies: + self.tallies.export_to_xml() + if self.cmfd: + self.cmfd.export_to_xml() + + def execute(self, output=True): + self.export_to_xml() + + openmc.run(output=output) + + statepoint_batches = self.settings.batches + if self.settings.statepoint is not None: + if 'batches' in self.settings.statepoint: + statepoint_batches = self.settings.statepoint['batches'][-1] + self.sp = openmc.StatePoint('statepoint.' + str(statepoint_batches) + + '.h5') + + return self.sp.k_combined + + def close(self): + if self.sp is not None: + self.sp._f.close() + self.sp.summary._f.close() diff --git a/openmc/search.py b/openmc/search.py new file mode 100644 index 0000000000..d99b427b00 --- /dev/null +++ b/openmc/search.py @@ -0,0 +1,126 @@ +from numbers import Real +from types import FunctionType +from inspect import getfullargspec + +import openmc +from openmc.checkvalue import check_type, check_length + + +class KeffSearch(object): + """Class to perform a search for a certain keff value given changes on an + arbitrary scalar input. + + Parameters + ---------- + model_builder : FunctionType + Callable function which builds a model according to a single, passed + parameter. This function must return an openmc.ModelContainer object. + guess : Real + Initial guess for the parameter modified in :param:`model_builder`. + target_keff : Real + keff value to search for, defaults to 1.0. + + Attributes + ---------- + model_builder : FunctionType + Callable function which builds a model according to a single, passed + parameter. This function must return an openmc.ModelContainer object. + guess : Real + Initial guess for the parameter modified in :param:`model_builder`. + target_keff : Real + keff value to search for. + guesses : List of Real + List of guesses attempted by the search + keffs : List of Real + List of keffs corresponding to the guess attempted by the search + keff_uncs : List of Real + List of keff uncertainties corresponding to the guess attempted by the + search + + """ + + def __init__(self, model_builder, guess, target_keff=1.0): + self.initial_guess = guess + self.model_builder = model_builder + self.target_keff = target_keff + self.guesses = [] + self.keffs = [] + self.keff_uncs = [] + + @property + def model_builder(self): + return self._model_builder + + @model_builder.setter + def model_builder(self, model_builder): + # Make sure model_builder is a function + check_type('model_builder', model_builder, FunctionType) + + # Make sure model_builder has only one parameter + argspec = getfullargspec(model_builder) + check_length('model_builder arguments', argspec.args, 1) + + # Run the model builder function once to make sure it provides the + # correct output types + model = model_builder(self.initial_guess) + check_type('model_builder return', model, openmc.ModelContainer) + self._model_builder = model_builder + + @property + def initial_guess(self): + return self._initial_guess + + @initial_guess.setter + def initial_guess(self, initial_guess): + self._initial_guess = initial_guess + + @property + def target_keff(self): + return self._target_keff + + @target_keff.setter + def target_keff(self, target_keff): + check_type('target_keff', target_keff, Real) + self._target_keff = target_keff + + def _search_function(self, guess): + # Build the model + model = self.model_builder(guess) + + # Run the model + keff = model.execute(output=False) + + # Close the model to ensure HDF5 will allow access during the next + # OpenMC execution + model.close() + + # Record the history + self.guesses.append(guess) + self.keffs.append(keff[0]) + self.keff_uncs.append(keff[1]) + + return (keff[0] - self.target_keff) + + def search(self, **kwargs): + """Searches for the target eigenvalue with the Newton-Raphson method + + Parameters + ---------- + **kwargs + Keyword arguments passed to :func:`scipy.optimize.newton`. + + Returns + zero_value : Real + Estimated value of the variable parameter where keff is the + targeted value + keff : Iterable of Real + keff calculated at the zero_value + + """ + + import scipy.optimize as sopt + + zero_value = sopt.newton(self._search_function, self.initial_guess, + **kwargs) + + return zero_value From 4b7a7e900b7a0611360c93ab525f0ae877cdd2f0 Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Sat, 18 Mar 2017 20:53:59 -0400 Subject: [PATCH 02/17] Moved the ModelContainer to models.Model, and allowed for brackets and choices on the solver methods --- openmc/__init__.py | 3 +- openmc/model/__init__.py | 1 + openmc/{modelcontainer.py => model/model.py} | 2 +- openmc/search.py | 151 ++++++++++++++++--- 4 files changed, 129 insertions(+), 28 deletions(-) rename openmc/{modelcontainer.py => model/model.py} (99%) diff --git a/openmc/__init__.py b/openmc/__init__.py index 4030063d9f..2f65d0317e 100644 --- a/openmc/__init__.py +++ b/openmc/__init__.py @@ -28,5 +28,4 @@ from openmc.summary import * from openmc.particle_restart import * from openmc.mixin import * from openmc.plotter import * -from openmc.search import * -from openmc.modelcontainer import * +from openmc.search import * \ No newline at end of file diff --git a/openmc/model/__init__.py b/openmc/model/__init__.py index ffb1f42820..557effcefa 100644 --- a/openmc/model/__init__.py +++ b/openmc/model/__init__.py @@ -1 +1,2 @@ from .triso import * +from .model import * diff --git a/openmc/modelcontainer.py b/openmc/model/model.py similarity index 99% rename from openmc/modelcontainer.py rename to openmc/model/model.py index 384f3f84bf..13868f339c 100644 --- a/openmc/modelcontainer.py +++ b/openmc/model/model.py @@ -2,7 +2,7 @@ import openmc from openmc.checkvalue import check_type -class ModelContainer(object): +class Model(object): """OpenMC model container for the openmc.Geometry, openmc.Materials, openmc.Settings, openmc.Tallies, and openmc.CMFD objects diff --git a/openmc/search.py b/openmc/search.py index d99b427b00..c2c8d2fa9e 100644 --- a/openmc/search.py +++ b/openmc/search.py @@ -1,34 +1,58 @@ from numbers import Real from types import FunctionType -from inspect import getfullargspec import openmc -from openmc.checkvalue import check_type, check_length +import openmc.model +from openmc.checkvalue import check_type, check_iterable_type, check_length, \ + check_value + + +_SCALAR_BRACKETED_METHODS = ['brentq', 'brentq', 'ridder', 'bisect'] class KeffSearch(object): - """Class to perform a search for a certain keff value given changes on an - arbitrary scalar input. + """Class to perform a keff search by modifying an arbitrarily parametrized + model. Parameters ---------- model_builder : FunctionType - Callable function which builds a model according to a single, passed - parameter. This function must return an openmc.ModelContainer object. - guess : Real - Initial guess for the parameter modified in :param:`model_builder`. - target_keff : Real + Callable function which builds a model according to a passed + parameter. This function must return an openmc.model.Model object. + guess : Real, optional + Initial guess for the parameter to be searched in + :param:`model_builder`. One of :param:`guess` or :param`bracket` must + be provided. + target_keff : Real, optional keff value to search for, defaults to 1.0. + bracket : None or Iterable of Real, optional + Bracketing interval to search for the solution; if not provided, + a generic non-bracketing method is used. If provided, the brackets + are used. Defaults to no brackets provided. One of :param:`guess` or + :param`bracket` must be provided. If both are provided, the bracket + will be preferentially used. Attributes ---------- model_builder : FunctionType - Callable function which builds a model according to a single, passed - parameter. This function must return an openmc.ModelContainer object. - guess : Real - Initial guess for the parameter modified in :param:`model_builder`. + Callable function which builds a model according to parameters passed. + This function must return an openmc.model.Model + object. + initial_guess : Iterable of Real + Initial guess for the parameter to be searched in + :param:`model_builder`. target_keff : Real keff value to search for. + bracket : None or Iterable of Real + Bracketing interval to search for the solution; if not provided, + a generic non-bracketing method is used. If provided, the brackets + are used. + print_iterations : bool + Whether or not to print the guess and the resultant keff during the + iteration process. Defaults to False. + print_output : bool + Whether or not to print the OpenMC output during the iterations. + Defaults to False. guesses : List of Real List of guesses attempted by the search keffs : List of Real @@ -39,13 +63,17 @@ class KeffSearch(object): """ - def __init__(self, model_builder, guess, target_keff=1.0): + def __init__(self, model_builder, guess=None, bracket=None, + target_keff=1.0): self.initial_guess = guess + self.bracket = bracket self.model_builder = model_builder self.target_keff = target_keff self.guesses = [] self.keffs = [] self.keff_uncs = [] + self.print_iterations = False + self.print_output = False @property def model_builder(self): @@ -56,14 +84,13 @@ class KeffSearch(object): # Make sure model_builder is a function check_type('model_builder', model_builder, FunctionType) - # Make sure model_builder has only one parameter - argspec = getfullargspec(model_builder) - check_length('model_builder arguments', argspec.args, 1) - # Run the model builder function once to make sure it provides the - # correct output types - model = model_builder(self.initial_guess) - check_type('model_builder return', model, openmc.ModelContainer) + # correct output type + if self.bracket is not None: + model = model_builder(self.bracket[0]) + elif self.initial_guess is not None: + model = model_builder(self.initial_guess) + check_type('model_builder return', model, openmc.model.Model) self._model_builder = model_builder @property @@ -72,8 +99,21 @@ class KeffSearch(object): @initial_guess.setter def initial_guess(self, initial_guess): + if initial_guess is not None: + check_type('initial_guess', initial_guess, Real) self._initial_guess = initial_guess + @property + def bracket(self): + return self._bracket + + @bracket.setter + def bracket(self, bracket): + if bracket is not None: + check_iterable_type('bracket', bracket, Real) + check_length('bracket', bracket, 2) + self._bracket = bracket + @property def target_keff(self): return self._target_keff @@ -83,12 +123,30 @@ class KeffSearch(object): check_type('target_keff', target_keff, Real) self._target_keff = target_keff + @property + def print_iterations(self): + return self._print_iterations + + @print_iterations.setter + def print_iterations(self, print_iterations): + check_type('print_iterations', print_iterations, bool) + self._print_iterations = print_iterations + + @property + def print_output(self): + return self._print_output + + @print_output.setter + def print_output(self, print_output): + check_type('print_output', print_output, bool) + self._print_output = print_output + def _search_function(self, guess): # Build the model model = self.model_builder(guess) # Run the model - keff = model.execute(output=False) + keff = model.execute(output=self._print_output) # Close the model to ensure HDF5 will allow access during the next # OpenMC execution @@ -99,13 +157,22 @@ class KeffSearch(object): self.keffs.append(keff[0]) self.keff_uncs.append(keff[1]) + if self._print_iterations: + print(guess, '{:1.5f} +/- {:1.5f}'.format(keff[0], keff[1])) + return (keff[0] - self.target_keff) - def search(self, **kwargs): + def search(self, tol=None, bracketed_method='brentq', **kwargs): """Searches for the target eigenvalue with the Newton-Raphson method Parameters ---------- + tol : Real + Tolerance to pass to the search method + bracketed_method : {'brentq', 'brenth', 'ridder', 'bisect'}, optional + Solution method to use; only applies if + :param:`bracket` is set, otherwise the Newton method is used. + Defaults to 'brentq'. **kwargs Keyword arguments passed to :func:`scipy.optimize.newton`. @@ -118,9 +185,43 @@ class KeffSearch(object): """ + check_value('bracketed_method', bracketed_method, + _SCALAR_BRACKETED_METHODS) + import scipy.optimize as sopt - zero_value = sopt.newton(self._search_function, self.initial_guess, - **kwargs) + if self.bracket is not None: + # Generate our arguments + args = {'f': self._search_function, 'a': self.bracket[0], + 'b': self.bracket[1]} + if tol is not None: + args['rtol'] = tol + + # Set the root finding method + if bracketed_method == 'brentq': + root_finder = sopt.brentq + elif bracketed_method == 'brenth': + root_finder = sopt.brenth + elif bracketed_method == 'ridder': + root_finder = sopt.ridder + elif bracketed_method == 'bisect': + root_finder = sopt.bisect + + elif self.initial_guess is not None: + + # Generate our arguments + args = {'func': self._search_function, 'x0': self.initial_guess} + if tol is not None: + args['tol'] = tol + + # Set the root finding method + root_finder = sopt.newton + + else: + raise ValueError("One of the 'bracket' or 'initial_guess' " + "parameters must be set") + + # Perform the search + zero_value = root_finder(**args, **kwargs) return zero_value From 0ebac7687d9dc600e34f2d8c017f6f1dd35d3a53 Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Sun, 19 Mar 2017 17:34:23 -0400 Subject: [PATCH 03/17] Added example notebook and incorporated some lessons learned in the code --- docs/source/examples/index.rst | 1 + docs/source/pythonapi/index.rst | 14 +++++++++++++ openmc/search.py | 37 +++++++++++++++++++++++++-------- 3 files changed, 43 insertions(+), 9 deletions(-) diff --git a/docs/source/examples/index.rst b/docs/source/examples/index.rst index c1117b4630..720909284c 100644 --- a/docs/source/examples/index.rst +++ b/docs/source/examples/index.rst @@ -23,4 +23,5 @@ features via the :ref:`pythonapi`. mg-mode-part-iii mdgxs-part-i mdgxs-part-ii + search nuclear-data diff --git a/docs/source/pythonapi/index.rst b/docs/source/pythonapi/index.rst index e9762c4f67..0345ec32bc 100644 --- a/docs/source/pythonapi/index.rst +++ b/docs/source/pythonapi/index.rst @@ -172,6 +172,7 @@ Running OpenMC openmc.calculate_volumes openmc.plot_geometry openmc.plot_inline + openmc.KeffSearch Post-processing --------------- @@ -336,6 +337,19 @@ Functions openmc.model.create_triso_lattice openmc.model.pack_trisos +Model Container +--------------- + +Classes ++++++++ + +.. autosummary:: + :toctree: generated + :nosignatures: + :template: myclass.rst + + openmc.model.Model + -------------------------------------------- :mod:`openmc.data` -- Nuclear Data Interface -------------------------------------------- diff --git a/openmc/search.py b/openmc/search.py index c2c8d2fa9e..5593898f98 100644 --- a/openmc/search.py +++ b/openmc/search.py @@ -7,12 +7,12 @@ from openmc.checkvalue import check_type, check_iterable_type, check_length, \ check_value -_SCALAR_BRACKETED_METHODS = ['brentq', 'brentq', 'ridder', 'bisect'] +_SCALAR_BRACKETED_METHODS = ['brentq', 'brenth', 'ridder', 'bisect'] class KeffSearch(object): - """Class to perform a keff search by modifying an arbitrarily parametrized - model. + """Class to perform a keff search by modifying a model parametrized by a + single independent variable. Parameters ---------- @@ -47,6 +47,8 @@ class KeffSearch(object): Bracketing interval to search for the solution; if not provided, a generic non-bracketing method is used. If provided, the brackets are used. + model_args : dict + Keyword-based arguments to pass to the :param:`model_builder` method. print_iterations : bool Whether or not to print the guess and the resultant keff during the iteration process. Defaults to False. @@ -64,9 +66,10 @@ class KeffSearch(object): """ def __init__(self, model_builder, guess=None, bracket=None, - target_keff=1.0): + target_keff=1.0, model_args={}): self.initial_guess = guess self.bracket = bracket + self.model_args = model_args self.model_builder = model_builder self.target_keff = target_keff self.guesses = [] @@ -87,9 +90,9 @@ class KeffSearch(object): # Run the model builder function once to make sure it provides the # correct output type if self.bracket is not None: - model = model_builder(self.bracket[0]) + model = model_builder(self.bracket[0], **self.model_args) elif self.initial_guess is not None: - model = model_builder(self.initial_guess) + model = model_builder(self.initial_guess, **self.model_args) check_type('model_builder return', model, openmc.model.Model) self._model_builder = model_builder @@ -141,9 +144,18 @@ class KeffSearch(object): check_type('print_output', print_output, bool) self._print_output = print_output + @property + def model_args(self): + return self._model_args + + @model_args.setter + def model_args(self, model_args): + check_type('model_args', model_args, dict) + self._model_args = model_args + def _search_function(self, guess): # Build the model - model = self.model_builder(guess) + model = self.model_builder(guess, **self.model_args) # Run the model keff = model.execute(output=self._print_output) @@ -158,7 +170,10 @@ class KeffSearch(object): self.keff_uncs.append(keff[1]) if self._print_iterations: - print(guess, '{:1.5f} +/- {:1.5f}'.format(keff[0], keff[1])) + text = 'Iteration: {}; Guess of {:.2E} produced a keff of ' + \ + '{:1.5f} +/- {:1.5f}' + print(text.format(self._i, guess, keff[0], keff[1])) + self._i += 1 return (keff[0] - self.target_keff) @@ -174,7 +189,8 @@ class KeffSearch(object): :param:`bracket` is set, otherwise the Newton method is used. Defaults to 'brentq'. **kwargs - Keyword arguments passed to :func:`scipy.optimize.newton`. + All remaining keyword arguments are passed to the root-finding + method. Returns zero_value : Real @@ -221,6 +237,9 @@ class KeffSearch(object): raise ValueError("One of the 'bracket' or 'initial_guess' " "parameters must be set") + # Set the iteration counter + self._i = 0 + # Perform the search zero_value = root_finder(**args, **kwargs) From 941074178f02a97a1872f7c02d063c39bf92ae28 Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Sun, 19 Mar 2017 17:34:44 -0400 Subject: [PATCH 04/17] Forgot to include the notebook --- docs/source/examples/search.ipynb | 238 ++++++++++++++++++++++++++++++ docs/source/examples/search.rst | 13 ++ 2 files changed, 251 insertions(+) create mode 100644 docs/source/examples/search.ipynb create mode 100644 docs/source/examples/search.rst diff --git a/docs/source/examples/search.ipynb b/docs/source/examples/search.ipynb new file mode 100644 index 0000000000..92c885edb3 --- /dev/null +++ b/docs/source/examples/search.ipynb @@ -0,0 +1,238 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This Notebook illustrates the usage of the OpenMC Python API's generic eigenvalue search capability. In this Notebook, we will do a critical boron concentration search of a typical PWR pin cell.\n", + "\n", + "To use the search functionality, we must create a function which creates our model according to the input parameter we wish to search for (in this case, the boron concentration). \n", + "\n", + "This notebook will first create that function, and then, run the search.\n", + "\n", + "\n", + "# Create Parametrized Model" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "\n", + "import openmc\n", + "import openmc.model\n", + "\n", + "%matplotlib inline" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To use the search functionality of `openmc.KeffSearch`, we require a function which creates an `openmc.model.Model` object. The first parameter of this function will be modified during the search process for our critical eigenvalue.\n", + "\n", + "Our model will be a pin-cell from the [Multi-Group Mode Part II](./mg-mode-part-ii.rst) assembly, except this time the entire model building process will be contained within a function, and the Boron concentration will be parametrized." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "# Create the model. `ppm_Boron` will be the parametric variable.\n", + "\n", + "def build_model(ppm_Boron):\n", + " # Create the pin materials\n", + " fuel = openmc.Material(name='1.6% Fuel')\n", + " fuel.set_density('g/cm3', 10.31341)\n", + " fuel.add_element('U', 1., enrichment=1.6)\n", + " fuel.add_element('O', 2.)\n", + "\n", + " zircaloy = openmc.Material(name='Zircaloy')\n", + " zircaloy.set_density('g/cm3', 6.55)\n", + " zircaloy.add_element('Zr', 1.)\n", + "\n", + " water = openmc.Material(name='Borated Water')\n", + " water.set_density('g/cm3', 0.741)\n", + " water.add_element('H', 2.)\n", + " water.add_element('O', 1.)\n", + "\n", + " # Include the amount of boron in the water based on the ppm,\n", + " # neglecting the other constituents of boric acid\n", + " water.add_element('B', ppm_Boron * 1E-6)\n", + " \n", + " # Instantiate a Materials object\n", + " materials = openmc.Materials((fuel, zircaloy, water))\n", + " \n", + " # Create cylinders for the fuel and clad\n", + " fuel_outer_radius = openmc.ZCylinder(R=0.39218)\n", + " clad_outer_radius = openmc.ZCylinder(R=0.45720)\n", + "\n", + " # Create boundary planes to surround the geometry\n", + " min_x = openmc.XPlane(x0=-0.63, boundary_type='reflective')\n", + " max_x = openmc.XPlane(x0=+0.63, boundary_type='reflective')\n", + " min_y = openmc.YPlane(y0=-0.63, boundary_type='reflective')\n", + " max_y = openmc.YPlane(y0=+0.63, boundary_type='reflective')\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", + "\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", + "\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 & (+min_x & -max_x & +min_y & -max_y)\n", + "\n", + " # Create root Universe\n", + " root_universe = openmc.Universe(name='root universe', universe_id=0)\n", + " root_universe.add_cells([fuel_cell, clad_cell, moderator_cell])\n", + "\n", + " # Create Geometry and set root universe\n", + " geometry = openmc.Geometry(root_universe)\n", + " \n", + " # Finish with the settings file\n", + " settings = openmc.Settings()\n", + " settings.batches = 300\n", + " settings.inactive = 20\n", + " settings.particles = 1000\n", + " settings.run_mode = 'eigenvalue'\n", + "\n", + " # Create an initial uniform spatial source distribution over fissionable zones\n", + " bounds = [-0.63, -0.63, -10, 0.63, 0.63, 10.]\n", + " uniform_dist = openmc.stats.Box(bounds[:3], bounds[3:], only_fissionable=True)\n", + " settings.source = openmc.source.Source(space=uniform_dist)\n", + "\n", + " # We dont need a tallies file so dont waste the disk input/output time\n", + " settings.output = {'tallies': False}\n", + " \n", + " model = openmc.model.Model(geometry, materials, settings)\n", + " \n", + " return model" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Search for the Critical Boron Concentration\n", + "\n", + "To perform the search we will initialize the `openmc.KeffSearch` object by passing it the model building function (`build_model`) and a bracketed range for the expected critical Boron concentration (1,000 to 2,500 ppm). We could also used a single initial guess, but have elected not to in this example. Finally, due to the high noise inherent in using as few histories as are used in this example, a bisection method will be used for the search.\n", + "\n", + "We will also set the `print_iterations` attribute of `openmc.KeffSearch` to `True` so we can display the iteration progress." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Iteration: 0; Guess of 1.00E+03 produced a keff of 1.08721 +/- 0.00158\n", + "Iteration: 1; Guess of 2.50E+03 produced a keff of 0.95263 +/- 0.00147\n", + "Iteration: 2; Guess of 1.75E+03 produced a keff of 1.01466 +/- 0.00163\n", + "Iteration: 3; Guess of 2.12E+03 produced a keff of 0.98475 +/- 0.00167\n", + "Iteration: 4; Guess of 1.94E+03 produced a keff of 0.99954 +/- 0.00154\n", + "Iteration: 5; Guess of 1.84E+03 produced a keff of 1.00428 +/- 0.00162\n", + "Iteration: 6; Guess of 1.89E+03 produced a keff of 1.00633 +/- 0.00166\n", + "Iteration: 7; Guess of 1.91E+03 produced a keff of 1.00388 +/- 0.00166\n", + "Iteration: 8; Guess of 1.93E+03 produced a keff of 0.99813 +/- 0.00142\n", + "Critical Boron Concentration: 1926 ppm\n" + ] + } + ], + "source": [ + "# Initialize our searching object\n", + "searcher = openmc.KeffSearch(build_model, bracket=[1000., 2500.])\n", + "# Perform the search with a tolerance that is larger in magnitude to the eigenvalue uncertainty we expect\n", + "searcher.print_iterations = True\n", + "crit_ppm = searcher.search(tol=1.E-2, bracketed_method='bisect')\n", + "\n", + "print('Critical Boron Concentration: {:4.0f} ppm'.format(crit_ppm))\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Finally, the `openmc.KeffSearch` object was storing our critical boron concentration guesses and the corresponding eigenvalue from OpenMC. Let's use that information to make a quick plot of the value of keff versus the boron concentration." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAfsAAAEyCAYAAAD9bHmuAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X+8VXWd7/HXW8A8qXhUyARUrNTCVLTjr24qWVfQmUnS\nysy5/qiJadK6/ZAZGbvZ2JST2M1xdHJwImVqNDP0WmloJtJUmgdREB0UfxQHSFCDIskAP/eP9d24\n2Ox9zuZw1tlnr/N+Ph77wVrf7/rx+e512J+9vuu711JEYGZmZuW1Q7MDMDMzs2I52ZuZmZWck72Z\nmVnJOdmbmZmVnJO9mZlZyTnZm5mZlZyTvQ0Iks6SdFez4+iOpL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gBT1rI6FgAAAAASUVORK5CYII=\n", + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "plt.figure(figsize=(8, 4.5))\n", + "plt.title('Eigenvalue versus Boron Concentration')\n", + "plt.scatter(searcher.guesses, searcher.keffs)\n", + "plt.xlabel('Boron Concentration [ppm]')\n", + "plt.ylabel('Eigenvalue')\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "collapsed": true + }, + "source": [ + "We see a nearly linear reactivity coefficient for the boron concentration, exactly as one would expect for a pure 1/v absorber at small concentrations." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.0" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/docs/source/examples/search.rst b/docs/source/examples/search.rst new file mode 100644 index 0000000000..9bb75b5830 --- /dev/null +++ b/docs/source/examples/search.rst @@ -0,0 +1,13 @@ +.. _notebook_search: + +================== +Criticality Search +================== + +.. only:: html + + .. notebook:: search.ipynb + +.. only:: latex + + IPython notebooks must be viewed in the online HTML documentation. From 512a21b0937f4edc556ee34ef05fa90abbb5d5d4 Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Sun, 19 Mar 2017 17:40:21 -0400 Subject: [PATCH 05/17] Fixed python2 failures --- openmc/search.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openmc/search.py b/openmc/search.py index 5593898f98..c79b608c82 100644 --- a/openmc/search.py +++ b/openmc/search.py @@ -240,7 +240,10 @@ class KeffSearch(object): # Set the iteration counter self._i = 0 + # Create a new dictionary with the arguments from args and kwargs + args.update(kwargs) + # Perform the search - zero_value = root_finder(**args, **kwargs) + zero_value = root_finder(**args) return zero_value From 2d848401c109256409d5e7ca2e2db270b1cc162d Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Sun, 19 Mar 2017 17:44:56 -0400 Subject: [PATCH 06/17] Added docstrings to model methods --- openmc/model/model.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/openmc/model/model.py b/openmc/model/model.py index 13868f339c..18c435d513 100644 --- a/openmc/model/model.py +++ b/openmc/model/model.py @@ -107,6 +107,20 @@ class Model(object): self.cmfd.export_to_xml() def execute(self, output=True): + """Creates the XML files, runs OpenMC, and loads the statepoint. + + Parameters + ---------- + output : bool + Capture OpenMC output from standard out, defaults to True + + Returns + ------- + Iterable of float + k_combined from the statepoint + + """ + self.export_to_xml() openmc.run(output=output) @@ -121,6 +135,9 @@ class Model(object): return self.sp.k_combined def close(self): + """Close the statepoint and summary files + """ + if self.sp is not None: self.sp._f.close() self.sp.summary._f.close() From d311e06029a04bb21176c250a25eb0668c0dfb99 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 13 Mar 2017 10:00:41 -0500 Subject: [PATCH 07/17] Add physical units in user's guide, TallyDerivative link --- docs/source/pythonapi/index.rst | 1 + docs/source/usersguide/input.rst | 16 ++++++++++++++++ openmc/tally_derivative.py | 8 ++++---- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/docs/source/pythonapi/index.rst b/docs/source/pythonapi/index.rst index e9762c4f67..e845641e10 100644 --- a/docs/source/pythonapi/index.rst +++ b/docs/source/pythonapi/index.rst @@ -135,6 +135,7 @@ Constructing Tallies openmc.EnergyFunctionFilter openmc.Mesh openmc.Trigger + openmc.TallyDerivative openmc.Tally openmc.Tallies diff --git a/docs/source/usersguide/input.rst b/docs/source/usersguide/input.rst index b8629f1801..e1775d3644 100644 --- a/docs/source/usersguide/input.rst +++ b/docs/source/usersguide/input.rst @@ -87,6 +87,22 @@ be validated using the following command: /opt/openmc/bin/openmc-validate-xml +-------------- +Physical Units +-------------- + +Unless specified otherwise, all length quantities are assumed to be in units of +centimeters, all energy quantities are assumed to be in electronvolts, and all +time quantities are assumed to be in seconds. + +======= ============ ====== +Measure Default unit Symbol +======= ============ ====== +length centimeter cm +energy electronvolt eV +time second s +======= ============ ====== + -------------------------------------- Settings Specification -- settings.xml -------------------------------------- diff --git a/openmc/tally_derivative.py b/openmc/tally_derivative.py index 1c8a316cf5..24187df84e 100644 --- a/openmc/tally_derivative.py +++ b/openmc/tally_derivative.py @@ -23,12 +23,12 @@ class TallyDerivative(EqualityMixin): Parameters ---------- - derivative_id : Integral, optional + derivative_id : int, optional Unique identifier for the tally derivative. If none is specified, an identifier will automatically be assigned variable : str, optional Accepted values are 'density', 'nuclide_density', and 'temperature' - material : Integral, optional + material : int, optional The perturubed material ID nuclide : str, optional The perturbed nuclide. Only needed for 'nuclide_density' derivatives. @@ -36,11 +36,11 @@ class TallyDerivative(EqualityMixin): Attributes ---------- - id : Integral + id : int Unique identifier for the tally derivative variable : str Accepted values are 'density', 'nuclide_density', and 'temperature' - material : Integral + material : int The perturubed material ID nuclide : str The perturbed nuclide. Only needed for 'nuclide_density' derivatives. From 6f854d2dee8b72750665bfb5436b2d7b74603391 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 13 Mar 2017 13:54:59 -0500 Subject: [PATCH 08/17] Update openmc-voxel-to-silovtk --- scripts/openmc-voxel-to-silovtk | 70 ++++++++++++--------------------- 1 file changed, 26 insertions(+), 44 deletions(-) diff --git a/scripts/openmc-voxel-to-silovtk b/scripts/openmc-voxel-to-silovtk index 471047127e..9748cc3bba 100755 --- a/scripts/openmc-voxel-to-silovtk +++ b/scripts/openmc-voxel-to-silovtk @@ -3,30 +3,24 @@ from __future__ import division, print_function import struct import sys +from argparse import ArgumentParser import numpy as np import h5py -def parse_options(): - """Process command line arguments""" - from optparse import OptionParser - usage = r"""%prog [options] """ - p = OptionParser(usage=usage) - p.add_option('-o', '--output', action='store', dest='output', - default='plot', help='Path to output SILO or VTK file.') - p.add_option('-v', '--vtk', action='store_true', dest='vtk', - default=False, help='Flag to convert to VTK instead of SILO.') - parsed = p.parse_args() - if not parsed[1]: - p.print_help() - return parsed - return parsed +def main(): + # Process command line arguments + parser = ArgumentParser() + parser.add_argument('voxel_file', help='Path to voxel file') + parser.add_argument('-o', '--output', action='store', + default='plot', help='Path to output SILO or VTK file.') + parser.add_argument('-s', '--silo', action='store_true', + default=False, help='Flag to convert to SILO instead of VTK.') + args = parser.parse_args() - -def main(filename, o): # Read data from voxel file - fh = h5py.File(filename, 'r') + fh = h5py.File(args.voxel_file, 'r') dimension = fh.attrs['num_voxels'] width = fh.attrs['voxel_width'] lower_left = fh.attrs['lower_left'] @@ -35,14 +29,8 @@ def main(filename, o): nx, ny, nz = dimension upper_right = lower_left + width*dimension - if o.vtk: - try: - import vtk - except: - print('The vtk python bindings do not appear to be installed ' - 'properly.\nOn Ubuntu: sudo apt install python-vtk\n' - 'See: http://www.vtk.org/') - return + if not args.silo: + import vtk grid = vtk.vtkImageData() grid.SetDimensions(nx+1, ny+1, nz+1) @@ -53,12 +41,12 @@ def main(filename, o): data.SetName("id") data.SetNumberOfTuples(nx*ny*nz) for x in range(nx): - sys.stdout.write(" {0}%\r".format(int(x/nx*100))) + sys.stdout.write(" {}%\r".format(int(x/nx*100))) sys.stdout.flush() for y in range(ny): for z in range(nz): i = z*nx*ny + y*nx + x - data.SetValue(i, voxel_data[x,y,z]) + data.SetValue(i, voxel_data[x, y, z]) grid.GetCellData().AddArray(data) writer = vtk.vtkXMLImageDataWriter() @@ -66,31 +54,27 @@ def main(filename, o): writer.SetInputData(grid) else: writer.SetInput(grid) - if not o.output.endswith(".vti"): - o.output += ".vti" - writer.SetFileName(o.output) + if not args.output.endswith(".vti"): + args.output += ".vti" + writer.SetFileName(args.output) writer.Write() else: - try: - import silomesh - except: - print('The silomesh package does not appear to be installed ' - 'properly.\nSee: https://github.com/nhorelik/silomesh/') - return - if not o.output.endswith(".silo"): - o.output += ".silo" - silomesh.init_silo(o.output) + import silomesh + + if not args.output.endswith(".silo"): + args.output += ".silo" + silomesh.init_silo(args.output) meshparams = list(map(int, dimension)) + list(map(float, lower_left)) + \ list(map(float, upper_right)) silomesh.init_mesh('plot', *meshparams) silomesh.init_var("id") for x in range(nx): - sys.stdout.write(" {0}%\r".format(int(x/nx*100))) + sys.stdout.write(" {}%\r".format(int(x/nx*100))) sys.stdout.flush() for y in range(ny): for z in range(nz): - silomesh.set_value(float(voxel_data[x,y,z]), + silomesh.set_value(float(voxel_data[x, y, z]), x + 1, y + 1, z + 1) print() silomesh.finalize_var() @@ -99,6 +83,4 @@ def main(filename, o): if __name__ == '__main__': - (options, args) = parse_options() - if args: - main(args[0], options) + main() From d938fa0176329c5abf510b44040363dd0d90e18f Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 15 Mar 2017 11:25:24 -0400 Subject: [PATCH 09/17] Fix bugs discovered during CNL workshop --- openmc/cell.py | 7 ++++--- openmc/geometry.py | 25 ++++++++++++++++--------- openmc/stats/multivariate.py | 3 ++- openmc/tally_derivative.py | 2 +- openmc/volume.py | 6 +++--- 5 files changed, 26 insertions(+), 17 deletions(-) diff --git a/openmc/cell.py b/openmc/cell.py index b578702bba..9993175efd 100644 --- a/openmc/cell.py +++ b/openmc/cell.py @@ -289,9 +289,10 @@ class Cell(object): c3, s3 = cos(phi), sin(phi) c2, s2 = cos(theta), sin(theta) c1, s1 = cos(psi), sin(psi) - return np.array([[c1*c2, c1*s2*s3 - c3*s1, s1*s3 + c1*c3*s2], - [c2*s1, c1*c3 + s1*s2*s3, c3*s1*s2 - c1*s3], - [-s2, c2*s3, c2*c3]]) + self._rotation_matrix = np.array([ + [c1*c2, c1*s2*s3 - c3*s1, s1*s3 + c1*c3*s2], + [c2*s1, c1*c3 + s1*s2*s3, c3*s1*s2 - c1*s3], + [-s2, c2*s3, c2*c3]]) @translation.setter def translation(self, translation): diff --git a/openmc/geometry.py b/openmc/geometry.py index 02bcbe180d..598aa43125 100644 --- a/openmc/geometry.py +++ b/openmc/geometry.py @@ -361,18 +361,25 @@ class Geometry(object): if not case_sensitive: name = name.lower() - all_cells = self.get_all_cells().values() cells = set() - for cell in all_cells: - cell_fill_name = cell.fill.name - if not case_sensitive: - cell_fill_name = cell_fill_name.lower() + for cell in self.get_all_cells().values(): + names = [] + if cell.fill_type in ('material', 'universe', 'lattice'): + names.append(cell.fill.name) + elif cell.fill_type == 'distribmat': + for mat in cell.fill: + if mat is not None: + names.append(mat.name) - if cell_fill_name == name: - cells.add(cell) - elif not matching and name in cell_fill_name: - cells.add(cell) + for fill_name in names: + if not case_sensitive: + fill_name = fill_name.lower() + + if fill_name == name: + cells.add(cell) + elif not matching and name in fill_name: + cells.add(cell) cells = list(cells) cells.sort(key=lambda x: x.id) diff --git a/openmc/stats/multivariate.py b/openmc/stats/multivariate.py index ca25cf5fb3..0ab11b7c54 100644 --- a/openmc/stats/multivariate.py +++ b/openmc/stats/multivariate.py @@ -54,7 +54,8 @@ class PolarAzimuthal(UnitSphere): """Angular distribution represented by polar and azimuthal angles This distribution allows one to specify the distribution of the cosine of - the polar angle and the azimuthal angle independently of once another. + the polar angle and the azimuthal angle independently of one another. The + polar angle is measured relative to the reference angle. Parameters ---------- diff --git a/openmc/tally_derivative.py b/openmc/tally_derivative.py index 24187df84e..185e7ab6ae 100644 --- a/openmc/tally_derivative.py +++ b/openmc/tally_derivative.py @@ -29,7 +29,7 @@ class TallyDerivative(EqualityMixin): variable : str, optional Accepted values are 'density', 'nuclide_density', and 'temperature' material : int, optional - The perturubed material ID + The perturbed material ID nuclide : str, optional The perturbed nuclide. Only needed for 'nuclide_density' derivatives. Ex: 'Xe135' diff --git a/openmc/volume.py b/openmc/volume.py index c9e1a5afa6..6c4b130f96 100644 --- a/openmc/volume.py +++ b/openmc/volume.py @@ -246,9 +246,9 @@ class VolumeCalculation(object): results = type(self).from_hdf5(filename) # Make sure properties match - assert self.domains == results.domains - assert self.lower_left == results.lower_left - assert self.upper_right == results.upper_right + assert self.ids == results.ids + assert np.all(self.lower_left == results.lower_left) + assert np.all(self.upper_right == results.upper_right) # Copy results self.volumes = results.volumes From b08d0eb51ca896071d10f97423d0c3a0f2828570 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 17 Mar 2017 06:47:10 -0400 Subject: [PATCH 10/17] Remove unnecessary import in __init__.py. Fix MG env var doc --- openmc/__init__.py | 2 -- openmc/material.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/openmc/__init__.py b/openmc/__init__.py index b355385580..53fbec3f22 100644 --- a/openmc/__init__.py +++ b/openmc/__init__.py @@ -1,5 +1,3 @@ -import warnings - from openmc.arithmetic import * from openmc.cell import * from openmc.mesh import * diff --git a/openmc/material.py b/openmc/material.py index 92d992a6f6..357753fa91 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -980,7 +980,7 @@ class Materials(cv.CheckedList): :envvar:`OPENMC_CROSS_SECTIONS` environment variable will be used for continuous-energy calculations and :envvar:`OPENMC_MG_CROSS_SECTIONS` will be used for multi-group - calculations to find the path to the XML cross section file. + calculations to find the path to the HDF5 cross section file. multipole_library : str Indicates the path to a directory containing a windowed multipole cross section library. If it is not set, the From 48135a59ab62438e6e3666a0d653c2dc6c2128bc Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 17 Mar 2017 07:06:07 -0400 Subject: [PATCH 11/17] Documentation/test fixes --- docs/source/devguide/workflow.rst | 43 +++++++++++++++++-------------- tests/run_tests.py | 7 +++++ 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/docs/source/devguide/workflow.rst b/docs/source/devguide/workflow.rst index a53bd114bd..7a303f45e9 100644 --- a/docs/source/devguide/workflow.rst +++ b/docs/source/devguide/workflow.rst @@ -37,9 +37,8 @@ In order to be considered suitable for inclusion in the *develop* branch, the following criteria must be satisfied for all proposed changes: - Changes have a clear purpose and are useful. -- Compiles under all conditions (MPI, OpenMP, HDF5, etc.). This is checked as - part of the test suite. -- Passes the regression suite. +- Compiles and passes the regression suite with all configurations (This is + checked by Travis CI). - If appropriate, test cases are added to regression suite. - No memory leaks (checked with valgrind_). - Conforms to the OpenMC `style guide`_. @@ -81,8 +80,7 @@ features and bug fixes. The general steps for contributing are as follows: At a minimum, you should describe what the changes you've made are and why you are making them. If the changes are related to an oustanding issue, make - sure it is cross-referenced. A wise developer would also check whether their - changes do indeed pass the regression test suite. + sure it is cross-referenced. 5. A trusted developer will review your pull request based on the criteria above. Any issues with the pull request can be discussed directly on the pull @@ -104,7 +102,7 @@ full OpenMC code is executed. Results from simulations are compared with expected results. The test suite is comprised of many build configurations (e.g. debug, mpi, hdf5) and the actual tests which reside in sub-directories in the tests directory. We recommend to developers to test their branches -before submitting a formal pull request using gfortran and intel compilers +before submitting a formal pull request using gfortran and Intel compilers if available. The test suite is designed to integrate with cmake using ctest_. @@ -113,9 +111,9 @@ download these cross sections please do the following: .. code-block:: sh - cd ../data - python get_nndc_data.py - export CROSS_SECTIONS=/nndc/cross_sections.xml + cd ../scripts + ./openmc-get-nndc-data + export OPENMC_CROSS_SECTIONS=/nndc_hdf5/cross_sections.xml The test suite can be run on an already existing build using: @@ -137,21 +135,29 @@ more control over which tests are executed. Before running the test suite python script, the following environmental variables should be set if the default paths are incorrect: - * **FC** - The command of the Fortran compiler (e.g. gfotran, ifort). + * **FC** - The command for a Fortran compiler (e.g. gfotran, ifort). * Default - *gfortran* + * **CC** - The command for a C compiler (e.g. gcc, icc). + + * Default - *gcc* + + * **CXX** - The command for a C++ compiler (e.g. g++, icpc). + + * Default - *g++* + * **MPI_DIR** - The path to the MPI directory. - * Default - */opt/mpich/3.1.3-gnu* + * Default - */opt/mpich/3.2-gnu* * **HDF5_DIR** - The path to the HDF5 directory. - * Default - */opt/hdf5/1.8.14-gnu* + * Default - */opt/hdf5/1.8.16-gnu* * **PHDF5_DIR** - The path to the parallel HDF5 directory. - * Default - */opt/phdf5/1.8.14-gnu* + * Default - */opt/phdf5/1.8.16-gnu* To run the full test suite, the following command can be executed in the tests directory: @@ -192,15 +198,12 @@ a test you need to add the following files to your new test directory, *test_name* for example: * OpenMC input XML files - * **test_name.py** - python test driver script, please refer to other + * **test_name.py** - Python test driver script, please refer to other tests to see how to construct. Any output files that are generated during testing must be removed at the end of this script. - * **results.py** - python script that extracts results from statepoint - output files. By default it should look for a binary file, but can - take an argument to overwrite which statepoint file is processed, - whether it is at a different batch or with an HDF5 extension. This - script must output a results file that is named *results_test.dat*. - It is recommended that any real numbers reported use *12.6E* format. + * **inputs_true.dat** - ASCII file that contains Python API-generated XML + files concatenated together. When the test is run, inputs that are + generated are compared to this file. * **results_true.dat** - ASCII file that contains the expected results from the test. The file *results_test.dat* is compared to this file during the execution of the python test driver script. When the diff --git a/tests/run_tests.py b/tests/run_tests.py index 28bedab0dc..f0ecd82916 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -43,6 +43,7 @@ parser.add_option("-s", "--script", action="store_true", dest="script", # Default compiler paths FC='gfortran' CC='gcc' +CXX='g++' MPI_DIR='/opt/mpich/3.2-gnu' HDF5_DIR='/opt/hdf5/1.8.16-gnu' PHDF5_DIR='/opt/phdf5/1.8.16-gnu' @@ -55,6 +56,8 @@ if 'FC' in os.environ: FC = os.environ['FC'] if 'CC' in os.environ: CC = os.environ['CC'] +if 'CXX' in os.environ: + CXX = os.environ['CXX'] if 'MPI_DIR' in os.environ: MPI_DIR = os.environ['MPI_DIR'] if 'HDF5_DIR' in os.environ: @@ -162,9 +165,11 @@ class Test(object): else: self.fc = os.path.join(MPI_DIR, 'bin', 'mpif90') self.cc = os.path.join(MPI_DIR, 'bin', 'mpicc') + self.cxx = os.path.join(MPI_DIR, 'bin', 'mpicxx') else: self.fc = FC self.cc = CC + self.cxx = CXX # Sets the build name that will show up on the CDash def get_build_name(self): @@ -195,6 +200,7 @@ class Test(object): def run_ctest_script(self): os.environ['FC'] = self.fc os.environ['CC'] = self.cc + os.environ['CXX'] = self.cxx if self.mpi: os.environ['MPI_DIR'] = MPI_DIR if self.phdf5: @@ -210,6 +216,7 @@ class Test(object): def run_cmake(self): os.environ['FC'] = self.fc os.environ['CC'] = self.cc + os.environ['CXX'] = self.cxx if self.mpi: os.environ['MPI_DIR'] = MPI_DIR if self.phdf5: From 5adc5f63faf498846dc69bd203fa1d378e3e8bb9 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 17 Mar 2017 08:26:40 -0500 Subject: [PATCH 12/17] Add OpenMOC compatiblity module in documentation --- docs/source/pythonapi/index.rst | 22 ++++++++++++++++++++ docs/source/pythonapi/openmoc_compatible.rst | 8 ------- 2 files changed, 22 insertions(+), 8 deletions(-) delete mode 100644 docs/source/pythonapi/openmoc_compatible.rst diff --git a/docs/source/pythonapi/index.rst b/docs/source/pythonapi/index.rst index e845641e10..c23bf19211 100644 --- a/docs/source/pythonapi/index.rst +++ b/docs/source/pythonapi/index.rst @@ -470,6 +470,28 @@ Functions openmc.data.endf.get_tab2_record openmc.data.endf.get_text_record +--------------------------------------------------------- +:mod:`openmc.openmoc_compatible` -- OpenMOC Compatibility +--------------------------------------------------------- + +.. autosummary:: + :toctree: generated + :nosignatures: + :template: myfunction.rst + + openmc.openmoc_compatible.get_openmoc_material + openmc.openmoc_compatible.get_openmc_material + openmc.openmoc_compatible.get_openmoc_surface + openmc.openmoc_compatible.get_openmc_surface + openmc.openmoc_compatible.get_openmoc_cell + openmc.openmoc_compatible.get_openmc_cell + openmc.openmoc_compatible.get_openmoc_universe + openmc.openmoc_compatible.get_openmc_universe + openmc.openmoc_compatible.get_openmoc_lattice + openmc.openmoc_compatible.get_openmc_lattice + openmc.openmoc_compatible.get_openmoc_geometry + openmc.openmoc_compatible.get_openmc_geometry + .. _Jupyter: https://jupyter.org/ .. _NumPy: http://www.numpy.org/ .. _Codecademy: https://www.codecademy.com/tracks/python diff --git a/docs/source/pythonapi/openmoc_compatible.rst b/docs/source/pythonapi/openmoc_compatible.rst deleted file mode 100644 index bf353b96ef..0000000000 --- a/docs/source/pythonapi/openmoc_compatible.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. _pythonapi_openmoc_compatible: - -===================== -OpenMOC Compatibility -===================== - -.. automodule:: openmc.openmoc_compatible - :members: From 5a116aedb30284b91555ea86bae1995e5a07c381 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 20 Mar 2017 06:24:19 -0500 Subject: [PATCH 13/17] Update missing label in documentation --- docs/source/methods/cross_sections.rst | 52 +++++++++++++------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/docs/source/methods/cross_sections.rst b/docs/source/methods/cross_sections.rst index b9043a944d..9f677bac43 100644 --- a/docs/source/methods/cross_sections.rst +++ b/docs/source/methods/cross_sections.rst @@ -183,45 +183,43 @@ Multi-Group Data The data governing the interaction of particles with various nuclei or materials are represented using a multi-group library format specific to the OpenMC code. -The format is described in the :ref:`mgxs_lib_spec`. -The data itself can be prepared via traditional paths or directly from a -continuous-energy OpenMC calculation by use of the Python API as is shown in the -:ref:`notebook_mgxs_part_iv` example notebook. This multi-group -library consists of meta-data (such as the energy group structure) and multiple -`xsdata` objects which contains the required microscopic or macroscopic -multi-group data. +The format is described in the :ref:`mgxs_lib_spec`. The data itself can be +prepared via traditional paths or directly from a continuous-energy OpenMC +calculation by use of the Python API as is shown in the +:ref:`notebook_mg_mode_part_i` example notebook. This multi-group library +consists of meta-data (such as the energy group structure) and multiple `xsdata` +objects which contains the required microscopic or macroscopic multi-group data. At a minimum, the library must contain the absorption cross section (:math:`\sigma_{a,g}`) and a scattering matrix. If the problem is an eigenvalue -problem then all fissionable materials must also contain either -a fission production matrix cross section -(:math:`\nu\sigma_{f,g\rightarrow g'}`), or -both the fission spectrum data (:math:`\chi_{g'}`) and a fission production -cross section (:math:`\nu\sigma_{f,g}`), or, . The library must also contain -the fission cross section (:math:`\sigma_{f,g}`) or the fission energy release -cross section (:math:`\kappa\sigma_{f,g}`) if the associated tallies are -required by the model using the library. +problem then all fissionable materials must also contain either a fission +production matrix cross section (:math:`\nu\sigma_{f,g\rightarrow g'}`), or both +the fission spectrum data (:math:`\chi_{g'}`) and a fission production cross +section (:math:`\nu\sigma_{f,g}`), or, . The library must also contain the +fission cross section (:math:`\sigma_{f,g}`) or the fission energy release cross +section (:math:`\kappa\sigma_{f,g}`) if the associated tallies are required by +the model using the library. After a scattering collision, the outgoing particle experiences a change in both energy and angle. The probability of a particle resulting in a given outgoing -energy group (`g'`) given a certain incoming energy group (`g`) is provided -by the scattering matrix data. The angular information can be expressed either -via Legendre expansion of the particle's change-in-angle (:math:`\mu`), a -tabular representation of the probability distribution function of :math:`\mu`, -or a histogram representation of the same PDF. The formats used to -represent these are described in the :ref:`mgxs_lib_spec`. +energy group (`g'`) given a certain incoming energy group (`g`) is provided by +the scattering matrix data. The angular information can be expressed either via +Legendre expansion of the particle's change-in-angle (:math:`\mu`), a tabular +representation of the probability distribution function of :math:`\mu`, or a +histogram representation of the same PDF. The formats used to represent these +are described in the :ref:`mgxs_lib_spec`. Unlike the continuous-energy mode, the multi-group mode does not explicitly track particles produced from scattering multiplication (i.e., :math:`(n,xn)`) reactions. These are instead accounted for by adjusting the weight of the particle after the collision such that the correct total weight is maintained. The weight adjustment factor is optionally provided by the `multiplicity` data -which is required to be provided in the form of a group-wise matrix. -This data is provided as a group-wise matrix since the probability of producing -multiple particles in a scattering reaction depends on both the incoming energy, -`g`, and the sampled outgoing energy, `g'`. This data represents the average -number of particles emitted from a scattering reaction, given a scattering -reaction has occurred: +which is required to be provided in the form of a group-wise matrix. This data +is provided as a group-wise matrix since the probability of producing multiple +particles in a scattering reaction depends on both the incoming energy, `g`, and +the sampled outgoing energy, `g'`. This data represents the average number of +particles emitted from a scattering reaction, given a scattering reaction has +occurred: .. math:: From b63e1133f9de49264b818392942f7dd6acbbf33f Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Mon, 20 Mar 2017 21:10:04 -0400 Subject: [PATCH 14/17] Updated per @paulromano comments --- docs/source/examples/search.ipynb | 22 ++++---- openmc/model/model.py | 79 ++++++++++++++++---------- openmc/search.py | 92 +++++++++++++++---------------- 3 files changed, 106 insertions(+), 87 deletions(-) diff --git a/docs/source/examples/search.ipynb b/docs/source/examples/search.ipynb index 92c885edb3..6f89f49ee6 100644 --- a/docs/source/examples/search.ipynb +++ b/docs/source/examples/search.ipynb @@ -147,15 +147,15 @@ "name": "stdout", "output_type": "stream", "text": [ - "Iteration: 0; Guess of 1.00E+03 produced a keff of 1.08721 +/- 0.00158\n", - "Iteration: 1; Guess of 2.50E+03 produced a keff of 0.95263 +/- 0.00147\n", - "Iteration: 2; Guess of 1.75E+03 produced a keff of 1.01466 +/- 0.00163\n", - "Iteration: 3; Guess of 2.12E+03 produced a keff of 0.98475 +/- 0.00167\n", - "Iteration: 4; Guess of 1.94E+03 produced a keff of 0.99954 +/- 0.00154\n", - "Iteration: 5; Guess of 1.84E+03 produced a keff of 1.00428 +/- 0.00162\n", - "Iteration: 6; Guess of 1.89E+03 produced a keff of 1.00633 +/- 0.00166\n", - "Iteration: 7; Guess of 1.91E+03 produced a keff of 1.00388 +/- 0.00166\n", - "Iteration: 8; Guess of 1.93E+03 produced a keff of 0.99813 +/- 0.00142\n", + "Iteration: 0; Guess of 1.00e+03 produced a keff of 1.08721 +/- 0.00158\n", + "Iteration: 1; Guess of 2.50e+03 produced a keff of 0.95263 +/- 0.00147\n", + "Iteration: 2; Guess of 1.75e+03 produced a keff of 1.01466 +/- 0.00163\n", + "Iteration: 3; Guess of 2.12e+03 produced a keff of 0.98475 +/- 0.00167\n", + "Iteration: 4; Guess of 1.94e+03 produced a keff of 0.99954 +/- 0.00154\n", + "Iteration: 5; Guess of 1.84e+03 produced a keff of 1.00428 +/- 0.00162\n", + "Iteration: 6; Guess of 1.89e+03 produced a keff of 1.00633 +/- 0.00166\n", + "Iteration: 7; Guess of 1.91e+03 produced a keff of 1.00388 +/- 0.00166\n", + "Iteration: 8; Guess of 1.93e+03 produced a keff of 0.99813 +/- 0.00142\n", "Critical Boron Concentration: 1926 ppm\n" ] } @@ -167,7 +167,7 @@ "searcher.print_iterations = True\n", "crit_ppm = searcher.search(tol=1.E-2, bracketed_method='bisect')\n", "\n", - "print('Critical Boron Concentration: {:4.0f} ppm'.format(crit_ppm))\n" + "print('Critical Boron Concentration: {:4.0f} ppm'.format(crit_ppm))" ] }, { @@ -188,7 +188,7 @@ "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAfsAAAEyCAYAAAD9bHmuAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X+8VXWd7/HXW8A8qXhUyARUrNTCVLTjr24qWVfQmUnS\nysy5/qiJadK6/ZAZGbvZ2JST2M1xdHJwImVqNDP0WmloJtJUmgdREB0UfxQHSFCDIskAP/eP9d24\n2Ox9zuZw1tlnr/N+Ph77wVrf7/rx+e512J+9vuu711JEYGZmZuW1Q7MDMDMzs2I52ZuZmZWck72Z\nmVnJOdmbmZmVnJO9mZlZyTnZm5mZlZyTvQ0Iks6SdFez4+iOpLmS/qrZcZg1QtKdks5pdhw2MDjZ\nW7+R9Kyk9ZLW5V5XA0TEtyPipGbHaD1LX3r+mI7fWknzJB3S7LgqJB0o6buSnk/xLZT0GUlDmh1b\nLX3xJVLSFyR9K18WESdHxA3bF52VhZO99be/iIhdcq8Lmh1QWUga2o+7uyAidgH2BOYC/9GbjfR1\nzJLeCDwALAMOiYjdgPcDHcCufbmv/tLPx9VKysneBgRJ50r6r9z8SZKWpDOzf5V0X/7sR9KHJT0u\n6beS5kjaL1cXkj4m6clUf40yr5G0RtJbc8uOTL0Nr5O0u6QfSFqd1vuBpDF14t3iTErS2LTfoWl+\nN0nfkLRS0nJJ/1jrzFLSqLT/PXJlh6ez0mENtvV8SU8CT6Z2fk3SqtxZ7VvTslucQebf8+7W605E\nbARuAsbltvsaSVdKWpFeV0p6TaqbIKlL0t9J+g3wzVT+UUlLJb0o6XZJo3o6nnVC+gfg5xHxmYhY\nmWJcEhEfiog1aXvvkbQ4/S3MlfSW3L6elXRhav9aSd+RtFOu/lRJD0v6naSnJE3q6XhX3mdJV6T4\nn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X\ncF+9jSR3AR+rDKKTtAfZg05Gpl4LJA2TdHAP2/k9sGs39bsBKyPilRRXZaBid+vNA85KMUwAno/c\nM9d7YQegMmL+Q2Rd9BWV8RXvANam99Ks5fkbqVnvtUmqdLULOCciNkm6FTiW7ClvAfxtRPwmfSHY\nLCIeknQ9r34R+PeIWCBpbCM7j4g7JO0F/FhZP3sAM1P1OcC1kl5L9ujR83rY3L+TdakvlLSB7Nr1\n1cp+RnZV6jYfClxJ1qNQz73ARel9qfXrhH8Fvifp/WnZyln/QmCjpEfIrnsvyK3zBeCbkhaSXS8/\np4e29OQPwMGS5pONtTgjV/dbST8nG3D54e3cj9mA4afemVmpSVoXEbvUm8+VzyX7dUPnduzrerKB\nhbf0dhtmRXA3vpmV3e/UTzfVAU6gsXEIZv3KZ/ZmZmYl5zN7MzOzknOyNzMzKzknezMzs5Jzsjcz\nMys5J3szM7OSc7I3MzMruf8PsJgBT1rI6FgAAAAASUVORK5CYII=\n", "text/plain": [ - "" + "" ] }, "metadata": {}, diff --git a/openmc/model/model.py b/openmc/model/model.py index 18c435d513..7716cae97b 100644 --- a/openmc/model/model.py +++ b/openmc/model/model.py @@ -4,7 +4,8 @@ from openmc.checkvalue import check_type class Model(object): """OpenMC model container for the openmc.Geometry, openmc.Materials, - openmc.Settings, openmc.Tallies, and openmc.CMFD objects + openmc.Settings, openmc.Tallies, openmc.CMFD objects, and openmc.Plot + objects Parameters ---------- @@ -18,6 +19,8 @@ class Model(object): Tallies information, optional cmfd : openmc.CMFD CMFD information, optional + plots : openmc.Plots + Plot information, optional Attributes ---------- @@ -31,21 +34,28 @@ class Model(object): Tallies information cmfd : openmc.CMFD CMFD information + plots : openmc.Plots + Plot information """ - def __init__(self, geometry, materials, settings, tallies=None, cmfd=None): + def __init__(self, geometry, materials, settings, tallies=None, cmfd=None, + plots=None): self.geometry = geometry self.materials = materials self.settings = settings if tallies: self.tallies = tallies else: - self._tallies = None + self._tallies = openmc.Tallies() if cmfd: self.cmfd = cmfd else: self._cmfd = None + if plots: + self.plots = plots + else: + self.plots = openmc.Plots() self.sp = None @@ -53,47 +63,56 @@ class Model(object): def geometry(self): return self._geometry + @property + def materials(self): + return self._materials + + @property + def settings(self): + return self._settings + + @property + def tallies(self): + return self._tallies + + @property + def cmfd(self): + return self._cmfd + + @property + def plots(self): + return self._plots + @geometry.setter def geometry(self, geometry): check_type('geometry', geometry, openmc.Geometry) self._geometry = geometry - @property - def materials(self): - return self._materials - @materials.setter def materials(self, materials): check_type('materials', materials, openmc.Materials) self._materials = materials - @property - def settings(self): - return self._settings - @settings.setter def settings(self, settings): check_type('settings', settings, openmc.Settings) self._settings = settings - @property - def tallies(self): - return self._tallies - @tallies.setter def tallies(self, tallies): check_type('tallies', tallies, openmc.Tallies) self._tallies = tallies - @property - def cmfd(self): - return self._cmfd - @cmfd.setter def cmfd(self, cmfd): check_type('cmfd', cmfd, openmc.CMFD) self._cmfd = cmfd + @plots.setter + def plots(self, plots): + check_type('plots', plots, openmc.Plots) + self._plots = plots + def export_to_xml(self): """Export model settings to XML files. """ @@ -101,36 +120,38 @@ class Model(object): self.geometry.export_to_xml() self.materials.export_to_xml() self.settings.export_to_xml() - if self.tallies: - self.tallies.export_to_xml() - if self.cmfd: + self.tallies.export_to_xml() + if self.cmfd is not None: self.cmfd.export_to_xml() + self.plots.export_to_xml() - def execute(self, output=True): + def run(self, **kwargs): """Creates the XML files, runs OpenMC, and loads the statepoint. Parameters ---------- - output : bool - Capture OpenMC output from standard out, defaults to True + **kwargs + All keyword arguments are passed to openmc.run Returns ------- - Iterable of float + 2-tuple of float k_combined from the statepoint """ self.export_to_xml() - openmc.run(output=output) + return_code = openmc.run(**kwargs) + + assert (return_code == 0), "OpenMC did not execute successfully" statepoint_batches = self.settings.batches if self.settings.statepoint is not None: if 'batches' in self.settings.statepoint: statepoint_batches = self.settings.statepoint['batches'][-1] - self.sp = openmc.StatePoint('statepoint.' + str(statepoint_batches) + - '.h5') + self.sp = \ + openmc.StatePoint('statepoint.{}.h5'.format(statepoint_batches)) return self.sp.k_combined diff --git a/openmc/search.py b/openmc/search.py index c79b608c82..69e301c216 100644 --- a/openmc/search.py +++ b/openmc/search.py @@ -1,10 +1,9 @@ +from collections import Callable from numbers import Real -from types import FunctionType import openmc import openmc.model -from openmc.checkvalue import check_type, check_iterable_type, check_length, \ - check_value +import openmc.checkvalue as cv _SCALAR_BRACKETED_METHODS = ['brentq', 'brenth', 'ridder', 'bisect'] @@ -16,7 +15,7 @@ class KeffSearch(object): Parameters ---------- - model_builder : FunctionType + model_builder : collections.Callable Callable function which builds a model according to a passed parameter. This function must return an openmc.model.Model object. guess : Real, optional @@ -82,10 +81,34 @@ class KeffSearch(object): def model_builder(self): return self._model_builder + @property + def initial_guess(self): + return self._initial_guess + + @property + def bracket(self): + return self._bracket + + @property + def target_keff(self): + return self._target_keff + + @property + def print_iterations(self): + return self._print_iterations + + @property + def print_output(self): + return self._print_output + + @property + def model_args(self): + return self._model_args + @model_builder.setter def model_builder(self, model_builder): # Make sure model_builder is a function - check_type('model_builder', model_builder, FunctionType) + cv.check_type('model_builder', model_builder, Callable) # Run the model builder function once to make sure it provides the # correct output type @@ -93,64 +116,40 @@ class KeffSearch(object): model = model_builder(self.bracket[0], **self.model_args) elif self.initial_guess is not None: model = model_builder(self.initial_guess, **self.model_args) - check_type('model_builder return', model, openmc.model.Model) + cv.check_type('model_builder return', model, openmc.model.Model) self._model_builder = model_builder - @property - def initial_guess(self): - return self._initial_guess - @initial_guess.setter def initial_guess(self, initial_guess): if initial_guess is not None: - check_type('initial_guess', initial_guess, Real) + cv.check_type('initial_guess', initial_guess, Real) self._initial_guess = initial_guess - @property - def bracket(self): - return self._bracket - @bracket.setter def bracket(self, bracket): if bracket is not None: - check_iterable_type('bracket', bracket, Real) - check_length('bracket', bracket, 2) + cv.check_iterable_type('bracket', bracket, Real) + cv.check_length('bracket', bracket, 2) self._bracket = bracket - @property - def target_keff(self): - return self._target_keff - @target_keff.setter def target_keff(self, target_keff): - check_type('target_keff', target_keff, Real) + cv.check_type('target_keff', target_keff, Real) self._target_keff = target_keff - @property - def print_iterations(self): - return self._print_iterations - @print_iterations.setter def print_iterations(self, print_iterations): - check_type('print_iterations', print_iterations, bool) + cv.check_type('print_iterations', print_iterations, bool) self._print_iterations = print_iterations - @property - def print_output(self): - return self._print_output - @print_output.setter def print_output(self, print_output): - check_type('print_output', print_output, bool) + cv.check_type('print_output', print_output, bool) self._print_output = print_output - @property - def model_args(self): - return self._model_args - @model_args.setter def model_args(self, model_args): - check_type('model_args', model_args, dict) + cv.check_type('model_args', model_args, dict) self._model_args = model_args def _search_function(self, guess): @@ -158,7 +157,7 @@ class KeffSearch(object): model = self.model_builder(guess, **self.model_args) # Run the model - keff = model.execute(output=self._print_output) + keff = model.run(output=self._print_output) # Close the model to ensure HDF5 will allow access during the next # OpenMC execution @@ -170,7 +169,7 @@ class KeffSearch(object): self.keff_uncs.append(keff[1]) if self._print_iterations: - text = 'Iteration: {}; Guess of {:.2E} produced a keff of ' + \ + text = 'Iteration: {}; Guess of {:.2e} produced a keff of ' + \ '{:1.5f} +/- {:1.5f}' print(text.format(self._i, guess, keff[0], keff[1])) self._i += 1 @@ -178,31 +177,30 @@ class KeffSearch(object): return (keff[0] - self.target_keff) def search(self, tol=None, bracketed_method='brentq', **kwargs): - """Searches for the target eigenvalue with the Newton-Raphson method + """Apply root-finding algorithm to search for the target k-eigenvalue Parameters ---------- - tol : Real + tol : float Tolerance to pass to the search method bracketed_method : {'brentq', 'brenth', 'ridder', 'bisect'}, optional Solution method to use; only applies if - :param:`bracket` is set, otherwise the Newton method is used. + :param:`bracket` is set, otherwise the Secant method is used. Defaults to 'brentq'. **kwargs All remaining keyword arguments are passed to the root-finding method. Returns - zero_value : Real + ------- + zero_value : float Estimated value of the variable parameter where keff is the targeted value - keff : Iterable of Real - keff calculated at the zero_value """ - check_value('bracketed_method', bracketed_method, - _SCALAR_BRACKETED_METHODS) + cv.check_value('bracketed_method', bracketed_method, + _SCALAR_BRACKETED_METHODS) import scipy.optimize as sopt From 033197a091feff8e6e4e13258b43eae7c0e3160a Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 21 Mar 2017 06:48:21 -0500 Subject: [PATCH 15/17] Sort as they are written to plots.xml --- openmc/plots.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openmc/plots.py b/openmc/plots.py index 2ba5d9758e..cc2fcc4b6b 100644 --- a/openmc/plots.py +++ b/openmc/plots.py @@ -636,7 +636,8 @@ class Plot(object): subelement.text = ' '.join(str(x) for x in color) if self._colors: - for domain, color in self._colors.items(): + for domain, color in sorted(self._colors.items(), + key=lambda x: x[0].id): subelement = ET.SubElement(element, "color") subelement.set("id", str(domain.id)) if isinstance(color, string_types): From bbb351f06b9551be4bdd54ffbf3692bb111802f9 Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Tue, 21 Mar 2017 20:40:50 -0400 Subject: [PATCH 16/17] Converted openmc.KeffSearch class to openmc.search_for_keff function --- docs/source/examples/search.ipynb | 48 ++-- openmc/search.py | 350 +++++++++++++----------------- 2 files changed, 174 insertions(+), 224 deletions(-) diff --git a/docs/source/examples/search.ipynb b/docs/source/examples/search.ipynb index 6f89f49ee6..69359470ce 100644 --- a/docs/source/examples/search.ipynb +++ b/docs/source/examples/search.ipynb @@ -8,10 +8,7 @@ "\n", "To use the search functionality, we must create a function which creates our model according to the input parameter we wish to search for (in this case, the boron concentration). \n", "\n", - "This notebook will first create that function, and then, run the search.\n", - "\n", - "\n", - "# Create Parametrized Model" + "This notebook will first create that function, and then, run the search." ] }, { @@ -22,6 +19,7 @@ }, "outputs": [], "source": [ + "# Initialize third-party libraries and the OpenMC Python API\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", @@ -35,7 +33,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "To use the search functionality of `openmc.KeffSearch`, we require a function which creates an `openmc.model.Model` object. The first parameter of this function will be modified during the search process for our critical eigenvalue.\n", + "# Create Parametrized Model\n", + "\n", + "To perform the search we will use the `openmc.search_for_keff` function. This function requires a different function be defined which creates an parametrized model to analyze. This model is required to be stored in an `openmc.model.Model` object. The first parameter of this function will be modified during the search process for our critical eigenvalue.\n", "\n", "Our model will be a pin-cell from the [Multi-Group Mode Part II](./mg-mode-part-ii.rst) assembly, except this time the entire model building process will be contained within a function, and the Boron concentration will be parametrized." ] @@ -131,9 +131,9 @@ "source": [ "# Search for the Critical Boron Concentration\n", "\n", - "To perform the search we will initialize the `openmc.KeffSearch` object by passing it the model building function (`build_model`) and a bracketed range for the expected critical Boron concentration (1,000 to 2,500 ppm). We could also used a single initial guess, but have elected not to in this example. Finally, due to the high noise inherent in using as few histories as are used in this example, a bisection method will be used for the search.\n", + "To perform the search we imply call the `openmc.search_for_keff` function and pass in the relvant arguments. For our purposes we will be passing in the model building function (`build_model` defined above), a bracketed range for the expected critical Boron concentration (1,000 to 2,500 ppm), the tolerance, and the method we wish to use. \n", "\n", - "We will also set the `print_iterations` attribute of `openmc.KeffSearch` to `True` so we can display the iteration progress." + "Instead of the bracketed range we could have used a single initial guess, but have elected not to in this example. Finally, due to the high noise inherent in using as few histories as are used in this example, our tolerance on the final keff value will be rather large (1.e-2) and a bisection method will be used for the search." ] }, { @@ -147,25 +147,24 @@ "name": "stdout", "output_type": "stream", "text": [ - "Iteration: 0; Guess of 1.00e+03 produced a keff of 1.08721 +/- 0.00158\n", - "Iteration: 1; Guess of 2.50e+03 produced a keff of 0.95263 +/- 0.00147\n", - "Iteration: 2; Guess of 1.75e+03 produced a keff of 1.01466 +/- 0.00163\n", - "Iteration: 3; Guess of 2.12e+03 produced a keff of 0.98475 +/- 0.00167\n", - "Iteration: 4; Guess of 1.94e+03 produced a keff of 0.99954 +/- 0.00154\n", - "Iteration: 5; Guess of 1.84e+03 produced a keff of 1.00428 +/- 0.00162\n", - "Iteration: 6; Guess of 1.89e+03 produced a keff of 1.00633 +/- 0.00166\n", - "Iteration: 7; Guess of 1.91e+03 produced a keff of 1.00388 +/- 0.00166\n", - "Iteration: 8; Guess of 1.93e+03 produced a keff of 0.99813 +/- 0.00142\n", + "Iteration: 1; Guess of 1.00e+03 produced a keff of 1.08721 +/- 0.00158\n", + "Iteration: 2; Guess of 2.50e+03 produced a keff of 0.95263 +/- 0.00147\n", + "Iteration: 3; Guess of 1.75e+03 produced a keff of 1.01466 +/- 0.00163\n", + "Iteration: 4; Guess of 2.12e+03 produced a keff of 0.98475 +/- 0.00167\n", + "Iteration: 5; Guess of 1.94e+03 produced a keff of 0.99954 +/- 0.00154\n", + "Iteration: 6; Guess of 1.84e+03 produced a keff of 1.00428 +/- 0.00162\n", + "Iteration: 7; Guess of 1.89e+03 produced a keff of 1.00633 +/- 0.00166\n", + "Iteration: 8; Guess of 1.91e+03 produced a keff of 1.00388 +/- 0.00166\n", + "Iteration: 9; Guess of 1.93e+03 produced a keff of 0.99813 +/- 0.00142\n", "Critical Boron Concentration: 1926 ppm\n" ] } ], "source": [ - "# Initialize our searching object\n", - "searcher = openmc.KeffSearch(build_model, bracket=[1000., 2500.])\n", - "# Perform the search with a tolerance that is larger in magnitude to the eigenvalue uncertainty we expect\n", - "searcher.print_iterations = True\n", - "crit_ppm = searcher.search(tol=1.E-2, bracketed_method='bisect')\n", + "# Perform the search\n", + "crit_ppm, guesses, keffs = openmc.search_for_keff(build_model, bracket=[1000., 2500.],\n", + " tol=1.E-2, bracketed_method='bisect',\n", + " print_iterations=True)\n", "\n", "print('Critical Boron Concentration: {:4.0f} ppm'.format(crit_ppm))" ] @@ -174,7 +173,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Finally, the `openmc.KeffSearch` object was storing our critical boron concentration guesses and the corresponding eigenvalue from OpenMC. Let's use that information to make a quick plot of the value of keff versus the boron concentration." + "Finally, the `openmc.search_for_keff` function also provided us with `List`s of the guesses and corresponding keff values generated during the search process with OpenMC. Let's use that information to make a quick plot of the value of keff versus the boron concentration." ] }, { @@ -188,7 +187,7 @@ "data": { "image/png": "iVB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W7ClvAfxtRPwmfSHY\nLCIeknQ9r34R+PeIWCBpbCM7j4g7JO0F/FhZP3sAM1P1OcC1kl5L9ujR83rY3L+TdakvlLSB7Nr1\n1cp+RnZV6jYfClxJ1qNQz73ARel9qfXrhH8Fvifp/WnZyln/QmCjpEfIrnsvyK3zBeCbkhaSXS8/\np4e29OQPwMGS5pONtTgjV/dbST8nG3D54e3cj9mA4afemVmpSVoXEbvUm8+VzyX7dUPnduzrerKB\nhbf0dhtmRXA3vpmV3e/UTzfVAU6gsXEIZv3KZ/ZmZmYl5zN7MzOzknOyNzMzKzknezMzs5Jzsjcz\nMys5J3szM7OSc7I3MzMruf8PsJgBT1rI6FgAAAAASUVORK5CYII=\n", "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -198,7 +197,8 @@ "source": [ "plt.figure(figsize=(8, 4.5))\n", "plt.title('Eigenvalue versus Boron Concentration')\n", - "plt.scatter(searcher.guesses, searcher.keffs)\n", + "# Create a scatter plot using the mean value of keff\n", + "plt.scatter(guesses, [keffs[i][0] for i in range(len(keffs))])\n", "plt.xlabel('Boron Concentration [ppm]')\n", "plt.ylabel('Eigenvalue')\n", "plt.show()" diff --git a/openmc/search.py b/openmc/search.py index 69e301c216..c3b3bf0bcb 100644 --- a/openmc/search.py +++ b/openmc/search.py @@ -9,8 +9,69 @@ import openmc.checkvalue as cv _SCALAR_BRACKETED_METHODS = ['brentq', 'brenth', 'ridder', 'bisect'] -class KeffSearch(object): - """Class to perform a keff search by modifying a model parametrized by a +def _search_keff(guess, target, model_builder, model_args, print_iterations, + print_output, guesses, results): + """Function which will actually create our model, run the calculation, and + obtain the result. This function will be passed to the root finding + algorithm + + Parameters + ---------- + guess : Real + Current guess for the parameter to be searched in `model_builder`. + target_keff : Real + Value to search for + model_builder : collections.Callable + Callable function which builds a model according to a passed + parameter. This function must return an openmc.model.Model object. + model_args : dict + Keyword-based arguments to pass to the `model_builder` method. + print_iterations : bool + Whether or not to print the guess and the resultant keff during the + iteration process. + print_output : bool + Whether or not to print the OpenMC output during the iterations. + guesses : Iterable of Real + Running list of guesses thus far, to be updated during the execution of + this function. + results : Iterable of Real + Running list of results thus far, to be updated during the execution of + this function. + + Returns + ------- + float + Value of the model for the current guess compared to the target value. + + """ + + # Build the model + model = model_builder(guess, **model_args) + + # Run the model and obtain keff + keff = model.run(output=print_output) + + # Close the model to ensure HDF5 will allow access during the next + # OpenMC execution + model.close() + + # Record the history + guesses.append(guess) + results.append(keff) + + if print_iterations: + text = 'Iteration: {}; Guess of {:.2e} produced a keff of ' + \ + '{:1.5f} +/- {:1.5f}' + print(text.format(len(guesses), guess, keff[0], keff[1])) + + return (keff[0] - target) + + +def search_for_keff(model_builder, initial_guess=None, target=1.0, + bracket=None, model_args={}, tol=None, + bracketed_method='bisect', print_iterations=False, + print_output=False, **kwargs): + """Function to perform a keff search by modifying a model parametrized by a single independent variable. Parameters @@ -18,230 +79,119 @@ class KeffSearch(object): model_builder : collections.Callable Callable function which builds a model according to a passed parameter. This function must return an openmc.model.Model object. - guess : Real, optional + initial_guess : Real, optional Initial guess for the parameter to be searched in - :param:`model_builder`. One of :param:`guess` or :param`bracket` must - be provided. - target_keff : Real, optional + `model_builder`. One of `guess` or `bracket` must be provided. + target : Real, optional keff value to search for, defaults to 1.0. bracket : None or Iterable of Real, optional Bracketing interval to search for the solution; if not provided, a generic non-bracketing method is used. If provided, the brackets - are used. Defaults to no brackets provided. One of :param:`guess` or - :param`bracket` must be provided. If both are provided, the bracket - will be preferentially used. - - Attributes - ---------- - model_builder : FunctionType - Callable function which builds a model according to parameters passed. - This function must return an openmc.model.Model - object. - initial_guess : Iterable of Real - Initial guess for the parameter to be searched in - :param:`model_builder`. - target_keff : Real - keff value to search for. - bracket : None or Iterable of Real - Bracketing interval to search for the solution; if not provided, - a generic non-bracketing method is used. If provided, the brackets - are used. + are used. Defaults to no brackets provided. One of `guess` or `bracket` + must be provided. If both are provided, the bracket will be + preferentially used. model_args : dict - Keyword-based arguments to pass to the :param:`model_builder` method. + Keyword-based arguments to pass to the `model_builder` method. + tol : float + Tolerance to pass to the search method + bracketed_method : {'brentq', 'brenth', 'ridder', 'bisect'}, optional + Solution method to use; only applies if + :param:`bracket` is set, otherwise the Secant method is used. + Defaults to 'bisect'. print_iterations : bool - Whether or not to print the guess and the resultant keff during the - iteration process. Defaults to False. + Whether or not to print the guess and the result during the iteration + process. Defaults to False. print_output : bool Whether or not to print the OpenMC output during the iterations. Defaults to False. + **kwargs + All remaining keyword arguments are passed to the root-finding + method. + + Returns + ------- + zero_value : float + Estimated value of the variable parameter where keff is the + targeted value guesses : List of Real List of guesses attempted by the search - keffs : List of Real - List of keffs corresponding to the guess attempted by the search - keff_uncs : List of Real - List of keff uncertainties corresponding to the guess attempted by the - search + results : List of 2-tuple of Real + List of keffs and uncertainties corresponding to the guess attempted by + the search """ - def __init__(self, model_builder, guess=None, bracket=None, - target_keff=1.0, model_args={}): - self.initial_guess = guess - self.bracket = bracket - self.model_args = model_args - self.model_builder = model_builder - self.target_keff = target_keff - self.guesses = [] - self.keffs = [] - self.keff_uncs = [] - self.print_iterations = False - self.print_output = False + if initial_guess is not None: + cv.check_type('initial_guess', initial_guess, Real) + if bracket is not None: + cv.check_iterable_type('bracket', bracket, Real) + cv.check_length('bracket', bracket, 2) + cv.check_less_than('bracket values', bracket[0], bracket[1]) + cv.check_type('model_args', model_args, dict) + cv.check_type('target', target, Real) + cv.check_type('tol', tol, Real) + cv.check_value('bracketed_method', bracketed_method, + _SCALAR_BRACKETED_METHODS) + cv.check_type('print_iterations', print_iterations, bool) + cv.check_type('print_output', print_output, bool) + cv.check_type('model_builder', model_builder, Callable) - @property - def model_builder(self): - return self._model_builder + # Run the model builder function once to make sure it provides the correct + # output type + if bracket is not None: + model = model_builder(bracket[0], **model_args) + elif initial_guess is not None: + model = model_builder(initial_guess, **model_args) + cv.check_type('model_builder return', model, openmc.model.Model) - @property - def initial_guess(self): - return self._initial_guess + import scipy.optimize as sopt - @property - def bracket(self): - return self._bracket + # Set the iteration data storage variables + guesses = [] + results = [] - @property - def target_keff(self): - return self._target_keff + # Set the searching function (for easy replacement should a later + # generic function be added. + search_function = _search_keff - @property - def print_iterations(self): - return self._print_iterations + if bracket is not None: + # Generate our arguments + args = {'f': search_function, 'a': bracket[0], 'b': bracket[1]} + if tol is not None: + args['rtol'] = tol - @property - def print_output(self): - return self._print_output + # Set the root finding method + if bracketed_method == 'brentq': + root_finder = sopt.brentq + elif bracketed_method == 'brenth': + root_finder = sopt.brenth + elif bracketed_method == 'ridder': + root_finder = sopt.ridder + elif bracketed_method == 'bisect': + root_finder = sopt.bisect - @property - def model_args(self): - return self._model_args + elif initial_guess is not None: - @model_builder.setter - def model_builder(self, model_builder): - # Make sure model_builder is a function - cv.check_type('model_builder', model_builder, Callable) + # Generate our arguments + args = {'func': search_function, 'x0': initial_guess} + if tol is not None: + args['tol'] = tol - # Run the model builder function once to make sure it provides the - # correct output type - if self.bracket is not None: - model = model_builder(self.bracket[0], **self.model_args) - elif self.initial_guess is not None: - model = model_builder(self.initial_guess, **self.model_args) - cv.check_type('model_builder return', model, openmc.model.Model) - self._model_builder = model_builder + # Set the root finding method + root_finder = sopt.newton - @initial_guess.setter - def initial_guess(self, initial_guess): - if initial_guess is not None: - cv.check_type('initial_guess', initial_guess, Real) - self._initial_guess = initial_guess + else: + raise ValueError("Either the 'bracket' or 'initial_guess' parameters " + "must be set") - @bracket.setter - def bracket(self, bracket): - if bracket is not None: - cv.check_iterable_type('bracket', bracket, Real) - cv.check_length('bracket', bracket, 2) - self._bracket = bracket + # Add information to be passed to the searching function + args['args'] = (target, model_builder, model_args, print_iterations, + print_output, guesses, results) - @target_keff.setter - def target_keff(self, target_keff): - cv.check_type('target_keff', target_keff, Real) - self._target_keff = target_keff + # Create a new dictionary with the arguments from args and kwargs + args.update(kwargs) - @print_iterations.setter - def print_iterations(self, print_iterations): - cv.check_type('print_iterations', print_iterations, bool) - self._print_iterations = print_iterations + # Perform the search + zero_value = root_finder(**args) - @print_output.setter - def print_output(self, print_output): - cv.check_type('print_output', print_output, bool) - self._print_output = print_output - - @model_args.setter - def model_args(self, model_args): - cv.check_type('model_args', model_args, dict) - self._model_args = model_args - - def _search_function(self, guess): - # Build the model - model = self.model_builder(guess, **self.model_args) - - # Run the model - keff = model.run(output=self._print_output) - - # Close the model to ensure HDF5 will allow access during the next - # OpenMC execution - model.close() - - # Record the history - self.guesses.append(guess) - self.keffs.append(keff[0]) - self.keff_uncs.append(keff[1]) - - if self._print_iterations: - text = 'Iteration: {}; Guess of {:.2e} produced a keff of ' + \ - '{:1.5f} +/- {:1.5f}' - print(text.format(self._i, guess, keff[0], keff[1])) - self._i += 1 - - return (keff[0] - self.target_keff) - - def search(self, tol=None, bracketed_method='brentq', **kwargs): - """Apply root-finding algorithm to search for the target k-eigenvalue - - Parameters - ---------- - tol : float - Tolerance to pass to the search method - bracketed_method : {'brentq', 'brenth', 'ridder', 'bisect'}, optional - Solution method to use; only applies if - :param:`bracket` is set, otherwise the Secant method is used. - Defaults to 'brentq'. - **kwargs - All remaining keyword arguments are passed to the root-finding - method. - - Returns - ------- - zero_value : float - Estimated value of the variable parameter where keff is the - targeted value - - """ - - cv.check_value('bracketed_method', bracketed_method, - _SCALAR_BRACKETED_METHODS) - - import scipy.optimize as sopt - - if self.bracket is not None: - # Generate our arguments - args = {'f': self._search_function, 'a': self.bracket[0], - 'b': self.bracket[1]} - if tol is not None: - args['rtol'] = tol - - # Set the root finding method - if bracketed_method == 'brentq': - root_finder = sopt.brentq - elif bracketed_method == 'brenth': - root_finder = sopt.brenth - elif bracketed_method == 'ridder': - root_finder = sopt.ridder - elif bracketed_method == 'bisect': - root_finder = sopt.bisect - - elif self.initial_guess is not None: - - # Generate our arguments - args = {'func': self._search_function, 'x0': self.initial_guess} - if tol is not None: - args['tol'] = tol - - # Set the root finding method - root_finder = sopt.newton - - else: - raise ValueError("One of the 'bracket' or 'initial_guess' " - "parameters must be set") - - # Set the iteration counter - self._i = 0 - - # Create a new dictionary with the arguments from args and kwargs - args.update(kwargs) - - # Perform the search - zero_value = root_finder(**args) - - return zero_value + return zero_value, guesses, results From f375d815555b319f45f0de75bb39629e8133d406 Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Wed, 22 Mar 2017 19:09:04 -0400 Subject: [PATCH 17/17] Added sentinel value for model_args parameter of search_for_keff function --- docs/source/pythonapi/index.rst | 2 +- openmc/search.py | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/source/pythonapi/index.rst b/docs/source/pythonapi/index.rst index 004d3809a3..161b8564ab 100644 --- a/docs/source/pythonapi/index.rst +++ b/docs/source/pythonapi/index.rst @@ -173,7 +173,7 @@ Running OpenMC openmc.calculate_volumes openmc.plot_geometry openmc.plot_inline - openmc.KeffSearch + openmc.search_for_keff Post-processing --------------- diff --git a/openmc/search.py b/openmc/search.py index c3b3bf0bcb..dd2c4345af 100644 --- a/openmc/search.py +++ b/openmc/search.py @@ -68,7 +68,7 @@ def _search_keff(guess, target, model_builder, model_args, print_iterations, def search_for_keff(model_builder, initial_guess=None, target=1.0, - bracket=None, model_args={}, tol=None, + bracket=None, model_args=None, tol=None, bracketed_method='bisect', print_iterations=False, print_output=False, **kwargs): """Function to perform a keff search by modifying a model parametrized by a @@ -90,13 +90,14 @@ def search_for_keff(model_builder, initial_guess=None, target=1.0, are used. Defaults to no brackets provided. One of `guess` or `bracket` must be provided. If both are provided, the bracket will be preferentially used. - model_args : dict - Keyword-based arguments to pass to the `model_builder` method. + model_args : dict, optional + Keyword-based arguments to pass to the `model_builder` method. Defaults + to no arguments. tol : float Tolerance to pass to the search method bracketed_method : {'brentq', 'brenth', 'ridder', 'bisect'}, optional Solution method to use; only applies if - :param:`bracket` is set, otherwise the Secant method is used. + `bracket` is set, otherwise the Secant method is used. Defaults to 'bisect'. print_iterations : bool Whether or not to print the guess and the result during the iteration @@ -127,7 +128,10 @@ def search_for_keff(model_builder, initial_guess=None, target=1.0, cv.check_iterable_type('bracket', bracket, Real) cv.check_length('bracket', bracket, 2) cv.check_less_than('bracket values', bracket[0], bracket[1]) - cv.check_type('model_args', model_args, dict) + if model_args is None: + model_args = {} + else: + cv.check_type('model_args', model_args, dict) cv.check_type('target', target, Real) cv.check_type('tol', tol, Real) cv.check_value('bracketed_method', bracketed_method,