Abstract
In order to reduce the potential safety hazards in the operation of rail vehicles, a new parameter table optimization algorithm based on the particle swarm optimization algorithm is proposed to carry on the failure assessment and fatigue life calculation of welded joints. This algorithm reduces the number of iterations by adding connection pools to connect the parameter selection database. In addition, based on this algorithm, combined with Python language and BS7910 standard, a calculation program for failure assessment and fatigue crack growth life is written. The algorithm program is validated by taking the commonly used T-type, butt, and lap joints as examples. In terms of failure assessment, the calculation results of the algorithm program are securer and more conservative, and the safety accuracy of the algorithm program is improved by 8%–12%. In terms of fatigue crack growth life, the error between the calculated value of the algorithm program and the test data is within the engineering allowable range. At the same time, the algorithm program can give the evaluation calculation results more intuitively and quickly, which provides a reference for the failure assessment and life calculation of the welded structure.
Keywords
Introduction
In the operation of railway vehicles, the fatigue fracture problem of structures is essentially a complex mechanical problem. 1 The current research methods are mostly based on fracture mechanics theory and the derived standards such as BS7910 and ASME. Taking the BS7910 standard 2 as an example, the standard includes evaluating whether the defective component is safe under the current condition according to the failure assessment diagram (FAD diagram), and giving the fatigue crack propagation residual life curve of the structure through the Paris formula and the basic theory of fracture mechanics. Nowadays, the BS7910 standard has been widely used in the fatigue resistance design of welded components.
Liu et al. 3 conducted a research on the safety evaluation method of the welding defects of the aluminum alloy car body based on the FAD diagram, and discussed whether the welding seam defects of the car body can meet the safety requirements of train operation under various a/c dimensions. Ziane et al. 4 put forward a mixed model for predicting the fatigue life based on the neural network optimization algorithm, and the accuracy of the model for predicting the fatigue lives of wind turbine blades was verified by comparing with the test data. Hong et al. 5 combined the multi-objective genetic algorithm and nominal stress method to optimize the quality of tank car frame, greatly improving its fatigue life. Li et al. 6 used the multi-objective optimization based on the particle swarm algorithm to improve the fatigue life of the semi-trailer tractor by optimizing the frame beam size on the basis of meeting the strength requirements. Jia et al. 7 compiled the C language iterative program according to the BS7910 standard, and estimated the allowable sizes of fatigue cracks of cranes under various stress conditions. Choong-Hyun et al. 8 combined the BS7910 standard’s systematic evaluation process for defects with first-order and second-order reliability models (Form, SORM), the reliability of a given defect structure is evaluated on the basis of considering the uncertainty of important parameters in defect evaluation. Yang et al. 9 carried out the secondary development of ABAQUS software combined with Python programming language, which can analyze the damage tolerance of structural parts under the action of cyclic load, and predict the fatigue lives of structural parts according to the Paris formula. Ding et al. 10 took the structure of a converter device as the research object, and used the fatigue life visualization program based on the secondary development of Ansys to conduct a global analysis and research on the fatigue life of components. Liu and Tang 11 used the topology optimization algorithm to carry out the secondary development. They added or deleted the element based on the mechanical properties of the material, and decomposed the fatigue life of the three-dimensional cantilever beam to improve the optimization calculation efficiency. Hou and Wang 12 took the long-span bridge as the research object, combined with MATLAB program to carry out the secondary development of Ansys, and realized the visualization of fatigue life and failure probability of the bridge under variable amplitude load. Lui and Chen 13 developed a fatigue life assessment system based on VB language, Paris formula, and Miner cumulative damage theory, which can improve the design efficiency of the crane and optimize the quality of the crane.
However, in the above analysis process, through experiments and manual calculation, the cost is high, the process is complex, and a lot of manpower and material resources are consumed, and the calculation results are inaccurate. Or the secondary development simplified calculation is only conducted for a certain type of problems, which has certain limitations. Therefore, based on the parameter table optimization algorithm and the BS7910 standard evaluation principle, this paper writes a visual program through the Python language to output the FAD diagram and the residual life curve of crack growth, effectively simplifies the process of welding joints failure assessment and the remaining life calculation. At the same time, taking T-type, butt joints, and lap joints as examples, it proves the feasibility and accuracy of the program based on the parameter table optimization algorithm, which has important practical value for the failure assessment and the prediction of fatigue life of the welded structure.
Principles of optimization algorithms
Typical parameter optimization algorithms
Typical parameter optimization algorithms are mainly divided into three categories: convex optimization parameter algorithms, intelligent optimization parameter algorithms, and black-box optimization parameter algorithms. Among them, the representatives of convex optimization arithmetic algorithms are: least squares method, Newton method, and gradient descent method. The representatives of intelligent optimization parameter algorithms are: genetic algorithm, particle swarm optimization algorithm, and ant colony algorithm. The representatives of black-box optimization parameter algorithms are: Bayesian optimization algorithm and random search optimization algorithm.
Taking the particle swarm optimization algorithm 14 in the intelligent optimization parameter algorithms as an example, it is a random search algorithm based on group cooperation summarized and proposed by Kennedy 15 and Eberhart 16 by simulating the predation behavior of birds.
In the particle swarm optimization algorithm, the solution of each optimization problem is regarded as a bird in the solution space, which called “particle.” Each particle reaches its individual optimal solution through multiple searches in the solution space, 17 the particle swarm determines the position of the global optimal solution through the individual optimal solution searched by each particle, and makes each particle adjust the connection of the next search. Finally, the optimal solution of the particle swarm optimization algorithm can be found through the above-mentioned multiple iterative search processes. 18
The principle of the particle swarm optimization algorithm is to initialize a group of random particles, record their current positions, and then determine the search direction and distance of each particle at a given speed, namely:
In the formula, i represents the i-th particle, Xi represents the current position vector of the i-th particle, and Vi represents the current velocity vector of the i-th particle.
Each particle will find its own corresponding individual optimal solution in each iterative search process, and then search for the global optimal solution of the previous iterative process through comparison, namely:
In the formula,
In the formula, ω represents the inertia weight, and its size affects the strength of the global and local search ability. c1 is the individual learning factor, c2 is the group learning factor, and we usually take c1 = c2 = 2.
Where equation (6) represents the relationship of the position and velocity between the particle of the next iterative search and the current particle. At the same time, the particles need to be limited by the maximum speed Vmax during the iterative search process to avoid exceeding the limit or blindly searching.
At present, the particle swarm optimization algorithm has been widely used in many scientific and engineering fields due to its advantages of simple principle and structure as well as no need to adjust a large number of parameters.
Parameter table optimization algorithm
The parameter table optimization algorithm is derived from the particle swarm optimization algorithm in principle, they all find the optimal solution is found through group iteration. The difference between the two is that the particle swarm optimization algorithm selects the global optimal solution of the particle swarm through multiple iterations of each particle. For some evaluation processes, when there are too many parameters to be considered, the calculation amount of multiple iterations is large, the space is occupied, and the calculation process is complicated. The parameter table optimization algorithm avoids these problems by creating a connection pool and connecting the parameters to the selected database. The iterative principle is as follows:
Where
The core of the parameter table optimization algorithm is to create a connection pool for connecting parameter databases to reduce the frequency of iterative solutions, and this process is mainly realized through code. Some code fragments are as follows, where # is followed by the comment statements in the code: class (object): def__init__(self, population_size, max_steps ): #Determine the number of test pieces or evaluation points public Get Property( String infile ){ InputStream = InStream.getClass () getResourceAsStream ( infile ) _ Properties Props=new Properties try{ Props.load ( InStream ) driver = Props.getProperty (“driver”) url = Props.getProperty (“ url ”) name = Props.getProperty (“name”) password= Props.getProperty (“password”)}} #Import the connection pool to connect to the parameter databases. public class ConnectionPool { private Connection CreateConn (){ } #Create a new connection in the connection pool, and check whether there is an idle connection or whether the connection has reached the upper limit. If the number of connections does not reach the upper limit, a new connection will be established. public synchronized Connection getConnection (){ }} #Put the connection created by the user into the connection pool. public class ConnectionPoolManger { private Connection getConnection (String poolname ){ } #Get a parameter database connection from the specified connection pool. public void backconn ((String poolname, Connection conn){ } #Return the connection created by the user to the specified connection pool. public synchronized void release (){ }} #Create all other connections print(‘step: %.d, best fitness: %.5f, mean fitness: %.5f’ % (step+1, self.global_best_fitness, np.mean (fitness)))# Output the value of the solution.
Realization of parameter table optimization algorithm
According to the principle of the parameter table optimization algorithm described above, in order to realize the algorithm and reflect its advantages, this paper combines the BS7910 standard and Python language to write the algorithm as a visual program.
In the program, the output of the result image is displayed in color, so that it is easy to distinguish whether the calculation result meets the evaluation requirements. In addition, the program can be run directly under the interface of ABAQUS software, which reduces the time of repeatedly modifying crack size parameters manually. According to the functional characteristics of the program, it is mainly divided into two modules, which respectively correspond to the failure assessment using FAD diagram and the prediction calculation of fatigue crack growth life in BS7910 assessment standard. The relationship between the two modules is progressive, which is the same as the evaluation calculation of BS7910 standard. That is to say, whether the failure assessment is qualified is the premise for calculating the crack growth life. If the failure assessment of the test piece is unqualified, that is, the assessment point in the FAD diagram is not within the assessment line, the test piece does not meet the requirements for continued use, and it is unnecessary to calculate its fatigue crack growth life. On the contrary, if the test piece meets the evaluation requirements of the FAD diagram, the remaining life can be calculated.
FAD graph calculation output module
The FAD diagram (Failure Assessment Diagram) is used in the failure assessment of the specimen in the BS7910 standard. It consists of the assessment coordinate system, the failure assessment curve, and the assessment points, as shown in Figure 1.

Schematic diagram of safety assessment.
In the figure, the axis of ordinate is the fracture ratio Kr, which represents the degree of failure of the structure due to brittle fracture. The axis of abscissa is the load ratio Lr, which represents the degree of instability of the structure due to plasticity. 20 The limited range surrounded by the failure assessment curve and the two coordinate axes is called the safety zone. If the coordinates (Lr, Kr) of the evaluation point are located in the safety zone during the evaluation calculation, the defect is acceptable. 21
For the drawing of the FAD diagram, it is first necessary to select an appropriate failure assessment curve, which has three evaluation levels. Taking the commonly used 2A-level failure assessment as an example, the failure assessment line equation is:
In the formula,
After the failure assessment curve is drawn according to the equation in the coordinate system, the coordinates of the assessment point are calculated. The first step is to calculate the fracture ratio
In the formula, M represents the correction factor. fw represents the correction factor of the finite plate width. km is the stress concentration factor caused by the structural dislocation.
The second step is to calculate the load ratio
In the formula, p is the shortest distance from the surface of the component to the defect, a is the crack depth. B is the thickness of the component. W is the width of the component.
It can be seen from the above principle that in the drawing of the FAD diagram, the ordinate Kr has more influence parameters. Therefore, based on the parameter table optimization algorithm, this module writes the program by adding the parameter databases of km, ktm, ktb, and its program flow chart is shown in Figure 2. The running process of the algorithm program is as follows: After inputting the mechanical properties of the specimen material and the stress calculation results and setting the crack size, the FAD diagram can be automatically generated, and the coordinate values of the evaluation points of the FAD diagram can be output, so as to judge whether the evaluation part is damaged.

Program flow chart of “FAD diagram” module.
Fatigue crack growth life calculation module
Fatigue crack growth life value is the main reference index in the fatigue assessment of the BS7910 standard. In order to accurately predict the fatigue crack growth life, it is usually necessary to obtain the fatigue crack growth rate FCGR of materials under appropriate environmental conditions through tests. However, the parameter table optimization algorithm is aimed at the optimization calculation of virtual simulation results. Therefore, in this module, the Paris formula is used to express FCGR as a function of the stress intensity factor range ΔK, so as to program the optimization algorithm. As shown in formula (16) and formula (17).
Where A and m are constants, which are determined by material properties and working environment. ΔK is the range of stress intensity factor, which is a function of structural geometry, stress range and instantaneous crack size. 23
Taking the initial crack size
In the formula; critical crack size
In the BS7910 standard, the Paris curve is refined into two orders due to the consideration of the diversity of materials and the structural variability, and the crack propagation relationship diagram is shown in Figure 3. Figure 3(a) shows the crack propagation relationship of the first-order Paris curve, which is mostly used for conventional fatigue evaluation. Figure 3(b) shows the crack propagation relationship of the double-slope second-order Paris curve after considering the influence of welding residual stress, which is more conservative than the first-order Paris curve. 24

Crack propagation diagram: (a) first-order Paris curve and (b) second-order Paris curve.
Therefore, this module adds the parameter database of shape coefficient Y based on the parameter table optimization algorithm, and its program flow chart is shown in Figure 4. The running process of this program module is: After setting the mechanical properties of the materials and the relevant crack dimensions of the evaluated structure, inputting the calculated stress amplitude of the specimen and selecting the appropriate curve order, the program can output the fatigue crack growth life value and growth curve of the evaluation piece.

Program flow chart of fatigue crack growth life module.
Welded joint evaluation verification and result analysis
Failure assessment and verification analysis
The accuracy and practicability of the FAD diagram and fatigue crack growth life calculation program written based on the parameter table optimization algorithm needs to be verified. Taking T-type, butt, and lap joints as examples, the FAD graph calculation output module is evaluated and verified firstly.
In order to make the subsequent comparative analysis more convincing, the simulation modeling sizes of the three types of welded joints and the application data of constraints and loads are consistent with the test samples used in Refs.25,26 Finite element models of the three types of welded joints are shown in Figure 5. For T-joints, the plate length L = 160 mm, the thickness B = 6 mm, the width W = 40 mm, the constraint is applied to the bottom plate and the two ends are 60 mm apart, and the load is applied to the center of the bottom of the weld. For butt joints, the plate length L = 160 mm, thickness B = 2 mm, width W = 30 mm, the constraint is applied on one side, the load is applied on the other side and the direction is outward stretching. For lap joints, the plate length L = 140 mm, the thickness B = 2 mm, the width W = 30 mm, the end face of the outer plate is completely fixed and the end face of the inner plate only retains the degree of freedom in the direction of force, and the tensile load is applied to the end face of the inner plate. The load application values of the three types of welded joints are shown in Table 1, and the calculation results of the stress nephogram are shown in Figure 6.

Three finite element models of welded joints (unit: mm): (a) T-joint, (b) butt joint, and (c) lap joint.
Kr coordinate value and comparison under two calculation methods.

Stress nephogram of three types of welded joints: (a) T-joint, (b) butt joint, and (c) lap joint.
In order to reflect the superiority of the algorithm program, two methods were used to calculate the coordinate values of the evaluation points of each specimen for comparison. First, the algorithm program is used for calculation. According to the calculation results in Figure 5, in the FAD diagram calculation output module of the algorithm program, after imputing the calculated stress value in sequence and setting the relevant parameters such as material properties, the program can output the coordinate values of the evaluation points and FAD diagram, as shown in Figure 7.

FAD diagram of three types of welded joints (calculated by algorithm program): (a) T-joint, (b) butt joint, and (c) lap joint.
Subsequently, the conventional failure assessment described in the Ref. 23 is used to calculate the coordinate value of each test piece evaluation point. The coordinate value of each joint test piece evaluation point is calculated according to formula (9) and formula (13). For formula (10), the stress intensity factor of the T-joint is calculated according to formula (19) and formula (20):
where
where μ is the Poisson’s ratio of the material of the joint specimen.
Since the algorithm program only adds the parameter database of the ordinate Kr of the evaluation point in the FAD diagram calculation output module, the above two methods only compare the Kr calculation results, as shown in Table 1.
It can be seen from Figure 7, that the coordinates of the evaluation points of the three types of welded joints are all within the failure evaluation curve and no fracture occurs, so that the failure assessment is qualified. The data in Table 1 shows that the Kr value calculated by the algorithm program is larger than that obtained by routine calculation, indicating that the algorithm program after adding the parameter database is more conservative in the failure assessment. After the comparison of the two calculation methods, the accuracy of the evaluation point coordinates of each joint specimen calculated by the algorithm program is improved by 8 %–12%. Compared with the same type of development program in the Ref., 7 the accuracy improvement is greater.
By comparing the improved accuracy of the three types of welded joint specimens in Table 1, it is found that the calculation accuracy of the evaluation points of the butt joints has a smaller improvement than the other two types of joints. The main reasons are: the concentration degree of cyclic stress in the butt joint structure is not obvious, the weld metal bulge is small, and the stress distribution on the base metal is relatively balanced. After the surface load is applied, the maximum stress concentration point in the simulation results is displayed at the stressed end of the base metal. In the calculation of failure assessment, this position is removed as invalid data, and the stress data of the weld toe on both sides where the stress of the weld metal is relatively concentrated and the weld root are used for calculation.
According to the above conclusions, it can be seen that the results of finite element simulation and algorithm program calculation are real and effective. In terms of failure assessment, the calculation accuracy of the evaluation point coordinates calculated by the algorithm program is higher, and the output FAD diagram is more conservative and reasonable.
Verification and analysis of fatigue crack growth life
According to the assessment results given in Section 3.1 of this paper, the failure assessment of each joint specimen is qualified and meets the requirements for continued use. Therefore, we continue to calculate the fatigue crack growth life. The fatigue life of each joint specimen calculated by the algorithm program is compared with the test life to verify the fatigue crack growth life calculation module of the algorithm program. The test data of the remaining life of the three types of welded joints are provided by Refs.25,26
Before calculating the fatigue life, it is necessary to determine the initial crack size and critical crack size of each specimen. The initial crack size a0 of the three types of welded joint specimens is selected according to a0/B = 0.01, that is 0.06, 0.02, and 0.02 mm. The critical crack size
Then, according to the finite element calculation results in Figure 6, input the stress calculation amplitude and set the crack-related parameters in the algorithm program to output the fatigue life value and crack growth curve of the specimen. The fatigue crack growth curve of each joint specimen is shown in Figure 8, and the fatigue residual life test values and algorithm program calculation values are shown in Table 2.

Calculation of fatigue crack growth curve by algorithmic program: (a) first-order Pairs curve of T-joint, (b) second-order Paris curve of T-joint, (c) first order Pairs curve of butt joint, (d) second-order Paris curve of butt joint, (e) first order Pairs curve of lap joint, and (f) second-order Paris curve of lap joint.
Experimental fatigue life value and fatigue life value calculated by algorithm program.
It can be seen from Figure 8, the first-order and second-order Paris curves of each joint specimen increase monotonically and smoothly, which is consistent with the theoretical trend. At the same time, the life value of the second-order Paris curve calculated by the algorithm program is smaller than the first-order Paris life value, which is consistent with the BS7910 standard and proves that the calculation output of the algorithm program is reasonable.
At present, for the prediction of fatigue crack growth life of test pieces, the vast majority of people use Paris formula to calculate, such as the calculation methods in Refs.9,13 However, they failed to fully consider the influence of parameters such as specimen shapes and geometric sizes when calculating, which will lead to large deviation of calculation results and affect the judgment of workers. The advantage of the parameter table optimization algorithm is that it adds the shape coefficient Y parameter selection database, which can take into account the influence of different shapes and sizes on fatigue life. At the same time, since the opt function in equation (7) selects the minimum value in the calculation results, the maximum fatigue life value can be calculated on the premise of ensuring the safe use of the test piece.
Taking the No. 2 specimen of each joint as an example, the data in Table 2 shows that the test life value is 3.26, 1.86, and 1.10 times of the first-order Paris curve calculated by the algorithm program and 4.44, 2.41, and 1.42 times of the second-order Paris curve calculated by the algorithm program. As the material of T-joint specimen is aluminum alloy, the material of butt joint and lap joint specimen is steel, according to the error multiple, it can be seen that: Under the same material, the smaller the load applied to the specimen, the smaller the life error between the test and the calculation. Under the same load condition, the life error of the steel is smaller than that of the aluminum alloy. As mentioned in Ref., 27 the error of the test life and the life calculated by the algorithm program based on the simulation results is not more than 10 times, which is within a reasonable range, and the calculation result of the algorithm program is valid.
Therefore, in the fatigue crack growth life calculation module, the fatigue life calculated by the program based on the parameter table optimization algorithm is also accurate and reasonable.
Conclusions
(1) The parameter table optimization algorithm can quickly and accurately carry on the failure assessment of the specimen through the parameter selection databases added by connection pools. At the same time, combined with the FAD diagram and fatigue crack growth curve from the program compiled by the algorithm, the state and remaining life of the specimen can be judged intuitively, and the validity of the algorithm is verified by three types of commonly used welded joints.
(2) This algorithm is only applicable to plate parts and welded joints. For other shapes such as thin-walled, cylindrical, etc., other methods need to be selected. In addition, only three parameters are added to the parameter selection databases of this algorithm. If you want to consider the selection of other parameters, further processing is required.
(3) The algorithm program solves the visualization problem in the evaluation process, provides a reference for the evaluation of welded structural specimens, and has important application prospects and engineering significance.
Footnotes
Handling Editor: Chenhui Liang
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: The authors gratefully acknowledge the support of the National Railway Group Science and Technology Research and Development Plan Project (Project No. K2021J006), and the National High Speed Train Technology Innovation Center Project (CXKY-02-01-03 (2020))
