Viewing and Archiving Model Configurations
This application mode is used to setup and interact with a complete model, constructed using the parameters described in Building Core Configurations.
Typical Use Cases
To test, view and archive a complete model configuration.
Creating an Input Module
An empty input module can be created using the manager utility:
oscar5 MY_REACTOR.manager configuration MODULE_NAME [options]
This command the following optional arguments:
- --package <str>
The subpackage to which this module should be added. The default value is ‘configurations’.
- --description <str>
A short description of the input module.
A typical input module has the following form:
import applications.configuration as app
from core import *
from ..model import assemblies
# Create parameter set
model = app.new()
# Set facility info
model.facility_description.name = 'MY_REACTOR'
model.facility_description.site = 'CORE'
model.facility_description.type = 'MTR'
model.facility_description.design_power = 10.0 * units.MW
model.facility_description.design_pressure = 1.8 * units.bars
model.facility_description.design_inlet_temperature = 40 * units.degC
model.facility_description.design_coolant_flow_direction = 'DOWNWARDS'
#
model.inventory_manager.inventory = core.utilities.path_relative_to(__file__, '../MY_REACTOR_inventory')
model.inventory_manager.model_path = core.utilities.path_relative_to(__file__, '../model')
model.facility_manager = core.utilities.path_relative_to(__file__, '../MY_REACTOR_facility')
# Set core layout, configure banks, set default state, etc
if __name__ == '__main__':
app.main(model=model)
Additional Input Parameters
This primary function is to define and store a complete model configuration. A new model instance is created by
calling model=app.new()
, whose parameters are then set as described in the
model configuration. This application mode has no other parameters to set.
Command Line Usage
$ oscar5 MY_REACTOR.configurations.my_config [options] <mode> [mode options]
Since this application has no special parameters to set, only the --log-level flag is supported. The supported application run modes are summarized below.
visualization
Works just like the standard visualization, with the same command line flags.
archive
Saves the model as a Model Configuration Object (.mco) file. It supports the following options:
- --name <str>
The archive file name. If not specified,
model.name
is used.
plotter
Creates two dimensional plots of slices through the model. Accepts all the plotter application command line arguments. Note that since only the plotter execution is supported, the mode can be excluded from the command line sequence. For example,
oscar5 MY_REACTOR.configurations.my_config plotter --z 0.0 --x 0.0 --pixels 10 --threads 4 --force
check-model
This checks your model by running a simple simulation using the specified target code (or plugin). It is a critical step in ensuring that the model is compatible, before running simulations with the specified plugin.
This modes uses the model checker command line interface. For example,
oscar5 MY_REACTOR.configurations.my_config check-model --particles 128000 --config-file my_config.cfg --target-mode MCNP run --threads 24 --force
Typical command line usage
To visually inspect the configuration, then check if the model geometry is compatible with MCNP, use the following:
oscar5 MY_REACTOR.configurations.my_config visualization --interactive --parts
oscar5 MY_REACTOR.configurations.my_config check-model --particles 128000 --config-file my_config.cfg --target-mode MCNP run --threads 24 --force
If there were lost particles (geometry errors), use the following the view them:
oscar5 MY_REACTOR.configurations.my_config check-model --particles 128000 --target-mode MCNP post --show