mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Storing surface source points using a cell ID (#2888)
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
parent
84f561c1ed
commit
ddc9526966
120 changed files with 3963 additions and 86 deletions
|
|
@ -277,6 +277,9 @@ source file can be manually generated with the :func:`openmc.write_source_file`
|
|||
function. This is particularly useful for coupling OpenMC with another program
|
||||
that generates a source to be used in OpenMC.
|
||||
|
||||
Surface Sources
|
||||
+++++++++++++++
|
||||
|
||||
A source file based on particles that cross one or more surfaces can be
|
||||
generated during a simulation using the :attr:`Settings.surf_source_write`
|
||||
attribute::
|
||||
|
|
@ -287,7 +290,51 @@ attribute::
|
|||
}
|
||||
|
||||
In this example, at most 10,000 source particles are stored when particles cross
|
||||
surfaces with IDs of 1, 2, or 3.
|
||||
surfaces with IDs of 1, 2, or 3. If no surface IDs are declared, particles
|
||||
crossing any surface of the model will be banked::
|
||||
|
||||
settings.surf_source_write = {'max_particles': 10000}
|
||||
|
||||
A cell ID can also be used to bank particles that are crossing any surface of
|
||||
a cell that particles are either coming from or going to::
|
||||
|
||||
settings.surf_source_write = {'cell': 1, 'max_particles': 10000}
|
||||
|
||||
In this example, particles that are crossing any surface that bounds cell 1 will
|
||||
be banked excluding any surface that does not use a 'transmission' or 'vacuum'
|
||||
boundary condition.
|
||||
|
||||
.. note:: Surfaces with boundary conditions that are not "transmission" or "vacuum"
|
||||
are not eligible to store any particles when using ``cell``, ``cellfrom``
|
||||
or ``cellto`` attributes. It is recommended to use surface IDs instead.
|
||||
|
||||
Surface IDs can be used in combination with a cell ID::
|
||||
|
||||
settings.surf_source_write = {
|
||||
'cell': 1,
|
||||
'surfaces_ids': [1, 2, 3],
|
||||
'max_particles': 10000
|
||||
}
|
||||
|
||||
In that case, only particles that are crossing the declared surfaces coming from
|
||||
cell 1 or going to cell 1 will be banked. To account specifically for particles
|
||||
leaving or entering a given cell, ``cellfrom`` and ``cellto`` are also available
|
||||
to respectively account for particles coming from a cell::
|
||||
|
||||
settings.surf_source_write = {
|
||||
'cellfrom': 1,
|
||||
'max_particles': 10000
|
||||
}
|
||||
|
||||
or particles going to a cell::
|
||||
|
||||
settings.surf_source_write = {
|
||||
'cellto': 1,
|
||||
'max_particles': 10000
|
||||
}
|
||||
|
||||
.. note:: The ``cell``, ``cellfrom`` and ``cellto`` attributes cannot be
|
||||
used simultaneously.
|
||||
|
||||
.. _compiled_source:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue