MCNP heat scattering data automatic identification and conversion method and system, storage medium and equipment
By establishing a dictionary of heat scattering data relationships and automatically converting Kelvin temperatures, the problems of inefficiency and inaccurate data matching caused by manual intervention in MCNP heat scattering data processing are solved, and efficient and accurate data processing and reliability of MCNP simulation calculation results are achieved.
Patent Information
- Application Number
- CN202510012547.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-05-09
AI Technical Summary
The prior art lacks automation in processing MCNP heat scattered data, requiring a lot of manual intervention, resulting in inefficiency and error-prone, especially when processing large-scale data and data matching under different temperature conditions.
It provides an automatic identification and conversion method for MCNP heat scattering data. By establishing a dictionary of heat scattering data relationships, it automatically matches and converts heat scattering data from different libraries, and realizes automatic conversion of Kelvin temperature and accurate matching of data.
It greatly reduces manual intervention, improves data processing efficiency and accuracy, and can quickly process large amounts of files and complex data structures, ensuring the reliability of MCNP simulation calculation results.
Smart Images

Figure CN119961485A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to a data processing method of a nuclear database, and in particular relates to a method, system, storage medium and device for automatic identification and conversion of MCNP thermal scattering data. Background Art
[0002] MCNP [1] It is a powerful Monte Carlo particle transport simulation program. It is mainly used to simulate the transport process of various particles such as neutrons, photons, electrons, etc. in complex geometric structures and materials. It is widely used and plays an important role in many fields such as nuclear engineering, radiation protection, and medical physics.
[0003] Evaluation of Thermal Scattering Data in Nuclear Databases [2] It is an important part of the nuclear database, which is specially used to store and manage data related to thermal scattering. These data mainly involve the information of the interaction between neutrons (photons) and atoms or molecules in the material in the state of thermal motion. It is a data set that quantitatively describes the physical process of thermal scattering. For different thermal motion states (temperatures), a certain material generally corresponds to multiple thermal scattering data. The naming rules of thermal scattering data in different countries are different. For example, the material name of the 296K temperature light water thermal scattering data in China's NP01sab database is lwtr.00t. [3] , in the US ENDF80sab library it is h-h2o.80t [4] , while in Japan's JENDL-TSL library it is h-h2o.43t [5] .
[0004] When using the MCNP program for reactor design and optimization, reactor safety analysis, radiation shielding design and other calculations, it is often necessary to use corresponding thermal scattering data under different transport environments (particle thermal motion states) [6] In existing techniques, a lot of manual intervention is required to match the temperature and thermal scattering data names in different libraries, and manually find and replace the relevant data in the MCNP input file. [7][8] , which is inefficient and error-prone when dealing with large numbers of files, complex file structures (such as input containing a mixture of files and folders), or complex data structures. And the temperature of materials in thermal scattering databases is often given in the form of energy [9] , it cannot be directly linked to the Celsius temperature or Kelvin temperature commonly used by users. The existing technology lacks the ability to adapt to temperature changes, and it is very easy to make mistakes or omissions during manual retrieval and conversion.
[0005] The main defects of the existing technology are: first, the processing process is not automated enough and requires a lot of manual participation, resulting in low efficiency, especially when processing large-scale data, the labor cost and time cost are greatly increased; second, the data matching under different temperature conditions is not accurate enough, which may lead to deviations in the MCNP simulation calculation results, and it is easy to omit or incorrectly process some data.
[0006] The above cited documents are as follows:
[0007] [1]X-5Monte-Carlo Team.MCNP-A General Monte Carlo N-ParticleTransport Code,Vers ion 5.Los Alamos National Laboratory,LA-UR-03-1987,2003.
[0008] [2] Chen Chaobin, Chen Yixue, Hu Zehua, Wang Jia, Wu Jun. Production and verification of MCNP program using thermal neutron scattering data[J]. Atomic Energy Science and Technology, 2010, 44(11):6. DOI:CNKI:SUN:YZJS.0.2010-11-011.
[0009] [3] Wen Lili, Wu Haicheng, Zhang Huanyu. Development of CENACE thermal scattering neutron file[J]. Atomic Energy Science and Technology, 2014(8):1345-1350.DOI:10.7538 / yzk.2014.48.08.1345.
[0010] [4]DABrown,MBChadwick,R.Capote,et al.ENDF / B-VIII.0:The 8th MajorRelease of the Nuclear React ion Data Library with CIELO-project Cross Sections,New Standards and Thermal Scatter ing Data.Nuclear Data Sheets.Volume148,February 2018,Pages 1-142.
[0011] [5]Osamu Iwamotoa, Nobuyuki Iwamotoa, et al. Japanese evaluated nuclear data l ibrary vers ion 5:JENDL-5.JOURNAL OF NUCLEAR SCIENCE AND TECHNOLOGY2023,VOL.60,NO.1,1–60.
[0012] [6] Mei Longwei, Cai Xiangzhou, Jiang Dazhen, et al. Development of MCNP temperature-dependent thermal neutron scattering database[J]. Nuclear Science and Engineering, 2013, 33(4):7. DOI:10.3969 / j.issn.0258-0918.2013.04.004.
[0013] [7] Wu Haicheng, Zhang Huanyu. Criticality benchmark verification of CENDL-3.2 based on ENDITS-2.1[J]. Atomic Energy Science and Technology, 2024, 58(6): 1271-1279.
[0014] [8]Ge Z, Xu R, Wu H, et al. CENDL-3.2: The new vers ion of Chinese general purpose evaluated nuclear data l ibrary[J]. The European Phys ical JournalConferences, 2020. DOI: 10.1051 / epjconf / 202023909001.
[0015] [9]DABrown,MBChadwick,R.Capote,et al.ENDF / B-VIII.0:The 8th MajorRelease of the Nuclear React ion Data Library with CIELO-project Cross Sections,New Standards and Thermal Scatter ing Data.Nuclear Data Sheets.Volume148,February 2018,Pages 1-142. Summary of the invention
[0016] The purpose of the present invention is to provide a MCNP thermal scattering data automatic identification and conversion method, system, storage medium and device to improve the automation of thermal scattering data processing, reduce manual intervention, realize efficient processing of a large number of files and complex data structures, and accurately match thermal scattering data under different temperature conditions and different naming rules, thereby improving the accuracy of MCNP simulation calculations.
[0017] To achieve the above object, the technical solution of the present invention is as follows:
[0018] A method for automatically identifying and converting MCNP thermal scattering data comprises the following steps:
[0019] (1) Determine the necessary and optional parameters required for MCNP thermal scattering data processing;
[0020] (2) Processing the input file path parameters, generating a list of files to be processed according to the file path parameters, and determining the output path;
[0021] (3) Establishing a thermal scattering data relationship dictionary to store the material name mapping relationships of different libraries and the thermal scattering data index information of different libraries;
[0022] (4) Traverse each file in the list of files to be processed, perform data matching and conversion on each file according to the established thermal scattering data relationship dictionary, and output the processed file according to the output path.
[0023] Further, in a specific embodiment, in the MCNP thermal scattering data automatic identification and conversion method as described above, in step (1), the necessary parameters include Kelvin temperature and the path of the file or folder to be processed; the optional parameters include the output path, the material name mapping relationship file path, the material list file path and the log file path.
[0024] Furthermore, the Kelvin temperature is automatically converted to the corresponding energy, and the conversion formula is as follows:
[0025]
[0026] Where k is the Boltzmann constant, 1.380649×10 -23 J / K; T is the Kelvin temperature entered by the user.
[0027] Further, in a specific embodiment, in the MCNP thermal scattering data automatic identification and conversion method described above, in step (1), the Kelvin temperature input by the user is verified, and the input value is converted into a floating point number. If the converted value is less than 0, it is prompted that the input Kelvin temperature is illegal.
[0028] Further, in a specific implementation, in the MCNP thermal scattering data automatic identification and conversion method described above, in step (2), the input file path parameter is processed, and each sub-path is judged: if it is a file, it is directly added to the list of files to be processed; if it is a folder, all files in the folder are traversed and added to the list of files to be processed.
[0029] Furthermore, in a specific implementation manner, the MCNP thermal scattering data automatic identification and conversion method described above, step (2) also includes determining a log file path and creating a log file.
[0030] Further, in a specific embodiment, in the MCNP thermal scattering data automatic identification and conversion method as described above, in step (3), an empty dictionary is initialized to store the material name mapping relationship of different libraries to form a material name mapping relationship file; and an empty dictionary is initialized to store the thermal scattering data index information of different libraries to form a thermal scattering data index file.
[0031] Further, in a specific embodiment, in the above-mentioned MCNP thermal scattering data automatic identification and conversion method, in step (4), the data matching and conversion specifically includes:
[0032] For the currently processed file, read the file content line by line to determine whether the line content is a comment line. If not, search for the target string and extract the part of the string that represents the material name;
[0033] According to the material name mapping relationship file, data matching the current material name is found, and according to the calculated energy value related to temperature, a suitable replacement string is found in the thermal scattering data index file.
[0034] Further, in a specific embodiment, in the MCNP thermal scattering data automatic identification and conversion method as described above, in step (4), when processing each file, the processing progress information is calculated and displayed, including the sequence number of the currently processed file, the number of remaining files to be processed and the total number of files, and this information is output to a log file.
[0035] An automatic identification and conversion system for MCNP thermal scattering data, comprising:
[0036] The parameter acquisition and verification module is used to determine the necessary and optional parameters required for MCNP thermal scattering data processing, convert the Kelvin temperature parameters into corresponding energies, and verify the Kelvin temperature input by the user;
[0037] The file list generation module is used to process the input file path parameters, generate a list of files to be processed according to the file path parameters, and determine the output path and log file path;
[0038] A data mapping relationship establishment module is used to establish a thermal scattering data relationship dictionary, which is used to store the material name mapping relationship of different libraries and the thermal scattering data index information of different libraries;
[0039] The thermal scattering data conversion module is used to traverse each file in the list of files to be processed, perform data matching and conversion for each file according to the established thermal scattering data relationship dictionary, and output the processed file according to the output path.
[0040] The present invention also provides a storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the above-mentioned MCNP thermal scattering data automatic identification and conversion method.
[0041] The present invention further provides a device, including a storage medium and a processor, wherein the storage medium stores a computer program, and the processor implements the above-mentioned MCNP thermal scattering data automatic identification and conversion method when executing the computer program.
[0042] The beneficial effects of the present invention are as follows:
[0043] 1. The present invention greatly reduces manual intervention by automatically processing thermal scattering data. Compared with the traditional manual processing method, the present invention can quickly process a large number of files and complex data structures. For example, when processing thermal scattering data containing multiple folders and a large number of files, the traditional method may require hours or even days of manual operation, while the present invention can be completed in a short time, significantly improving the data processing efficiency.
[0044] 2. The present invention can more accurately match thermal scattering data under different temperature conditions through precise temperature-related calculations and a data matching method based on a mapping table. This makes the MCNP simulation calculation results more reliable and reduces simulation errors caused by inaccurate data matching.
[0045] 3. The present invention can process various forms of input files, whether a single file, a folder or a combination of multiple file paths, and can accurately process thermal scattering data. This flexibility makes the present invention applicable to a wider range of application scenarios, without the need for users to specially organize input files, reducing the threshold for use and the complexity of data processing.
[0046] 4. The log file function can record the running process of the program, including parameter information, file processing status, error information, etc. This helps users manage and trace the data processing process, facilitates troubleshooting and analysis when problems arise, and improves the maintainability of the entire data processing system. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1It is a schematic flow chart of the automatic identification and conversion method of MCNP thermal scattering data according to a specific embodiment of the present invention;
[0048] Figure 2 This is a schematic diagram of the output results of the basic function test command line in Example 1 of the present invention;
[0049] Figure 3 This is a schematic diagram of the output results of the command line processing of multiple tasks, specifying input and output paths and log files, etc. in Example 2 of the present invention;
[0050] Figure 4 This is a schematic diagram of the comparison of the thermal scattering data material card of the MCNP input file before and after processing in Example 2 of the present invention;
[0051] Figure 5 This is a schematic diagram of part of the content of a log file in Example 2 of the present invention. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0053] The present invention aims to improve the automation of thermal scattering data processing, reduce manual intervention, achieve efficient processing of a large number of files and complex data structures, accurately match thermal scattering data under different temperature conditions and different naming rules, and improve the accuracy of MCNP simulation calculations. The main functions to be achieved by the present invention are as follows:
[0054] 1) It can automatically match and convert the thermal scattering data name in the to-be-processed file according to the temperature parameters input by the user, reducing the workload and error rate of manual operation;
[0055] 2) Support multiple input methods, such as processing a single file, files in an entire folder, or files specified by multiple file paths;
[0056] 3) The accuracy and scientificity of data conversion can be ensured through the material name mapping relationship file and thermal scattering data index file specified by the user;
[0057] 4) Provides optional output path settings and logging functions to facilitate users to manage output results and track program execution.
[0058] First, the present invention provides a method for automatic identification and conversion of MCNP thermal scattering data. The method can be implemented by Python program, and mainly includes four main steps: parameter acquisition and verification, file and data acquisition, data mapping relationship establishment and thermal scattering data conversion. The implementation principle and specific method of each step will be introduced in detail below.
[0059] 1. Parameter acquisition and verification
[0060] Define the parameters required for MCNP thermal scattering data processing, including the required parameters: Kelvin temperature (t), which is the key factor in determining thermal scattering data conversion and is used to match material data at different temperatures; and the path of the file or folder to be processed (srcfile), which specifies the source of the MCNP input file to be processed. At the same time, define optional parameters, such as the output path (-out) to specify the location of the processed file, the material name mapping relationship file path (-mt) and the material list file path (-xs) to determine the mapping rules for data conversion, and the log file path (-log) to record program running process information.
[0061] For the Kelvin temperature parameter, a custom function is used for verification. This function converts the input value into a floating point number. The floating point can facilitate the program to determine whether the user input parameter is a positive number (temperature) to avoid the user entering an incorrect parameter. If the value is less than 0, the user is prompted that the Kelvin temperature entered is illegal, ensuring that the input temperature parameter can correctly guide the conversion of thermal scattering data. The user-defined Kelvin temperature is automatically converted to the corresponding energy in the thermal scattering data index file. The conversion formula is as follows:
[0062]
[0063] Where k is the Boltzmann constant, 1.380649×10 -23 J / K; T is the Kelvin temperature entered by the user.
[0064] 2. Document and data acquisition
[0065] Process the input file path parameters and judge each subpath: if it is a file, add it directly to the file list; if it is a folder, traverse all the files under the folder and add them to the file list. In this way, the program can flexibly process a single file, an entire folder, or multiple file paths specified in a specific format, so as to fully obtain MCNP thermal scattering data files.
[0066] Generate a list of files to be processed based on the file path parameters entered by the user. If the list is empty, the user is prompted that there is no valid original input file and is asked to check the validity and readability of the file, then exit the program to avoid subsequent invalid operations.
[0067] In addition, for output path and log file processing, the output path can be determined according to the "-out" parameter. If the output path is specified and the path does not exist, the folder is created to ensure that the program has a suitable output location.
[0068] At the same time, the log file path can be determined according to the "-log" parameter. If the log file path is specified, a log file is created and the current date information is written in it to facilitate the subsequent tracing of the program running time. If the log file path is not specified, a flag is set to decide whether to print information to standard output or not to record it during the subsequent program running process.
[0069] 3. Establish data mapping relationship
[0070] 1) Material name mapping relationship processing
[0071] An empty dictionary is initialized by Python program to store the mapping relationship of material names in different libraries, forming a material name mapping relationship file. Users can manually adjust the corresponding relationship of material names in different libraries in this file according to their needs. For example, the beryllium thermal scattering data in the cendlNP library is named be, and the Japanese library is named be-met, etc. The partial content of the material name mapping relationship file is as follows:
[0072] #Material name index file identifier
[0073] Al al-27
[0074] be be-met
[0075] be / beo be-beo
[0076] benz benz
[0077] Dortho orthoD
[0078] Dpara paraD
[0079] Fe Fe-56
[0080] You can get the material name mapping file list based on the "-mt" parameter entered by the user. If the user does not specify this parameter, the file in the program's default path will be used.
[0081] Traverse each line of data in the material name mapping relationship file list to determine whether it is a comment line. If not, split the line by space. During the file reading process, if a reading error occurs, record the error information, including the file name where the error occurred, and prompt the user for a file error and exit.
[0082] 2) Material list processing
[0083] An empty dictionary is initialized by Python program to store the index information of thermal scattering data from different libraries, forming a thermal scattering data index file. The file generally contains several lines, each line corresponds to a different temperature of a different material, and related data storage location and other information. For example, the index file format is generally material name_material mass number_data storage location information_data volume_temperature given in energy form, part of the content is as follows:
[0084] h-h2o.40t 0.999167tsl / h2o / h-h2o.40t 0 1 1 6547869 0 0 2.327e-08
[0085] h-h2o.41t 0.999167tsl / h2o / h-h2o.41t 0 1 1 6420200 0 0 2.413e-08
[0086] h-h2o.42t 0.999167tsl / h2o / h-h2o.42t 0 1 1 6357838 0 0 2.499e-08
[0087] h-h2o.43t 0.999167tsl / h2o / h-h2o.43t 0 1 1 6393948 0 0 2.530e-08
[0088] h-h2o.44t 0.999167tsl / h2o / h-h2o.44t 0 1 1 6395833 0 0 2.551e-08
[0089] h-h2o.45t 0.999167tsl / h2o / h-h2o.45t 0 1 1 6350289 0 0 2.585e-08
[0090] h-h2o.46t 0.999167tsl / h2o / h-h2o.46t 0 1 1 6419411 0 0 2.671e-08
[0091] There are usually hundreds of lines.
[0092] The thermal scattering data index file can be obtained according to the "-xs" parameter input by the user. If not specified, the file in the default path is used.
[0093] Traverse and obtain each line of data in the thermal scattering data index file. If it is not a comment line, obtain the corresponding dictionary object; otherwise, create a new dictionary object. Sort the energy value list corresponding to each material name so that the appropriate replacement data can be found according to the energy value range during the subsequent data conversion process. If the thermal scattering data index file is empty, log an error message and exit the program.
[0094] 4. Thermal scattering data conversion
[0095] Traverse each file in the list of files to be processed, and calculate and display the processing progress information when processing each file, including the sequence number of the currently processed file, the number of remaining files to be processed, and the total number of files, and output this information to the log file, record the corresponding separator line and original file path information, so that users can understand the program running status and file processing status.
[0096] For readable files, open the file in read-only mode and read the file content line by line. For each line of content, determine whether it is a comment line (whether the line starts with 'c' or 'C'). If not, search for a string containing a specific format. For example, for the Chinese NP01sab library, search for a string with the suffix ".00t". When the target string is found, extract the part of the string that represents the material name.
[0097] Data matching and conversion are performed according to the established thermal scattering data relationship dictionary. First, data matching the current material name is found according to the material name mapping relationship file, and then the appropriate replacement string is found in the material list of the thermal scattering data index file according to the previously calculated temperature-related energy value. If the material name is not in the mapping table, an error message is recorded.
[0098] Process the output file name according to the output path. If the user defines the output path and the output file already exists, avoid file name conflicts by adding a suffix (such as a sequence number). Open the output file in write mode and write the output file. If an error occurs during the creation or writing of the output file, log the error information to ensure that the user is aware of the problem in the data processing process.
[0099] Furthermore, the present invention also provides a MCNP thermal scattering data automatic identification and conversion system, storage medium and device. The software system corresponding to the above MCNP thermal scattering data automatic identification and conversion method includes:
[0100] The parameter acquisition and verification module is used to determine the necessary and optional parameters required for MCNP thermal scattering data processing, convert the Kelvin temperature parameters into corresponding energies, and verify the Kelvin temperature input by the user;
[0101] The file list generation module is used to process the input file path parameters, generate a list of files to be processed according to the file path parameters, and determine the output path and log file path;
[0102] A data mapping relationship establishment module is used to establish a thermal scattering data relationship dictionary, which is used to store the material name mapping relationship of different libraries and the thermal scattering data index information of different libraries;
[0103] The thermal scattering data conversion module is used to traverse each file in the list of files to be processed, perform data matching and conversion for each file according to the established thermal scattering data relationship dictionary, and output the processed file according to the output path.
[0104] The computer program of the software system is stored in a storage medium, and when the computer program is executed by a processor, the automatic identification and conversion method of MCNP thermal scattering data as described above is implemented.
[0105] A hardware device comprises the above-mentioned storage medium and a processor, wherein the storage medium stores a computer program, and when the processor executes the computer program, the above-mentioned MCNP thermal scattering data automatic identification and conversion method is implemented.
[0106] Example 1: Basic functional testing
[0107] Input parameters: Specify the Kelvin temperature as 300k, the file to be processed is the MCNP input file named HCF003_01 in the current folder, use the default material name mapping file and thermal scattering data index file, and do not specify the output path (that is, overwrite the original file) and log file path (print the information to the standard output).
[0108] Execution process: After the program is started, the parameters are parsed and the temperature-related values are calculated. The list of files to be processed is obtained through the bigfile ist function, and then each file is traversed. For each file, the content is read, and the thermal scattering data is automatically identified and converted according to the default mapping relationship and temperature conditions according to the above file processing flow. The processed content overwrites the original file. The progress information and related processing details during the processing are displayed in the standard output.
[0109] The command line output of this test is as follows Figure 2 shown.
[0110] Result verification: Check the processed file. All the thermal scattering data material names with 00t as the suffix in the HCF003_01 file are replaced with the thermal scattering data material name closest to the temperature of 300K in the default thermal scattering data index file. lwtr.00t is replaced with h-h2o.45t, and poly.00t is replaced with h-poly.44t. The material names of the thermal scattering data in this file are correctly replaced according to the temperature conditions. The MCNP simulation program can use the processed file normally for simulation calculations, and the simulation results are in line with expectations.
[0111] Example 2: Multitasking, specifying input and output paths and log files, etc.
[0112] Input parameters: specify the Kelvin temperature as 550K, the path of the file to be processed as E:\TST-1.0\input_card\, specify the output path (-out) as E:\TST-1.0\output\, specify the thermal scattering data index file (-xs) as the user-defined xs.sab.B80, and specify the log file (-log) name as log.
[0113] Execution process: After the program parses the parameters, it creates a folder according to the specified output path (if it does not exist), and creates and initializes the log file according to the specified log file path. It obtains the material name mapping relationship data and material list data, and then processes the input file. During the processing, the processed file is saved to the specified output folder, and the file name is processed according to whether there is a file with the same name. Detailed information during the processing, including file processing progress, data replacement, etc., is recorded in the log file.
[0114] The command line output of this test is as follows Figure 3 shown.
[0115] Result verification: Check the processed files in the specified output folder, and the conversion of thermal scattering data is correct. Comparison of MCNP input file thermal scattering data material card before and after processing is shown in the figure below: Figure 4 shown.
[0116] Check the log file, which contains complete program operation information, such as parameter values, processed file information, detailed records of data replacement, etc., to facilitate users to trace and check the processing process. Figure 5 shown.
[0117] The above examples prove that the technical method of the present invention is feasible and can well realize the function of automatic recognition and conversion of thermal scattering data of MCNP input files, thereby achieving the purpose of improving efficiency, accuracy and flexibility.
[0118] Those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed by the present invention. Thus, if these variations and use adaptations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and use adaptations.
[0119] The above embodiments are merely illustrative of the present invention, and the present invention may also be implemented in other specific ways or other specific forms without departing from the gist or essential features of the present invention. Therefore, the described embodiments should be considered illustrative rather than restrictive in any respect. The scope of protection of the present invention should be described by the claims, and any changes equivalent to the intent and scope of the claims should also be included within the scope of the present invention.
Claims
1. A method for automatic identification and conversion of MCNP thermal scattering data, characterized in that: The following steps are involved: (1) Determine the necessary and optional parameters required for MCNP thermal scattering data processing; (2) Processing the input file path parameters, generating a list of files to be processed according to the file path parameters, and determining the output path; (3) Establishing a thermal scattering data relationship dictionary to store the material name mapping relationships of different libraries and the thermal scattering data index information of different libraries; (4) Traverse each file in the list of files to be processed, perform data matching and conversion on each file according to the established thermal scattering data relationship dictionary, and output the processed file according to the output path.
2. The MCNP thermal scattering data automatic identification and conversion method as claimed in claim 1, characterized in that: In step (1), the necessary parameters include Kelvin temperature, the path of the file or folder to be processed; the optional parameters include the output path, the material name mapping relationship file path, the material list file path and the log file path.
3. The MCNP thermal scattering data automatic identification and conversion method as claimed in claim 2, characterized in that: In step (1), the Kelvin temperature is automatically converted into the corresponding energy, and the conversion formula is as follows: Where k is the Boltzmann constant, 1.380649×10 -23 J / K; T is the Kelvin temperature entered by the user.
4. The MCNP thermal scattering data automatic identification and conversion method as claimed in claim 2, characterized in that: In step (1), the Kelvin temperature input by the user is verified by converting the input value into a floating point number. If the converted value is less than 0, it is prompted that the input Kelvin temperature is illegal.
5. The MCNP thermal scattering data automatic identification and conversion method as claimed in claim 1, characterized in that: In step (2), the input file path parameter is processed and each sub-path is judged: if it is a file, it is directly added to the list of files to be processed; If it is a folder, all files in the folder are traversed and added to the list of files to be processed.
6. The MCNP thermal scattering data automatic identification and conversion method as claimed in claim 1, characterized in that: Step (2) also includes determining the log file path and creating the log file.
7. The MCNP thermal scattering data automatic identification and conversion method as claimed in claim 1, characterized in that: In step (3), an empty dictionary is initialized to store the material name mapping relationships of different libraries, forming a material name mapping relationship file; And initialize an empty dictionary to store the thermal scattering data index information of different libraries to form a thermal scattering data index file.
8. The MCNP thermal scattering data automatic identification and conversion method as claimed in claim 7, characterized in that: In step (4), the data matching and conversion specifically includes: For the currently processed file, read the file content line by line to determine whether the line content is a comment line. If not, search for the target string and extract the part of the string that represents the material name; According to the material name mapping relationship file, data matching the current material name is found, and according to the calculated energy value related to temperature, a suitable replacement string is found in the thermal scattering data index file.
9. The MCNP thermal scattering data automatic identification and conversion method as claimed in claim 1, characterized in that: In step (4), when processing each file, the processing progress information is calculated and displayed, including the sequence number of the currently processed file, the number of remaining files to be processed and the total number of files, and this information is output to the log file.
10. A MCNP thermal scattering data automatic identification and conversion system, characterized in that: include: The parameter acquisition and verification module is used to determine the necessary and optional parameters required for MCNP thermal scattering data processing, convert the Kelvin temperature parameters into corresponding energies, and verify the Kelvin temperature input by the user; The file list generation module is used to process the input file path parameters, generate a list of files to be processed according to the file path parameters, and determine the output path and log file path; A data mapping relationship establishment module is used to establish a thermal scattering data relationship dictionary, which is used to store the material name mapping relationship of different libraries and the thermal scattering data index information of different libraries; The thermal scattering data conversion module is used to traverse each file in the list of files to be processed, perform data matching and conversion for each file according to the established thermal scattering data relationship dictionary, and output the processed file according to the output path.
11. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the MCNP thermal scattering data automatic identification and conversion method as claimed in any one of claims 1 to 9 is implemented.
12. A device comprising a storage medium and a processor, wherein the storage medium stores a computer program, characterized in that: When the processor executes the computer program, the MCNP thermal scattering data automatic identification and conversion method as described in any one of claims 1 to 9 is implemented.