class openmc.model.Model(geometry=None, materials=None, settings=None, tallies=None, plots=None)[source]

Model container.

This class can be used to store instances of openmc.Geometry, openmc.Materials, openmc.Settings, openmc.Tallies, openmc.Plots, and openmc.CMFD, thus making a complete model. The Model.export_to_xml() method will export XML files for all attributes that have been set. If the Model.materials() attribute is not set, it will attempt to create a materials.xml file based on all materials appearing in the geometry.

  • geometry (openmc.Geometry, optional) – Geometry information
  • materials (openmc.Materials, optional) – Materials information
  • settings (openmc.Settings, optional) – Settings information
  • tallies (openmc.Tallies, optional) – Tallies information
  • plots (openmc.Plots, optional) – Plot information
  • geometry (openmc.Geometry) – Geometry information
  • materials (openmc.Materials) – Materials information
  • settings (openmc.Settings) – Settings information
  • tallies (openmc.Tallies) – Tallies information
  • plots (openmc.Plots) – Plot information
deplete(timesteps, chain_file=None, method='cecm', fission_q=None, **kwargs)[source]

Deplete model using specified timesteps/power

  • timesteps (iterable of float) – Array of timesteps in units of [s]. Note that values are not cumulative.
  • chain_file (str, optional) – Path to the depletion chain XML file. Defaults to the chain found under the depletion_chain in the OPENMC_CROSS_SECTIONS environment variable if it exists.
  • method (str) – Integration method used for depletion (e.g., ‘cecm’, ‘predictor’)
  • fission_q (dict, optional) – Dictionary of nuclides and their fission Q values [eV]. If not given, values will be pulled from the chain_file.
  • **kwargs – Keyword arguments passed to integration function (e.g., openmc.deplete.integrator.cecm())

Export model to XML files.

Parameters:directory (str) – Directory to write XML files to. If it doesn’t exist already, it will be created.

Creates the XML files, runs OpenMC, and returns k-effective

Parameters:**kwargs – All keyword arguments are passed to
Returns:Combined estimator of k-effective from the statepoint
Return type:uncertainties.UFloat