mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 21:25:36 -04:00
Merge remote-tracking branch 'upstream/develop' into minimalist-imports
This commit is contained in:
commit
a596ba3ec3
8 changed files with 136 additions and 42 deletions
|
|
@ -27,7 +27,7 @@ before_install:
|
|||
- conda config --set always_yes yes --set changeps1 no
|
||||
- conda update -q conda
|
||||
- conda info -a
|
||||
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION numpy scipy h5py pandas
|
||||
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION numpy scipy h5py=2.5 pandas
|
||||
- source activate test-environment
|
||||
|
||||
# Install GCC, MPICH, HDF5, PHDF5
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
.. _pythonapi_energy_groups:
|
||||
|
||||
=============
|
||||
Energy Groups
|
||||
=============
|
||||
|
||||
.. automodule:: openmc.mgxs.groups
|
||||
:members:
|
||||
|
|
@ -19,6 +19,7 @@ on a given module or class.
|
|||
:maxdepth: 1
|
||||
|
||||
ace
|
||||
mgxs_library
|
||||
|
||||
**Creating input files:**
|
||||
|
||||
|
|
@ -65,8 +66,6 @@ on a given module or class.
|
|||
:maxdepth: 1
|
||||
|
||||
mgxs
|
||||
energy_groups
|
||||
mgxs_library
|
||||
|
||||
**Example Jupyter Notebooks:**
|
||||
|
||||
|
|
|
|||
|
|
@ -4,31 +4,57 @@
|
|||
Multi-Group Cross Sections
|
||||
==========================
|
||||
|
||||
.. currentmodule:: openmc.mgxs.mgxs
|
||||
|
||||
----------------------------
|
||||
Summary of Available Classes
|
||||
----------------------------
|
||||
|
||||
Energy Groups
|
||||
-------------
|
||||
|
||||
.. currentmodule:: openmc.mgxs.groups
|
||||
|
||||
.. autosummary::
|
||||
|
||||
MGXS
|
||||
AbsorptionXS
|
||||
CaptureXS
|
||||
Chi
|
||||
FissionXS
|
||||
NuFissionXS
|
||||
NuScatterXS
|
||||
NuScatterMatrixXS
|
||||
ScatterXS
|
||||
ScatterMatrixXS
|
||||
TotalXS
|
||||
TransportXS
|
||||
EnergyGroups
|
||||
|
||||
Multi-group Cross Sections
|
||||
--------------------------
|
||||
|
||||
.. currentmodule:: openmc.mgxs.mgxs
|
||||
|
||||
.. autosummary::
|
||||
|
||||
MGXS
|
||||
AbsorptionXS
|
||||
CaptureXS
|
||||
Chi
|
||||
FissionXS
|
||||
NuFissionXS
|
||||
NuScatterXS
|
||||
NuScatterMatrixXS
|
||||
ScatterXS
|
||||
ScatterMatrixXS
|
||||
TotalXS
|
||||
TransportXS
|
||||
|
||||
Multi-group Cross Section Libraries
|
||||
-----------------------------------
|
||||
|
||||
.. currentmodule:: openmc.mgxs.library
|
||||
|
||||
.. autosummary::
|
||||
|
||||
Library
|
||||
|
||||
-------------------
|
||||
Class Documentation
|
||||
-------------------
|
||||
|
||||
.. automodule:: openmc.mgxs.groups
|
||||
:members:
|
||||
|
||||
.. currentmodule:: openmc.mgxs.mgxs
|
||||
|
||||
.. autoclass:: MGXS
|
||||
:members:
|
||||
|
||||
|
|
@ -64,3 +90,6 @@ Class Documentation
|
|||
|
||||
.. autoclass:: TransportXS
|
||||
:members:
|
||||
|
||||
.. automodule:: openmc.mgxs.library
|
||||
:members:
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
.. _pythonapi_mgxs_library:
|
||||
|
||||
============
|
||||
MGXS Library
|
||||
============
|
||||
==============================
|
||||
Multi-group Cross Section Data
|
||||
==============================
|
||||
|
||||
.. automodule:: openmc.mgxs.library
|
||||
.. automodule:: openmc.mgxs_library
|
||||
:members:
|
||||
|
|
|
|||
|
|
@ -723,9 +723,8 @@ class MaterialsFile(object):
|
|||
material.make_isotropic_in_lab()
|
||||
|
||||
def _create_material_subelements(self):
|
||||
subelement = ET.SubElement(self._materials_file, "default_xs")
|
||||
|
||||
if self._default_xs is not None:
|
||||
subelement = ET.SubElement(self._materials_file, "default_xs")
|
||||
subelement.text = self._default_xs
|
||||
|
||||
for material in self._materials:
|
||||
|
|
|
|||
|
|
@ -87,8 +87,9 @@ class XSdata(object):
|
|||
----------
|
||||
name : str, optional
|
||||
Name of the mgxs data set.
|
||||
|
||||
representation : {'isotropic', 'angle'}
|
||||
energy_groups : openmc.mgxs.EnergyGroups
|
||||
Energygroup structure
|
||||
representation : {'isotropic', 'angle'}, optional
|
||||
Method used in generating the MGXS (isotropic or angle-dependent flux
|
||||
weighting). Defaults to 'isotropic'
|
||||
|
||||
|
|
@ -99,10 +100,10 @@ class XSdata(object):
|
|||
alias : str
|
||||
Separate unique identifier for the xsdata object
|
||||
kT : float
|
||||
Temperature (in units of MeV) of this data set.
|
||||
energy_groups : EnergyGroups
|
||||
Temperature (in units of MeV).
|
||||
energy_groups : openmc.mgxs.EnergyGroups
|
||||
Energy group structure
|
||||
fissionable : boolean
|
||||
fissionable : bool
|
||||
Whether or not this is a fissionable data set.
|
||||
scatt_type : {'legendre', 'histogram', or 'tabular'}
|
||||
Angular distribution representation (legendre, histogram, or tabular)
|
||||
|
|
@ -115,6 +116,85 @@ class XSdata(object):
|
|||
Legendre polynomial form). Dict contains two keys: 'enable' and
|
||||
'num_points'. 'enable' is a boolean and 'num_points' is the
|
||||
number of points to use, if 'enable' is True.
|
||||
num_azimuthal : int
|
||||
Number of equal width angular bins that the azimuthal angular domain is
|
||||
subdivided into. This only applies when ``representation`` is "angle".
|
||||
num_polar : int
|
||||
Number of equal width angular bins that the polar angular domain is
|
||||
subdivided into. This only applies when ``representation`` is "angle".
|
||||
total : numpy.ndarray
|
||||
Group-wise total cross section ordered by increasing group index (i.e.,
|
||||
fast to thermal). If ``representation`` is "isotropic", then the length
|
||||
of this list should equal the number of groups described in the
|
||||
``groups`` element. If ``representation`` is "angle", then the length
|
||||
of this list should equal the number of groups times the number of
|
||||
azimuthal angles times the number of polar angles, with the
|
||||
inner-dimension being groups, intermediate-dimension being azimuthal
|
||||
angles and outer-dimension being the polar angles.
|
||||
absorption : numpy.ndarray
|
||||
Group-wise absorption cross section ordered by increasing group index
|
||||
(i.e., fast to thermal). If ``representation`` is "isotropic", then the
|
||||
length of this list should equal the number of groups described in the
|
||||
``groups`` attribute. If ``representation`` is "angle", then the length
|
||||
of this list should equal the number of groups times the number of
|
||||
azimuthal angles times the number of polar angles, with the
|
||||
inner-dimension being groups, intermediate-dimension being azimuthal
|
||||
angles and outer-dimension being the polar angles.
|
||||
scatter : numpy.ndarray
|
||||
Scattering moment matrices presented with the columns representing
|
||||
incoming group and rows representing the outgoing group. That is,
|
||||
down-scatter will be above the diagonal of the resultant matrix. This
|
||||
matrix is repeated for every Legendre order (in order of increasing
|
||||
orders) if ``scatt_type`` is "legendre"; otherwise, this matrix is
|
||||
repeated for every bin of the histogram or tabular representation.
|
||||
Finally, if ``representation`` is "angle", the above is repeated for
|
||||
every azimuthal angle and every polar angle, in that order.
|
||||
multiplicity : numpy.ndarray
|
||||
Ratio of neutrons produced in scattering collisions to the neutrons
|
||||
which undergo scattering collisions; that is, the multiplicity provides
|
||||
the code with a scaling factor to account for neutrons being produced in
|
||||
(n,xn) reactions. This information is assumed isotropic and therefore
|
||||
does not need to be repeated for every Legendre moment or
|
||||
histogram/tabular bin. This matrix follows the same arrangement as
|
||||
described for the ``scatter`` attribute, with the exception of the data
|
||||
needed to provide the scattering type information.
|
||||
fission : numpy.ndarray
|
||||
Group-wise fission cross section ordered by increasing group index
|
||||
(i.e., fast to thermal). If ``representation`` is "isotropic", then the
|
||||
length of this list should equal the number of groups described in the
|
||||
``groups`` attribute. If ``representation`` is "angle", then the length
|
||||
of this list should equal the number of groups times the number of
|
||||
azimuthal angles times the number of polar angles, with the
|
||||
inner-dimension being groups, intermediate-dimension being azimuthal
|
||||
angles and outer-dimension being the polar angles.
|
||||
k_fission : numpy.ndarray
|
||||
Group-wise kappa-fission cross section ordered by increasing group index
|
||||
(i.e., fast to thermal). If ``representation`` is "isotropic", then the
|
||||
length of this list should equal the number of groups described in the
|
||||
``groups`` attribute. If ``representation`` is "angle", then the length
|
||||
of this list should equal the number of groups times the number of
|
||||
azimuthal angles times the number of polar angles, with the
|
||||
inner-dimension being groups, intermediate-dimension being azimuthal
|
||||
angles and outer-dimension being the polar angles.
|
||||
chi : numpy.ndarray
|
||||
Group-wise fission spectra ordered by increasing group index (i.e., fast
|
||||
to thermal). This attribute should be used if making the common
|
||||
approximation that the fission spectra does not depend on incoming
|
||||
energy. If the user does not wish to make this approximation, then this
|
||||
should not be provided and this information included in the
|
||||
``nu_fission`` element instead. If ``representation`` is "isotropic",
|
||||
then the length of this list should equal the number of groups described
|
||||
in the ``groups`` element. If ``representation`` is "angle", then the
|
||||
length of this list should equal the number of groups times the number
|
||||
of azimuthal angles times the number of polar angles, with the
|
||||
inner-dimension being groups, intermediate-dimension being azimuthal
|
||||
angles and outer-dimension being the polar angles.
|
||||
nu_fission : numpy.ndarray
|
||||
Group-wise fission production cross section vector (i.e., if ``chi`` is
|
||||
provided), or is the group-wise fission production matrix. If providing
|
||||
the vector, it should be ordered the same as the ``fission`` data. If
|
||||
providing the matrix, it should be ordered the same as the
|
||||
``multiplicity`` matrix.
|
||||
|
||||
"""
|
||||
def __init__(self, name, energy_groups, representation="isotropic"):
|
||||
|
|
@ -577,8 +657,6 @@ class MGXSLibraryFile(object):
|
|||
Energy group structure.
|
||||
inverse_velocities : Iterable of Real
|
||||
Inverse of velocities, units of sec/cm
|
||||
filename : str
|
||||
XML file to write to.
|
||||
xsdatas : Iterable of XSdata
|
||||
Iterable of multi-Group cross section data objects
|
||||
"""
|
||||
|
|
@ -717,6 +795,3 @@ class MGXSLibraryFile(object):
|
|||
tree = ET.ElementTree(self._cross_sections_file)
|
||||
tree.write(filename, xml_declaration=True,
|
||||
encoding='utf-8', method="xml")
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
5c2fdde85affcd44c1b02c07c300acb8e5c189c1adbf7aa079e37a68e8b8313678fc292bd7f6e0d0957f723e05b8146bd165cf3315dde5f6b2f88ebc954cd65e
|
||||
526c91551d9a80dc01216e5cb04162253f12ec684cc2b4912ca18cfc510f1ea2e5303029f1c1607882082b0c2c8a47f25dd5be14678f449a1579e3601d1bdec5
|
||||
Loading…
Add table
Add a link
Reference in a new issue