Optimization of SOFC stack gas distribution structure based on BP Neural network and CFD

: The flow field distribution of solid oxide fuel cells significantly affects the performance of the stack. The flow uniformity can be improved and the power generation efficiency can be improved by optimizing the gas distribution structure of the stack. Based on the simplified 6kW stack model, the stack gas distribution structure with two-stage buffer cavity was designed, and the stack model was numerically simulated by ANSYS Fluent software. The BP neural network model, which can predict the uniformity of the outlet of the integrated stack, is established successfully. The parameters of the gas distribution structure are analyzed and optimized by using the orthogonal test and BP neural network. The results show that at the same time considering pile distribution structure under the condition of surface area and uniformity, when the first stage inlet buffer chamber depth is 40 mm, the channel width is 40 mm, the secondary inlet buffer chamber depth is 80 mm, can effectively reduce the electric pile distribution structure, surface area, to reduce heat loss, at the same time guarantee the integrated electric reactor outlet flow uniformity of more than 96%, greatly improves the efficiency of power generation.


Introduction
Solid Oxide Fuel Cell (SOFC) is an energy conversion device which directly generates electric energy and heat energy through the electrochemical reaction of fuel and oxidant. Due to the advantages of high power generation efficiency and low pollutant emission level, SOFC is considered as a clean, low-carbon, safe and efficient power generation method, which has attracted more attention from researchers in recent years [1][2][3] . SOFC has a variety of different structures, and its power generation scale covers tens of watts to hundreds of megawatts, with a wide range of application scenarios [4][5][6] .
For flat plate single cell, usually a single cell can generate a voltage of 0.5~1V. In order to generate a high enough voltage, several single cells need to be stacked to form a series structure, namely the stack [7] . Stacking the cells, however, presents some difficult technical problems. In addition to the structure of the internal flow channel of the cell, the parameters of the gas distribution structure of the stack are also the key issues in the design of the fuel cell stack. If the fuel gas and oxygen are not evenly distributed in the stack, the electrochemical reaction rate of the cell will be directly affected [8] . In addition, the gas distribution structure of the reactor also needs to ensure the compactness of the structure. If the surface area is too large, a certain amount of heat will be lost, which will affect the power generation efficiency. Therefore, the design of the gas distribution structure of the reactor is very important. Fuel cell stacks are divided into two main intake types: inner and outer airways. The outer airway is simpler and less costly than the inner airway. However, the inner airway has better tightness [9] .
For SOFC stack multi-physics field coupling simulation, although the calculation results may be more accurate, but the demand for computing resources is relatively large, the current work only achieve a single stack multi-physics field simulation. However, for systemlevel multi-stack, multi-physical field simulation is relatively difficult and costly, so we need to put forward reasonable assumptions to simplify the difficulty of simulation. Firstly, the uniformity of gas distribution can be verified from the perspective of single flow field, so as to improve the corresponding gas distribution structure, thus greatly reducing the computational resources. Zuopeng Qu et al. [7] studied the effects of different design parameters, such as gas distributor, porous medium permeability and cathode gas supply rate, on gas distribution and pressure variation in a 60-layer reactor. Daifen Chen et al. [10] studied the influence of parameters such as different airway positions and radii on flow allocation in 10-layer short reactor. Cheng Zhao et al. [11] studied the influence of the position, size and number of pipes in the 40-layer stack on the flow uniformity. Through CFD and experimental methods, Cheng Zhao et al. [12] improved the flow uniformity of a 20-layer stack with an outer airway by studying different structures and size of pipes as well as secondary gas distribution structures.
From the above analysis, it can be seen that the design of the size parameters of the SOFC stack gas distribution structure is important for the uniform distribution of gas flow. Through CFD simulation, the full flow field information, such as velocity distribution inside the stack and outlet flow, can be obtained, and the influence of various factors on gas distribution can be analyzed. The existing CFD simulation studies on the distribution structure of the reactor are mainly based on the flow field, and the simulation and design are carried out by simply changing the structure parameters, which is not easy to obtain the optimal structure parameters. The development of neural network technology provides a new method for the optimization of SOFC stack gas distribution structure [13][14][15][16][17] .
In this paper, the numerical models of the 6kW stack integrated structure and air distribution structure are established, and the orthogonal test scheme is designed for simulation. The data obtained from CFD simulation is used to establish the BP neural network model. Firstly, the optimal configuration parameters are obtained from the angle of the uniformity of the outlet of the integrated stack by using the orthogonal factor analysis. On the basis of the optimal distribution structure, the overall surface area and uniformity of the reactor distribution structure were considered comprehensively, and the influences of the first and second stage inlet buffer chamber on the surface area and uniformity were predicted and analyzed by using the neural network. It is expected that within a reasonable range of uniformity, the surface area of the gas distribution structure of the reactor can be reduced as far as possible, and the heat loss can be controlled, so as to improve the power generation efficiency and service life of the fuel cell reactor, and also provide reference for the successful design and operation of the higher-power reactor in the future. Fig. 1 shows the 6kW SOFC integrated stack and its air distribution structure. The main structural parameters are shown in Table 1. Each stack is composed of 43 single cells stacked with a power of 1kW, and the stack numbers are 1~6. The fuel flow channel is ignored in the stack model, and only the air flow channel is considered. In order to ensure the uniformity of gas distribution and compact structure, the air distribution structure adopts a two-stage buffer chamber. There are three rectangular channels between the first and second stage inlet buffer chambers, and the outlet buffer chamber structure is consistent with the inlet buffer chamber structure.

CFD model
In this paper, ANSYS Fluent 19.2 and Simple-Consistent (Simple-Consistent) algorithms are used to calculate the flow distribution in the stack. In order to simplify the calculation, the following hypotheses are proposed: (1) Electrochemical reaction, heat exchange and mass transfer are ignored, and only the flow field in the stack is considered; (2) The state in the inlet pipe is turbulent; (3) The working medium is incompressible gas, and the airflow in the stack is in a stable state; (4) Ignoring the effect of gravity, and setting the reference pressure as 10325Pa.
Based on the above assumptions, the mass conservation equation and momentum conservation equation are solved. The equation is as follows: In the formula, ߩ is air density; ‫ݐ‬ is time; ‫ݑ‬ ሬ⃗ is velocity vector. ‫ݑߩ In the formula, ‫‬ is pressure; ߬ is stress tensor; ܵ ⃗ ெ is momentum source term

Mesh generation and boundary conditions
Generate a structured grid using ANSYS ICEM CFD 19.2. Because the flow channel size of the stack model is small and the number of generated grids is large, it is not easy to verify the overall grid independence. Therefore, only grid independence verification was carried out for the single stack model, as shown in Figure 2. The results showed that the number of single stack grids was appropriate at about 30.3 million, and the total number of grids at this time was about 201.8 million. The boundary conditions in the model are set as: (1) The pipe inlet is the mass flow inlet, 774L/min; (2) The outlet of the pipe is pressure boundary condition, and the outlet pressure is 10325Pa; (3) Other positions are default wall boundary conditions.

Determination of BP neural network structure
The establishment of artificial neural network does not need to determine the specific function form between input and output, but only needs to take a large number of corresponding input and output variables as training data. The neural network will independently establish the nonlinear relationship between input and output, and get the result closest to the expected output under the given input [18] .
BP neural network is a multi-layer feedforward network trained by error back propagation. Its basic idea is gradient descent method and gradient search technology is used to minimize the error between the predicted output value and the expected output value of the network [19] .
The BP neural network adopted in this paper is shown in Figure 3, which is a three-layer BP neural network.The three structural parameters of the first inlet buffer chamber depth, the channel width and the second inlet buffer chamber depth were taken as the input layer of the neural network, and the flow uniformity of the outlet of the integrated stack was taken as the output layer of the neural network.

Input samples
In this paper, the orthogonal test method is used to design the experimental scheme, and some main parameters of the reactor gas distribution structure are optimized. Orthogonal experimental design is a design method for multi-factor and multi-level experimental problems. The method uses orthogonal tables to arrange appropriate number of experiments to seek the optimal level combination.Orthogonal test method has obvious advantages in saving experimental time and cost [20,21] .
In order to make the optimization results of the distribution structure parameters of the reactor more reasonable, the parameter variation range was determined. The depth of the first inlet buffer chamber was controlled within 30~60mm, the channel width was controlled within 10~40mm, and the depth of the second inlet buffer chamber was controlled within 70~85mm. Minitab was used to establish orthogonal test with 3 factors and 4 levels for solution. The orthogonal test scheme and CFD simulation results are shown in Table 2. Where A represents the depth of first stage inlet buffer chamber, B represents the channel width, C represents the depth of secondary inlet buffer cavity, and ܳ represents the flow uniformity at the outlet of the integrated stack calculated by CFD [22] .
Where ݈ represents the stack number,݈=1,2,3,4,5,6; ݊ represents the number of each layer of a single stack (from bottom to top), ݊=1,2,3……43 ݉ , represents the mass flow rate of the ݊ layer of the ݈ stack; m represents the average mass flow rate of all outlets of 6 stacks; ݉ , represents the ݊ layer of the ݈ stack of the dimensionless mass flow rate.

Prediction error analysis
Based on 16 groups of orthogonal test samples, under the given initial boundary conditions, the uniformity of 16 groups of samples corresponding to the integrated stack was calculated by CFD. BP neural network is modeled with the structure of 3 input and 1 output. The number of nodes in the hidden layer can be calculated according to the following formula: ݊ = ඥ݊ + ݊ + ݅ ݊ ∈ ܰ * (5) In the formula, ݊ is the number of nodes in the hidden layer; ݊ is the number of nodes in the input layer; ݊ is the number of nodes in the output layer; ݅ is a constant between 1 and 10 [23] . It can be known from the above formula that 3≤݊≤12. By comparing the number of nodes in different hidden layers with the program, the prediction accuracy is highest when n=11, so the structure of BP neural network model is 3×11×1.
In order to ensure sufficient training samples, 13 groups of data were randomly selected as training samples, and the remaining 3 groups were used as verification samples. The prediction effect of the model is shown in Figure 4(a), and the prediction deviation of the model is shown in Figure 4(b). The maximum error is only 1.7%, indicating that the model has a high prediction accuracy. Therefore, the established BP neural network model can be used in subsequent work.  Table 3 is based on the orthogonal test results and the range analysis method is used to analyze the degree and regularity trend of the influence of the changes in the selection level of three factors, namely, the first stage inlet buffer chamber depth, the channel width and the depth of the secondary inlet buffer chamber depth, on the flow uniformity at the outlet of the integrated stack. The value of ܴ in the table is called range. The range can represent the degree of influence of the corresponding factor on the result. A large range means that the level change of the factor has a great influence on the result. On the contrary, small range means that the level change of this factor has little influence on the result, and the range can be calculated by formula. ‫ݔ‬ reflects the variation trend of the index with the change of the level [24] .

Orthogonal experiment optimization
In the formula, ܳ is the flow uniformity at the outlet of the integrated stack, ݅ is the factor number, ݅ = ‫,ܣ‬ ‫,ܤ‬ ‫;ܥ‬ ݆ is the horizontal sign, ݆=1 2 3 4 ܴ is the range value.
In order to analyze the influence rule of each factor level on uniformity, the values of ‫ݔ‬ ‫ݔ‬ ‫ݔ‬ were ploted, as shown in Fig. 5. As can be seen from Fig. 5, with the increase of the channel width and the first stage inlet buffer chamber depth, the uniformity gradually increases, and the increase of the width of the inlet has a significant impact on the uniformity. With the increase of the secondary inlet buffer chamber depth, the uniformity increases at first and reaches the highest value when the depth of the air chamber is 80mm, then decreases. From the above range ܴ , it can be seen that the three factors have a descending order of importance on the uniformity: the channel width, the secondary inlet buffer chamber depth and the first stage inlet buffer chamber depth. With uniformity as the evaluation index, it can be seen from the figure analysis that B 4 C 3 A 4 is the optimal combination. There is no above scheme in the orthogonal test scheme, so the scheme is verified by CFD simulation.
The main structural parameters and uniformity before and after optimization are shown in Table 4. The results show that when the first stage inlet buffer chamber depth is 60mm, the channel width is 40mm, and the secondary inlet buffer chamber depth is 80mm, the flow uniformity at the outlet of the integrated stack is the highest, reaching 96.31%, and the uniformity is increased by 9.87% compared with that before optimization. At this time, the uniformity of BP neural network prediction is 96.92%, and the error is only 0.61%.

Comparison of results before and after optimization
The normalized mass flow distribution at the 6 stacks outlets before and after the optimization of the reactor gas distribution structure is shown in Fig. 6. It can be seen from Fig. 6(a) that the flow distribution of No. 4, No. 5 and No. 6 stacks before optimization is uneven, leading to poor overall flow distribution. As can be seen from Fig.  6(b), the flow distribution uniformity of No. 4, No. 5 and No. 6 stacks after optimization has been significantly improved, and the overall flow distribution deviation is about ±3%. This deviation is within the acceptable operating range because the actual inlet air of the stack is excessive.
Take No. 4 stack as an example to analyze the outlet velocity distribution of stack, as shown in Fig. 7. Fig. 7(a) shows the velocity distribution before optimization. It can be seen from the figure that the maximum velocity at the exit of the stack before optimization is 1.5m/s, and the velocity distribution on the left and right sides is obviously uneven. Fig. 7(b) shows the velocity distribution after optimization. It can be seen that after parameter optimization, the maximum outlet velocity of the stack is 1.24m/s, and the velocity distribution on the left and right sides tends to be the same.
The above analysis shows that the flow uniformity at the outlet of the integrated stack can be well improved by optimizing the structure parameters of the stack gas distribution.

Optimization of surface area of electric stack integrated structure
In addition to the uniformity of outlet flow, the overall surface area should also be considered. Because SOFC stacks operate at an ambient temperature of more than 700℃, they need a compact structure to control heat loss and keep the operating temperature stable to improve the efficiency of power generation.In this section, based on the optimal structural parameters, BP neural network is used to make the prediction analysis, and the influence of the gas distribution structure surface area and outlet flow uniformity on the performance of the stack is comprehensively considered.
Since the channel width has no effect on the surface area of the integrated stack gas distribution structure, only the influences of the changes of the first stage inlet buffer chamber depth and the secondary inlet buffer chamber depth on the overall surface area and uniformity are considered here. Considering the influence of the prediction error of BP neural network, it is considered that the prediction uniformity above 96% is an acceptable working range. Figure 8 shows the variation of the uniformity predicted by BP neural network model with the first stage inlet buffer chamber depth when the channel width of the integrated stack gas distribution structure is 40mm and the secondary inlet buffer chamber depth is 80mm.

Prediction of the effect of the depth of the first inlet buffer chamber on the uniformity
As can be seen from the figure, when the first stage inlet buffer chamber depth is larger than 40mm, the uniformity is more than 96%. When the depth of primary buffer cavity is 40mm, the overall surface area of the stack integrated structure is reduced by 31480mm 2 compared with the original, which can effectively control the compactness of the structure and reduce the heat loss.  Fig. 9 shows the variation of the uniformity predicted by BP neural network model with the secondary inlet buffer chamber depth of the integrated stack gas distribution structure when the depth of the first stage inlet buffer chamber depth is 60mm and the channel width of is 40mm. As can be seen from the figure, when the depth of the secondary buffer cavity is greater than 72.5mm, the uniformity is more than 96%. When the secondary inlet buffer chamber depth is 72.5mm, the surface area of the stack integrated structure decreases by 13779mm 2 compared with the original one.

Prediction of influence of depth change of secondary inlet buffer chamber on uniformity
The results show that it is more effective to reduce the surface area and control the uniformity by reducing the depth of the first inlet buffer chamber depth. At this time, the parameters of the integrated stack gas distribution structure are as follows: the first stage inlet buffer chamber depth is 40mm, the channel width is 40mm, and the secondary inlet buffer chamber depth is 80mm.

Fig9
Prediction curve of the influence of the depth of secondary inlet buffer chamber on the uniformity

Conclusions
By designing the orthogonal test scheme, the main parameters of the integrated stack gas distribution structure are optimized by using the method of CFD simulation and BP neural network. Based on the optimal structural parameters of uniformity, various structural parameters and their influences on the gas distribution structure surface area of the stack and the flow uniformity at the outlet of the integrated stack are predicted and analyzed, and the following conclusions are drawn: (1) The flow uniformity at the outlet of the integrated stack corresponding to different parameters of the gas distribution structure was obtained by using CFD simulation. The mathematical relationship between the main parameters of the gas distribution structure and the uniformity was established by using the powerful learning ability of BP neural network, and the flow uniformity at the outlet of the integrated stack corresponding to different parameters was successfully predicted. The prediction accuracy is high, and the maximum error is only 1.7%.
(2) When only the uniformity is considered, the optimal gas distribution structure parameter combination is obtained by orthogonal test factor analysis. The results show that the highest uniformity is obtained when the first stage inlet buffer chamber depth is 60mm, the channel is 40mm, and the secondary inlet buffer chamber depth is 80mm. The uniformity obtained by CFD simulation is 96.31%. At this time, the prediction result of BP neural network is 96.92%, and the prediction error is only 0.61%, which further verifies the accuracy of BP neural network model.
(3) The uniformity after optimization is increased by 9.87% compared with that before optimization, and the uniformity of gas distribution in the stack is improved, so as to improve the power generation efficiency and service life of the reactor. The results show that the structural performance of the stack gas distribution structure designed by the conventional structural parameter method is not optimal and there is a large space for improvement.
(4) On the basis of the optimal gas distribution structure, the factor of the overall surface area of the stack gas distribution structure is also considered. Using BP neural network prediction analysis of first stage and secondary inlet chamber depth for the effect of surface area and evenness, the results show that when the first stage inlet buffer chamber depth is 40 mm, the channel width is 40 mm, the secondary inlet buffer chamber depth is 80 mm, can ensure uniformity over 96%, but also greatly reduced the integrated structure of the overall surface area, reduce the heat loss, improve the efficiency of power generation.