[ Identification | Description | Input parameters | Output parameters | Links ]

# The `Virtual_mcnp_input` Component

This component uses a file of recorded neutrons from the reactor monte carlo code MCNP as a source of particles.

## Identification

- Author: Chama Hennane and E. Farhi
- Origin: ILL
- Date: June 28th, 2006
- Version: 1.15
- Modification history:
  - EF, July 25th 2006: bug fixes.

## Description

    This component generates neutron events from a file created using the
    MCNP Monte Carlo code for nuclear reactors. It is used to
    calculate flux exiting from hot or cold neutron sources.
    Neutron position and velocity is set from the file. The neutron time is
    left at zero.

    Note that axes orientation may be different between MCNP and McStas.
    The component has the ability to center and orient the neutron beam to the Z-axis.
    It also may change the coordinate system from the MCNP frame to the McStas one.
    The verbose mode is highly recommended as it displays lots of useful informations.
    To obtain absolute intensity, set 'intensity' and 'nps' parameters.
    The source total intensity is 1.054e18 for LLB/Saclay (14 MW) and 4.28e18 for
    ILL/Grenoble (58 MW).

    Format of MCNP events are :

      position_X position_Y position_Z dir_X dir_Y dir_Z Energy Weight Time

    energy is in Mega eV, time in shakes (1e-8 s),
    positions are in cm and the direction vector is normalized to 1.

    %BUGS
    We recommend not to use parallel execution (MPI/Threads) with this component.

    EXAMPLE:
    To generate PTRAC files using MCNP/MCNPX, add at the end of your input file:
      ptrac         file = asc
                    max  = -1000000   // number of neutrons to generate and stop
                    write = all
                    event = sur
                    filter = 2001,jsu // surface id
    To create a 'source' from a MCNP simulation event file for the ILL:
    COMPONENT source = Virtual_mcnp_input(
       file = "H10p", intensity=4.28e18, nps=11328982,
       verbose = 1, autocenter="translate rotate rescale")

WARNING: This is a contributed Component.

## Input parameters

Parameters in boldface are required; the others are optional.

Name | Unit | Description | Default
--- | --- | --- | ---
file | str | Name of the MCNP PTRAC neutron input file. Empty string "" unactivates component | 0
autocenter | str | String which may contain following keywords. "translate" or "center" to center the beam area AT (0,0,0) "rotate" or "orient" to center the beam velocity along Z "change axes" to change coordinate system definition "rescale" to adapt intensity to abs. units. with factor intensity/nps. Other words are ignored. | 0
repeat_count | 1 | Number of times the source must be generated. 0 unactivates the component | 1
verbose | 0|1 | Displays additional informations if set to 1 | 0
intensity | n/s | Intensity multiplication factor | 0
MCNP_ANALYSE | 1 | Number of neutron events to read for file pre-analysis. Use 0 to analyze them all. | 10000
surface_id | 1 | Index of the emitting MCNP surface to use. -1 for all. | -1
nps | 1 | Number of total events shot by MCNP to generate the PTRAC as indicated at the end of the MCNP 'o' file as 'source particle weight for summary table normalization' or alternatively 'nps = '. | 0
smooth | 0/1 | Smooth sparsed event files for file repetitions. | 1

## Output parameters

Name | Unit | Description | Default
--- | --- | --- | ---
hfile |  |  |
head | char | header buffer |
rep |  |  |
begin_neutrons |  |  |
do_rotate |  |  |
do_translate |  |  |
bx |  |  |
by |  |  |
bz |  |  |
angle2z | double, rad | rotation angle required to orient beam along Z axis |
mean_x | double | \ |
mean_y | double | source center coordinates |
mean_z | double | / |
old_surface |  |  |
surface |  |  |
informed_event |  |  |
informed_surface |  |  |
min_x |  |  |
min_y |  |  |
min_z |  |  |
max_x |  |  |
max_y |  |  |
max_z |  |  |
min_vx |  |  |
min_vy |  |  |
min_vz |  |  |
max_vx |  |  |
max_vy |  |  |
max_vz |  |  |
n_count_extrapolated |  |  |
repeat_cnt |  |  |

## Links

- Source code for `Virtual_mcnp_input.comp`.
- MCNP
- MCNP -- A General Monte Carlo N-Particle Transport Code, Version 5, Volume II: User's Guide, p177

[ Identification | Description | Input parameters | Output parameters | Links ]