mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Add documentation for atoms calculations via cell
This commit is contained in:
parent
c2a769f1f2
commit
275512bb0e
1 changed files with 32 additions and 1 deletions
|
|
@ -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
|
||||
<usersguide_universes>` or :ref:`lattice <usersguide_lattices>`.
|
||||
<usersguide_universes>` or :ref:`lattice <usersguide_lattices>`. 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
|
|||
<https://svalinn.github.io/DAGMC/usersguide/tools.html#make-watertight>`_. 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']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue