G).- SOLICITUD DE SALAS EN LA RESAD
G.1. b).- APROBACIÓN / DENEGACIÓN
MCNP and the ion-transport code are married using a script written in the Perl scripting language. Before the functionality of the script can be discussed however, a few other topics must be considered. First, the method by which absorption locations of neutrons in the MCNP simulation are recorded for use as ion birth locations must be considered. Second, modifications to MCNP for this specific application must be discussed. Finally, modifications to the ion-transport code itself are described.
The MCNP PTRAC File
The MCNP PTRAC file is a particle tracking file. It records user filtered events of the sim- ulated particles; the filters are specified to MCNP by giving a keyword and then parameters associated with that keyword. The available keywords can be arranged into three categories: output control keywords, event filter keywords, and history filter keywords. While many keywords (12) are available, only those necessary for understanding the desired calculations are investigated. [X-5 Monte Carlo Team, 2003]
rod
H
T
capW
cellW
cellFig. 3.4. 3D diagram of rod-type perforation unit cell
The max keyword specifies the number of total tracking events to record to the PTRAC file. Obviously, the default value of 10000 events is insufficient as many neutrons are going to be simulated and the absorption location for each is required. For this reason, the argument for the max keyword is specified to be the total number of histories, so, if every neutron is absorbed then every absorption location would be available.
By default the MCNP PTRAC file is written as a binary file, and binary files, although easy to access and read record by record, are difficult to match with regular expressions in Perl. To correct this issue the PTRAC file can be instructed to write the output to a ASCII file using the file keyword. The argument of the file keyword is either bin for binary or asc for ASCII. Here, asc is chosen.
The keyword filtering according to the particle is type. Type can be any particle MCNP can transport, i.e., n for neutron, p for photon, or e for electron. In addition, the filter keyword allows special filters to be placed on which particles are printed by selecting only particles of specific energies, in a certain cell, having specific x, y, or z coordinates, etc. There are many possibilities for the filter keyword that can greatly limit the number of particle events printed to the PTRAC file. Because only the absorption locations occurring in the cap or perforations of the model are of interest, a cell filtering scheme is used that only prints events occurring in the cap or perforation cells.
The most important keyword for this specific study is the event keyword, which specifies the types of events written to the the PTRAC file; there are five types of events and multiple types can be specified in unison if desired. The types are src for initial source events, bnk for banked events, sur for surface crossing events, col for collision events, and ter for termination events. For these calculations implicit capture is toggled off so that when
a particle is absorbed it is also terminated. In this way, the absorption locations of the neutrons, which can later be used as the starting position for ion-transport calculations, in cells specified by the cell filtering are written to the PTRAC file.
A Slight Modification to the MCNP PTRAC Routine
Dimensions in MCNP are given in units of centimeters, but the problem of interest deals with dimensions on the order of microns. The floating point output in the default PTRAC file does not offer precision to the micron range, and therefore, the output precision of the write statements are modified to include sub-micron precision.
Specifically, lines 418 and 450 of the MCNP source file “ptrak.F90” contain the write statements controlling output of the floating point quantities of interest. The FORTRAN output formatters given for the position is the “e13.5” designator, which does not provide micron precision if the output number is on the order of centimeters, as they are in MCNP. To obtain the desired level of precision, the output formating is changed to the “e20.10” designator, which provides micron precision output to the PTRAC file.
Modification to the Ion Transport Code
The ion-transport code was modified to accept the ion birth locations, which are locations where neutron absorption occurred in the MCNP simulation, from an input file rather than randomly sampling the ion birth locations. Before modification, the program calculated the probability a neutron is absorbed in the cap and rod and then randomly sampled for the location of the absorption. All of this source code was removed, and, in its place, source code to read in the absorption locations from a temporary file, which is based on the PTRAC file, was inserted.
The code first reads in the number of absorptions present in the temporary file. Then, the program reads in triplets corresponding to the x, y, and z neutron absorption locations in the unit cell. The ion-transport algorithm remained unchanged, and the fraction of ions producing a count is output to the same output file as in the original ion-tracking program. The Workings of the Control Script
The control script calculates the angular efficiencies of a specific dimension of a rod perforated detector by calling MCNP and, subsequently, the ion-transport code. The sequence of events produced by the control script are as follow:
1. Initialize parameters for the specific problem 2. Begin looping through polar and azimuthal angles 3. Create an MCNP input file
4. Run the newly created MCNP input file
6. Convert neutron absorption coordinates from the PTRAC file to equivalent unit-cell coordinates needed for the ion-transport calculations
7. Run the ion-transport code
8. Extract useful information from the ion-transport output file 9. Print processed data to file “datafile”
10. Repeat the entire procedure for all specified angles of neutron incidence
Each step of the control script is now discussed, and an example control script is provided in Appendix A.
Initialization: The initialization phase of the script sets parameters for the size of the detectors and fundamental constants such as π. The variables in the script governing the dimensions of the detector are $rd, the radius of the detector, $tc, the cap thickness, and $hd, the rod (hole) depth measured from below the cap. These three variables, along with some hard coded dimensions, entirely specify the dimensions of the detector. The unit-cell widths are hard coded into the program having values of 50 µm and 9 µm for 6LiF and 10B, respectively. The variable $r defines the distance from the center of the top plane of the detector to the center of the source disk whose radius is $rs. The number of histories is specified by $nps and varies as one over the cosine of the polar angle, such that, as the detector fades out of the solid angle, the same number of particles are still crossing the front detector surface. $pi is simply the constant π, and the variables $As and $Ad correspond to the surface area of the source disk and the top plane surface area of the detector, respectively. Angular Loops: Once the problem parameters have been initialized, the script initiates two loops: the first loops over the polar angle increasing in 5◦ increments, and the second over the azimuthal angle increasing by 3◦ increments. The detector remains fixed in all simulations, and the source is rotated about the polar and azimuth (see Fig. 3.3) Thus, the angles from the loops are used to establish the location of the center of the source disk and the direction of particles leaving the source. The angles in degrees are converted to radians and the coordinates of the center of the source disk are given as
x = r sin θ cos ψ y = r sin θ sin ψ
z = r cos θ, (3.1)
where r is the distance from the center of the top detector plane to the source and θ and ψ are the polar and azimuthal angles, respectively.
MCNP Input File: After calculating the angles for a specific case, the script prints an MCNP input file. The input file contains a model of a rod perforated detector with or without a cap; if the $tc variable is equal to zero then no cap is created, otherwise a cap of thickness $tc (in centimeters) is created. The disk source is constructed a distance $r away
from the center of the detector’s top plane in a direction specified by the angles calculated above. The source disk emits a Maxwellian distribution of neutrons toward the detector parallel to the source’s axis. The input file is named based on the polar and azimuthal angles, such that, the name of an input file with a polar angle of 10◦ and an azimuthal angle of 60◦ would be “10-60.i.”
Run MCNP: The next step calls MCNP and waits for execution of the MCNP run to complete. Both sequential and parallel versions of MCNP5 RSICC version 1.40 are available and used depending of the platform preforming the calculations. The secondary files created by MCNP are named using the same scheme as the input file but with different extensions; namely, the output file had a “.o” extension, the run-tape file had a “.r” extension, and the PTRAC file had a “.p” extension.
Process MCNP Output: After MCNP completes the calculation, necessary information is extracted from the output and PTRAC files. The regular expression functionality of Perl is used to search for specific lines in the file and extract the values to variables in the script. For instance, the absorption efficiency and its relative error are extracted from the output file. The PTRAC file is read twice, once to count the number of absorptions, and the second to write the number of absorptions and the x, y, and z coordinates of all the absorptions to a temporary file.
Transform Absorption Site to Unit Cell: Once the absorption locations have been extracted to a temporary file, the ion transport begins; however, the absorption locations that have been specified are not relative to the unit-cell geometry required for the ion-transport code to work. To correct this problem, a FORTRAN code was written to calculate, given the unit-cell dimensions, the corresponding absorption locations in the unit-cell geometry. This FORTRAN code first determines in which lattice element each absorption occurs and subtracts the vector vc from the center of the unit cell to the center of the distant lattice from the vector va from the center of the unit cell to the absorption location. Figure 3.5 illustrates this process. The difference of these two vectors gives the vector vu from the center of the distant lattice member to the absorption location that is also the vector from the center of the unit-cell member to the equivalent absorption location in the unit cell. The program reads in the absorption locations from the temporary file created in the previous step, performs the transformation on each point, and then prints the new unit cell absorption locations to another temporary file.
Ion Transport: Having all the absorption locations translated to the unit-cell geometry allows the ion-transport code to determine the probability that enough energy is deposited in the detector to produce a count per neutron absorption. The ion-transport program (see Appendix A) reads in absorption locations in the unit cell from the temporary file and counts the number of absorptions leading to sufficient energy being deposited in the detector. An output file is then created by the ion-transport program and the number of absorptions producing a count is extracted using Perl.
Center/Unit Cell Lattice Element Distant Lattice Element va vc vu Equivalent Absorption
Location in Unit Cell
* Absorption
*
Fig. 3.5. Calculation of unit-cell absorption locations
Efficiency Calculation: The desired efficiency of the detector finally is calculated for the specific angular incidence defined by the polar and azimuthal angles. The efficiency is calculated by multiplying the values of the neutron absorption efficiency and the ion product detection efficiencies to obtain the total detector efficiency. Additionally, the total efficiency must be multiplied by the ratio of the detector area to the source area because the detector efficiency is normalized to unit fluence incident on the detector. To obtain the efficiency, normalized to the current crossing the surface of the detector, one simply divides by the cosine of the polar angle. Lastly, the polar angle, azimuthal angle, absorption efficiency, ion-detection efficiency, fluence-normalized total efficiency, and current-normalized total efficiency are printed to a data file. Then, the control script increments the inner loop over the azimuthal angles and repeats the entire process for the next angular iterate.