/openmcyclus

Repository of Cyclus archetypes to couple Cyclus with OpenMc

Primary LanguageJupyter NotebookBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

OpenMCyclus

https://github.com/arfc/openmcyclus/actions/workflows/test-openmcyclus.yml/badge.svg?branch=main

Library of Cyclus archetypes to couple Cyclus with OpenMC.

Installation

Dependencies

You will need to have Cyclus, OpenMC, and their required dependencies. Both are available via conda binaries or can be installed from source via their github repositories. Please note the versions listed below, as these are required versions, not minimum versions.

Dependency Version
Cyclus 1.6
OpenMC 0.14
SciPy 1.11

Directions to install Cyclus and OpenMC [1]

It is advised to create a new conda environment for installing all of the dependencies.

~ $ conda install -y mamba

~ $ mamba install -y cyclus openmc=0.14.0 scipy=1.11

~ $ git clone https://github.com/cyclus/cyclus.git

~ $ cd cyclus

~/cyclus $ python install.py

If desired, Cycamore can be installed from source or from Conda/Mamba. Cycamore is highly recommended, as it contains other archetypes for creating a fuel cycle model in Cyclus, but it is not a dependency for OpenMCyclus.

Install OpenMCyclus

To install OpenMCyclus:

~ $ git clone https://github.com/arfc/openmcyclus.git

~ $ cd openmcyclus

~/openmcyclus/ $ pip install .

To run the tests:

~/openmcyclus $ pytest tests/

Running

This archetype assumes that you have a defined material file for OpenMC (.xml), a flux value for the fuel assemblies, and the required microscopic cross sections (.csv file) for the model. The cross section data must be saved as a .csv file. These files must all be in the same location. Information about these can be found on the OpenMC docpages.

This archetype is then called during a Cyclus simulation by calling the DepleteReactor archetype from the openmcyclus.DepleteReactor library. The input structure is:

<DepleteReactor>
       <fuel_incommods>
         <val>string</val>
         <val>string</val>
       </fuel_incommods>
       <fuel_prefs>
         <val>double</val>
         <val>double</val>
       </fuel_prefs>
       <fuel_outcommods>
         <val>string</val>
         <val>string</val>
       </fuel_outcommods>
       <fuel_inrecipes>
         <val>string</val>
         <val>string</val>
       </fuel_inrecipes>
       <fuel_outrecipes>
         <val>string</val>
         <val>string</val>
       </fuel_outrecipes>
       <assem_size>double</assem_size>
       <cycle_time>int</cycle_time>
       <refuel_time>int</refuel_time>
       <n_assem_core>int</n_assem_core>
       <n_assem_batch>int</n_assem_batch>
       <power_cap>double</power_cap>
       <model_path>string</model_path>
       <chain_file>string</chain_file>
       <flux>double</flux>
       <thermal_power>double</thermal_power>
     </DepleteReactor>

Some notes about this input structure:

  • fuel_prefs and fuel_inrecipes must be equal in length to fuel_incommods and fuel_outrecipes must be equal in length to fuel_outcommods.
  • The model_path variable is the location of the files for OpenMC (can be relative or absolute path): one-group cross sections, materials, and depletion chain file. If using a relative path, it must be relative to the directory you are running the Cyclus input file from, not the location of the file that defines the prototype.
  • The archetype assumes that the OpenMC materials are in the file called materials.xml and that the cross section data is in a file called micro_xs.csv.
  • The chain_file variable is the depletion chain file, and the user provides the name of this file.
  • Each material in the materials.xml file that are fuel materials must be marked as depletable and have the name assembly_#. Define one material for each assembly in the reactor core (matches with n_assem_core), the number assigned to each material name is irrelevant, just as long as there is one.

Outputs

The results of the simulation will be written to cyclus.sqlite or the file name provided when Cyclus was called.

[1]More installation options and instructions for installing OpenMC can be found at https://docs.openmc.org/en/stable/quickinstall.html