mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-29 06:35:48 -04:00
Merge branch 'develop' into properties-exim
This commit is contained in:
commit
c9d84310d3
71 changed files with 4811 additions and 3405 deletions
|
|
@ -19,7 +19,7 @@ Each ``<surface>`` element can have the following attributes or sub-elements:
|
|||
|
||||
:name:
|
||||
An optional string name to identify the surface in summary output
|
||||
files. This string is limited to 52 characters for formatting purposes.
|
||||
files.
|
||||
|
||||
*Default*: ""
|
||||
|
||||
|
|
@ -122,7 +122,6 @@ Each ``<cell>`` element can have the following attributes or sub-elements:
|
|||
|
||||
:name:
|
||||
An optional string name to identify the cell in summary output files.
|
||||
This string is limmited to 52 characters for formatting purposes.
|
||||
|
||||
*Default*: ""
|
||||
|
||||
|
|
@ -235,7 +234,7 @@ the following attributes or sub-elements:
|
|||
|
||||
:name:
|
||||
An optional string name to identify the lattice in summary output
|
||||
files. This string is limited to 52 characters for formatting purposes.
|
||||
files.
|
||||
|
||||
*Default*: ""
|
||||
|
||||
|
|
@ -301,7 +300,7 @@ the following attributes or sub-elements:
|
|||
|
||||
:name:
|
||||
An optional string name to identify the hex_lattice in summary output
|
||||
files. This string is limited to 52 characters for formatting purposes.
|
||||
files.
|
||||
|
||||
*Default*: ""
|
||||
|
||||
|
|
@ -370,3 +369,40 @@ Here is an example of a properly defined 2d hexagonal lattice:
|
|||
202
|
||||
</universes>
|
||||
</hex_lattice>
|
||||
|
||||
|
||||
.. _dagmc_element:
|
||||
|
||||
----------------------------
|
||||
``<dagmc_universe>`` Element
|
||||
----------------------------
|
||||
|
||||
Each ``<dagmc_universe>`` element can have the following attributes or sub-elements:
|
||||
|
||||
:id:
|
||||
A unique integer used to identify the universe.
|
||||
|
||||
*Default*: None
|
||||
|
||||
:name:
|
||||
An optional string name to identify the surface in summary output
|
||||
files.
|
||||
|
||||
*Default*: None
|
||||
|
||||
:auto_geom_ids:
|
||||
Boolean value indicating whether the existing geometry IDs will be used or appended
|
||||
to the existing ID space of natively defined OpenMC geometry entities.
|
||||
|
||||
*Default*: false
|
||||
|
||||
:auto_mat_ids:
|
||||
Boolean value indicating whether the existing material IDs will be used or appended
|
||||
to the existing ID space of natively defined OpenMC materials.
|
||||
|
||||
*Default*: false
|
||||
|
||||
:filename:
|
||||
A required string indicating the file to be loaded representing the DAGMC universe.
|
||||
|
||||
*Default*: None
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ Each ``material`` element can have the following attributes or sub-elements:
|
|||
|
||||
:name:
|
||||
An optional string name to identify the material in summary output
|
||||
files. This string is limited to 52 characters for formatting purposes.
|
||||
files.
|
||||
|
||||
*Default*: ""
|
||||
|
||||
|
|
|
|||
|
|
@ -88,14 +88,6 @@ you care. This element has the following attributes/sub-elements:
|
|||
|
||||
*Default*: 0.0
|
||||
|
||||
--------------------------------
|
||||
``<dagmc>`` Element
|
||||
--------------------------------
|
||||
|
||||
When the DAGMC mode is enabled, the OpenMC geometry will be read from the file
|
||||
``dagmc.h5m``. If a :ref:`geometry.xml <io_geometry>` file is present with
|
||||
``dagmc`` set to ``true``, it will be ignored.
|
||||
|
||||
----------------------------
|
||||
``<delayed_photon_scaling>``
|
||||
----------------------------
|
||||
|
|
|
|||
|
|
@ -24,8 +24,6 @@ The current version of the summary file format is 6.0.
|
|||
- **n_universes** (*int*) -- Number of unique universes in the
|
||||
problem.
|
||||
- **n_lattices** (*int*) -- Number of lattices in the problem.
|
||||
- **dagmc** (*int*) -- Indicates that a DAGMC geometry was used
|
||||
if present.
|
||||
|
||||
**/geometry/cells/cell <uid>/**
|
||||
|
||||
|
|
@ -49,6 +47,8 @@ The current version of the summary file format is 6.0.
|
|||
- **lattice** (*int*) -- Unique ID of the lattice which fills the
|
||||
cell. Only present if fill_type is set to 'lattice'.
|
||||
- **region** (*char[]*) -- Region specification for the cell.
|
||||
- **geom_type** (*char[]*) -- Type of geometry used to create the cell.
|
||||
Either 'csg' or 'dagmc'.
|
||||
|
||||
**/geometry/surfaces/surface <uid>/**
|
||||
|
||||
|
|
@ -62,12 +62,27 @@ The current version of the summary file format is 6.0.
|
|||
- **boundary_condition** (*char[]*) -- Boundary condition applied to
|
||||
the surface. Can be 'transmission', 'vacuum', 'reflective', or
|
||||
'periodic'.
|
||||
- **geom_type** (*char[]*) -- Type of geometry used to create the cell.
|
||||
Either 'csg' or 'dagmc'.
|
||||
|
||||
|
||||
**/geometry/universes/universe <uid>/**
|
||||
|
||||
:Datasets:
|
||||
- **cells** (*int[]*) -- Array of unique IDs of cells that appear in
|
||||
the universe.
|
||||
- **geom_type** (*char[]*) -- Type of geometry used to create the cell.
|
||||
Either 'csg' or 'dagmc'.
|
||||
- **filename** (*char[]*) -- Name of the DAGMC file representing this universe.
|
||||
Only present for DAGMC Universes.
|
||||
:Attributes:
|
||||
- **auto_geom_ids** (*int*) -- ``1`` if geometry IDs of the DAGMC
|
||||
model will be appended to the ID space of the natively defined
|
||||
CSG geometry, ``0`` if the existing DAGMC IDs will be used.
|
||||
- **auto_mat_ids** (*int*) -- ``1`` if UWUW material IDs of the DAGMC
|
||||
model will be appended to the ID space of the natively defined
|
||||
OpenMC materials, ``0`` if the existing UWUW IDs will be used.
|
||||
|
||||
|
||||
**/geometry/lattices/lattice <uid>/**
|
||||
|
||||
|
|
@ -119,8 +134,8 @@ The current version of the summary file format is 6.0.
|
|||
:Attributes: - **volume** (*double[]*) -- Volume of this material [cm^3]. Only
|
||||
present if ``volume`` supplied
|
||||
- **temperature** (*double[]*) -- Temperature of this material [K].
|
||||
Only present in ``temperature`` supplied
|
||||
- **depletable** (*int[]*) -- ``1`` if the material can be depleted,
|
||||
Only present if ``temperature`` is supplied
|
||||
- **depletable** (*int*) -- ``1`` if the material can be depleted,
|
||||
``0`` otherwise. Always present
|
||||
|
||||
**/nuclides/**
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ The ``<tally>`` element accepts the following sub-elements:
|
|||
|
||||
:name:
|
||||
An optional string name to identify the tally in summary output
|
||||
files. This string is limited to 52 characters for formatting purposes.
|
||||
files.
|
||||
|
||||
*Default*: ""
|
||||
|
||||
|
|
|
|||
|
|
@ -433,30 +433,64 @@ will handle creating the unverse::
|
|||
Using CAD-based Geometry
|
||||
--------------------------
|
||||
|
||||
OpenMC relies on the Direct Accelerated Geometry Monte Carlo toolkit (`DAGMC
|
||||
<https://svalinn.github.io/DAGMC/>`_) to represent CAD-based geometry in a
|
||||
surface mesh format. A DAGMC run can be enabled in OpenMC by setting the
|
||||
``dagmc`` property to ``True`` in the model Settings either via the Python
|
||||
:class:`openmc.settings` Python class::
|
||||
Defining Geometry
|
||||
-----------------
|
||||
|
||||
settings = openmc.Settings()
|
||||
settings.dagmc = True
|
||||
OpenMC relies on the `Direct Accelerated Geometry Monte Carlo`_ (DAGMC)
|
||||
to represent CAD-based geometry in a surface mesh format. DAGMC geometries are
|
||||
applied as universes in the OpenMC geometry file. A geometry represented
|
||||
entirely by a DAGMC geometry will contain only the DAGMC universe. Using a
|
||||
:class:`openmc.DAGMCUniverse` looks like the following::
|
||||
|
||||
or in the :ref:`settings.xml <io_settings>` file::
|
||||
dag_univ = openmc.DAGMCUniverse(filename='dagmc.h5m')
|
||||
geometry = openmc.Geometry(dag_univ)
|
||||
geometry.export_to_xml()
|
||||
|
||||
<dagmc>true</dagmc>
|
||||
The resulting ``geometry.xml`` file will be:
|
||||
|
||||
With ``dagmc`` set to true, OpenMC will load the DAGMC model (from a local file
|
||||
named ``dagmc.h5m``) when initializing a simulation. If a `geometry.xml
|
||||
<../io_formats/geometry.html>`_ is present as well, it will be ignored.
|
||||
.. code-block:: xml
|
||||
|
||||
**Note:** DAGMC geometries used in OpenMC are currently required to be clean,
|
||||
meaning that all surfaces have been `imprinted and merged
|
||||
<https://svalinn.github.io/DAGMC/usersguide/trelis_workflow.html>`_
|
||||
successfully and that the model is `watertight
|
||||
<https://svalinn.github.io/DAGMC/usersguide/tools.html#make-watertight>`_. Future
|
||||
implementations of DAGMC geometry will support small volume overlaps and
|
||||
un-merged surfaces.
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<geometry>
|
||||
<dagmc auto_ids="false" filename="dagmc.h5m" id="1" name="" />
|
||||
</geometry>
|
||||
|
||||
DAGMC universes can also be used to fill CSG cells or lattice cells in a geometry::
|
||||
|
||||
cell.fill = dagmc_univ
|
||||
|
||||
It is important in these cases to understand the DAGMC model's position
|
||||
with respect to the CSG geometry. DAGMC geometries can be plotted with
|
||||
OpenMC to verify that the model matches one's expectations.
|
||||
|
||||
**Note:** DAGMC geometries used in OpenMC are currently required to be clean,
|
||||
meaning that all surfaces have been `imprinted and merged
|
||||
<https://svalinn.github.io/DAGMC/usersguide/trelis_workflow.html>`_
|
||||
successfully and that the model is `watertight
|
||||
<https://svalinn.github.io/DAGMC/usersguide/tools.html#make-watertight>`_. Future
|
||||
implementations of DAGMC geometry will support small volume overlaps and
|
||||
un-merged surfaces.
|
||||
|
||||
Cell, Surface, and Material IDs
|
||||
-------------------------------
|
||||
|
||||
By default, DAGMC applies cell and surface IDs defined by the CAD engine that
|
||||
the model originated in. If these IDs overlap with IDs in the CSG ID space,
|
||||
this will result in an error. However, the ``auto_ids`` property of a DAGMC
|
||||
universe can be set to set DAGMC cell and surface IDs by appending to the
|
||||
existing CSG cell ID space in the OpenMC model.
|
||||
|
||||
Similar options exist for the material IDs of DAGMC models. If DAGMC material
|
||||
assignments are based on natively defined OpenMC materials, no further work is
|
||||
required. If DAGMC materials are assigned using the `University of Wisconsin
|
||||
Unified Workflow`_ (UWUW), however, material IDs in the UWUW material library
|
||||
may overlap with those used in the CSG geometry. In this case, overlaps in the
|
||||
UWUW and OpenMC material ID space will cause an error. To automatically resolve
|
||||
these ID overlaps, ``auto_ids`` can be set to ``True`` to append the UWUW
|
||||
material IDs to the OpenMC material ID space.
|
||||
|
||||
.. _Direct Accelerated Geometry Monte Carlo: https://svalinn.github.io/DAGMC/
|
||||
.. _University of Wisconsin Unified Workflow: https://svalinn.github.io/DAGMC/usersguide/uw2.html
|
||||
|
||||
-------------------------
|
||||
Calculating Atoms Content
|
||||
|
|
|
|||
|
|
@ -45,6 +45,23 @@ with the :envvar:`OPENMC_CROSS_SECTIONS` environment variable. It is recommended
|
|||
to add a line in your ``.profile`` or ``.bash_profile`` setting the
|
||||
:envvar:`OPENMC_CROSS_SECTIONS` environment variable.
|
||||
|
||||
RuntimeError: Failed to open HDF5 file with mode 'w': summary.h5
|
||||
****************************************************************
|
||||
|
||||
This often occurs when working with the Python API and executing multiple OpenMC
|
||||
runs in a script. If an :class:`openmc.StatePoint` is open in the Python interpreter,
|
||||
the file handle of the statepoint file as well as the linked `summary.h5` file will
|
||||
be unavailable for writing, causing this error to appear. To avoid this situation,
|
||||
it is recommended that data be extracted from statepoint files in a context manager:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
with openmc.StatePoint('statepoint.10.h5') as sp:
|
||||
k_eff = sp.k_combined
|
||||
|
||||
or that the :meth:`StatePoint.close` method is called before executing a subsequent
|
||||
OpenMC run.
|
||||
|
||||
Geometry Debugging
|
||||
******************
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue