Modified *CROSS_SECTIONS envvar to be OPENMC_*CROSS_SECTIONS, incorporated latest comments from @paulromano. Next is to work on fixing up bank

This commit is contained in:
Adam Nelson 2016-02-22 19:51:34 -05:00
parent d7b19558d9
commit 9cbc1180d0
7 changed files with 46 additions and 41 deletions

View file

@ -112,10 +112,11 @@ standard deviation.
The ``<cross_sections>`` element has no attributes and simply indicates the path
to an XML cross section listing file (usually named cross_sections.xml). If this
element is absent from the settings.xml file, the :envvar:`CROSS_SECTIONS`
environment variable will be used to find the path to the XML cross section
listing when in continuous-energy mode, and the :envvar:`MG_CROSS_SECTIONS`
environment variable will be used in multi-group mode.
element is absent from the settings.xml file, the
:envvar:`OPENMC_CROSS_SECTIONS` environment variable will be used to find the
path to the XML cross section listing when in continuous-energy mode, and the
:envvar:`OPENMC_MG_CROSS_SECTIONS` environment variable will be used in
multi-group mode.
``<cutoff>`` Element
--------------------
@ -1728,7 +1729,7 @@ The ``<tally>`` element accepts the following sub-elements:
|inverse-velocity |The flux-weighted inverse velocity where the |
| |velocity is in units of centimeters per second. |
| |This score type is not used in the |
| |multi-group :ref:`energy_mode`. |
| |multi-group :ref:`energy_mode`. |
+----------------------+---------------------------------------------------+
|kappa-fission |The recoverable energy production rate due to |
| |fission. The recoverable energy is defined as the |

View file

@ -355,7 +355,7 @@ Testing Build
-------------
If you have ENDF/B-VII.1 cross sections from NNDC_ you can test your build.
Make sure the **CROSS_SECTIONS** environmental variable is set to the
Make sure the **OPENMC_CROSS_SECTIONS** environmental variable is set to the
*cross_sections.xml* file in the *data/nndc* directory.
There are two ways to run tests. The first is to use the Makefile present in
the source directory and run the following:
@ -405,9 +405,10 @@ extract, and set up a confiuration file:
cd openmc/data
python get_nndc_data.py
At this point, you should set the :envvar:`CROSS_SECTIONS` environment variable
to the absolute path of the file ``openmc/data/nndc/cross_sections.xml``. This
cross section set is used by the test suite.
At this point, you should set the :envvar:`OPENMC_CROSS_SECTIONS` environment
variable to the absolute path of the file
``openmc/data/nndc/cross_sections.xml``. This cross section set is used by the
test suite.
Using JEFF Cross Sections from OECD/NEA
---------------------------------------
@ -433,8 +434,8 @@ the following steps must be taken:
4. Additionally, you may need to change any occurrences of upper-case "ACE"
within the ``cross_sections.xml`` file to lower-case.
5. Either set the :ref:`cross_sections` in a settings.xml file or the
:envvar:`CROSS_SECTIONS` environment variable to the absolute path of the
``cross_sections.xml`` file.
:envvar:`OPENMC_CROSS_SECTIONS` environment variable to the absolute path of
the ``cross_sections.xml`` file.
Using Cross Sections from MCNP
------------------------------
@ -442,8 +443,9 @@ Using Cross Sections from MCNP
To use cross sections distributed with MCNP, change the <directory> element in
the ``cross_sections.xml`` file in the root directory of the OpenMC distribution
to the location of the MCNP cross sections. Then, either set the
:ref:`cross_sections` in a settings.xml file or the :envvar:`CROSS_SECTIONS`
environment variable to the absolute path of the ``cross_sections.xml`` file.
:ref:`cross_sections` in a settings.xml file or the
:envvar:`OPENMC_CROSS_SECTIONS` environment variable to the absolute path of
the ``cross_sections.xml`` file.
Using Cross Sections from Serpent
---------------------------------
@ -451,8 +453,9 @@ Using Cross Sections from Serpent
To use cross sections distributed with Serpent, change the <directory> element
in the ``cross_sections_serpent.xml`` file in the root directory of the OpenMC
distribution to the location of the Serpent cross sections. Then, either set the
:ref:`cross_sections` in a settings.xml file or the :envvar:`CROSS_SECTIONS`
environment variable to the absolute path of the ``cross_sections_serpent.xml``
:ref:`cross_sections` in a settings.xml file or the
:envvar:`OPENMC_CROSS_SECTIONS` environment variable to the absolute path of
the ``cross_sections_serpent.xml``
file.
Using Multi-Group Cross Sections
@ -462,7 +465,7 @@ Multi-group cross section libraries are generally tailored to the specific
calculation to be performed. Therefore, at this point in time, OpenMC is not
distributed with any pre-existing multi-group cross section libraries.
However, if the user has obtained or generated their own library, the user
should set the :envvar:`MG_CROSS_SECTIONS` environment variable
should set the :envvar:`OPENMC_MG_CROSS_SECTIONS` environment variable
to the absolute path of the file library expected to used most frequently.
.. _NJOY: http://t2.lanl.gov/nis/codes.shtml

View file

@ -270,7 +270,7 @@ attributes/sub-elements required to describe the meta-data:
with the inner-dimension being groups, intermediate-dimension being
azimuthal angles and outer-dimension being the polar angles.
*Default*: None, this is required only if :ref:`kappa_fission` tallies are
*Default*: None, this is required only if kappa_fission tallies are
requested and the material is fissionable.
:chi:

View file

@ -17,6 +17,7 @@ from openmc.clean_xml import *
# Supported incoming particle MGXS angular treatment representations
_REPRESENTATIONS = ['isotropic', 'angle']
def ndarray_to_string(arr):
"""Converts a numpy ndarray in to a join with spaces between entries
similar to ' '.join(map(str,arr)) but applied to all sub-dimensions.
@ -48,14 +49,14 @@ def ndarray_to_string(arr):
for i in range(shape[0]):
text += tab
for j in range(shape[1]):
text += '{:.7E} '.format(arr[i,j])
text += '{:.7E} '.format(arr[i, j])
text += indent
elif ndim == 3:
for i in range(shape[0]):
for j in range(shape[1]):
text += tab
for k in range(shape[2]):
text += '{:.7E} '.format(arr[i,j,k])
text += '{:.7E} '.format(arr[i, j, k])
text += indent
elif ndim == 4:
for i in range(shape[0]):
@ -63,7 +64,7 @@ def ndarray_to_string(arr):
for k in range(shape[2]):
text += tab
for l in range(shape[3]):
text += '{:.7E} '.format(arr[i,j,k,l])
text += '{:.7E} '.format(arr[i, j, k, l])
text += indent
elif ndim == 5:
for i in range(shape[0]):
@ -72,7 +73,7 @@ def ndarray_to_string(arr):
for l in range(shape[3]):
text += tab
for m in range(shape[4]):
text += '{:.7E} '.format(arr[i,j,k,l,m])
text += '{:.7E} '.format(arr[i, j, k, l, m])
text += indent
return text
@ -289,7 +290,7 @@ class XSdata(object):
check_value('num_points', num_points, Integral)
check_greater_than('num_points', num_points, 0)
else:
if enable == False:
if not enable:
num_points = 1
else:
num_points = 33
@ -563,6 +564,7 @@ class XSdata(object):
return element
class MGXSLibraryFile(object):
"""Multi-Group Cross Sections file used for an OpenMC simulation.
Corresponds directly to the MG version of the cross_sections.xml input file.
@ -686,7 +688,6 @@ class MGXSLibraryFile(object):
xml_element = xsdata._get_xsdata_xml()
self._cross_sections_file.append(xml_element)
def export_to_xml(self, filename='mg_cross_sections.xml'):
"""Create an mg_cross_sections.xml file that can be used for a
simulation.

View file

@ -5,7 +5,7 @@ module bank_header
implicit none
!===============================================================================
! BANK* is used for storing fission sites in eigenvalue calculations. Since all
! BANK is used for storing fission sites in eigenvalue calculations. Since all
! the state information of a neutron is not needed, this type allows sites to be
! stored with less memory
!===============================================================================

View file

@ -129,11 +129,11 @@ contains
! No cross_sections.xml file specified in settings.xml, check
! environment variable
if (run_CE) then
call get_environment_variable("CROSS_SECTIONS", env_variable)
call get_environment_variable("OPENMC_CROSS_SECTIONS", env_variable)
if (len_trim(env_variable) == 0) then
call fatal_error("No cross_sections.xml file was specified in &
&settings.xml or in the CROSS_SECTIONS environment variable. &
&OpenMC needs such a file to identify where to &
&settings.xml or in the OPENMC_CROSS_SECTIONS environment &
&variable. OpenMC needs such a file to identify where to &
&find ACE cross section libraries. Please consult the user's &
&guide at http://mit-crpg.github.io/openmc for information on &
&how to set up ACE cross section libraries.")
@ -141,11 +141,11 @@ contains
path_cross_sections = trim(env_variable)
end if
else
call get_environment_variable("MG_CROSS_SECTIONS", env_variable)
call get_environment_variable("OPENMC_MG_CROSS_SECTIONS", env_variable)
if (len_trim(env_variable) == 0) then
call fatal_error("No cross_sections.xml file was specified in &
&settings.xml or in the MG_CROSS_SECTIONS environment variable. &
&OpenMC needs such a file to identify where to &
&settings.xml or in the OPENMC_MG_CROSS_SECTIONS environment &
&variable. OpenMC needs such a file to identify where to &
&find the cross section libraries. Please consult the user's &
&guide at http://mit-crpg.github.io/openmc for information on &
&how to set up the cross section libraries.")

View file

@ -13,8 +13,8 @@ element materials {
element nuclide {
(element name { xsd:string { maxLength = "7" } } |
attribute name { xsd:string { maxLength = "7" } }) &
(element xs { xsd:string { maxLength = "3" } } |
attribute xs { xsd:string { maxLength = "3" } })? &
(element xs { xsd:string { maxLength = "5" } } |
attribute xs { xsd:string { maxLength = "5" } })? &
(element scattering { ( "data" | "iso-in-lab" ) } |
attribute scattering { ( "data" | "iso-in-lab" ) })? &
(
@ -24,17 +24,17 @@ element materials {
}* &
element macroscopic {
(element name { xsd:string { maxLength = "7" } } |
attribute name { xsd:string { maxLength = "7" } }) &
(element xs { xsd:string { maxLength = "3" } } |
attribute xs { xsd:string { maxLength = "3" } })
(element name { xsd:string } |
attribute name { xsd:string }) &
(element xs { xsd:string { maxLength = "5" } } |
attribute xs { xsd:string { maxLength = "5" } })
}* &
element element {
(element name { xsd:string { maxLength = "2" } } |
attribute name { xsd:string { maxLength = "2" } }) &
(element xs { xsd:string { maxLength = "3" } } |
attribute xs { xsd:string { maxLength = "3" } })? &
(element xs { xsd:string { maxLength = "5" } } |
attribute xs { xsd:string { maxLength = "5" } })? &
(element scattering { ( "data" | "iso-in-lab" ) } |
attribute scattering { ( "data" | "iso-in-lab" ) })? &
(
@ -46,10 +46,10 @@ element materials {
element sab {
(element name { xsd:string { maxLength = "7" } } |
attribute name { xsd:string { maxLength = "7" } }) &
(element xs { xsd:string { maxLength = "3" } } |
attribute xs { xsd:string { maxLength = "3" } })?
(element xs { xsd:string { maxLength = "5" } } |
attribute xs { xsd:string { maxLength = "5" } })?
}*
}+ &
element default_xs { xsd:string { maxLength = "3" } }?
element default_xs { xsd:string { maxLength = "5" } }?
}