CFD software automatic testing method and system
The automated CFD software testing method addresses inefficiencies in traditional manual testing by using a combinatorial optimization algorithm to generate and prioritize test cases based on operating parameter coefficients, enhancing efficiency and reliability.
Patent Information
- Application Number
- CN202411127460.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-12-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional CFD software testing methods require significant manual intervention, leading to low efficiency, inaccurate results, and difficulty in ensuring reliability, especially for complex scenarios with multiple boundary conditions and physical model parameters.
An automated testing method using a combinatorial optimization algorithm to generate test cases, calculate operating parameter coefficients, and arrange test cases based on these coefficients to ensure accuracy and efficiency.
The method significantly reduces manual effort, improves test efficiency, enhances result accuracy and reliability, and ensures comprehensive test coverage by automating the testing process.
Smart Images

Figure CN119088685A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automated testing of computational fluid dynamics software, and in particular to an automated testing method and system for CFD software. Background Art
[0002] In the prior art, the testing process of computational fluid dynamics (CFD) software usually requires a lot of manual intervention and complex manual operations, which easily leads to low test efficiency and difficulty in ensuring the accuracy of test results. Traditional CFD software testing methods include manually inputting test data and operating parameters, manually optimizing and combining input parameters to generate test cases, and manually testing in CFD software to obtain test results. However, these manual operations are not only time-consuming and laborious, but may also lead to inaccurate test results due to human errors.
[0003] In addition, the existing CFD software testing methods lack automation means and cannot effectively conduct large-scale testing and repeated testing, resulting in insufficient test coverage and difficulty in ensuring the reliability of test results. Especially for complex CFD software, its combination of multiple boundary conditions and physical model parameters requires testing, which makes it difficult for traditional manual testing methods to cope with. Summary of the invention
[0004] Based on the above-mentioned shortcomings of the prior art, the purpose of the present invention is to provide a CFD software automated testing method and system to solve the above-mentioned technical problems.
[0005] To achieve the above object, the present invention provides the following technical solution: a CFD software automated testing method, comprising:
[0006] Obtaining input parameters in the test data of the CFD software, and generating test cases using a combinatorial optimization algorithm according to the input parameters;
[0007] Input the test case into CFD software for automated testing to obtain the operating parameters of the test case;
[0008] Extracting operation characteristics according to the operation parameters of the test case, and calculating the operation parameter coefficient according to the operation characteristics;
[0009] When the operating parameter coefficient is less than the preset operating parameter coefficient threshold, the CFD software automated test fails; when the operating parameter coefficient is greater than or equal to the preset operating parameter coefficient threshold, the test cases are arranged in descending order according to the operating parameter coefficient to generate a test case table.
[0010] The present invention is further configured such that the input parameters include grid resolution, physical model parameters, solver setting parameters and boundary condition parameters, wherein the boundary condition parameters include inlet velocity, pressure and temperature.
[0011] The present invention is further configured to generate a test case using a combinatorial optimization algorithm according to the input parameters, including:
[0012] Obtain the value range of the input parameter, and partition the value range of the input parameter. When the value of the input parameter is a discrete value, no partitioning is performed.
[0013] For the i-th input parameter x i , select a value in the jth interval, the selection logic is: Among them, x ij is the i-th input parameter x i The value selected in the jth interval, L i The input parameter x i The lower bound of the range of values, U i The input parameter x i The upper limit of the range of values, r ij is a random number uniformly distributed between [0,1], and n is an interval number;
[0014] Generate n values for each input parameter, generate a value matrix for each input parameter's n values, and generate test cases through permutations and combinations.
[0015] The present invention is further configured as follows: after generating the value matrix, the covariance matrix of the value matrix is calculated; the covariance matrix is standardized so that the mean of the input parameter is 0 and the variance is 1; the standardized covariance matrix is subjected to eigenvalue decomposition to obtain eigenvalues and eigenvectors, and the main eigenvectors are selected as principal components according to the size of the eigenvalues; the standardized covariance matrix is projected to the principal component space to obtain an adjusted covariance matrix; the adjusted covariance matrix is converted from the principal component space back to the original space; the covariance matrix converted back to the original space is arranged and combined to generate test cases.
[0016] The present invention is further configured such that the operating parameters include output parameter values and test time; and the operating characteristics include result accuracy, calculation time and result stability.
[0017] The present invention is further configured such that the calculation logic of the result accuracy is: Among them, A k is the result accuracy of the k-th test case, m is the number of tests of the k-th test case, O kl is the output parameter value of the kth test case in the lth test, O ref is the expected value of the kth test case; the calculation logic of the calculation time is: Among them, Tk is the computation time of the kth test case, T kl is the test time of the lth test of the kth test case; the calculation logic of the result stability is: Among them, S k is the result stability of the kth test case, σ(O k1 ,...,O km ) is the standard deviation of the output parameter value of the kth test case m times test, μ(O k1 ,...,O km ) is the mean of the output parameter values of the kth test case after m tests.
[0018] The present invention is further configured to calculate an operating parameter coefficient according to the operating characteristics, and the calculation logic of the operating parameter coefficient is: Among them, CO is the operating parameter coefficient.
[0019] The present invention is further configured to arrange the test cases in descending order according to the operating parameter coefficients to generate a test case table, and also includes: obtaining the test coverage of the test cases in sequence according to the order of the test case table, and deleting subsequent test cases when the sum of the test coverage of the current test cases is greater than or equal to a preset test coverage threshold.
[0020] The present invention also provides a CFD software automatic testing system, the system comprising:
[0021] The first acquisition module is used to acquire input parameters in the test data of the CFD software, and generate test cases using a combinatorial optimization algorithm according to the input parameters;
[0022] The second acquisition module is used to input the test case into the CFD software for automated testing, and obtain the operating parameters of the test case;
[0023] Calculation coefficient module: extracts operation characteristics according to the operation parameters of the test case, and calculates the operation parameter coefficient according to the operation characteristics;
[0024] Coefficient judgment module: When the operating parameter coefficient is less than the preset operating parameter coefficient threshold, the CFD software automated test fails; when the operating parameter coefficient is greater than or equal to the preset operating parameter coefficient threshold, the test cases are arranged in descending order according to the operating parameter coefficient to generate a test case table.
[0025] The present invention provides a CFD software automated testing method and system. The method obtains input parameters in test data of the CFD software, generates test cases according to the input parameters using a combinatorial optimization algorithm; inputs the test cases into the CFD software for automated testing, and obtains operating parameters of the test cases; extracts operating features according to the operating parameters of the test cases, and calculates operating parameter coefficients according to the operating features; when the operating parameter coefficient is less than a preset operating parameter coefficient threshold, the CFD software automated test fails; when the operating parameter coefficient is greater than or equal to the preset operating parameter coefficient threshold, the test cases are arranged in descending order according to the operating parameter coefficients, and a test case table is generated, and the beneficial effects produced include:
[0026] 1. Improve test efficiency: The present invention greatly reduces the need for manual operations and significantly improves test efficiency by automatically generating and executing test cases. Traditional CFD software testing methods often require a lot of manual intervention, while the automated testing process of the present invention can quickly and efficiently complete a large number of test tasks, saving time and human resources;
[0027] 2. Accuracy and reliability of test results: The present invention reduces the possibility of human error and ensures the accuracy of the test process through automated test data input and parameter optimization. At the same time, more reliable test data support is provided through systematic storage and analysis of test results. The implementation of multiple repeated tests and large-scale tests further improves the reliability of test results and ensures the stability of CFD software under various conditions;
[0028] 3. Enhanced intelligence and flexibility: The present invention has real-time feedback and adjustment functions, can automatically optimize input parameters according to test results, generate new test cases, and improve the intelligence and flexibility of the test process.
[0029] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0031] Figure 1A flow chart of a CFD software automated testing method shown as an exemplary embodiment of the present invention;
[0032] Figure 2 The present invention is a schematic diagram of a CFD software automated testing system according to an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0033] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention, not for limiting the scope of protection of the present invention.
[0034] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0035] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.
[0036] Embodiment 1
[0037] A CFD software automated testing method, such as Figure 1 As shown, including:
[0038] Obtaining input parameters in the test data of the CFD software, and generating test cases using a combinatorial optimization algorithm according to the input parameters;
[0039] Input the test case into CFD software for automated testing to obtain the operating parameters of the test case;
[0040] Extracting operation characteristics according to the operation parameters of the test case, and calculating the operation parameter coefficient according to the operation characteristics;
[0041] When the operating parameter coefficient is less than the preset operating parameter coefficient threshold, the CFD software automated test fails; when the operating parameter coefficient is greater than or equal to the preset operating parameter coefficient threshold, the test cases are arranged in descending order according to the operating parameter coefficient to generate a test case table.
[0042] Specifically, CFD (Computational Fluid Dynamics) software is a computational tool used to simulate and analyze phenomena such as fluid (liquid and gas) flow, heat transfer, chemical reactions, etc. CFD software simulates the motion and behavior of fluids by numerically solving fluid mechanics equations (such as the Navier-Stokes equations). These equations describe the conservation of mass, momentum, and energy of the fluid. Automated testing is a method that uses software tools to execute pre-designed test cases to verify the functionality, performance, and reliability of a software system. Automated testing is an integral part of the software development and quality assurance process by reducing manual intervention and improving test efficiency and accuracy. In the process of CFD software development and application, automated testing is an important means to ensure software quality and reliability.
[0043] In the automated testing process of CFD (computational fluid dynamics) software, input parameters are important factors in defining and controlling the calculation process. Input parameters include grid resolution, physical model parameters, solver setting parameters, and boundary condition parameters, where the boundary condition parameters include inlet velocity, pressure, and temperature. Specifically, grid resolution refers to the size and number of grid cells in the calculation domain. Grid resolution directly affects the calculation accuracy and efficiency. High-resolution grids are suitable for capturing complex flow characteristics, and low-resolution grids can be used for preliminary calculations and rapid evaluation of large-scale problems. Physical model parameters are used to select and define physical phenomena and models in CFD calculations. Physical model parameters determine additional terms and closure relationships in fluid dynamics equations. Different physical models are suitable for different flow types and working conditions. Solver setting parameters are used to control the numerical method and calculation parameters of the CFD solution process, including time step, number of iterations, convergence criteria and linear solver settings. Solver setting parameters affect the convergence, stability and accuracy of the calculation. Different solver settings are suitable for different flow types and physical phenomena. Boundary condition parameters are used to define the flow and thermodynamic state on the boundary of the calculation domain, including inlet velocity, pressure and temperature. Boundary condition parameters determine the way the fluid enters and leaves the calculation domain. Different boundary conditions are suitable for different physical scenarios and flow types.
[0044] The present invention is further configured to generate a test case using a combinatorial optimization algorithm according to the input parameters, including:
[0045] Get the value range of the input parameter and partition the value range of the input parameter. When the value of the input parameter is a discrete value, no partitioning is performed. Specifically, determine the value range of each input parameter. The input parameter can be a continuous value or a discrete value. For a continuous value parameter, its value range is partitioned into equal intervals. For a discrete value parameter, no partitioning is performed and its specific value is used directly.
[0046] In the testing process of CFD software, the range of continuous value parameters is usually large and changes continuously. In order to effectively generate test cases, it is necessary to partition the range of continuous value parameters. Specifically, the range of continuous value parameters is divided into n intervals. For the i-th input parameter x i , select a value in the jth interval, the selection logic is: Among them, x ij is the i-th input parameter x i The value selected in the jth interval, L i The input parameter x i The lower bound of the range of values, U i The input parameter x i The upper limit of the range of values, r ij is a random number uniformly distributed between [0,1], and n is the number of intervals. By dividing the value range into multiple intervals and selecting a value in each interval, it can ensure that the generated test cases cover different areas of the entire parameter space, which can effectively avoid the problem of incomplete test coverage caused by test cases being concentrated in certain specific areas.
[0047] Generate n values for each input parameter, generate a value matrix for each input parameter, and generate test cases through permutations and combinations. Specifically, generate a value matrix based on the value range and partitioning method of the input parameter. Each column of the value matrix represents an input parameter, and each row represents a test case.
[0048] The present invention is further configured to calculate the covariance matrix of the value matrix after generating the value matrix; standardize the covariance matrix so that the mean of the input parameter is 0 and the variance is 1; perform eigenvalue decomposition on the standardized covariance matrix to obtain eigenvalues and eigenvectors, and select the main eigenvectors as principal components according to the size of the eigenvalues; project the standardized covariance matrix to the principal component space to obtain the adjusted covariance matrix; convert the adjusted covariance matrix from the principal component space back to the original space; perform permutations and combinations on the covariance matrix converted back to the original space to generate test cases. Specifically, the covariance matrix of the value matrix is calculated, and the calculation logic is: in, is the mean matrix of the value matrix X. The logic of eigenvalue decomposition of the standardized covariance matrix is: std =VΛV T , where V is the eigenvector matrix and Λ is the eigenvalue matrix. According to the size of the eigenvalue, the main eigenvectors are selected as the principal components, and the eigenvectors with a larger explained variance ratio are selected. Usually, the eigenvectors with a cumulative explained variance of more than 80% are selected. The standardized covariance matrix is projected into the principal component space to obtain the adjusted covariance matrix. The adjusted covariance matrix is converted from the principal component space back to the original space to obtain the final adjusted covariance matrix. The covariance matrix converted back to the original space is arranged and combined to generate test cases.
[0049] The present invention is further configured such that the operating parameters include output parameter values and test time; and the operating characteristics include result accuracy, calculation time, and result stability. Specifically, in the automated testing process of CFD software, calculating the operating characteristics through the operating parameters is an important indicator for evaluating the test case. The present invention comprehensively evaluates the quality of each test case through the result accuracy, calculation time, and result stability.
[0050] The present invention is further configured such that the calculation logic of the result accuracy is: Among them, A k is the result accuracy of the k-th test case, m is the number of tests of the k-th test case, O kl is the output parameter value of the kth test case in the lth test, O ref is the expected value of the kth test case, and the result accuracy A k It reflects the closeness between the test case output and the expected value. The closer the value is to 1, the more accurate the result is. The calculation logic of the calculation time is: Among them, T k is the computation time of the kth test case, T kl is the test time of the lth test of the kth test case, and the calculation time T k Reflects the calculation efficiency of the test case. The smaller the value, the faster the calculation speed. The calculation logic of the result stability is: Among them, S k is the result stability of the kth test case, σ(O k1 ,...,O km ) is the standard deviation of the output parameter value of the kth test case m times test, μ(O k1 ,...,O km ) is the mean of the output parameter values of the kth test case m times tested, and the result stability S k It reflects the consistency of the test case results. The closer the value is to 1, the more stable the result is.
[0051] The present invention is further configured to calculate an operating parameter coefficient according to the operating characteristics, and the calculation logic of the operating parameter coefficient is: Among them, CO is the operating parameter coefficient. Through the above calculation formula and logic, the quality of each test case can be comprehensively evaluated. Result accuracy A k Ensure the accuracy of the test results and calculate the time T k Evaluate computational efficiency and result stability S k Ensure the consistency of test results. The final operating parameter coefficient CO combines these indicators and provides a scientific basis for selecting and optimizing test cases. The above logic can improve the efficiency and effect of automated testing of CFD software and ensure the reliability and effectiveness of test results. Through reasonable indicators and formulas, high-quality test cases can be effectively screened out, and unqualified test cases can be discovered and improved in a timely manner, thereby improving the overall performance and quality of CFD software.
[0052] The present invention is further configured to arrange the test cases in descending order according to the operating parameter coefficients to generate a test case table, and also includes: obtaining the test coverage of the test cases in sequence according to the order of the test case table, and deleting subsequent test cases when the sum of the test coverage of the current test cases is greater than or equal to a preset test coverage threshold; specifically, the test coverage measures the coverage of the test cases for all possible input parameter combinations. In the process of CFD software automated testing, the test cases are sorted according to the operating parameter coefficients and the test coverage is calculated, which can effectively screen out high-quality test cases, reduce redundant tests, and improve test efficiency. Furthermore, the test coverage calculation logic is the number of input parameter combinations covered by the test case divided by the total number of all possible input parameter combinations. The test coverage of each test case is calculated in sequence according to the sorted test case table, and the test coverage is accumulated until the accumulated value is greater than or equal to the preset test coverage threshold, and the subsequent test cases after the accumulated value is greater than the threshold are deleted; through the above logic, it is ensured that the selected test cases can cover the preset test range, ensure the comprehensiveness of the test, and reduce test time and resource consumption by deleting redundant test cases, thereby improving test efficiency.
[0053] Embodiment 2
[0054] See also Figure 2 , the exemplary CFD software automated testing system comprises:
[0055] The first acquisition module is used to acquire input parameters in the test data of the CFD software, and generate test cases using a combinatorial optimization algorithm according to the input parameters;
[0056] The second acquisition module is used to input the test case into the CFD software for automated testing, and obtain the operating parameters of the test case;
[0057] Calculation coefficient module: extracts operation characteristics according to the operation parameters of the test case, and calculates the operation parameter coefficient according to the operation characteristics;
[0058] Coefficient judgment module: When the operating parameter coefficient is less than the preset operating parameter coefficient threshold, the CFD software automated test fails; when the operating parameter coefficient is greater than or equal to the preset operating parameter coefficient threshold, the test cases are arranged in descending order according to the operating parameter coefficient to generate a test case table.
[0059] It should be noted that the CFD software automated testing system provided in the above embodiment and the CFD software automated testing method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs operations has been described in detail in the method embodiment and will not be repeated here. In actual applications, the CFD software automated testing system provided in the above embodiment can allocate the above functions to different functional modules as needed, that is, divide the internal structure of the system into different functional modules to complete all or part of the functions described above, and this is not limited here.
[0060] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0061] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.
[0062] In this application, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0063] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0064] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0065] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0066] In the several embodiments provided in the present application, it should be understood that the disclosed system can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0067] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0068] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0069] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.
[0070] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A CFD software automated testing method, It is characterized in that include: Obtaining input parameters in the test data of the CFD software, and generating test cases using a combinatorial optimization algorithm according to the input parameters; Input the test case into CFD software for automated testing to obtain the operating parameters of the test case; Extracting operation characteristics according to the operation parameters of the test case, and calculating the operation parameter coefficient according to the operation characteristics; When the operating parameter coefficient is less than the preset operating parameter coefficient threshold, the CFD software automated test fails; When the operating parameter coefficient is greater than or equal to a preset operating parameter coefficient threshold, the test cases are arranged in descending order according to the operating parameter coefficient to generate a test case table.
2. A CFD software automated testing method according to claim 1, It is characterized in that The input parameters include grid resolution, physical model parameters, solver setting parameters and boundary condition parameters, wherein the boundary condition parameters include inlet velocity, pressure and temperature.
3. A CFD software automated testing method according to claim 2, It is characterized in that Generating a test case using a combinatorial optimization algorithm according to the input parameters includes: Obtain the value range of the input parameter, and partition the value range of the input parameter. When the value of the input parameter is a discrete value, no partitioning is performed. For the i-th input parameter x i , select a value in the jth interval, the selection logic is: Among them, x ij is the i-th input parameter x i The value selected in the jth interval, L i The input parameter x i The lower bound of the range of values, U i The input parameter x i The upper limit of the range of values, r ij is a random number uniformly distributed between [0,1], and n is an interval number; Generate n values for each input parameter, generate a value matrix for each input parameter's n values, and generate test cases through permutations and combinations.
4. A CFD software automated testing method according to claim 3, It is characterized in that After generating the value matrix, calculate the covariance matrix of the value matrix; standardize the covariance matrix so that the mean of the input parameters is 0 and the variance is 1; perform eigenvalue decomposition on the standardized covariance matrix to obtain eigenvalues and eigenvectors, and select the main eigenvectors as principal components according to the size of the eigenvalues; project the standardized covariance matrix to the principal component space to obtain the adjusted covariance matrix; transform the adjusted covariance matrix from the principal component space back to the original space; perform permutations and combinations on the covariance matrix transformed back to the original space to generate test cases.
5. A CFD software automated testing method according to claim 1, It is characterized in that The operation parameters include output parameter values and test time; the operation characteristics include result accuracy, calculation time and result stability.
6. A CFD software automated testing method according to claim 5, It is characterized in that The calculation logic of the result accuracy is: Among them, A k is the result accuracy of the k-th test case, m is the number of tests of the k-th test case, O kl is the output parameter value of the kth test case in the lth test, O ref is the expected value of the kth test case; the calculation logic of the calculation time is: Among them, T k is the computation time of the kth test case, T kl is the test time of the lth test of the kth test case; the calculation logic of the result stability is: Among them, S k is the result stability of the kth test case, σ(O k1 ,...,O km ) is the standard deviation of the output parameter value of the kth test case m times test, μ(O k1 ,...,O km ) is the mean of the output parameter values of the kth test case after m tests.
7. A CFD software automated testing method according to claim 6, It is characterized in that The operating parameter coefficient is calculated according to the operating characteristics, and the calculation logic of the operating parameter coefficient is: Among them, CO is the operating parameter coefficient.
8. A CFD software automated testing method according to claim 1, It is characterized in that Arranging the test cases in descending order according to the running parameter coefficients to generate a test case table also includes: obtaining the test coverage of the test cases in sequence according to the order of the test case table, and deleting subsequent test cases when the sum of the test coverage of the current test cases is greater than or equal to a preset test coverage threshold.
9. A CFD software automated testing system, It is characterized in that include: The first acquisition module is used to acquire input parameters in the test data of the CFD software, and generate test cases using a combinatorial optimization algorithm according to the input parameters; The second acquisition module is used to input the test case into the CFD software for automated testing, and obtain the operating parameters of the test case; Calculation coefficient module: extracts operation characteristics according to the operation parameters of the test case, and calculates the operation parameter coefficient according to the operation characteristics; Coefficient judgment module: When the operating parameter coefficient is less than the preset operating parameter coefficient threshold, the CFD software automated test fails; when the operating parameter coefficient is greater than or equal to the preset operating parameter coefficient threshold, the test cases are arranged in descending order according to the operating parameter coefficient to generate a test case table.
