Back to PHITS homepage → https://phits.jaea.go.jp/index.html
1. FAQ¶
1.1. Questions related to parameter setting¶
- Q1.1: Input file that works before ver. 2.88 does not work after that version.
 A1.1: Several revisions were made in terms of the input file format after ver. 2.89 to avoid frequently-occurring mistakes. In general, it is not necessary to change input file when PHITS is updated, but in some cases, it is necessary. If you encounter an error after the update, please check the following points.
After ver. 2.89, c_ (here _ is a space), cannot be used as a comment remark in [material] section in the default setting. You have to change the comment remarks c_ in [material] to $ or #, or set icommat=1 in [parameters].
After ver. 2.93, low energy neutrons are transported using nuclear data library in the default setting. Thus, you may encounter an error There is no cross section table(s) in xsdir even when you want to transport only photon and electrons. In that case, you have to set nucdata=0 in [parameters] to disable the use of nuclear data library.
After ver. 2.96, it is not allowed to define two or more [parameters] sections in an input file.
After ver. 2.96, unnecessary tallies are automatically disabled, depending on the icntl parameter. Consequently, set: and infl: commands are ignored when they are written in the disabled sections. When set: or infl: commands are ignored, PHITS outputs warning.
- Q1.2: Electrons and positrons are not transported.
 A1.2: Transport of electrons and positrons are ignored in the default setting because they are time consuming. If you want to transport them, you have to activate EGS5 mode by setting negs=1,2 in [parameters].
- Q1.3: Which nuclear reaction model settings give the most accurate result?
 A1.3: In general, the default models give the best results in most cases. However, it is desirable to activate JQMD-2.0 (irqmd=1) for precisely simulating nucleon-nucleon interactions, and SMM (ismm=1) for precisely estimating the residual nuclide yields after high-energy nuclear reactions, though they are time consumptive.
- Q1.4: What kind of simulation is the event-generator mode suited to?
 A1.4: Event generator mode is best suited to simulations in which it is necessary to obtain event-by-event information, e.g., detector response calculations and the design of semi-conductor devices. It is also useful for simulations in which the energies and types of charged particles produced by low-energy neutron interactions must be determined. Specifically, event generator mode is generally most suited to simulations using [T-Deposit], [T-LET], [T-SED], [T-Yield], and/or [T-Product] tallies. On the other hand, it is not suited to simulations only using [T-Track] and/or [T-Cross] tallies, such as shielding calculations. See PHITS manual “5.2.27 Event Generator Mode” for further details.
- Q1.5: When should the mode for statistical uncertainty (the setting of istdev) be changed?
 A1.5: We generally recommend using the history variance mode (istdev=-2 or 2), in which the statistical uncertainty depends on the total history number (maxcas*maxbch), except in the case of shared-memory parallel computing, in which only the batch variance mode (istdev=-1 or 1) can be selected. However, the computational time occasionally becomes extremely long in history variance mode, especially in for tallies using a large number of memories, e.g., an xyz mesh tally with very fine structure. When performing a PHITS calculation under such conditions, please switch to batch variance mode and set maxbch to be greater than 10.
- Q1.6: Is it possible to use nuclear data libraries other than JENDL-4.0?
 A1.6: Yes. PHITS can use nuclear data libraries that are written in the ACE format, i.e., the MCNP format. Note that the instruction changes for neutron libraries below 20~MeV and others. The following are instructions on how to use a new nuclear data library in PHITS:
- For neutron libraries below 20 MeV.
 using a text editor, open the xsdir file contained in the package of the new nuclear data library and copy all nuclear data addresses (e.g., 1001.80c 0.999167 xdata/endf71x/H/1001.710nc 0 1 4 17969 0 0 2.5301E-08);
using a text editor, open the file xsdir.jnd included in the PHITS data folder and paste the copied addresses below directory around the 180th line: above the first address information of JENDL-4.0 (1001.50c 0.999167 neu/H_001.j40n_300K 0 1 1 30720 0 0 2.585E-08) because PHITS automatically finds the data library of the previously written nucleus in xsdir.jnd;
create a new folder with the appropriate name written in the address file in the PHITS XS folder and copy the data files from the new nuclear data library to the created folder.
- For other libraries such as proton, deuteron, photo-nuclear reaction, high energy neutron libraries, etc.
 using a text editor, open the xsdir file contained in the package of the new nuclear data library and copy all nuclear data addresses (e.g., 1001.80c 0.999167 xdata/endf71x/H/1001.710nc 0 1 4 17969 0 0 2.5301E-08) and then using a text editor, open the file xsdir.jnd included in the PHITS data folder and paste the copied addresses at the end of the file;
create a new folder with the appropriate name written in the address file in the PHITS XS folder and copy the data files from the new nuclear data library to the created folder;
explicitly specify the library ID using lib(i) in the [parameters] section of your PHITS input file (e.g., lib(2)=80c for the above example) and set the maximum energy of the library using dmax(i). If the nuclear data libraries are not available for certain nuclides specified in [material], PHITS automatically employs the nuclear reaction models for the nuclides.
The latest version of ENDF (ENDF/B-VIII.0) in the ACE format can be downloaded from the link below. https://nucleardata.lanl.gov/ace/lib80x/
There are two xsdir files (xsdir & xsdir_2.0) in the package, but only xsdir is compatible with PHITS. You have to replace + by ptable when you copy xsdir to xsdir.jnd.
- Q1.7: How can neutron fluxes emitted from photo-nuclear reactions with low statistical uncertainty be found?
 A1.7: The photonuclear cross section can be biased using the pnimul parameter. For example, the probability of photo-nuclear reaction is doubled when pnimul is set =2.0 and the weights of secondary particles emitted from the photo-nuclear reaction are 0.5. If a very high value of pnimul, e.g., above 100.0, is selected, the photon fluxes might be altered; therefore, it should be confirmed that the photon fluxes are not significantly altered as a result of changing this parameter.
- Q1.8: I cannot restart PHITS simulation as a result of an error related to the inconsistency of a tally. Why is this?
 A1.8: This occurs as the result of the loss of significant digits in the PHITS input file. In this case, set ireschk=1 to induce PHITS to skip the consistency check.
1.2. Questions related to errors occurred in compiling or executing PHITS¶
- Q2.1: I got an error in compiling PHITS. How can I correct this to finish compiling?
 A2.1: Intel Fortran Compiler 11.1 (or later) and gfortran 4.7 (or later) can be used. Note that the PHITS office recommends using Intel Fortran Compiler 11.1 (or later). Intel fortran of OneAPI is available for free of charge as explained in “phits/document/OneAPI-Fortran-manual.pdf” . Intel Fortran is recommended because PHITS compiled by Intel Fortran is much faster than that by gfortran. See PHITS manual “10 Compilation of PHITS” for further details.
- Q2.2: Access violation or Segmentation fault occurred during the execution of PHITS.
 A2.2: It is probably due to a bug related to memory usage in PHITS. Please append $DBG=1 to the first line of the input file that causes the problem and run PHITS in debug mode. If you get any error messages, please send the messages to PHITS office, together with the information on your machine environment. If you used your own compiled version of PHITS, please recompile PHITS in the debug mode (change DEBUG? = false to true in makefile), execute the debug mode with your input file, and send the error message to the office.
- Q2.3: An error occurred when I tried to use infl: in my PHITS input file.
 A2.3: When the infl: command is used in the PHITS input file (e.g., phits.inp), it is necessary to type file=phits.inp in the first line of phits.inp file. Otherwise, another input file (e.g., phits.in) can be created with the first line file=phits.inp and used as the PHITS input file. For example:
phits_LinIfort < phits.inSee manual “2.3.2 Execution on Linux OS” for further details.
- Q2.4: An error occurred when I tries to execute PHITS on a Linux console, but I can execute it on Windows using the same input file.
 A2.4: This error could have many causes, but the most likely one is a difference in the line endings between Linux and Windows. If the input file is prepared in a Windows computer and transferred to a Linux system using FTP software, the status of the transfer mode must be checked, i.e., ASCII mode must be selected in the FTP software.
- Q2.5: Can PHITS be executed on Cygwin?
 A2.5: Yes. The Cygwin option can be found in the PHITS makefile.
- Q2.6: Which is most suitable for compiling PHITS—Intel, Fortran, or gfortran?
 A2.6: We generally recommend using the Intel Fortran compiler because it can make PHITS executable files that are faster than those made using gfortran. When using gfortran, it is vital that you set “-O0” instead of using optimization options because of the possibility that an executable file with optimization will not work correctly. Thus, an executable file compiled using Intel Fortran is on average from 3 to 5 times faster than one compiled using gfortran. Note that the Intel Fortran compiler distributed as OneAPI toolkit is free of charge since 2020.
- Q2.7: How should the distributed memory parallel computing (MPI) or shared memory parallel computing (OpenMP) be set depending on the situation?
 A2.7: Calculation using MPI is generally faster than calculation using OpenMP if the MPI protocol is installed in the computer. However, because the protocol is not generally pre-installed in Windows or Mac OS systems as a default setting, we recommend the use of OpenMP for executable files. To perform PHITS calculation on huge memories such as high energy nuclear data files or voxel phantoms, the hybrid MPI-OpenMP setting must be used to avoid the possible memory shortages that could occur if only MPI were to be used. In the hybrid setting, the number of MPI processes should be increased, but only up to the point at which the used memory does not overflow the capacity of the computer. Note that PHITS uses a number of CPU cores appropriate to the number of OpenMP processes to control the MPI processes. For example, to set the number of OpenMP processes to eight on a computer with 128 CPU cores, the maximum number of MPI processes can be specified as 128/8-1 = 15.
- Q2.8: When running DCHAIN, an error such as “The specified file cannot be found” is displayed.
 A2.8: If the DCHAIN input file or the PHITS input file containing the infl: command is placed in a folder whose name includes full-width (double-byte) characters, it will not work properly. In that case, please change the folder name to use only half-width (single-byte) characters.
- Q2.9: I got many warning messages about lost particles. What should I do?
 A2.9: Several reasons can be considered as the cause of this problem. The most probable reason is wrong definition of your geometry, such as double-defined and undefined regions. Please check your geometry using [t-gshow] or icntl=8. You may also have to check the following issues.
If you set the location of source particles exactly on (or source direction exactly parallel to) a boundary of certain cells, you have to slightly change the definition of your source.
If you rotate a lattice structure by [transform], you have to set the size of outer frame surface to be slightly smaller than the lattice structure inside it. Please see phits/lecture/advanced/voxel in more detail.
If you set [weight window] (or [t-wwg] to generate it) with mesh=xyz that exactly overlaps with a boundary of certain cells, you have to slightly change the definition of the xyz mesh. Please be especially careful if you are using parameters to link geometry boundary and xyz-mesh ranges. After version 3.34, if the maximum and minimum xyz mesh values for [weight window] and [t-wwg] are defined as integers, the minimum value is shifted by -1*deltxyz and the maximum value by +2*deltxyz from the integer.
If you cannot figure out the reason of lost particles, but the frequency of lost particles is not so high (approximately less than once per several 1000 histories), you can ignore the message. It is probably due to the loss of significant digit.
- Q2.10: I fail to execute PHITS with OpenMP parallelization in Linux. The library libiomp5.so is required.
 A2.10: In order to execute PHITS with OpenMP parallelization, you may be required to install the libiomp5.so library. In this case, please install the libomp-dev library by using installation software provided in each Linux distribution. For instance, for Ubuntu case, you can install the library by
sudo apt-get install libomp-devThis will create a library /usr/lib/x86_64-linux-gnu/libomp.so.5 Then please move to this directory
cd /usr/lib/x86_64-linux-gnu/and make a symbolic link to libiomp5.so
sudo ln -s libomp.so.5 libiomp5.soWith this, you should be able to execute PHTIS with OpenMP parallelization.
- Q2.11: PHITS execution fails in Linux with an error GLIBC_2.34 not found.
 A2.11: The executable files for Linux in the PHITS package are using updated GLIBC library. Therefore PHITS execution fails in a computer with older version of Linux OS such as Ubuntu 20.04 LTS. To solve this problem, you need to update OS of your PC or recompile PHITS under your environment by yourself. Some Fortran compiler such as Intel Fortran or Gfortran is required for recompilation. The source code of PHITS is located at phits/src. Please properly set the value of ENVFLAGS in makefile according to your environment and compile PHITS using make command (please see also PHITS manual “10.3 Compilation on Linux OS” ).
- Q2.12: I encountered symptoms that are clearly PHITS bugs, such as abnormal termination and infinite loops of calculations. What should I do?
 A2.12: Please append $DBG=1 to the first line of the input file that causes the problem and run PHITS in debug mode. If you get any error messages, please send the messages to PHITS office, together with the information on your machine environment. In the case of infinite loops, please identify the random seed that reproduces the issue with one history by following the steps below:
Open the batch.out file created when PHITS was hanging.
Copy the line next initial random seed, for example:
bitrseed = 1111111100000000100001111000001011001100011000101101000011001000and paste it into the [parameters] section of your input file.
Set idmprijk=1 in the [parameters] section.
Run PHITS again with the revised input file.
Copy the bitrseed written in the rijkdmp.inp file (or rijkdmp***.inp for MPI parallel calculation) and paste it into the [parameters] section.
Run PHITS again and check whether PHITS hangs again with the first history.
1.3. Questions related to Tallies¶
- Q3.1: What is the difference between the [t-heat] and the [t-deposit] tallies?
 A3.1: These two tallies essentially produce the same values of deposition energies. After version 3.05, [t-deposit] gives the deposition energies not only by ionization of charged particles but also kerma of neutral particles. Thus, we do not recommend to use [t-heat] after that version.
- Q3.2: The track length or fluence of heavy ions calculated by [t-track] or [t-cross] is strange.
 A3.2: This might be caused by a mis-definition of the energy mesh in the tally section. The energies of heavy ions should be defined in MeV in the tally section but should be written in MeV/n (per nucleon) in the [source] section. Note that the unit in the tally can be changed to MeV/n by setting iMeVperu=1 in [parameters].
- Q3.3: Results obtained by [T-LET] and/or [T-SED] tally are strange.
 A3.3: The density of the material selected by letmat must be checked: if a material not used in your geometry is selected, it is necessary to define its absolute atomic densities (1H 6.893407e-2 16O 3.446704e-2) in the [material] section. In addition, if a very fine mesh (more than 10 meshes per decade) in [t-let] is set, the results might have zigzag structure. In that case, the LET mesh should be widened.
- Q3.4: How can the statistical uncertainty be estimated from the tally output?
 A3.4: In Version 2.50 and later the standard deviations or standard errors are correctly output in the tally results. See PHITS manual “5.2.2 Number of history and Bank” for details.
- Q3.5: Can the dump function be used when executing PHITS in distributed memory parallel computing?
 A3.5: This is possible from version 2.30 onward. Please ask the PHITS offce for more information on its detailed usage.
- Q3.6: Tally results in boxes obtained using mesh=reg and mesh=xyz are inconsistent with each other.
 A3.6: PHITS automatically calculates the volume of tally regions only in the cases of mesh=xyz or r-z. Thus, if mesh=reg is set and the [volume] section is not specified, the volume of the tally region is assumed to be 1 \({\rm cm^3}\) .
- Q3.7: Why do some events deposit energies greater than the incident energy when using [t-deposit] with the output=deposit option.
 A3.7: When exothermic nuclear reactions occur, the total energy of secondary particles becomes greater than the incident energy. Such events are also observed when mesh=xyz or r-z and nedisp=t0 based on the output of the algorithm for onsidering the energy straggling of charged particles in PHITS. In such case, it is necessary to set mesh=reg in [t-deposit] and define cells corresponding to each xyz or r-z mesh in the [cell] section.
- Q3.8: Can I switch x and z axes in 2D drawing of the tally results?
 A3.8: Yes. For that purpose, you have to swap x-type and z-type mesh information, and add the following 3 lines:
trcl = 0 0 0 0 0 1 0 1 0 1 0 x-txt = x [cm] y-txt = z [cm]
Then, you will see eps file rotated by 90 degree.
- Q3.9: Computational time becomes longer when I set up many tallies in my input file.
 A3.9: You can decrease the computational time by setting istdev=1 (batch variance mode) or italsh=1 (sharing tally memory, only for OpenMP), particularly when you define tally consuming large memory size. In addition, [t-yield] and [t-dchain] cost numerous computational time between PHITS 2.94 and 3.24. If you feel your simulation using [t-yield] and [t-dchain] is too slow, please contact PHITS office. We will provide the latest version.
- Q3.10: Is it possible to easily output the statistical error of the sum-over data?
 A3.10: In Version 3.35 and later this error is output in the tally results.
- Q3.11: Is it possible to stop the PHITS simulation when the statistical errors of the tally data only for certain meshes become lower than stdcut?
 A3.11: No. When stdcut is set, PHITS checks the statistical errors of all data in the tally. Thus, you have to limit the meshes only to the regions of your interest in the case of specifying stdcut in the tally.
- Q3.12: I would like to know the PHITS tallies corresponding to MCNP ones.
 A3.12: Please see below for the answer.
F1: Surface Current → [t-cross] with output=current
F2: Surface Flux → [t-cross] with output=flux
F4: Track Length cell flux → [t-track]
F4 with FM card: Reaction number → [t-interact],[t-yield],[t-product]
F5: Flux at a point and ring → [t-point]
F6: Energy Deposition → [t-deposit] with output=dose
F8: Pulse Height → [t-deposit] with output=deposit
- Q3.13: Tally results obtained from [t-cross] with mesh=reg are inconsistent with the corresponding data obtained from [t-cross] with mesh=xyz or r-z.
 A3.13: Surface area must be defined in [t-cross] with mesh=reg, otherwise the area is always assumed to be 1.0 \({\rm /cm^2\) . If a boundary of geometry coincides with a tally plane at cylindrical surface in r-z mesh or at a rotated surface in xyz mesh, the tally results might be underestimated due to the problem of significant digit. In such cases, the mesh size should be changed slightly so that it does not coincide with the boundary plane.
1.4. Questions related to source generation¶
- Q4.1: How PHITS outputs be normalized when using an isotropic source (s-type=9 or 10, dir=-all)?
 A4.1: If there is nothing inside the sphere of an isotropic source, the fluence inside the sphere is normalized to \(1/\pi/r_1^2\) (/source), where \(r_1\) is the radius of the sphere. Therefore, to convert the tally output (/source) to the unit fluence, it is necessary to multiply the result by \(\pi r_1^2\) . It should be noted that, as the weight control method is employed in generating an isotropic source, event-by-event information cannot be derived from simulations using an isotropic source. To obtain event-by-event information for isotropic irradiation, set dir=iso in the [source] section (PHITS must be updated to use this function).
- Q4.2: What should be done if a source particle is not created in the desired location in a cell?
 A4.2: To set the source generating surface (or point) precisely on the surface of a certain cell, PHITS sometimes mis-identifies the cell where it should be located. In this case, the source surface should be moved so that it differs slightly from the cell surface.
- Q4.3: Is it possible to use the source energy spectrum bias function (SB card in MCNP) created by ADVANTG in PHITS?
 A4.3: Yes, it is possible. As shown in the example below, you must define the source energy spectrum using e-type=4, and then specify the relative number of particles to be generated from each energy bin using p-type.
e-type=4 ne = 3 0.0 2.0 1.0 1.5 2.0 1.0 3 p-type=1 1.0 2.0 3.0
1.5. Questions related to PHIG-3D¶
- Q5.1: When starting PHIG-3D on Windows, it stops with the error message of VCOMP140.DLL not found.
 A5.1: Please install Microsoft Visual C++ 2015 redistributable package from website below. https://www.microsoft.com/en-US/download/details.aspx?id=53840 If this cannot resolve the above error, please contact the phits office.
- Q5.2: When I try to start PHIG-3D on Mac, I get an error message Cannot be opened because the developer cannot be verified.
 A5.2: Please select the PHIG-3D executable file, right-click while holding down the Control key, and select Open from the shortcut menu to launch it. You can also grant permissions from System Preferences $to$ Security and Privacy.
- Q5.3: A Not enough free memory error occurs when I press draw button.
 A5.3: Please stop other applications that may consume a lot of memory in your computer. If you still observe the same error even after stopping the applications, please click Setting in the left tab and reduce Points/cell parameter.
1.6. Other questions¶
- Q6.1: Can I use PHITS for commercial purpose?
 A6.1: Basically yes. You can use PHITS for commercial purposes such as the design of radiation detector to be sold, and radiation shielding calculation for the accelerator facilities for medical use. However, you have to make an onerous contract if you want to sell a product that includes the executable file of PHITS, such as the treatment planning system based on PHITS. In that case, please contact us.
- Q6.2: What kinds of physical processes cannot be handled by PHITS?
 A6.2: PHITS cannot handle interactions involved with more than (or equal to) two moving particles such as particle collision experiments, transports and generations of non-ionizing radiation such as visible light, and change of chemical or material properties after irradiation. More detailed information can be found in PHITS manual “Appendix A List of physical processes that cannot be handled by PHITS” .
- Q6.3: I would like to install PHITS to my new computer, but I cannot find the installer. What can I do?
 A6.3: Please send a message to PHITS office via contact page by selecting PHITS upgrade patch request and writing I would like to install PHITS in a new PC in the column of PHITS version. We will check your registration status and send the latest package in free of charge if you are registered, or ask you to submit application form if not.