diff --git a/docs/source/usersguide/geometry.rst b/docs/source/usersguide/geometry.rst index dc7dd978eb..be2c92a12d 100644 --- a/docs/source/usersguide/geometry.rst +++ b/docs/source/usersguide/geometry.rst @@ -183,9 +183,13 @@ the :class:`openmc.Cell` class:: fuel.fill = uo2 fuel.region = pellet + # This cell will be filled with void on export to XML + gap = openmc.Cell(region=pellet_gap) + In this example, an instance of :class:`openmc.Material` is assigned to the :attr:`Cell.fill` attribute. One can also fill a cell with a :ref:`universe -` or :ref:`lattice `. +` or :ref:`lattice `. If you provide +no fill to a cell, it will be filled with void on export to XML. The classes :class:`Halfspace`, :class:`Intersection`, :class:`Union`, and :class:`Complement` and all instances of :class:`openmc.Region` and can be @@ -434,3 +438,30 @@ named ``dagmc.h5m``) when initializing a simulation. If a `geometry.xml `_. Future implementations of DAGMC geometry will support small volume overlaps and un-merged surfaces. + +------------------------- +Calculating Atoms Content +------------------------- + +If the total volume occupied by all instances of a cell in a geometry is known +by a user, it is possible to assign it to a cell without a stochastic volume +calculation:: + + from uncertainties import ufloat + + # Set known total volume in [cc] + cell = openmc.Cell() + cell.volume = 17.0 + + # Set volume if it is known with some uncertainty + cell.volume = ufloat(17.0, 0.1) + +Once a volume is set and a cell is filled with a material or distributed +materials. It is possible to use :func:`~openmc.Cell.atoms` method to obtain +a dictionary that maps nuclides to a total number of atoms in all instances +of a cell (e.g. ``{'H1':1.0e22, 'O16':0.5e22, ...}``):: + + cell = openmc.Cell(fill = u02) + cell.volume = 17.0 + + O16_atoms = cell.atoms['O16']