Pore modeling method for gas diffusion layer of proton exchange membrane fuel cell

By combining the pore modeling method with MATLAB script parameterized modeling technology, the problem that the existing technology fails to effectively consider the binder and hydrophobic agent is solved, and an accurate two-dimensional fiber pore structure of the gas diffusion layer is generated, which improves the performance and durability of the fuel cell.

CN119889506APending Publication Date: 2025-04-25CHANGAN UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411731189.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-04-25

Smart Images

  • Figure CN119889506A_ABST
    Figure CN119889506A_ABST
Patent Text Reader

Abstract

The invention discloses a pore modeling method for a gas diffusion layer of a proton exchange membrane fuel cell in the field of pore modeling, which comprises the following steps of: S1, initializing the size of a fiber layer, namely initializing parameters such as the length and width of the fiber layer of the gas diffusion layer, the number and porosity of the fiber layer, the number of random seeds, the size of a grid and the volume fraction of PTFE (Polytetrafluoroethylene); according to the method, after points are randomly generated, all points meeting the conditions are screened out in circulation, it is ensured that all generated fibers are in a simulation area, the innovative modeling method is provided, visual data of gas diffusion layer two-dimensional fiber pores can be efficiently generated, and the method has the advantages of being high in practicability and high in practicability. And an accurate and visual tool is provided for research on improvement of the internal drainage performance of the battery. According to the method, an MATLAB script parametric modeling technology is combined, the number of seeds and target porosity characteristics are accurately set, a structure meeting the actual diffusion layer porosity requirement is randomly generated, and reasonable distribution of substances in the modeling process is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of pore modeling, and in particular to a pore modeling method for a gas diffusion layer of a proton exchange membrane fuel cell. Background Art

[0002] Reconstructing gas courses with real structural characteristics and using numerical methods to study the influence of their internal structure and property changes on the heat and mass transfer process is an effective way to optimize gas course design and improve fuel cell performance and durability. Considering the limited computing resources, the computational domain and grid resolution of the gas course used to simulate internal material transfer cannot be too high, so some microscopic features are generally simplified when reconstructing it. The first is to assume that the gas diffusion layer is composed only of pore phase and carbon fiber phase, without considering the existence of binder and hydrophobic agent. Although it can reduce the amount of calculation, it can only simulate simple gas-liquid flow processes. The second is based on the first, further considering the binder phase on the carbon fiber, and the influence of the morphology and distribution of the binder on the heat and liquid water transfer can be additionally considered. The third is based on the second, further considering the hydrophobic agent on the surface of the carbon fiber, the distribution and content of each phase can be freely controlled, and the influence of the content and distribution of the hydrophobic agent on the heat and liquid water transfer can be further considered.

[0003] Existing technical solutions such as Figure 2 As shown, the steps are as follows:

[0004] (1) Generate a random point group (each group contains two random points) in a plane of a given area and then connect them to generate a straight line to represent the center line of the carbon fiber;

[0005] (2) expanding the fiber center line in step (1) into a cylinder in two dimensions to form a single carbon fiber, wherein the diameter of the cylinder is a preset carbon fiber diameter, and the processing method is to determine whether the distance from the pore grid point around the center line to the center line is less than the carbon fiber radius, if so, the grid point is converted into a fiber grid point, otherwise it remains as a pore grid point;

[0006] Repeat steps (1) and (2) to generate a certain number of carbon fibers until the porosity in the space meets the requirements.

[0007] The prior art has the following disadvantages:

[0008] (1) In the actual manufacturing process of the gas diffusion layer, a certain amount of binder is added to ensure a tight connection between the carbon fibers. The presence of the binder will reduce the porosity of the gas diffusion layer and have a significant impact on the thermal conductivity. However, the prior art does not take into account the actual binder in the gas diffusion layer, which is inconsistent with the actual situation;

[0009] Since carbon fiber itself is a hydrophilic material, in order to perform good water management inside the fuel cell, a certain amount of hydrophobic agent needs to be added to the gas diffusion layer to cover the surface of the carbon fiber to improve its hydrophobicity. The presence of the hydrophobic agent will reduce the porosity of the gas diffusion layer, change the transfer process of liquid water, and change the thermal conductivity of the carbon fiber. However, the existing technology does not take into account the actual presence of the hydrophobic agent in the gas diffusion layer, which is inconsistent with reality. Summary of the invention

[0010] The purpose of this section is to summarize some aspects of the embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the specification abstract and the invention title of the present invention to avoid blurring the purpose of this section, the specification abstract and the invention title, and such simplifications or omissions cannot be used to limit the scope of the present invention.

[0011] The purpose of the present invention is to solve the technical problems in the background technology. The present invention proposes a pore modeling method for a gas diffusion layer of a proton exchange membrane fuel cell. The present invention proposes an innovative modeling method that can efficiently generate visualization data of two-dimensional fiber pores of the gas diffusion layer, and provide an accurate and intuitive tool for research on improving the internal drainage performance of the battery. The method combines MATLAB script parameterized modeling technology, and by accurately setting the number of seeds and target porosity characteristics, randomly generates a structure that meets the actual diffusion layer porosity requirements, and ensures the reasonable distribution of substances during the modeling process.

[0012] The present invention proposes a pore modeling method for a gas diffusion layer of a proton exchange membrane fuel cell, comprising the following steps:

[0013] S1 is a step for initializing the fiber layer size, which initializes the length and width of the fiber layer of the gas diffusion layer, the number of fiber layers and their porosity, the number of random seeds, the grid size and the PTFE volume fraction and other parameters;

[0014] S2 parameterized modeling step, in which the above-mentioned input information is used as input data to model the fiber structure to represent the grid state after fiber growth. After randomly generating points, all points that meet the conditions are screened out within the loop to ensure that all generated fibers are within the simulation area;

[0015] S3 is a step of setting the center coordinates of a circle. In this step, a plane coordinate system is established in the simulation area by setting any point in the simulation area, and then a circular area is generated by using the radius and the interval size as parameters to check whether the point generated in the previous step is in the interval, and the position of the legal point is converted into a grid index, and finally the grid value is updated to include the position of the circular area;

[0016] S4 is a step of calculating the volume fraction. In this step, the generated fibers are counted by the gridded coordinate system in the simulation space, and the slope and intercept of the random straight line are calculated using the interval size, grid array, random points and other parameters mentioned above. The intersection of two fiber straight lines is found, and each point is judged whether it is in the closed area according to specific conditions, and the grid value is updated to include the position of the adhesive, and finally the volume fraction of the adhesive is calculated;

[0017] S5: determining pixel position step, in which the pixel positions with a value of 0 adjacent to the boundary pixels with a value of 1 are found, the initial grid is set to 0, and it is considered as the potential PTFE position. Then, the neighbor index is randomly selected as the phase position according to the required PTFE quantity, and finally a pattern representing the PTFE structure is generated in the two-dimensional grid;

[0018] S6 is a merging and rendering step, in which each component is merged and rendered after the modeling design of each component is completed, until a whole visualized gas diffusion layer is formed.

[0019] Preferably, the step of initializing the fiber layer size limits the fiber layer size. In actual use, the fiber layer size is set according to the actual gas diffusion requirements. At the same time, this step performs synchronous operations on multiple fiber layers, and the sizes of the multiple fiber layers are different. In subsequent operations, the same subsequent operations are performed on multiple fiber layers of different sizes, so as to make a horizontal comparison to determine whether fiber layers of different sizes have an impact on subsequent experimental operations and the extent of the impact. The volume parameters of the fiber layer include the length and width of the fiber layer.

[0020] Preferably, the parametric modeling step, if no random seed parameter is provided when calling the function, is set to 0 by default. This step has two establishment methods when establishing the coordinate axis. One establishment method is to set the zero point of the coordinate axis near the center of the above-mentioned fiber layer area. At this time, the generated fibers are most likely evenly distributed within the four quadrants of the coordinate axis. Another coordinate axis establishment method is to select one side edge of the above-mentioned fiber layer to establish the coordinate axis. At this time, the generated fibers are distributed within the two quadrants of the coordinate axis. In actual operation, a suitable coordinate axis establishment method is selected according to the actual fiber distribution. In this step, the fibers are generated by continuously randomly selecting pairs of points in a loop, calculating their distance and updating the grid value to simulate fiber growth.

[0021] Preferably, the step of setting the coordinates of the circle center, the script parameterized modeling of this step is realized based on the automatic operation of the MATLAB script. In actual operation, this step adjusts the grid size in the coordinate system according to the generated fiber density, so that the number of fibers distributed in each grid is as similar as possible. The use of a suitable grid size can facilitate the subsequent counting of the number of fibers generated inside the fiber layer. At the same time, when setting the grid size, the number of fibers located on the grid lines should be reduced as much as possible, so that the fibers are framed inside the grid through the grid.

[0022] Preferably, in the step of setting the coordinates of the circle center, the two-dimensional coordinates stored at the end of this step will all be converted into one-dimensional indexes. After this step grids the coordinates of the fiber layer in the area, the grids are numbered, so that different positions on the current fiber layer can be located by numbering. At the same time, when generating and saving information, the number of fibers inside the grid is integrated at the end of the numbering information, so as to achieve the effect that the one-dimensional index can accurately locate the accurate single position inside the fiber layer while also including the fiber quantity information inside the current grid. For example, a grid numbered 03 has 5 generated fibers, and the record can be saved as 030005 when performing one-dimensional index storage. By adding a split zero bit, the two types of information will not interfere with each other.

[0023] Preferably, in the step of calculating the volume fraction, the generation of fiber straight lines is achieved with the help of random points. When setting the random point parameters in the above step, the position of the generated fibers can be controlled to a certain extent by adjusting the random parameters. During operation, this step can save the fiber position distribution records generated by multiple different random points, and then the correlation between the random points and the direction and size of the fiber generation can be calculated through the model.

[0024] Preferably, the parameterized modeling step specifically includes the following steps:

[0025] S71 sets an initial seed step, in which the initial seed seed is set to 0 to ensure that the result is reproducible, and then initializes the random number generator according to the provided seed value, calculates the total number of elements in the grid, creates a grid point coordinate matrix and converts the point coordinates into a column vector;

[0026] S72 is a variable recording step, in which the ratio of elements in the current grid that are not marked as fiber structures is recorded for the vol_C variable, and its initial value is set to 1. At the same time, a random point matrix is ​​initialized and stored. A new value is calculated for each loop iteration and compared with the target porosity Vs. When it is greater than Vs, two different point indexes are randomly selected and added to the matrix;

[0027] S73 is a step of calculating vectors, in which the vector between two points and its length is calculated, and the vectors from all points to the first random point are calculated at the same time, and then the perpendicular distances from all points to the line segment are calculated to determine which points are inside the fiber. This step is the core of the calculation;

[0028] S74 is a distance value calculation step, which calculates the standardized distance value and finds the points whose distance is less than or equal to the threshold value, extracts the coordinates of these points and checks whether these points are within the interval, converts the coordinates of the points that meet the conditions into linear indices, marks them in the grid, and updates the porosity. Finally, the screening is completed.

[0029] Preferably, a center line is generated between two points and a single fiber is generated through two-dimensional expansion, and the single fiber is stacked to form a fiber layer. In the parameterized modeling step, the detailed logic and process of carbon fiber generation and screening are as follows:

[0030] S81 defines the genFiber function step, which defines a function genFiber, then performs parameter initialization and input checking, defines four input parameters box, arrgrid, Vs, seed, and if the seed parameter is not provided, it defaults to 0, and then randomly generates two points on the cross section of the fiber layer center;

[0031] S82: a step of calculating a vertical distance. The calculation formula of the standardized distance value in this step is disp1=distances / norm_disp, where disp1 is the vertical distance from all points to the line segment calculated in the previous step;

[0032] For norm_disp, the Euclidean norm of vector v1 is calculated here, that is, the length of the vector: if two randomly selected points are recorded as (x1, y1) and (x2, y2), then the norm of their vectors is:

[0033]

[0034] After the calculation is completed, the fiber model is generated with two randomly generated points in the fiber layer as the two ends of the fiber. After the model is generated, it is stretched and extended to facilitate modeling. The stretching process is as follows: Figure 5 As shown, the diameter of carbon fiber is generally 5-20 microns. For the convenience of modeling, it is magnified 1000 times during modeling, that is, millimeters are used as units. When further solving after the pre-processing is completed, the size parameters are scaled 1000 times again.

[0035] Preferably, the step of calculating the volume fraction, which is about the generation process of the binder structure, sets the seed of the random number generator to ensure that the results of each operation are the same, sets the number of random lines to be generated to half of randompoints (an array containing the coordinates of the random points), uses the polyfit function to fit each pair of points, obtains the slope and intercept of the line, and stores the slope and intercept in two initial arrays, slope and intercept, respectively;

[0036] Furthermore, a double loop is used to traverse all combinations of lines, calculate their intersection points, use the inverse tangent function atan to calculate the angle, convert it into degrees, and calculate the angle between the two lines. Then, based on the angle and the intersection point, the positions of the two circle centers can be calculated. Then, whether each point is within the grid is determined, and the grid is updated. The detailed judgment logic we use here is as follows:

[0037] S91 defines the genBinder function step, which defines a function named genBinder and explains its parameters: box: represents the size of the grid, such as [rows, cols], arrgrid: the initial grid data, used to mark the generated binder area, randompoints: randomly generated points, used to determine the position of the line, radius: the radius of the circle, used to calculate the binder area, seed: random seed, used to control the random number generator. If the seed parameter is not provided, the default is 0. Use rng(seed) to set the seed of the random number generator;

[0038] S92 defines a numLines parameter step, which defines numLines as the number of straight lines to be generated; line is used to store the slope and intercept of each straight line, and the least squares method polyfit is used to fit the straight line y=mx+b to obtain the slope and intercept, where m is the slope and b is the intercept;

[0039] S93 is the step of finding the intersection of the straight lines. This step requires traversing all the straight line combinations and calculating their intersection points. Four parameters are defined here: θ1: calculate the angle of the first straight line; θ2: calculate the angle of the second straight line. col and row are used to calculate the horizontal and vertical coordinates of the intersection of the two straight lines, respectively. The specific formula is as follows:

[0040]

[0041] row=m i ·col+b i

[0042] S94 is the step of calculating the angle and distance. This step is to calculate the angle and distance between two straight lines. We define two parameters again, which are to calculate the angle θ1 and θ2 between the two straight lines, and to calculate the distance d1 and d2 between the two circle centers according to the angle. The calculation formula is as follows:

[0043] θ1=|θ line1 -θ line2 |

[0044] θ2=180 ° -θ1

[0045]

[0046] S95 defines the center function step. In this step, we define the center function to calculate the coordinates of the four center points:

[0047] x center =x int ±d·cos(α)

[0048] y center =y int ±d·sin(α)

[0049] S96 determines whether a point is in a closed area. This step determines whether each point is in a closed area. First, the meanings of several parameters are given here: ind2sub: convert linear index to subscript index, points: store points that meet the conditions, norm: calculate the length of the vector, dot: calculate the dot product of the vector, acos: calculate the arc cosine value to get the angle, d1, d2, d3, d4: calculate the distance from the point to the center of each circle, radius1: adjusted radius, points: if the point meets the conditions, add it to points.

[0050] For a point (row(k),col(k))(row(k),col(k)), first calculate its vector v1 to the intersection, the vector v2 to the center of the first circle, and the vector v3 to the center of the second circle:

[0051] v1=[row(k),col(k)]-intersection

[0052] v2=center(1,:)-intersection

[0053] v3 = center(3,:)-intersection

[0054] Then calculate the magnitude and dot product of these vectors:

[0055]

[0056] dot_product=v1 x v2 x +v1 y v2 y

[0057] Then calculate its arc cosine value to get the angle, and then calculate the distance from the point to the center of each circle.

[0058]

[0059] Here we can also use the dot product and the modulus to calculate the angle (in degrees):

[0060]

[0061] If angle_deg>90°, convert to supplementary angle:

[0062] if angle_deg>90°:angle_deg=180-angle_deg

[0063] Furthermore, the angle and distance are used to determine whether the point is within the closed area:

[0064] If the calculated angle between the two vectors is less than half of the angle between the two straight lines, check whether the distance from the point to the two centers is less than the radius minus 5, and check whether the direction vector from the point to the center of the first circle is longer than the direction vector to the intersection. If the above conditions are met, the point is in the closed area. Otherwise, similarly check the distance and direction vector from the point to the other two centers. After calculating the tangent circle and the closed area, the area of ​​the adhesive can be obtained. The specific process is as follows: Figure 7 As shown,

[0065] S97 updates the grid data step. This step updates the grid data and calculates the volume ratio. We define the idv parameter to convert the index of the points that meet the conditions into a linear index, use arrgrid to update the grid data, mark the points that meet the conditions, and finally use vol_B to calculate the volume ratio of the marked area. The formula is as follows:

[0066]

[0067] Among them, n p is the total number of marked points, t p is the total number of points in the grid.

[0068] Preferably, the step of determining the pixel position, which is about the generation process of the PTFE structure, is divided into four parts: initialization, finding boundary pixels, randomly selecting the PTFE phase, and finally expanding the PTFE phase. The following is a detailed explanation of the four processes:

[0069] S101 defines a genPTFE function step, which defines a function genPTFE, which contains four parameters: box: a vector containing two elements, indicating the size of the grid (here the number of rows box1 and the number of columns box2 are defined), arrgrid: a two-dimensional array, indicating the initial grid, where the value 1 indicates the boundary and 0 indicates the empty area, Vp: a scalar, indicating the volume fraction of PTFE, seed: a random seed used to control the random number generator, and then Vp is multiplied with box1 and box2 to obtain the required PTFE quantity;

[0070] S102 determines the boundary position step. This step then finds the boundary pixels and adjacent empty pixel positions. Here we use the bwperim function to find all boundary pixels. Using arrgrid == 1, we return a logical array of the same size as arrgrid, where the position with a value of 1 is true and the other positions are false. After completion, the bwperim function returns a logical array, where a value of 1 indicates that the pixel is a boundary pixel. After finding the boundary pixel, the find function returns the row and column indexes of the boundary pixel, and then initializes an empty array neighbor_indices to store the index of the neighbor pixel. Then for each For boundary pixels, calculate the neighbor pixels in four directions (up, down, left, and right). After the calculation is completed, use the isinbox function to check whether the neighbor pixels are within the grid range. Only those neighbor pixels within the grid range will be retained, which we call valid neighbor pixels. Then use the sub2ind function to convert the two-dimensional index into a linear index. Only those grids with a value of 0, that is, empty positions, are retained. The neighbor index of the current boundary pixel is added to the neighbor_indices array. In this way, we get the indexes of all boundary pixels and their adjacent empty positions. These indexes will be used in the subsequent PTFE placement process.

[0071] S103 is the step of expanding the PTFE position. In this step, we need to expand the PTFE to other empty positions until the required number of PTFE is reached. First, an empty array Ion_node is initialized to store the newly discovered PTFE positions. The while loop is used to continuously expand the PTFE until a certain condition is met (that is, enough PTFE positions are found). During this period, the find function returns the row and column indexes of all positions with a value of 3. Then, an empty array neighbor_indices is initialized again to store the neighbor index of the current PTFE position. For each PTFE position, its neighbor pixels in four directions (up, down, left, and right) are calculated and used The isinbox function is used to check whether the neighbor pixels are within the grid range. Only those neighbor pixels within the grid range will be retained. Further, the sub2ind function is used to convert the two-dimensional index into a linear index, and only those grids with values ​​​​of 0 are retained, that is, empty positions. The neighbor index of the current PTFE position is added to the Ion_node array, and it is ensured that these indexes are unique. Then the values ​​​​of these positions are set to 3, indicating that these positions are now PTFE. Finally, it is checked whether enough PTFE positions have been found. If the number of newly discovered PTFE positions reaches or exceeds the required number of PTFE, the flag is set to false and the loop is exited.

[0072] In summary, the present invention includes at least one of the following beneficial effects:

[0073] This paper proposes an innovative modeling method that can efficiently generate visualization data of the two-dimensional fiber pores of the gas diffusion layer, providing an accurate and intuitive tool for research on improving the internal drainage performance of batteries. This method combines MATLAB script parameterized modeling technology, and by accurately setting the number of seeds and target porosity characteristics, randomly generates structures that meet the actual diffusion layer porosity requirements and ensures the reasonable distribution of substances during the modeling process.

[0074] In this method, mathematical models and parametric modeling techniques are used to accurately control the volume fraction and spatial distribution of each component in the diffusion layer, including carbon fiber, adhesive, and hydrophobic agent. By optimizing the distribution of these components, we can effectively improve the microstructure of the diffusion layer, thereby improving the gas transmission efficiency. Specifically, the method uses a random seed and growth core initialization strategy to simulate a carbon fiber network structure that meets actual requirements and ensures the consistency of the model's micromorphology with the real gas diffusion layer. The diffusion layer structure generated in this way can not only maintain the preset porosity, but also ensure a reasonable distribution of materials, meet design requirements, and ensure that the pore structure is uniform and reasonably distributed.

[0075] In addition, the correct generation of binder at the intersection of carbon fibers and the realization of its distribution form are also a major innovation of this invention. We use the tangent circle residual area method to calculate the position distribution of the binder: first set the seed of the random number generator to ensure that the results of each run are the same, and set the number of random lines to be generated to half of randompoints (an array containing the coordinates of random points). Use the polyfit function to fit each pair of points to obtain the slope and intercept of the line, and store the slope and intercept in the two initial arrays of slope and intercePTFE respectively. Further, a double loop is used to traverse all combinations of lines and calculate their intersections. Use the inverse tangent function atan to calculate the angle and convert it to degrees, and calculate the angle between the two lines. Then, based on the angle and the intersection position, the positions of the two center points can be calculated. Then determine whether each point is within the grid and update the grid data. The complete binder distribution form is finally obtained through such a cyclic update. During actual operation, some images of Binder are generated as follows Fig. 9 shown.

[0076] Furthermore, we also innovatively adopted the method of traversing boundary pixels to screen the distribution of hydrophobic agents, that is, using the bwperim function to find all boundary pixels and obtaining their row and column indices through the find function. Initialize an empty array neighbor_indices to store the indices of neighbor pixels. For each boundary pixel, calculate the neighbor pixels in four directions and check whether they are within the grid range, and only keep the neighbor pixels that meet the conditions. Convert the two-dimensional index to a linear index and keep the empty positions. These indexes are used in the PTFE placement process. Extend PTFE to other empty positions until the required number of PTFE is reached. Use a while loop to continuously expand PTFE, during which the find function returns the row and column indices of all positions with a value of 3. Initialize an empty array neighbor_indices again to store the neighbor indices of the current PTFE position, calculate the neighbor pixels in four directions and check whether they are within the grid range, and only keep the neighbor pixels that meet the conditions. Add the neighbor indices of the current PTFE position to the Ion_node array to ensure that these indices are unique. Finally, check whether enough PTFE positions have been found. If the conditions are met, set the flag to false and exit the loop. In actual operation, the partial image of PTFE is generated as follows Fig.10 shown.

[0077] Finally, after the above steps, the generated carbon fiber, binder and PTFE structural models are merged and the gaps are filled to obtain a complete two-dimensional fiber pore structure model of the diffusion layer. Here is a model of a gas diffusion layer with a porosity of each fiber layer of a fixed value of 0.7 and a PTFE volume fraction of 0.05, such as Fig.11As shown in the figure. The model not only provides the visualization data of the planar structure of the diffusion layer, but also accurately calculates the porosity and material distribution of the diffusion layer, verifying the stability and reliability of the model. Through script parameterized modeling, the modeling efficiency and operation convenience are improved, providing strong support for the performance optimization design of fuel cells in the future. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0079] Figure 1 A schematic flow chart of a specific embodiment of the pore modeling method for a proton exchange membrane fuel cell gas diffusion layer of the present invention;

[0080] Figure 2 It is a schematic diagram of background technology;

[0081] Figure 3 A schematic diagram of two points is randomly generated on the central cross section of the fiber layer for the present invention;

[0082] Figure 4 A schematic diagram of a fiber model generated by using two randomly generated points as two ends of a fiber in a fiber layer of the present invention;

[0083] Figure 5 Schematic diagram of two ends of stretched fibers in the fiber layer of the present invention;

[0084] Figure 6 A schematic diagram of determining fiber positions for a fiber layer of the present invention;

[0085] Figure 7 It is a schematic diagram of the process of generating a Binder in the fiber model schematic diagram of the present invention;

[0086] Figure 8 It is a schematic diagram of the process of generating PTFE in the fiber model schematic diagram of the present invention;

[0087] Fig. 9 It is a partial image schematic diagram of Binder when the present invention is actually running;

[0088] Fig.10 A partial image schematic diagram of PTFE during actual operation of the present invention;

[0089] Fig.11 This is a schematic diagram of a model of a gas diffusion layer in which the porosity of each fiber layer is a fixed value of 0.7 and the volume fraction of PTFE is 0.05; DETAILED DESCRIPTION

[0090] The following is combined with Figure 1-11 The present invention is described in further detail.

[0091] Embodiment 1

[0092] like Figure 1-Figure 11 As shown, in this embodiment, in order to solve the existing problems, the present invention discloses a pore modeling method for a gas diffusion layer of a proton exchange membrane fuel cell, comprising the following steps:

[0093] S1 is a step for initializing the fiber layer size, which initializes the length and width of the fiber layer of the gas diffusion layer, the number of fiber layers and their porosity, the number of random seeds, the grid size and the PTFE volume fraction and other parameters;

[0094] S2 parameterized modeling step, in which the above-mentioned input information is used as input data to model the fiber structure to represent the grid state after fiber growth. After randomly generating points, all points that meet the conditions are screened out within the loop to ensure that all generated fibers are within the simulation area;

[0095] S3 is a step of setting the center coordinates of a circle. In this step, a plane coordinate system is established in the simulation area by setting any point in the simulation area, and then a circular area is generated by using the radius and the interval size as parameters to check whether the point generated in the previous step is in the interval, and the position of the legal point is converted into a grid index, and finally the grid value is updated to include the position of the circular area;

[0096] S4 is a step of calculating the volume fraction. In this step, the generated fibers are counted by the gridded coordinate system in the simulation space, and the slope and intercept of the random straight line are calculated using the interval size, grid array, random points and other parameters mentioned above. The intersection of two fiber straight lines is found, and each point is judged whether it is in the closed area according to specific conditions, and the grid value is updated to include the position of the adhesive, and finally the volume fraction of the adhesive is calculated;

[0097] S5: determining pixel position step, in which the pixel positions with a value of 0 adjacent to the boundary pixels with a value of 1 are found, the initial grid is set to 0, and it is considered as the potential PTFE position. Then, the neighbor index is randomly selected as the phase position according to the required PTFE quantity, and finally a pattern representing the PTFE structure is generated in the two-dimensional grid;

[0098] S6 is a merging and rendering step, in which each component is merged and rendered after the modeling design of each component is completed, until a whole visualized gas diffusion layer is formed.

[0099] Through the random reconstruction technology of the gas diffusion layer provided by the present invention, it is possible to quickly generate a gas diffusion layer structure that meets the requirements and is close to the actual one according to the input gas diffusion layer structural attribute parameters, with high program running efficiency and less computing resources and time required. The structure can accurately reflect the true distribution state and dependencies of each phase in the gas diffusion layer. Based on this structure, a numerical model can be used to conduct a detailed and in-depth study of the structure and attribute parameters of the gas diffusion layer, thereby optimizing the heat and mass transfer performance of the gas diffusion layer, and ultimately achieving the purpose of improving the performance and durability of the fuel cell. The use of the present invention can contribute to the application and promotion of hydrogen fuel cells, thereby facilitating the use and promotion of hydrogen fuel cell vehicles.

[0100] Embodiment 2

[0101] like Figure 1-Figure 11 As shown, in order to solve the existing problems in this embodiment, based on the same concept as the above-mentioned embodiment 1, the pore modeling method of the gas diffusion layer of the proton exchange membrane fuel cell further includes:

[0102] The step of initializing the fiber layer size limits the fiber layer size. In actual use, the fiber layer size is set according to the actual gas diffusion requirements. At the same time, this step performs synchronous operations on multiple fiber layers, and the sizes of the multiple fiber layers are different. In subsequent operations, the same subsequent operations are performed on multiple fiber layers of different sizes, so as to make a horizontal comparison to determine whether fiber layers of different sizes have an impact on subsequent experimental operations and the extent of the impact. The volume parameters of the fiber layer include the length and width of the fiber layer.

[0103] The parametric modeling step, if no random seed parameter is provided when calling the function, is set to 0 by default. There are two methods for establishing the coordinate axis in this step. One method is to set the zero point of the coordinate axis near the center of the above-mentioned fiber layer area. At this time, the generated fibers are most likely evenly distributed in the four quadrants of the coordinate axis. Another method for establishing the coordinate axis is to select one side edge of the above-mentioned fiber layer to establish the coordinate axis. At this time, the generated fibers are distributed in the two quadrants of the coordinate axis. In actual operation, the appropriate method for establishing the coordinate axis is selected according to the actual fiber distribution. In this step, the fibers are generated by continuously randomly selecting points in a loop, calculating their distance and updating the grid value to simulate fiber growth.

[0104] The step of setting the coordinates of the circle center, the script parameterized modeling of this step is realized based on the automatic operation of the MATLAB script. In actual operation, this step adjusts the grid size in the coordinate system according to the generated fiber density, so that the number of fibers distributed in each grid is as similar as possible. The use of a suitable grid size can facilitate the subsequent counting of the number of fibers generated inside the fiber layer. At the same time, when setting the grid size, the number of fibers located on the grid lines should be reduced as much as possible, so that the fibers are framed inside the grid through the grid.

[0105] In the step of setting the coordinates of the circle center, the two-dimensional coordinates stored at the end of this step will all be converted into one-dimensional indexes. After this step grids the coordinates of the fiber layer in the area, the grids are numbered, and different positions on the current fiber layer can be located by numbering. At the same time, when generating and saving information, the number of fibers inside the grid is integrated at the end of the numbering information, so that the one-dimensional index can accurately locate the accurate single position inside the fiber layer while also including the fiber quantity information inside the current grid. For example, a grid numbered 03 has 5 generated fibers, and the record can be saved as 030005 when performing one-dimensional index storage. By adding a split zero bit, the two types of information will not interfere with each other.

[0106] The step of calculating the volume fraction, in which the generation of fiber straight lines is achieved with the help of random points, when setting the random point parameters in the above step, the position of the generated fiber can be controlled to a certain extent by adjusting the random parameters. During operation, this step can save the fiber position distribution records generated by multiple different random points, and then the correlation between the random points and the direction and size of the fiber generation can be calculated through the model.

[0107] The parameterized modeling step specifically includes the following steps:

[0108] S71 sets an initial seed step, in which the initial seed seed is set to 0 to ensure that the result is reproducible, and then initializes the random number generator according to the provided seed value, calculates the total number of elements in the grid, creates a grid point coordinate matrix and converts the point coordinates into a column vector;

[0109] S72 is a variable recording step, in which the ratio of elements in the current grid that are not marked as fiber structures is recorded for the vol_C variable, and its initial value is set to 1. At the same time, a random point matrix is ​​initialized and stored. A new value is calculated for each loop iteration and compared with the target porosity Vs. When it is greater than Vs, two different point indexes are randomly selected and added to the matrix;

[0110] S73 is a step of calculating vectors, in which the vector between two points and its length is calculated, and the vectors from all points to the first random point are calculated at the same time, and then the perpendicular distances from all points to the line segment are calculated to determine which points are inside the fiber. This step is the core of the calculation;

[0111] S74 is a distance value calculation step, which calculates the standardized distance value and finds the points whose distance is less than or equal to the threshold value, extracts the coordinates of these points and checks whether these points are within the interval, converts the coordinates of the points that meet the conditions into linear indices, marks them in the grid, and updates the porosity. Finally, the screening is completed.

[0112] A center line is generated between two points and then expanded in two dimensions to generate a single fiber, which is then stacked to form a fiber layer. In the parametric modeling step, the detailed logic and process of carbon fiber generation and screening are as follows:

[0113] S81 defines the genFiber function step, which defines a function genFiber, then performs parameter initialization and input checking, defines four input parameters box, arrgrid, Vs, seed, and if the seed parameter is not provided, it defaults to 0, and then randomly generates two points on the cross section of the fiber layer center;

[0114] S82: a step of calculating a vertical distance. The calculation formula of the standardized distance value in this step is disp1=distances / norm_disp, where disp1 is the vertical distance from all points to the line segment calculated in the previous step;

[0115] For norm_disp, the Euclidean norm of vector v1 is calculated here, that is, the length of the vector: if two randomly selected points are recorded as (x1, y1) and (x2, y2), then the norm of their vectors is:

[0116]

[0117] After the calculation is completed, the fiber model is generated with two randomly generated points in the fiber layer as the two ends of the fiber. After the model is generated, it is stretched and extended to facilitate modeling. The stretching process is as follows: Figure 5 As shown, the diameter of carbon fiber is generally 5-20 microns. For the convenience of modeling, it is magnified 1000 times during modeling, that is, millimeters are used as units. When further solving after the pre-processing is completed, the size parameters are scaled 1000 times again.

[0118] The step of calculating the volume fraction, which is about the generation process of the binder structure, sets the seed of the random number generator to ensure that the results of each run are the same, sets the number of random lines to be generated to half of randompoints (an array containing the coordinates of the random points), uses the polyfit function to fit each pair of points, obtains the slope and intercept of the line, and stores the slope and intercept in two initial arrays, slope and intercept, respectively;

[0119] Furthermore, a double loop is used to traverse all combinations of lines, calculate their intersection points, use the inverse tangent function atan to calculate the angle, convert it into degrees, and calculate the angle between the two lines. Then, based on the angle and the intersection point, the positions of the two circle centers can be calculated. Then, whether each point is within the grid is determined, and the grid is updated. The detailed judgment logic we use here is as follows:

[0120] S91 defines the genBinder function step, which defines a function named genBinder and explains its parameters: box: represents the size of the grid, such as [rows, cols], arrgrid: the initial grid data, used to mark the generated binder area, randompoints: randomly generated points, used to determine the position of the line, radius: the radius of the circle, used to calculate the binder area, seed: random seed, used to control the random number generator. If the seed parameter is not provided, the default is 0. Use rng(seed) to set the seed of the random number generator;

[0121] S92 defines a numLines parameter step, which defines numLines as the number of straight lines to be generated; line is used to store the slope and intercept of each straight line, and the least squares method polyfit is used to fit the straight line y=mx+b to obtain the slope and intercept, where m is the slope and b is the intercept;

[0122] S93 is the step of finding the intersection of the straight lines. This step requires traversing all the straight line combinations and calculating their intersection points. Four parameters are defined here: θ1: calculate the angle of the first straight line; θ2: calculate the angle of the second straight line. col and row are used to calculate the horizontal and vertical coordinates of the intersection of the two straight lines, respectively. The specific formula is as follows:

[0123]

[0124] row=m i ·col+b i

[0125] S94 is the step of calculating the angle and distance. This step is to calculate the angle and distance between two straight lines. We define two parameters again, which are to calculate the angle θ1 and θ2 between the two straight lines, and to calculate the distance d1 and d2 between the two circle centers according to the angle. The calculation formula is as follows:

[0126] θ1=|θ line1 -θ line2 |

[0127] θ2=180 ° -θ1

[0128]

[0129] S95 defines the center function step. In this step, we define the center function to calculate the coordinates of the four center points:

[0130] x center =x int ±d·cos(α)

[0131] y center =y int ±d·sin(α)

[0132] S96 determines whether a point is in a closed area. This step determines whether each point is in a closed area. First, the meanings of several parameters are given here: ind2sub: convert linear index to subscript index, points: store points that meet the conditions, norm: calculate the length of the vector, dot: calculate the dot product of the vector, acos: calculate the arc cosine value to get the angle, d1, d2, d3, d4: calculate the distance from the point to the center of each circle, radius1: adjusted radius, points: if the point meets the conditions, add it to points.

[0133] For a point (row(k),col(k))(row(k),col(k)), first calculate its vector v1 to the intersection, the vector v2 to the center of the first circle, and the vector v3 to the center of the second circle:

[0134] v1=[row(k),col(k)]-intersection

[0135] v2=center(1,:)-intersection

[0136] v3 = center(3,:)-intersection

[0137] Then calculate the magnitude and dot product of these vectors:

[0138]

[0139] dot_product=v1 x v2 x +v1 y v2 y

[0140] Then calculate its arc cosine value to get the angle, and then calculate the distance from the point to the center of each circle.

[0141]

[0142] Here we can also use the dot product and the modulus to calculate the angle (in degrees):

[0143]

[0144] If angle_deg>90°, convert to supplementary angle:

[0145] if angle_deg>90°:angle_deg=180-angle_deg

[0146] Furthermore, the angle and distance are used to determine whether the point is within the closed area:

[0147] If the calculated angle between the two vectors is less than half of the angle between the two straight lines, check whether the distance from the point to the two centers is less than the radius minus 5, and check whether the direction vector from the point to the center of the first circle is longer than the direction vector to the intersection. If the above conditions are met, the point is in the closed area. Otherwise, similarly check the distance and direction vector from the point to the other two centers. After calculating the tangent circle and the closed area, the area of ​​the adhesive can be obtained. The specific process is as follows: Figure 7 As shown,

[0148] S97 updates the grid data step. This step updates the grid data and calculates the volume ratio. We define the idv parameter to convert the index of the points that meet the conditions into a linear index, use arrgrid to update the grid data, mark the points that meet the conditions, and finally use vol_B to calculate the volume ratio of the marked area. The formula is as follows:

[0149]

[0150] Among them, n p is the total number of marked points, t p is the total number of points in the grid.

[0151] The step of determining the pixel position, which is about the generation process of the PTFE structure, is divided into four parts: initialization, finding boundary pixels, randomly selecting the PTFE phase, and finally expanding the PTFE phase. The following is a detailed explanation of the four processes:

[0152] S101 defines a genPTFE function step, which defines a function genPTFE, which contains four parameters: box: a vector containing two elements, indicating the size of the grid (here the number of rows box1 and the number of columns box2 are defined), arrgrid: a two-dimensional array, indicating the initial grid, where the value 1 indicates the boundary and 0 indicates the empty area, Vp: a scalar, indicating the volume fraction of PTFE, seed: a random seed, used to control the random number generator, and then Vp is multiplied with box1 and box2 to obtain the required PTFE quantity;

[0153] S102 determines the boundary position step. This step then finds the boundary pixels and adjacent empty pixel positions. Here we use the bwperim function to find all boundary pixels. Using arrgrid == 1, we return a logical array of the same size as arrgrid, where the position with a value of 1 is true and the other positions are false. After completion, the bwperim function returns a logical array, where a value of 1 indicates that the pixel is a boundary pixel. After finding the boundary pixel, the find function returns the row and column indexes of the boundary pixel, and then initializes an empty array neighbor_indices to store the index of the neighbor pixel. Then for each For boundary pixels, calculate the neighbor pixels in four directions (up, down, left, and right). After the calculation is completed, use the isinbox function to check whether the neighbor pixels are within the grid range. Only those neighbor pixels within the grid range will be retained, which we call valid neighbor pixels. Then use the sub2ind function to convert the two-dimensional index into a linear index. Only those grids with a value of 0, that is, empty positions, are retained. The neighbor index of the current boundary pixel is added to the neighbor_indices array. In this way, we get the indexes of all boundary pixels and their adjacent empty positions. These indexes will be used in the subsequent PTFE placement process.

[0154] S103 is the step of expanding the PTFE position. In this step, we need to expand the PTFE to other empty positions until the required number of PTFE is reached. First, an empty array Ion_node is initialized to store the newly discovered PTFE positions. The while loop is used to continuously expand the PTFE until a certain condition is met (that is, enough PTFE positions are found). During this period, the find function returns the row and column indexes of all positions with a value of 3. Then, an empty array neighbor_indices is initialized again to store the neighbor index of the current PTFE position. For each PTFE position, its neighbor pixels in four directions (up, down, left, and right) are calculated and used The isinbox function is used to check whether the neighbor pixels are within the grid range. Only those neighbor pixels within the grid range will be retained. Further, the sub2ind function is used to convert the two-dimensional index into a linear index, and only those grids with values ​​​​of 0 are retained, that is, empty positions. The neighbor index of the current PTFE position is added to the Ion_node array, and it is ensured that these indexes are unique. Then the values ​​​​of these positions are set to 3, indicating that these positions are now PTFE. Finally, it is checked whether enough PTFE positions have been found. If the number of newly discovered PTFE positions reaches or exceeds the required number of PTFE, the flag is set to false and the loop is exited.

[0155] The above are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A pore modeling method for a proton exchange membrane fuel cell gas diffusion layer, comprising the following steps: S1 is a step for initializing the fiber layer size, which initializes the length and width of the fiber layer of the gas diffusion layer, the number of fiber layers and their porosity, the number of random seeds, the grid size and the PTFE volume fraction and other parameters; S2 parameterized modeling step, in which the above-mentioned input information is used as input data to model the fiber structure to represent the grid state after fiber growth. After randomly generating points, all points that meet the conditions are screened out within the loop to ensure that all generated fibers are within the simulation area; S3 is a step of setting the center coordinates of a circle. In this step, a plane coordinate system is established in the simulation area by setting any point in the simulation area, and then a circular area is generated by using the radius and the interval size as parameters to check whether the point generated in the previous step is in the interval, and the position of the legal point is converted into a grid index, and finally the grid value is updated to include the position of the circular area; S4 is a step of calculating the volume fraction. In this step, the generated fibers are counted by the gridded coordinate system in the simulation space, and the slope and intercept of the random straight line are calculated using the interval size, grid array, random points and other parameters mentioned above. The intersection of two fiber straight lines is found, and each point is judged whether it is in the closed area according to specific conditions, and the grid value is updated to include the position of the adhesive, and finally the volume fraction of the adhesive is calculated; S5: determining pixel position step, in which the pixel positions with a value of 0 adjacent to the boundary pixels with a value of 1 are found, the initial grid is set to 0, and it is considered as the potential PTFE position. Then, the neighbor index is randomly selected as the phase position according to the required PTFE quantity, and finally a pattern representing the PTFE structure is generated in the two-dimensional grid; S6 is a merging and rendering step, in which each component is merged and rendered after the modeling design of each component is completed, until a whole visualized gas diffusion layer is formed.

2. The pore modeling method of a proton exchange membrane fuel cell gas diffusion layer according to claim 1, characterized in that: The step of initializing the fiber layer size limits the fiber layer size. In actual use, the fiber layer size is set according to the actual gas diffusion requirements. At the same time, this step performs synchronous operations on multiple fiber layers, and the sizes of the multiple fiber layers are different. In subsequent operations, the same subsequent operations are performed on multiple fiber layers of different sizes, so as to make a horizontal comparison to determine whether fiber layers of different sizes have an impact on subsequent experimental operations and the extent of the impact. The volume parameters of the fiber layer include the length and width of the fiber layer.

3. The pore modeling method of a proton exchange membrane fuel cell gas diffusion layer according to claim 2, characterized in that: The parametric modeling step, if no random seed parameter is provided when calling the function, is set to 0 by default. There are two methods for establishing the coordinate axis in this step. One method is to set the zero point of the coordinate axis near the center of the above-mentioned fiber layer area. At this time, the generated fibers are evenly distributed in the four quadrants of the coordinate axis with a high probability. Another method for establishing the coordinate axis is to select one side edge of the above-mentioned fiber layer to establish the coordinate axis. At this time, the generated fibers are distributed in the two quadrants of the coordinate axis. In actual operation, the appropriate method for establishing the coordinate axis is selected according to the actual fiber distribution. In this step, the fibers are generated by continuously randomly selecting point pairs in a loop, calculating their distance and updating the grid value to simulate fiber growth.

4. The pore modeling method of a proton exchange membrane fuel cell gas diffusion layer according to claim 3, characterized in that: The step of setting the coordinates of the circle center, the script parameterized modeling of this step is realized based on the automatic operation of the MATLAB script. In actual operation, this step adjusts the grid size in the coordinate system according to the generated fiber density, so that the number of fibers distributed in each grid is as similar as possible. The use of a suitable grid size can facilitate the subsequent counting of the number of fibers generated inside the fiber layer. At the same time, when setting the grid size, the number of fibers located on the grid lines should be reduced as much as possible, so that the fibers are framed inside the grid through the grid.

5. The pore modeling method of a proton exchange membrane fuel cell gas diffusion layer according to claim 4, characterized in that: In the step of setting the coordinates of the circle center, the two-dimensional coordinates stored at the end of this step will all be converted into one-dimensional indexes. After this step grids the coordinates of the fiber layer in the area, the grids are numbered, and different positions on the current fiber layer can be located by numbering. At the same time, when generating and saving information, the number of fibers inside the grid is integrated at the end of the numbering information, so that the one-dimensional index can accurately locate the accurate single position inside the fiber layer while also including the fiber quantity information inside the current grid. For example, a grid numbered 03 has 5 generated fibers, and the record can be saved as 030005 when performing one-dimensional index storage. By adding a split zero bit, the two types of information will not interfere with each other.

6. The pore modeling method of a proton exchange membrane fuel cell gas diffusion layer according to claim 5, characterized in that: The step of calculating the volume fraction, in which the generation of fiber straight lines is achieved with the help of random points, when setting the random point parameters in the above step, the position of the generated fiber can be controlled to a certain extent by adjusting the random parameters. During operation, this step can save the fiber position distribution records generated by multiple different random points, and then the correlation between the random points and the direction and size of the fiber generation can be calculated through the model.

7. The pore modeling method of a proton exchange membrane fuel cell gas diffusion layer according to claim 6, characterized in that: The parameterized modeling step specifically includes the following steps: S71 sets an initial seed step, in which the initial seed seed is set to 0 to ensure that the result is reproducible, and then initializes the random number generator according to the provided seed value, calculates the total number of elements in the grid, creates a grid point coordinate matrix and converts the point coordinates into a column vector; S72 is a variable recording step, in which the ratio of elements in the current grid that are not marked as fiber structures is recorded for the vol_C variable, and its initial value is set to 1. At the same time, a random point matrix is ​​initialized and stored. A new value is calculated for each loop iteration and compared with the target porosity Vs. When it is greater than Vs, two different point indexes are randomly selected and added to the matrix; S73 is a step of calculating vectors, in which the vector between two points and its length is calculated, and the vectors from all points to the first random point are calculated at the same time, and then the perpendicular distances from all points to the line segment are calculated to determine which points are inside the fiber. This step is the core of the calculation; S74 is a distance value calculation step, which calculates the standardized distance value and finds the points whose distance is less than or equal to the threshold value, extracts the coordinates of these points and checks whether these points are within the interval, converts the coordinates of the points that meet the conditions into linear indices, marks them in the grid, and updates the porosity. Finally, the screening is completed.

8. The pore modeling method of a proton exchange membrane fuel cell gas diffusion layer according to claim 7, characterized in that: A center line is generated between two points and then expanded in two dimensions to generate a single fiber, which is then stacked to form a fiber layer. In the parametric modeling step, the detailed logic and process of carbon fiber generation and screening are as follows: S81 defines the genFiber function step, which defines a function genFiber, then performs parameter initialization and input checking, defines four input parameters box, arrgrid, Vs, seed, and if the seed parameter is not provided, it defaults to 0, and then randomly generates two points on the cross section of the fiber layer center; S82: a step of calculating a vertical distance. The calculation formula of the standardized distance value in this step is disp1=distances / norm_disp, where disp1 is the vertical distance from all points to the line segment calculated in the previous step; For norm_disp, the Euclidean norm of vector v1 is calculated here, that is, the length of the vector: if two randomly selected points are recorded as (x1, y1) and (x2, y2), then the norm of their vectors is: After the calculation is completed, a fiber model is generated with two randomly generated points in the fiber layer as the two ends of the fiber. After the model is generated, it is stretched and extended to facilitate modeling. The stretching process is shown in Figure 5. The diameter of the carbon fiber is generally 5-20 microns. For the convenience of modeling, it is magnified 1000 times during modeling, that is, millimeters are used as units. When further solving after the pre-processing is completed, the size parameters are scaled 1000 times.

9. The pore modeling method of a proton exchange membrane fuel cell gas diffusion layer according to claim 8, characterized in that: The step of calculating the volume fraction, which is about the generation process of the binder structure, sets the seed of the random number generator to ensure that the results of each run are the same, sets the number of random lines to be generated to half of randompoints (an array containing the coordinates of the random points), uses the polyfit function to fit each pair of points, obtains the slope and intercept of the line, and stores the slope and intercept in two initial arrays, slope and intercept, respectively; Furthermore, a double loop is used to traverse all combinations of lines, calculate their intersection points, use the inverse tangent function atan to calculate the angle, convert it into degrees, and calculate the angle between the two lines. Then, based on the angle and the intersection point, the positions of the two circle centers can be calculated. Then, whether each point is within the grid is determined, and the grid is updated. The detailed judgment logic we use here is as follows: S91 defines the genBinder function step, which defines a function named genBinder and explains its parameters: box: represents the size of the grid, such as [rows, cols], arrgrid: the initial grid data, used to mark the generated binder area, randompoints: randomly generated points, used to determine the position of the line, radius: the radius of the circle, used to calculate the binder area, seed: random seed, used to control the random number generator. If the seed parameter is not provided, the default is 0. Use rng(seed) to set the seed of the random number generator; S92 defines a numLines parameter step, which defines numLines as the number of straight lines to be generated; line is used to store the slope and intercept of each straight line, and the least squares method polyfit is used to fit the straight line y=mx+b to obtain the slope and intercept, where m is the slope and b is the intercept; S93 is the step of finding the intersection of the straight lines. This step requires traversing all the straight line combinations and calculating their intersection points. Four parameters are defined here: θ1: calculate the angle of the first straight line; θ2: calculate the angle of the second straight line. col and row are used to calculate the horizontal and vertical coordinates of the intersection of the two straight lines, respectively. The specific formula is as follows: row=m i ·col+b i S94 is the step of calculating the angle and distance. This step is to calculate the angle and distance between two straight lines. We define two parameters again, which are to calculate the angle θ1 and θ2 between the two straight lines, and to calculate the distance d1 and d2 between the two circle centers according to the angle. The calculation formula is as follows: θ1=|θ line1 -θ line2 | θ2=180 ° -θ1 S95 defines the center function step. In this step, we define the center function to calculate the coordinates of the four circle centers: x center =x int ±d·cos(α) and center =and int ±d·sin(α) S96 determines whether a point is in a closed area. This step determines whether each point is in a closed area. First, the meanings of several parameters are given here: ind2sub: convert linear index to subscript index, points: store points that meet the conditions, norm: calculate the length of the vector, dot: calculate the dot product of the vector, acos: calculate the arc cosine value to get the angle, d1, d2, d3, d4: calculate the distance from the point to the center of each circle, radius1: adjusted radius, points: if the point meets the conditions, add it to points. For a point (row(k),col(k))(row(k),col(k)), first calculate its vector v1 to the intersection, the vector v2 to the center of the first circle, and the vector v3 to the center of the second circle: v1=[row(k),col(k)]-intersection v2=center(1,:)-intersection v3 = center(3,:)-intersection Then calculate the magnitude and dot product of these vectors: dot_product=v1 x ·v2 x +v1 y ·v2 y Then calculate its arc cosine value to get the angle, and then calculate the distance from the point to the center of each circle. Here we can also use the dot product and the modulus to calculate the angle (in degrees): If angle_deg>90°, convert to supplementary angle: if angle_deg>90°:angle_deg=180-angle_deg Furthermore, the angle and distance are used to determine whether the point is within the closed area: If the calculated angle between the two vectors is less than half of the angle between the two straight lines, check whether the distance from the point to the two centers is less than the radius minus 5, and check whether the direction vector from the point to the center of the first circle is longer than the direction vector to the intersection. If the above conditions are met, the point is in the closed area. Otherwise, similarly check the distance and direction vector from the point to the other two centers. After calculating the tangent circle and the closed area, the area of ​​the adhesive can be obtained. The specific process is shown in Figure 7. S97 updates the grid data step. This step updates the grid data and calculates the volume ratio. We define the idv parameter to convert the index of the points that meet the conditions into a linear index, use arrgrid to update the grid data, mark the points that meet the conditions, and finally use vol_B to calculate the volume ratio of the marked area. The formula is as follows: Among them, n p is the total number of marked points, t p is the total number of points in the grid.

10. The pore modeling method of a proton exchange membrane fuel cell gas diffusion layer according to claim 9, characterized in that: The step of determining the pixel position, which is about the generation process of the PTFE structure, is divided into four parts: initialization, finding boundary pixels, randomly selecting the PTFE phase, and finally expanding the PTFE phase. The following is a detailed explanation of the four processes: S101 defines the genPTFE function step, which defines a function genPTFE, which contains four parameters: box: a vector containing two elements, indicating the size of the grid (here the number of rows box1 and the number of columns box2 are defined), arrgrid: a two-dimensional array, indicating the initial grid, where the value 1 indicates the boundary and 0 indicates the empty area, Vp: a scalar, indicating the volume fraction of PTFE, seed: a random seed used to control the random number generator, and then Vp is multiplied with box1 and box2 to obtain the required PTFE quantity; S102 determines the boundary position step. This step then finds the boundary pixels and adjacent empty pixel positions. Here we use the bwperim function to find all boundary pixels. Using arrgrid == 1, we return a logical array of the same size as arrgrid, where the position with a value of 1 is true and the other positions are false. After completion, the bwperim function returns a logical array, where a value of 1 indicates that the pixel is a boundary pixel. After finding the boundary pixel, the find function returns the row and column indexes of the boundary pixel, and then initializes an empty array neighbor_indices to store the index of the neighbor pixel. Then for each For boundary pixels, calculate the neighbor pixels in four directions (up, down, left, and right). After the calculation is completed, use the isinbox function to check whether the neighbor pixels are within the grid range. Only those neighbor pixels within the grid range will be retained, which we call valid neighbor pixels. Then use the sub2ind function to convert the two-dimensional index into a linear index. Only those grids with a value of 0, that is, empty positions, are retained. The neighbor index of the current boundary pixel is added to the neighbor_indices array. In this way, we get the indexes of all boundary pixels and their adjacent empty positions. These indexes will be used in the subsequent PTFE placement process. S103 is the step of expanding the PTFE position. In this step, we need to expand the PTFE to other empty positions until the required number of PTFE is reached. First, an empty array Ion_node is initialized to store the newly discovered PTFE positions. The while loop is used to continuously expand the PTFE until a certain condition is met (that is, enough PTFE positions are found). During this period, the find function returns the row and column indexes of all positions with a value of 3. Then, an empty array neighbor_indices is initialized again to store the neighbor index of the current PTFE position. For each PTFE position, its neighbor pixels in four directions (up, down, left, and right) are calculated and used The isinbox function is used to check whether the neighbor pixels are within the grid range. Only those neighbor pixels within the grid range will be retained. Further, the sub2ind function is used to convert the two-dimensional index into a linear index, and only those grids with values ​​​​of 0 are retained, that is, empty positions. The neighbor index of the current PTFE position is added to the Ion_node array, and it is ensured that these indexes are unique. Then the values ​​​​of these positions are set to 3, indicating that these positions are now PTFE. Finally, it is checked whether enough PTFE positions have been found. If the number of newly discovered PTFE positions reaches or exceeds the required number of PTFE, the flag is set to false and the loop is exited.

Citation Information

Cited By

  • Method, system, equipment and medium for predicting ice melting process in gas diffusion layer

    CN120337605A