Corrosion acceleration simulation method, device, equipment, storage medium and program product
By constructing the inverse matrix of the sparse approximation matrix and performing approximation factorization, the problems of large computational load and long time in corrosion simulation are solved, fast iterative convergence is achieved, and computational efficiency and storage space utilization are improved.
Patent Information
- Application Number
- CN202410274168.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-11
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2044-03-11
AI Technical Summary
Existing technologies for corrosion simulation, especially for equipment surface corrosion simulation in dynamic marine environments, suffer from problems such as large computational load and long computation time. In particular, the GMRES method has poor convergence in the case of ill-conditioned coefficient matrix, and the ILU decomposition preprocessing technology has huge storage requirements and low computational efficiency.
By constructing the inverse matrix of the sparse approximation matrix and performing approximation factorization, the product of the sparse approximation matrix and the given vector is calculated iteratively, avoiding direct sparse approximation matrix multiplication, thus achieving fast iterative convergence of large-scale linear equation systems.
It reduces storage space requirements, improves computational efficiency and convergence speed, and is suitable for fast iterative solutions of large-scale linear equation systems.
Smart Images

Figure CN118098401B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of numerical simulation technology of electrochemical corrosion fields, and in particular to a corrosion acceleration simulation method, apparatus, computer equipment, storage medium and computer program product. Background Technology
[0002] With the increasing understanding of the mechanisms of corrosion field generation and the rapid development of computer science and other disciplines, computer modeling methods such as the finite volume method and the finite element method are often used for corrosion simulation to predict the corrosion rate of equipment surfaces in dynamic marine environments and to provide reliable references for corrosion protection design. However, during the simulation process, as the amount of computational mesh increases, the scale of the discrete equations to be solved numerically becomes enormous, significantly increasing the computational load and time.
[0003] Currently, for solving large linear equation systems, the Krylov subspace method, represented by the Generalized Minimal Residual (GMRES) method, is gradually becoming the mainstream. The convergence of the GMRES method is closely related to the eigenvalues of the equation system. If the coefficient matrix of the equation system is ill-conditioned, i.e., the condition number is too large, the GMRES method will not have the characteristic of fast convergence. Therefore, preprocessing techniques are needed to improve the matrix properties of the coefficient matrix. Different preprocessing methods will have different effects on the convergence performance of the GMRES algorithm. Classic methods include preprocessing techniques such as incomplete LU (ILU) decomposition.
[0004] However, the ILU decomposition preprocessing technique requires explicitly constructing a sparse approximate matrix and then multiplying the matrix with a given vector. This process can lead to problems such as huge storage requirements, complex matrix construction, and low computational efficiency. Summary of the Invention
[0005] Therefore, it is necessary to provide a corrosion acceleration simulation method, apparatus, computer equipment, storage medium, and computer program product that can reduce the storage space required for the corrosion simulation process, in order to address the above-mentioned technical problems.
[0006] In a first aspect, this application provides a method for accelerating corrosion simulation, the method comprising:
[0007] Based on corrosion environment parameters, material properties of the object to be simulated, and boundary conditions used to simulate the corrosion process, a geometric model of the object to be simulated is constructed.
[0008] Based on the geometric model of the object to be simulated, a system of linear equations is constructed, wherein the system of linear equations characterizes the relationship between the coefficient matrix, the potentials distributed on the geometric model, and the excitation vectors;
[0009] Multiply both sides of the linear equation system by the inverse of a sparse approximation matrix, and then perform approximation factorization on the sparse approximation matrix to obtain the decomposition result.
[0010] Based on the decomposition results, the inverse matrix of the sparse approximation matrix is multiplied by the coefficient matrix and the excitation vector to obtain a new system of linear equations.
[0011] The corrosion field potential of the simulated object is obtained by recursively solving the new linear equations.
[0012] In one embodiment, constructing a system of linear equations based on the geometric model of the object to be simulated includes:
[0013] A computational domain is constructed based on the geometric model of the object to be simulated, and the computational domain is subjected to structured meshing to generate multiple mesh elements;
[0014] For each grid cell, multiple discrete potential points are set on the grid cell, and the boundary integral equation corresponding to each discrete potential point is established by the boundary element method.
[0015] A system of linear equations is constructed based on the boundary integral equations corresponding to each discrete potential point.
[0016] In one embodiment, the step of solving for the product of the inverse matrix of the sparse approximation matrix with the coefficient matrix and the activation vector based on the decomposition result to obtain a new system of linear equations includes:
[0017] Based on the decomposition result, the product between the inverse matrix of the sparse approximation matrix and the activation vector is calculated to obtain the first approximation value;
[0018] Based on the decomposition results, the product between the inverse matrix of the sparse approximation matrix and the coefficient matrix is calculated to obtain the second approximation value;
[0019] Substituting the first approximation and the second approximation into the system of linear equations yields a new system of linear equations.
[0020] In one embodiment, the step of solving the product between the inverse of the sparse approximation matrix and the activation vector based on the decomposition result to obtain a first approximation value includes:
[0021] Set an initial value for the product between the inverse of the sparse approximation matrix and the activation vector, and use the initial value as a historical approximation value;
[0022] Based on the decomposition results and the historical approximations, determine the approximate value of the product between the inverse of the sparse approximation matrix and the activation vector in the current iteration process;
[0023] The approximate value is used as the historical approximate value in the next iteration process, and the step of determining the approximate value of the product between the inverse matrix of the sparse approximate matrix and the excitation vector in the current iteration process based on the decomposition result and the historical approximate value is returned, until the number of iterations reaches the preset number of iterations, and the approximate value generated in the last iteration process is used as the first approximate value.
[0024] In one embodiment, the decomposition result includes a diagonal matrix, a lower triangular matrix, and an upper triangular matrix. The step of determining the approximate value of the product between the inverse of the sparse approximation matrix and the activation vector in the current iteration, based on the decomposition result and the historical approximation, includes:
[0025] Determine the first product between the inverse of the lower triangular matrix and the historical approximation;
[0026] Determine the second product between the inverse of the upper triangular matrix and the historical approximation;
[0027] Based on the diagonal matrix, the first product, and the second product, the approximate value of the product between the inverse of the sparse approximation matrix and the activation vector is determined during the current iteration.
[0028] In one embodiment, the step of recursively solving the new system of linear equations to obtain the corrosion field potential of the object to be simulated includes:
[0029] Set an initial approximate solution for the new linear equation system, and use the initial approximate solution as the current solution for the new linear equation system in the current iteration process;
[0030] Based on the current solution, the first approximation, and the second approximation, determine the residual between the current solution and the true solution of the new linear equation system;
[0031] The residuals are normalized to obtain unit residual vectors, and an orthonormal basis is constructed based on the unit residual vectors.
[0032] The orthonormal basis is processed using the least squares method to obtain the iterative approximate solution of the new linear equation system;
[0033] The iterative approximate solution is used as the current solution in the next iteration process, and the step of determining the residual between the current solution and the true solution of the new linear equation system based on the current solution, the first approximation value and the second approximation value is returned to continue until the residual is less than or equal to a preset residual value, and the corrosion field potential of the simulated object is obtained.
[0034] Secondly, this application also provides a corrosion acceleration simulation device. The device includes:
[0035] The model building module is used to construct the geometric model of the object to be simulated based on corrosion environment parameters, material properties of the object to be simulated, and boundary conditions for simulating the corrosion process.
[0036] The simulation module is used to construct a system of linear equations based on the geometric model of the object to be simulated, wherein the system of linear equations represents the relationship between the coefficient matrix, the potentials distributed on the geometric model, and the excitation vectors;
[0037] The decomposition module is used to multiply both sides of the equation system by the inverse of a sparse approximation matrix, and perform approximation factor decomposition on the sparse approximation matrix to obtain the decomposition result.
[0038] The first calculation module is used to solve the product between the inverse matrix of the sparse approximation matrix and the coefficient matrix and the excitation vector based on the decomposition result, so as to obtain a new system of linear equations.
[0039] The second calculation module is used to solve the new set of linear equations recursively to obtain the corrosion field potential of the object to be simulated.
[0040] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the above-described corrosion acceleration simulation method.
[0041] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the above-described corrosion acceleration simulation method.
[0042] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the above-described corrosion acceleration simulation method.
[0043] The aforementioned corrosion acceleration simulation method, device, computer equipment, storage medium, and computer program products, after building the geometric model of the object to be simulated, run the simulation software to obtain a system of linear equations. Multiply both sides of the equals sign of the system of linear equations by the inverse of a sparse approximation matrix. By decomposing the sparse approximation matrix, the product of the sparse approximation matrix and a given vector is iteratively calculated based on the decomposition result, instead of directly multiplying the product of the sparse approximation matrix and the given vector. Thus, without explicitly constructing the sparse approximation matrix (i.e., using a matrix-free approach), rapid iterative convergence of large-scale linear equation systems is achieved, improving efficiency and reducing storage space. Attached Figure Description
[0044] Figure 1 This is a diagram illustrating the application environment of the corrosion acceleration simulation method in one embodiment;
[0045] Figure 2 This is a flowchart illustrating a corrosion acceleration simulation method in one embodiment;
[0046] Figure 3 This is a schematic diagram of a structured mesh of a three-dimensional cylindrical model in one embodiment;
[0047] Figure 4 This is a potential distribution cloud map of a three-dimensional cylindrical model in one embodiment;
[0048] Figure 5 This is a schematic diagram showing the convergence comparison of the residuals of the three GMRES algorithms with respect to the iteration steps in one embodiment;
[0049] Figure 6 This is a schematic diagram showing the convergence comparison of residuals with respect to CPU time for three GMRES algorithms in one embodiment;
[0050] Figure 7 This is a structural block diagram of a corrosion acceleration simulation device in one embodiment;
[0051] Figure 8 This is an internal structural diagram of a computer device in one embodiment;
[0052] Figure 3 In the diagram, 1-lower surface of the cylinder, which is the electrode surface of the material; 2-upper surface of the cylinder, which is the insulating surface; 3-side surface of the cylinder, which is the insulating surface; 4-internal axial section of the cylinder; 5-axis of the cylinder. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0054] Marine and aerospace equipment operating in marine environments face challenges related to material corrosion failure and protection. Various forms of corrosion occur and develop rapidly and frequently in marine environments, with electrochemical corrosion being the most common, especially galvanic corrosion. Galvanic corrosion generally refers to the formation of a corrosion galvanic cell when two metals with different electrochemical properties come into contact in an electrolyte, resulting in electron transfer due to differences in electrode potential. As a potentially widespread and severe type of corrosion, galvanic corrosion is often accompanied by various localized corrosion phenomena, such as stress corrosion, pitting corrosion, and crevice corrosion, seriously affecting the service life and operational safety of equipment. However, the diversity, complexity, and variability of the marine environment complicate the issue of galvanic corrosion, and many corrosion phenomena remain unexplained, with many corrosion mechanisms still unclear. To predict the corrosion rate of equipment surfaces in dynamic marine environments and provide reliable references for corrosion protection design, simulation modeling can more effectively help understand the causes of galvanic corrosion from a fundamental perspective, predict its development, and design better corrosion protection strategies based on simulation results.
[0055] With the increasing understanding of the generation mechanism of corrosion fields and the rapid development of computer science and other disciplines, computer modeling research methods such as the finite volume method and the finite element method have been gradually developed. As the amount of computational mesh increases, the scale of the discrete equation systems for numerical solution becomes enormous, significantly increasing the computational load and time. Consequently, how to quickly solve large linear equation systems has become a crucial problem in engineering applications. For solving large linear equation systems, the Krylov subspace method, represented by the Generalized Minimal Residual (GMRES) method, has gradually become the mainstream approach.
[0056] Compared to traditional iterative methods, the GMRES method offers significantly improved convergence speed. However, its convergence is closely related to the eigenvalues of the equation system. If the coefficient matrix of the equation system is ill-conditioned (i.e., the condition number is too large), the GMRES method lacks fast convergence. Therefore, preprocessing techniques are needed to improve the matrix properties. Different preprocessing methods have varying impacts on the convergence performance of the GMRES algorithm. Classic methods include incomplete LU (ILU) decomposition preprocessing. However, ILU decomposition preprocessing requires explicitly constructing a sparse approximate matrix and then multiplying the matrix with a given vector. This process results in huge storage requirements, complex matrix construction, and low computational efficiency.
[0057] To address this issue, this application provides an accelerated simulation method for corrosion. By decomposing the sparse approximation matrix and iteratively calculating the product of the sparse approximation matrix and a given vector based on the decomposition results, instead of directly performing the product operation on the product of the sparse approximation matrix and the given vector, this method achieves rapid iterative convergence of large-scale linear equation systems without explicitly constructing the sparse approximation matrix (i.e., using a matrix-free approach), thereby improving efficiency.
[0058] The corrosion acceleration simulation method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed in the cloud or on another server. Terminal 102 constructs a geometric model of the object to be simulated based on corrosion environment parameters, material properties of the object to be simulated, and boundary conditions used to simulate the corrosion process. Based on the geometric model of the object to be simulated, terminal 102 constructs a system of linear equations, where the linear equations characterize the relationship between the coefficient matrix, the potential distributed on the geometric model, and the excitation vector. Terminal 102 multiplies both sides of the linear equations by the inverse of a sparse approximation matrix, performing approximation factorization on the sparse approximation matrix to obtain the decomposition result. Based on the decomposition result, terminal 102 solves for the products between the inverse of the sparse approximation matrix and the coefficient matrix and the excitation vector, respectively, to obtain a new system of linear equations. Terminal 102 solves the new system of linear equations recursively to obtain the corrosion field potential of the object to be simulated. The terminal 102 can be, but is not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart in-vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0059] In one embodiment, such as Figure 2 As shown, a corrosion acceleration simulation method is provided, which is applied to... Figure 1 Taking the terminal in the example, the explanation includes the following steps:
[0060] Step 202: Based on the corrosion environment parameters, the material properties of the object to be simulated, and the boundary conditions used to simulate the corrosion process, construct the geometric model of the object to be simulated.
[0061] Corrosion environment parameters refer to various environmental factors that affect the corrosion process, such as temperature, humidity, composition and concentration of electrolyte solutions, oxygen concentration, and pH value. In marine corrosion simulation scenarios, corrosion environment parameters include seawater temperature, seawater salinity, dissolved oxygen concentration, and pH value.
[0062] The object to be simulated refers to an object that is easily affected by corrosion due to long-term exposure to corrosive factors such as seawater, humidity, and salt spray. For example, the object to be simulated can be a ship, an offshore platform, a subsea pipeline, an offshore oil and gas facility, a battery, or other objects with metal surfaces that participate in the corrosion reaction.
[0063] Material properties refer to the physical and chemical characteristics of the object to be simulated, such as electrical conductivity, resistivity, corrosion resistance, and alloy composition.
[0064] Boundary conditions refer to the physical conditions between different regions outside or inside the model. For corrosion simulation, boundary conditions may include current input / output, potential boundaries, insulation boundaries, material interface conditions, etc.
[0065] A geometric model refers to a three-dimensional physical model of the object to be simulated. Geometric models can be created using specialized modeling software to accurately reflect the geometry and dimensions of the object. In corrosion simulation, the geometric model is used to simulate the corrosion process and current distribution to evaluate the object's corrosion resistance.
[0066] Specifically, the terminal collects data on the corrosion environment, material properties, and boundary conditions. Based on the collected data, the terminal defines the material properties of the object to be simulated. Based on the simulation purpose and experimental conditions, the terminal determines appropriate boundary conditions. Using CAD (Computer-Aided Design) software or other modeling tools, the terminal establishes a geometric model of the object to be simulated based on its actual shape, size, and surface characteristics. The geometric model is then meshed, dividing it into a series of small, regularly shaped mesh units. Based on the simulation purpose and experimental conditions, the terminal defines corrosion environment parameters, such as temperature, humidity, and the composition and concentration of the electrolyte solution. Based on the collected corrosion environment parameters, the defined material properties and boundary conditions, and the defined corrosion environment parameters, the terminal sets the simulation parameters to obtain the constructed geometric model.
[0067] Step 204: Based on the geometric model of the object to be simulated, construct a system of linear equations, where the system of linear equations represents the relationship between the coefficient matrix, the potentials distributed on the geometric model, and the excitation vectors.
[0068] In corrosion simulation, linear equations are used to represent the mathematical relationships between potential distribution and factors such as boundary conditions and material properties. Linear equations are typically expressed in the form Ax = b, where A is known. The coefficient matrix is of order [order]; x is the potential vector distributed on the geometric model, and the potential vector x is unknown. The order column vector; b is the excitation vector (also called the load vector), and the excitation vector b is known. Column vector of order.
[0069] In corrosion simulation, the coefficient matrix A is a symmetric, sparse matrix representing the boundary element matrix. The elements in coefficient matrix A are determined by the interactions between the boundary elements. Coefficient matrix A reflects the continuity of the potential distribution on the boundary, that is, how a change in the potential on one boundary element affects the potential on other boundary elements.
[0070] The potential vector x is a vector containing the potential values of all boundary elements. Each component of the potential vector x corresponds to the potential of a specific element on the boundary. Potential refers to the potential difference at a point on the metal surface during corrosion. Potential is an unknown obtained by solving a system of linear equations. It represents the potential distribution at various points on the geometric model under given boundary conditions and material properties.
[0071] The excitation vector b contains the excitation values for all boundary elements, such as given potential, current, or boundary conditions.
[0072] Specifically, the terminal uses the boundary element method to discretize the surface of the geometric model into a series of small boundary elements (or boundary elements), each representing a portion of the model surface and used to calculate the potential distribution. For each boundary element, the terminal constructs a boundary integral equation based on the theory of the boundary element method and the physical model of the corrosion process. The boundary integral equation describes the relationship between the potential on that boundary element and the potentials on other boundary elements, boundary conditions, and material properties. The terminal combines the boundary integral equations of all boundary elements to form a system of linear equations.
[0073] Step 206: Multiply both sides of the linear equation system by the inverse of a sparse approximation matrix, and perform approximation factorization on the sparse approximation matrix to obtain the decomposition result.
[0074] A sparse approximation matrix is a matrix in which most elements are zero, and only a few elements are non-zero. In a sparse approximation matrix, non-zero elements usually represent important features or patterns in the original matrix, while zero elements represent relatively unimportant information. A sparse approximation matrix is denoted as... After multiplying both sides of the linear equation system by the inverse of a sparse approximation matrix, the linear equation system is transformed into: .
[0075] Approximate factorization is the process of decomposing a sparse approximate matrix into the product of two or more matrices using decomposition techniques (such as LU decomposition, QR decomposition, Cholesky decomposition, etc.). For sparse approximate matrices, approximate factorization can approximately decompose the sparse matrix into the product of several sparse matrices, thus facilitating storage and computation.
[0076] The decomposition result refers to the several sparse matrices obtained after approximating the decomposition of the sparse matrix. The product of several sparse matrices is approximately equal to the original sparse approximation matrix, and each matrix is sparse, which helps to reduce storage and computation costs.
[0077] Specifically, the terminal multiplies both sides of the linear equation system by the inverse of a sparse approximation matrix to obtain the transformation of the linear equation system. The terminal performs approximation factorization on the sparse approximation matrix, transforming it into a product of several sparse matrices, extracting the sparse matrix, and using the sparse matrix as the decomposition result.
[0078] Step 208: Based on the decomposition results, solve for the product between the inverse matrix of the sparse approximation matrix and the coefficient matrix and the excitation vector, respectively, to obtain a new system of linear equations.
[0079] The new linear equation system is obtained by solving the product between the inverse matrix of the sparse approximation matrix and the coefficient matrix and the excitation vector, respectively, based on the decomposition result. The solution result is then used to replace the product between the inverse matrix of the sparse approximation matrix and the coefficient matrix and the excitation vector in the original linear equation system.
[0080] Specifically, the terminal solves the product between the inverse matrix and the coefficient matrix of the sparse approximation matrix, and the product between the inverse matrix of the sparse approximation matrix and the excitation vector based on the decomposition results. The solution results are then used to replace the product between the inverse matrix and the coefficient matrix of the sparse approximation matrix, and the product between the inverse matrix of the sparse approximation matrix and the excitation vector in the original linear equation system, resulting in a new linear equation system.
[0081] In some embodiments, the process of solving for the product between the inverse matrix and the coefficient matrix of the sparse approximation matrix based on the decomposition result depends on the decomposition method. The decomposition method can be LU decomposition, QR decomposition, Cholesky decomposition, etc., and different decomposition methods correspond to different methods for solving for the product between the inverse matrix and the coefficient matrix of the sparse approximation matrix.
[0082] For example, the decomposition method is LU decomposition. LU decomposition yields three matrices P, L, and U, where P is the permutation matrix, L is the lower triangular matrix, and U is the upper triangular matrix. The inverse of the sparse approximation matrix is transformed into the product of P, L, and U. Similarly, the product between the inverse of the sparse approximation matrix and the coefficient matrix is transformed into the product of P, L, U, and the coefficient matrix. Because the sparse approximation matrix is decomposed, only the product of non-zero elements is calculated, significantly reducing computational complexity, improving computational efficiency, enhancing numerical stability, and reducing storage requirements.
[0083] Step 210: Solve the new set of linear equations recursively to obtain the corrosion field potential of the object to be simulated.
[0084] Corrosion field potential refers to the surface potential distribution of the simulated object during corrosion simulation. It reflects the electrochemical behavior of the material under corrosive conditions.
[0085] Specifically, the terminal solves a new set of linear equations recursively (e.g., using the Generalized Minimal Residual (GMRES) method), and the solution obtained is the corrosion field potential of the object to be simulated.
[0086] In the above-mentioned accelerated corrosion simulation method, after building the geometric model of the object to be simulated, the simulation software is run to obtain a system of linear equations. The inverse of a sparse approximation matrix is multiplied on the left side of both sides of the equals sign of the system of linear equations. The sparse approximation matrix is decomposed, and the product of the sparse approximation matrix and the given vector is iteratively calculated based on the decomposition result, instead of directly multiplying the product of the sparse approximation matrix and the given vector. Thus, without explicitly constructing the sparse approximation matrix (i.e., using a matrix-free approach), the rapid iterative convergence of a large-scale system of linear equations is achieved, improving efficiency.
[0087] In one embodiment, based on the geometric model of the object to be simulated, a system of linear equations is constructed, including:
[0088] The computational domain is constructed based on the geometric model of the object to be simulated, and the computational domain is divided into structured meshes to generate multiple mesh elements. For each mesh element, multiple discrete potential points are set on the mesh element, and the boundary integral equation corresponding to each discrete potential point is established by boundary element method. Based on the boundary integral equation corresponding to each discrete potential point, a system of linear equations is constructed.
[0089] The computational domain refers to a specific computational area defined during simulation, within which the terminal performs corresponding numerical calculations and simulations. For example, the computational domain can be the surface area of a geometric model or the internal structure of the geometric model.
[0090] Structured mesh generation is a mesh generation method that produces meshes with regular topological structure, meaning all mesh points are arranged in an orderly manner and the relationships between adjacent points are clear. When further meshing, it is necessary to ensure that the mesh is fine enough to capture the potential changes on the surface of the object being simulated.
[0091] A grid cell refers to each small region in the computational domain obtained by dividing it into structured grids, used to discretize the problem to be solved.
[0092] Discrete potential points refer to discrete points set within or on the boundary of a computational domain to approximate a continuous potential distribution. The potential values at these points are unknowns and need to be obtained by solving equations. Discrete potential points are used to approximate a continuous potential distribution.
[0093] Boundary element method is a numerical method that transforms the problem into solving unknown quantities on the boundary by setting discrete points (boundary elements) on the boundary, thereby obtaining the solution within the entire computational domain.
[0094] In the boundary element method, the boundary integral equation is an integral equation that represents the relationship between unknown potential points on a discrete boundary. The boundary integral equation expresses the relationship between the potential of a discrete potential point and the potentials of its surrounding points.
[0095] Specifically, the terminal determines the range and boundaries of the computational domain based on the geometric model of the object to be simulated, and performs structured meshing on the computational domain, generating multiple mesh elements of the same shape and size. On each mesh element, the terminal sets multiple discrete potential points as needed. For each discrete potential point, the terminal establishes a corresponding boundary integral equation using the boundary element method. The terminal combines the boundary integral equations corresponding to all discrete potential points to form a large linear equation system, which includes the potential values of all discrete potential points as unknowns.
[0096] In some embodiments, Figure 3 This is a schematic diagram of a structured volume mesh of a three-dimensional cylindrical model in one embodiment, such as... Figure 3 As shown, after the geometric model is divided into structural meshes, multiple uniform mesh elements are obtained. Figure 4 This is a potential distribution cloud map of a three-dimensional cylindrical model in one embodiment.
[0097] In this embodiment, structured mesh generation ensures that the computational domain is divided into small regions of equal shape and size, which helps improve computational accuracy. Simultaneously, setting discrete potential points on the boundaries and establishing boundary integral equations using the boundary element method allows for a more accurate simulation of the potential distribution at the boundaries of the object being simulated. Structured mesh generation and the boundary element method are generally more efficient than traditional finite element methods because they only require discretization at the boundaries, rather than across the entire computational domain. This means fewer equations need to be solved, resulting in shorter computation time, making it particularly suitable for solving large-scale problems.
[0098] In one embodiment, based on the decomposition results, the inverse matrix of the sparse approximation matrix is multiplied by the coefficient matrix and the activation vector, respectively, to obtain a new system of linear equations, including:
[0099] Based on the decomposition results, the product between the inverse matrix of the sparse approximation matrix and the excitation vector is obtained to get the first approximation value; based on the decomposition results, the product between the inverse matrix of the sparse approximation matrix and the coefficient matrix is obtained to get the second approximation value; the first and second approximation values are substituted into the linear equation system to obtain a new linear equation system.
[0100] The first approximation is obtained by solving for the product between the inverse of the sparse approximation matrix and the activation vector based on the decomposition result. The first approximation is an estimate of the product between the inverse of the sparse approximation matrix and the activation vector. The first approximation can be expressed as... ,in, .
[0101] The second approximation is obtained by solving for the product between the inverse matrix and the coefficient matrix of the sparse approximation matrix based on the decomposition results. The second approximation is an estimate of the product between the inverse and coefficient matrices of the sparse approximation matrix. The second approximation can be expressed as... ,in, .
[0102] A new system of linear equations refers to a new system of equations obtained by substituting the first and second approximations into the original system of linear equations. This new system is usually easier to solve than the original system. The new system of linear equations can be represented as... .
[0103] Specifically, the terminal uses an appropriate matrix factorization technique to decompose the sparse approximation matrix, obtaining a set of matrices. It then uses these matrices to calculate the product between the inverse of the sparse approximation matrix and the excitation vector, obtaining a first approximation. Next, it uses these matrices to calculate the product between the inverse of the sparse approximation matrix and the coefficient matrix, obtaining a second approximation. The terminal then uses the first approximation to replace the product between the inverse of the sparse approximation matrix and the excitation vector, and uses the second approximation to replace the product between the inverse of the sparse approximation matrix and the coefficient matrix, resulting in a new system of linear equations.
[0104] In this embodiment, by using the decomposition result after approximation factor decomposition of the sparse approximation matrix, the product between the inverse matrix of the sparse approximation matrix and the excitation vector is approximately calculated to obtain the first approximation value, and the product between the inverse matrix of the sparse approximation matrix and the coefficient matrix is approximately calculated to obtain the second approximation value. This avoids directly using the matrix multiplication method to calculate the product between the inverse matrix of the sparse approximation matrix and the coefficient matrix and the excitation vector respectively, which can significantly improve computational efficiency, enhance numerical stability, and reduce storage requirements.
[0105] In one embodiment, the first approximation is obtained by solving the product between the inverse of the sparse approximation matrix and the activation vector based on the decomposition result, including:
[0106] Set an initial value for the product between the inverse of the sparse approximation matrix and the activation vector, and use the initial value as a historical approximation value; based on the decomposition result and the historical approximation value, determine the approximate value of the product between the inverse of the sparse approximation matrix and the activation vector in the current iteration; use the approximate value as the historical approximation value in the next iteration, and return the step of determining the approximate value of the product between the inverse of the sparse approximation matrix and the activation vector in the current iteration based on the decomposition result and the historical approximation value, until the number of iterations reaches the preset number of iterations, and use the approximate value generated in the last iteration as the first approximation value.
[0107] Here, the initial value is the initial estimate set at the beginning of the iteration process to solve for the product between the inverse of the sparse approximation matrix and the activation vector. The initial value is constant and is usually chosen as the zero vector or an initial guess based on some heuristic method.
[0108] Historical approximation refers to the approximate result of the product between the inverse of the sparse approximation matrix calculated in each iteration and the activation vector during the iteration process. Historical approximation is used in the next iteration to improve the estimation.
[0109] The current iteration process refers to the step that is currently in progress in the iterative algorithm, which updates the current estimate based on the result of the previous iteration (i.e., the historical approximation).
[0110] The preset number of iterations is the maximum number of iterations allowed before the iterative algorithm stops. When this number is reached, the algorithm will stop and return the current approximate solution, regardless of the accuracy of the solution.
[0111] Specifically, the terminal selects an initial estimate as the initial value for the product and sets this initial value as a historical approximation. During the current iteration, the terminal calculates an approximation of the product between the inverse of the sparse approximation matrix and the activation vector using various iterative methods and by employing the decomposition results and historical approximations. The terminal uses the approximation calculated in the current iteration as the historical approximation for the next iteration. The terminal checks if the preset number of iterations has been reached. If not, the terminal returns to the steps of calculating the approximation of the product between the inverse of the sparse approximation matrix and the activation vector using various iterative methods and by employing the decomposition results and historical approximations to continue iterating; if the preset number of iterations has been reached, the iteration stops, and the approximation generated in the last iteration is used as the first approximation, which is an estimate of the product between the inverse of the sparse approximation matrix and the activation vector.
[0112] It should be noted that the method for obtaining the first approximation is the same as that for obtaining the second approximation, and will not be repeated here.
[0113] In this embodiment, the product between the inverse matrix of the sparse approximation matrix and the activation vector is solved by an iterative method to obtain the first approximation value. This method is faster and more stable than the direct matrix multiplication method, thus improving the convergence speed and stability of large sparse matrices.
[0114] In one embodiment, the sparse approximate matrix is decomposed using LDU decomposition, resulting in a diagonal matrix, a lower triangular matrix, and an upper triangular matrix. The corresponding mathematical expression is: ,in It is a diagonal matrix. It is a lower triangular matrix. It is an upper triangular matrix.
[0115] In one embodiment, based on the decomposition results and historical approximations, determining the approximate value of the product between the inverse of the sparse approximation matrix and the activation vector in the current iteration includes:
[0116] Determine the first product between the inverse of the lower triangular matrix and the historical approximation; determine the second product between the inverse of the upper triangular matrix and the historical approximation; based on the diagonal matrix, the first product, and the second product, determine the approximate value of the product between the inverse of the sparse approximation matrix and the activation vector in the current iteration.
[0117] The lower triangular matrix is a square matrix in which all elements below the main diagonal (from the top left to the bottom right) are zero, while the elements above and below the main diagonal can be non-zero.
[0118] Upper Triangular Matrix: Unlike the lower triangular matrix, the elements above the main diagonal of the upper triangular matrix are all zero, while the elements on and below the main diagonal can be non-zero.
[0119] A diagonal matrix is a square matrix in which only the elements on the main diagonal are non-zero, and all other elements are zero.
[0120] Specifically, the terminal calculates the inverse of the lower triangular matrix and the inverse of the upper triangular matrix. According to the matrix multiplication rules, it calculates the first product between the inverse of the lower triangular matrix and the historical approximation, and the second product between the inverse of the upper triangular matrix and the historical approximation. The terminal calculates the sum of the first and second products, and then, based on the summation result and the product between the diagonal matrix, determines the approximate value of the product between the inverse of the sparse approximation matrix and the activation vector in the current iteration.
[0121] In some embodiments, to avoid directly using sparse approximation matrices Inverse and activation vector Find the first approximate value by directly performing a product operation. To overcome the drawback of low computational efficiency, the sparse approximation matrix is subjected to approximation factorization, and the sparse approximation matrix is then... Inverse and activation vector The product operation is transformed into solving matrix equations. The problem is how to solve matrix equations. When solving the problem, the sparse approximation matrix is used. Substitute the decomposition results into A new equation is obtained Then, the approximate calculation is performed using an iterative method. .
[0122] In some embodiments, solving matrix equations The solution to the problem specifically includes the following steps:
[0123] The initial value of the product between the inverse of the sparse approximation matrix and the activation vector is set to... ,Will As a historical approximation, and participating The first iteration process. In each iteration, the terminal calculates the approximate value of the product between the inverse of the sparse approximation matrix and the activation vector in the current iteration according to the following formula:
[0124]
[0125] in, k represents the current iteration number. max Indicates the maximum number of iterations. The expression represents a historical approximation, and n represents the solution of a new system of linear equations. The number of iterations, This represents the excitation vector generated by the new linear system of equations during the nth iteration.
[0126] It should be noted that: when solving new systems of linear equations The process involves calculating the solution to the new system of linear equations through multiple iterations. Therefore, in each iteration of solving the new system of linear equations, the following calculations are performed: ,and Iterate k using the above iterative formula. max The subsequent iterations of solving the new system of linear equations require k steps. max Solving in the second iteration and based on Update the new system of linear equations.
[0127] In this embodiment, to avoid directly using sparse approximation matrices Inverse and activation vector Find the first approximate value by directly performing a product operation. To address the computational inefficiency of sparse approximation matrices, approximate factorization is performed. Furthermore, since the sparse coefficient matrix contains a large number of zero elements, directly calculating the inverse of the sparse coefficient matrix involves numerous multiplication operations, and the sparse approximation matrix... The inverse of the matrix requires a large amount of memory. Therefore, to solve this problem, a sparse approximation matrix is used. Inverse and activation vector The product operation is transformed into solving matrix equations. The problem of solving the sparse approximation matrix is thus bypassed, thus avoiding the need to calculate the sparse approximation matrix. The process of inverting the matrix reduces computational cost and storage space.
[0128] In one embodiment, the corrosion field potential of the object to be simulated is obtained by recursively solving a new system of linear equations, including the following steps:
[0129] 1. Set an initial approximate solution for the new linear system of equations, and use the initial approximate solution as the current solution of the new linear system of equations in the current iteration process.
[0130] The initial approximate solution refers to an initial guess for the solution of a new system of linear equations before starting iterative solving. The initial approximate solution can be obtained based on experience, physical intuition, or simple calculations.
[0131] Specifically, the terminal uses a random method to set the initial approximate solution of the new linear equation system, and uses the initial approximate solution as the current solution of the new linear equation system in the current iteration process.
[0132] 2. Based on the current solution, the first approximation value, and the second approximation value, determine the residual between the current solution and the true solution of the new linear equation system; normalize the residual to obtain the unit residual vector, and construct an orthonormal basis based on the unit residual vector.
[0133] The residual refers to the difference between the current approximate solution and the true solution. In the GMRES algorithm, the residual is usually expressed as... ,in, It is the initial residual vector. This is the initial approximate solution.
[0134] The unit residual vector is obtained by normalizing the original residual vector. Normalization is the process of changing the length of the vector to 1. In GMRES, the unit residual vector is usually represented as... ,in, It is the unit residual vector in the current iteration process; It is the norm of the residual vector. .
[0135] An orthonormal basis is a set of vectors that are orthogonal to each other (i.e., their dot product is zero) and each vector has a norm of 1. In GMRES, orthonormal bases are used to construct Krylov subspaces that contain all possible directions of approximate solutions to new systems of linear equations.
[0136] Specifically, the terminal calculates the residual between the current solution and the true solution of the new linear equation system according to the residual calculation formula in the GMRES algorithm, as well as the current solution, the first approximation, and the second approximation. The terminal calculates the norm of the residual and then divides the residual by this norm to obtain a normalized unit residual vector. Based on the unit residual vector, the terminal constructs an orthonormal basis for the Krylov subspace using the Arnoldi process or other orthogonalization methods. This process involves multiple iterations, each generating a new orthogonal vector and adding it to the orthonormal basis. Ultimately, the orthonormal basis consists of a set of vectors that are orthogonal to each other and normalized.
[0137] In some embodiments, the Arnoldi orthogonalization method is used to construct the orthonormal basis of the Krylov subspace. , It is by , ,……, The standard orthonormal basis is formed, where m is the dimension of the subspace. Based on the unit residual vector, construct an orthonormal basis for the Krylov subspace using the Arnoldi process or other orthogonalization methods, including the following steps:
[0138] 1) Orthogonalization: and The dot product of each term can be obtained ,as follows
[0139]
[0140]
[0141] in, For a with A vector in which every term is orthogonal; additionally, calculate... It is still necessary to transform it into solving matrix equations. The problem is solved, and then the matrix-free method described above is used to calculate the solution. The steps are as described in the above embodiments.
[0142] 2) Standardization: , .
[0143] 3) Update the orthogonal basis ,matrix .
[0144]
[0145] And in middle, , , All other elements are zero. Thus, we obtain an orthonormal basis for a set of Krylov subspaces. .
[0146] Third, by processing the orthonormal basis using the least squares method, an iterative approximate solution for a new system of linear equations is obtained.
[0147] In the Krylov subspace, x is solved by minimizing the residual norm.
[0148] Specifically, the terminal processes the orthonormal basis using the least squares method to obtain the intermediate vector. Based on the current solution, the orthonormal basis, and the intermediate vector, the terminal obtains an iterative approximate solution to the new linear equation system.
[0149] In some embodiments, the mathematical formula corresponding to the least squares approach is as follows:
[0150]
[0151] Orthonormal basis The unknown vector is also an intermediate vector; Rm is an m-dimensional space.
[0152] In some embodiments, based on the current solution, the orthonormal basis, and the intermediate vectors, the mathematical formula corresponding to the iterative approximate solution of the new linear equation system is as follows:
[0153]
[0154] in, This is an iterative approximate solution.
[0155] Fourth, the step of taking the iterative approximate solution as the current solution in the next iteration process and returning to determine the residual between the current solution and the true solution of the new linear equation system based on the current solution, the first approximation value and the second approximation value continues until the residual is less than or equal to the preset residual value, and the corrosion field potential of the object to be simulated is obtained.
[0156] Specifically, the terminal calculates the residual between the iterative approximate solution and the true solution of the new linear equation system. If the residual is greater than the preset residual value, the iterative approximate solution is used as the current solution in the next iteration process. The step of determining the residual between the current solution and the true solution of the new linear equation system based on the current solution, the first approximation value and the second approximation value continues to be executed until the residual is less than or equal to the preset residual value, and the corrosion field potential of the simulated object is obtained.
[0157] In some embodiments, the residual between the iterative approximate solution and the true solution of the new linear system of equations is expressed as:
[0158]
[0159] like ,but It can be approximated as a solution to the equation, i.e., the corrosion field potential of the object to be simulated; otherwise, let the initial approximate solution... Return to step two. Among them, Given convergence criteria parameters, which are preset residual values, we can take... .
[0160] In some embodiments, to demonstrate the significant improvements of the present application's embodiments over the prior art, this embodiment uses the GMRES algorithm as an example for comparative analysis. Three algorithms are presented: the GMRES algorithm without sparse approximation matrix preprocessing, the GMRES algorithm with sparse approximation matrix preprocessing (denoted as ILU GMRES), and the GMRES algorithm after matrix-free processing in this application (denoted as NEW-GMRES). Figure 5 This is a schematic diagram comparing the convergence of residuals with respect to iteration steps for three GMRES algorithms in one embodiment. Figure 6 This is a schematic diagram comparing the convergence of residuals with respect to CPU time for three GMRES algorithms in one embodiment, as shown below. Figure 5 and Figure 6 As shown, the improved NEW-GMRES in this application has a significant acceleration effect on convergence, and its computational efficiency is several times higher than that of ILU GMRES and GMRES.
[0161] In this embodiment, by minimizing the residual norm to approximate the true solution of the new linear equation system, a satisfactory iterative approximation solution can be found in fewer iterations, effectively reducing the amount of computation and improving computational efficiency.
[0162] In one detailed embodiment, a corrosion acceleration simulation method includes:
[0163] 1. Based on the corrosion environment parameters, the material properties of the object to be simulated, and the boundary conditions used to simulate the corrosion process, construct the geometric model of the object to be simulated;
[0164] 2. Construct a computational domain based on the geometric model of the object to be simulated, and perform structured meshing on the computational domain to generate multiple mesh elements;
[0165] Third, for each grid cell, set multiple discrete potential points on the grid cell and establish the boundary integral equation corresponding to each discrete potential point using the boundary element method;
[0166] IV. Based on the boundary integral equation corresponding to each discrete potential point, construct a system of linear equations, where the system of linear equations characterizes the relationship between the coefficient matrix, the potentials distributed on the geometric model, and the excitation vectors.
[0167] 5. Multiply both sides of the linear equation system by the inverse of a sparse approximation matrix, and then perform approximation factorization on the sparse approximation matrix to obtain the decomposition results. The decomposition results include a diagonal matrix, a lower triangular matrix, and an upper triangular matrix.
[0168] 6. Set an initial value for the product between the inverse of the sparse approximation matrix and the activation vector, and use the initial value as the historical approximation value;
[0169] 7. Determine the first product between the inverse of the lower triangular matrix and the historical approximation;
[0170] 8. Determine the second product between the inverse of the upper triangular matrix and the historical approximation;
[0171] 9. Based on the diagonal matrix, the first product, and the second product, determine the approximate value of the product between the inverse matrix of the sparse approximation matrix and the activation vector in the current iteration process.
[0172] 10. Take the approximate value as the historical approximate value in the next iteration process, and return the step of determining the approximate value of the product between the inverse matrix of the sparse approximate matrix and the activation vector in the current iteration process based on the decomposition result and the historical approximate value, until the number of iterations reaches the preset number of iterations, and take the approximate value generated in the last iteration process as the first approximate value.
[0173] 11. Based on the decomposition results, solve for the product between the inverse matrix and the coefficient matrix of the sparse approximation matrix to obtain the second approximation value;
[0174] 12. Substitute the first and second approximations into the system of linear equations to obtain a new system of linear equations.
[0175] 13. Set an initial approximate solution for the new linear system of equations, and use the initial approximate solution as the current solution for the new linear system of equations in the current iteration process;
[0176] 14. Based on the current solution, the first approximation value, and the second approximation value, determine the residual between the current solution and the true solution of the new linear equation system;
[0177] 15. Normalize the residuals to obtain the unit residual vector, and construct an orthonormal basis based on the unit residual vector;
[0178] 16. By processing the orthonormal basis using the least squares method, an iterative approximate solution for a new system of linear equations is obtained;
[0179] 17. The step of taking the iterative approximate solution as the current solution in the next iteration process and returning the step of determining the residual between the current solution and the true solution of the new linear equation system based on the current solution, the first approximation value and the second approximation value continues until the residual is less than or equal to the preset residual value, and the corrosion field potential of the simulated object is obtained.
[0180] In this embodiment, after constructing the geometric model of the object to be simulated, the simulation software is run to obtain a system of linear equations. The inverse of a sparse approximation matrix is multiplied on the left side of both sides of the equations. The sparse approximation matrix is decomposed, and the product of the sparse approximation matrix and a given vector is iteratively calculated based on the decomposition results, instead of directly multiplying the sparse approximation matrix and the given vector. This achieves rapid iterative convergence of large-scale linear equation systems without explicitly constructing the sparse approximation matrix (i.e., using a matrix-free approach), improving efficiency. This avoids directly utilizing the sparse approximation matrix. Inverse and activation vector Find the first approximation by directly performing a product operation. To address the computational inefficiency of sparse approximation matrices, approximate factorization is performed. Furthermore, since the sparse coefficient matrix contains a large number of zero elements, directly calculating the inverse of the sparse coefficient matrix involves numerous multiplication operations, and the sparse approximation matrix... The inverse of the matrix requires a large amount of memory. Therefore, to solve this problem, a sparse approximation matrix is used. Inverse and activation vector The product operation is transformed into solving matrix equations. The problem of solving the sparse approximation matrix is thus bypassed. The process of inverting the matrix reduces computational cost and storage space.
[0181] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0182] Based on the same inventive concept, this application also provides a corrosion acceleration simulation device for implementing the corrosion acceleration simulation method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more embodiments of the corrosion acceleration simulation device provided below can be found in the limitations of the corrosion acceleration simulation method described above, and will not be repeated here.
[0183] In one embodiment, such as Figure 7 As shown, a corrosion acceleration simulation device is provided, comprising:
[0184] The model building module 701 is used to build a geometric model of the object to be simulated based on corrosion environment parameters, material properties of the object to be simulated, and boundary conditions for simulating the corrosion process.
[0185] Simulation module 702 is used to construct a system of linear equations based on the geometric model of the object to be simulated. The system of linear equations represents the relationship between the coefficient matrix, the potentials distributed on the geometric model, and the excitation vectors.
[0186] The decomposition module 703 is used to multiply both sides of the linear equation system by the inverse of a sparse approximation matrix, perform approximation factor decomposition on the sparse approximation matrix, and obtain the decomposition result.
[0187] The first calculation module 704 is used to solve the product between the inverse matrix of the sparse approximation matrix and the coefficient matrix and the excitation vector based on the decomposition result, and obtain a new system of linear equations.
[0188] The second calculation module 705 is used to solve a new set of linear equations recursively to obtain the corrosion field potential of the object to be simulated.
[0189] In one embodiment, the simulation module 702 is further configured to construct a computational domain based on the geometric model of the object to be simulated, and to perform structured meshing on the computational domain to generate multiple mesh elements; for each mesh element, multiple discrete potential points are set on the targeted mesh element, and the boundary integral equation corresponding to each discrete potential point is established through the boundary element method; and a system of linear equations is constructed based on the boundary integral equation corresponding to each discrete potential point.
[0190] In one embodiment, the first calculation module 704 is further configured to solve the product between the inverse matrix of the sparse approximation matrix and the excitation vector based on the decomposition result to obtain a first approximation value; solve the product between the inverse matrix of the sparse approximation matrix and the coefficient matrix based on the decomposition result to obtain a second approximation value; and substitute the first approximation value and the second approximation value into the linear equation system to obtain a new linear equation system.
[0191] In one embodiment, the first calculation module 704 is further configured to set an initial value for the product between the inverse matrix of the sparse approximation matrix and the excitation vector, and use the initial value as a historical approximation value; determine the approximate value of the product between the inverse matrix of the sparse approximation matrix and the excitation vector in the current iteration based on the decomposition result and the historical approximation value; use the approximate value as a historical approximation value in the next iteration, and return the step of determining the approximate value of the product between the inverse matrix of the sparse approximation matrix and the excitation vector in the current iteration based on the decomposition result and the historical approximation value, until the number of iterations reaches the preset number of iterations, and use the approximate value generated in the last iteration as the first approximation value.
[0192] In one embodiment, the decomposition result includes a diagonal matrix, a lower triangular matrix, and an upper triangular matrix. The first calculation module 704 is further configured to determine a first product between the inverse matrix of the lower triangular matrix and the historical approximation; determine a second product between the inverse matrix of the upper triangular matrix and the historical approximation; and, based on the diagonal matrix, the first product, and the second product, determine an approximate value of the product between the inverse matrix of the sparse approximation matrix and the activation vector in the current iteration.
[0193] In one embodiment, the second calculation module 705 is further configured to set an initial approximate solution for the new linear equation system and use the initial approximate solution as the current solution of the new linear equation system in the current iteration process; determine the residual between the current solution and the true solution of the new linear equation system based on the current solution, the first approximation value, and the second approximation value; normalize the residual to obtain a unit residual vector, and construct an orthonormal basis based on the unit residual vector; process the orthonormal basis using the least squares method to obtain an iterative approximate solution of the new linear equation system; use the iterative approximate solution as the current solution in the next iteration process, and return to the step of determining the residual between the current solution and the true solution of the new linear equation system based on the current solution, the first approximation value, and the second approximation value to continue execution until the residual is less than or equal to a preset residual value, thereby obtaining the corrosion field potential of the simulated object.
[0194] Each module in the aforementioned corrosion acceleration simulation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0195] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 8 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a corrosion acceleration simulation method. The display unit of the computer device is used to form a visually visible image. It can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0196] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0197] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0198] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0199] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0200] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0201] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0202] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0203] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for simulating accelerated corrosion, characterized in that, The method includes: Based on corrosion environment parameters, material properties of the object to be simulated, and boundary conditions used to simulate the corrosion process, a geometric model of the object to be simulated is constructed. Based on the geometric model of the object to be simulated, a system of linear equations is constructed, wherein the system of linear equations characterizes the relationship between the coefficient matrix, the potentials distributed on the geometric model, and the excitation vectors; Multiply both sides of the linear equation system by the inverse of a sparse approximation matrix, and then perform approximation factorization on the sparse approximation matrix to obtain the decomposition result; the decomposition result includes a diagonal matrix, a lower triangular matrix, and an upper triangular matrix; Set an initial value for the product between the inverse of the sparse approximation matrix and the activation vector, and use the initial value as a historical approximation value; Based on the decomposition results and the historical approximations, determine the approximate value of the product between the inverse of the sparse approximation matrix and the activation vector in the current iteration process; The approximate value is used as the historical approximate value in the next iteration process, and the step of determining the approximate value of the product between the inverse matrix of the sparse approximate matrix and the activation vector in the current iteration process based on the decomposition result and the historical approximate value is returned until the number of iterations reaches the preset number of iterations, and the approximate value generated in the last iteration process is used as the first approximate value. Based on the decomposition results, the product between the inverse matrix of the sparse approximation matrix and the coefficient matrix is calculated to obtain the second approximation value; Substituting the first approximation and the second approximation into the system of linear equations yields a new system of linear equations; The corrosion field potential of the simulated object is obtained by recursively solving the new system of linear equations; wherein... The step of determining the approximate value of the product between the inverse of the sparse approximation matrix and the activation vector in the current iteration, based on the decomposition result and the historical approximation value, includes: Determine the first product between the inverse of the lower triangular matrix and the historical approximation; Determine the second product between the inverse of the upper triangular matrix and the historical approximation; Based on the diagonal matrix, the first product, and the second product, the approximate value of the product between the inverse of the sparse approximation matrix and the activation vector is determined during the current iteration.
2. The method according to claim 1, characterized in that, The construction of a system of linear equations based on the geometric model of the object to be simulated includes: A computational domain is constructed based on the geometric model of the object to be simulated, and the computational domain is subjected to structured meshing to generate multiple mesh elements; For each grid cell, multiple discrete potential points are set on the grid cell, and the boundary integral equation corresponding to each discrete potential point is established by the boundary element method. A system of linear equations is constructed based on the boundary integral equations corresponding to each discrete potential point.
3. The method according to claim 1, characterized in that, The step of recursively solving the new system of linear equations to obtain the corrosion field potential of the simulated object includes: Set an initial approximate solution for the new linear equation system, and use the initial approximate solution as the current solution for the new linear equation system in the current iteration process; Based on the current solution, the first approximation, and the second approximation, determine the residual between the current solution and the true solution of the new linear equation system; The residuals are normalized to obtain unit residual vectors, and an orthonormal basis is constructed based on the unit residual vectors. The orthonormal basis is processed using the least squares method to obtain the iterative approximate solution of the new linear equation system; The iterative approximate solution is used as the current solution in the next iteration process, and the step of determining the residual between the current solution and the true solution of the new linear equation system based on the current solution, the first approximation value and the second approximation value is returned to continue until the residual is less than or equal to a preset residual value, and the corrosion field potential of the simulated object is obtained.
4. A corrosion acceleration simulation device, characterized in that, The device includes: The model building module is used to construct the geometric model of the object to be simulated based on corrosion environment parameters, material properties of the object to be simulated, and boundary conditions for simulating the corrosion process. The simulation module is used to construct a system of linear equations based on the geometric model of the object to be simulated, wherein the system of linear equations represents the relationship between the coefficient matrix, the potentials distributed on the geometric model, and the excitation vectors; The decomposition module is used to multiply both sides of the linear equation system by the inverse of a sparse approximation matrix, and perform approximation factor decomposition on the sparse approximation matrix to obtain the decomposition result; the decomposition result includes a diagonal matrix, a lower triangular matrix, and an upper triangular matrix. The first calculation module is used to set an initial value for the product between the inverse matrix of the sparse approximation matrix and the excitation vector, and use the initial value as a historical approximation value; based on the decomposition result and the historical approximation value, determine the approximate value of the product between the inverse matrix of the sparse approximation matrix and the excitation vector in the current iteration; use the approximate value as a historical approximation value in the next iteration, and return to the step of determining the approximate value of the product between the inverse matrix of the sparse approximation matrix and the excitation vector in the current iteration based on the decomposition result and the historical approximation value, until the iteration count reaches a preset iteration count, and stop using the approximation value generated in the last iteration as the first approximation value; solve the product between the inverse matrix of the sparse approximation matrix and the coefficient matrix based on the decomposition result to obtain a second approximation value; substitute the first approximation value and the second approximation value into the linear equation system to obtain a new linear equation system; wherein, The first calculation module is further configured to determine a first product between the inverse of the lower triangular matrix and the historical approximation; determine a second product between the inverse of the upper triangular matrix and the historical approximation; and, based on the diagonal matrix, the first product, and the second product, determine an approximate value of the product between the inverse of the sparse approximation matrix and the activation vector in the current iteration. The second calculation module is used to solve the new set of linear equations recursively to obtain the corrosion field potential of the object to be simulated.
5. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 3.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 3.
7. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Corrosion speed prediction method, device, equipment, storage medium and program product
CN117610368A
