mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Add doc section on file-based sources
This commit is contained in:
parent
f06f5b420e
commit
56fa60983d
2 changed files with 29 additions and 0 deletions
|
|
@ -248,6 +248,31 @@ following would generate a photon source::
|
|||
For a full list of all classes related to statistical distributions, see
|
||||
:ref:`pythonapi_stats`.
|
||||
|
||||
File-based Sources
|
||||
------------------
|
||||
|
||||
OpenMC can use a pregenerated HDF5 source file by specfying the ``filename``
|
||||
argument to :class:`openmc.Source`::
|
||||
|
||||
settings.source = openmc.Source(filename='source.h5')
|
||||
|
||||
Statepoint and source files are generated automatically when a simulation is run
|
||||
and can be used as the starting source in a new simulation. Alternatively, a
|
||||
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.
|
||||
|
||||
A source file based on particles that cross one or surfaces can be generated
|
||||
during a simulation using the :attr:`Settings.surf_source_write` attribute::
|
||||
|
||||
settings.surf_source_write = {
|
||||
'surfaces_ids': [1, 2, 3],
|
||||
'max_particles': 10000
|
||||
}
|
||||
|
||||
In this example, at most 10,000 source particles are stored when particles cross
|
||||
surfaces with IDs of 1, 2, or 3.
|
||||
|
||||
.. _custom_source:
|
||||
|
||||
Custom Sources
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue