Fluid simulation method, device, equipment, medium and product
By adopting non-structural grid and target functional optimization methods in fluid simulation, the problem of insufficient accuracy of finite volume methods in complex scenarios is solved, and efficient and accurate fluid simulation is achieved, reducing computational cost and grid requirements.
Patent Information
- Application Number
- CN202410981679.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-11-08
AI Technical Summary
Traditional finite volume methods cannot meet the accuracy requirements of spatial fluid simulation under complex computing requirements, and high-order precision reconstruction methods have problems such as low computational efficiency, grid deformation and high singularity.
Using a fluid simulation method based on non-structural grids, an initial polynomial with unknown coefficients is established by obtaining the average value of the fluid parameters, and the polynomial coefficient is determined under the minimum value of the target functional, using interface jump integral and geometric weight derivative Weight, implements smooth reconstruction of polynomials until it meets the iteration stop condition.
It improves the accuracy and calculation efficiency of fluid simulation, reduces the grid density requirements, avoids the problems of singularity and excessive calculation volume in traditional methods, and is suitable for complex flow scenarios.
Smart Images

Figure CN118917240A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of fluid mechanics, and in particular, relates to a fluid simulation method, device, equipment, medium and product. Background Art
[0002] In computer simulation of engineering fluids, the unstructured grid finite volume method is often used. The finite volume method ensures numerical conservation and is convenient for implanting complex flow control equations, such as turbulence patterns, chemical reaction equations, cavitation and discrete phases, and multiple flow media. It is widely used in the fields of aviation, automobiles, and chemical industry. When performing fluid simulation, the traditional method is to use the least squares method or the Gauss-Green formula to obtain a linear polynomial.
[0003] However, the traditional method can only reconstruct through a first-order (linear) polynomial, which is a second-order accuracy. However, with more complex computational requirements, the spatial discretization accuracy of the traditional method cannot meet the simulation accuracy requirements for spatial fluids. Summary of the invention
[0004] The embodiments of the present application provide a fluid simulation method, device, equipment, medium and product, which can provide high accuracy of fluid simulation.
[0005] On the one hand, an embodiment of the present application provides a fluid simulation method, comprising:
[0006] Obtaining an average value of fluid parameters inside each control body in an unstructured grid; the unstructured grid is generated based on the fluid space to be simulated;
[0007] Based on the finite volume method, the average values of the fluid parameters are reconstructed to obtain an initial polynomial with unknown coefficients;
[0008] When the target functional takes a minimum value, the coefficient values of the initial polynomial are determined to obtain the target polynomial; the target functional is the sum of the interface jump integrals (Interfacial Jump Integration, IJI) of all control body interfaces, and the IJI includes the derivatives of the initial polynomials of the two control bodies at the interface in each direction, and the derivatives in each direction are rotationally invariant;
[0009] Based on the target polynomial, determine a new average value of the fluid parameters, and return to the step of reconstructing the average values of the fluid parameters based on the finite volume method to obtain an initial polynomial with unknown coefficients until an iteration stop condition is met;
[0010] Based on the updated average value of the fluid parameters, the fluid flow in the fluid space to be simulated is simulated.
[0011] On the other hand, the coefficients of each order derivative in each direction in the IJI include geometric weights and / or derivative weights.
[0012] On the other hand, the geometric weight is:
[0013]
[0014] Where S is the area of the interface f, D f is the distance between the centers of the cells on both sides of the interface, and d is the dimension of the computational geometry.
[0015] In another aspect, the initial polynomial comprises:
[0016]
[0017] in, is the average value of the fluid parameter, are polynomial coefficients; N(k) is the number of polynomial coefficients, is the zero-mean basis function, and x is the coordinate.
[0018] On the other hand, in the two-dimensional case, the zero-mean basis function includes:
[0019]
[0020] δx i =(xx i ) / Δx i ;
[0021] δy i =(yy i ) / Δy i ;
[0022] Among them, p, q are the degrees of the basis functions, dΩ is the volume element, x i and i is the centroid coordinate of the control volume, Δx i and Δy i is the characteristic scale used to non-dimensionalize the basis function.
[0023] On the other hand, in the case where the fluid in the fluid space to be simulated is in steady flow, the iteration stop condition includes that the average value of the fluid parameter tends to be stable;
[0024] In the case where the fluid in the fluid space to be simulated is an unsteady flow, the iteration stop condition includes updating to a target time point.
[0025] On the other hand, an embodiment of the present application provides a fluid simulation device, the device comprising:
[0026] An acquisition module, used to acquire the average value of the fluid parameters inside each control body in the unstructured grid; the unstructured grid is generated based on the fluid space to be simulated;
[0027] A reconstruction module, used for reconstructing the average values of the fluid parameters based on the finite volume method to obtain an initial polynomial with unknown coefficients;
[0028] A determination module, used for determining the coefficient values of the initial polynomial to obtain the target polynomial when the target functional takes a minimum value; the target functional is the sum of the IJIs of all control body interfaces, and the IJI includes the derivatives of the initial polynomial of the two control bodies at the interface in each direction, and the derivatives in each direction are rotationally invariant;
[0029] The determination module is further used to determine a new average value of the fluid parameters based on the target polynomial, and return to the step of reconstructing the average values of the fluid parameters based on the finite volume method to obtain an initial polynomial with unknown coefficients until an iteration stop condition is met;
[0030] The simulation module is used to simulate the fluid flow in the fluid space to be simulated based on the updated average value of the fluid parameters.
[0031] In yet another aspect, an embodiment of the present application provides a fluid simulation device, the device comprising: a processor and a memory storing computer program instructions;
[0032] When the processor executes the computer program instructions, the fluid simulation method as described above is implemented.
[0033] On the other hand, an embodiment of the present application provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the fluid simulation method as described above is implemented.
[0034] On the other hand, an embodiment of the present application provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the fluid simulation method as described above.
[0035] The fluid simulation method provided in the embodiment of the present application generates an unstructured grid including multiple control bodies based on the fluid space to be simulated, and initializes the average value of the fluid parameters inside each control body. Then, based on the finite volume method, the average value of each fluid parameter is reconstructed to establish an initial polynomial with unknown coefficients. At this time, it is necessary to solve the polynomial coefficients, which is specifically realized by the target functional. The target functional is the sum of the IJI on the interface of all control bodies. The IJI includes the initial polynomials of the two control bodies at the junction. The derivatives in each direction have rotation invariance. When the target functional takes a minimum value, the coefficient values of the initial polynomial are determined to obtain the target polynomial; then based on the target polynomial, the average value of the fluid parameters is updated, and the steps of reconstructing the average value of each fluid parameter based on the finite volume method and establishing the initial polynomial with unknown coefficients are returned until the iteration stop condition is met. Finally, based on the updated average value of the fluid parameters, the fluid flow of the fluid space to be simulated is simulated. Through the functional, the present application can make the polynomials of each control body reconstructed smooth, so that the calculated flux accuracy is higher, and finally obtain the average value of the fluid parameters with higher accuracy to meet the actual needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0037] Figure 1 A schematic diagram of a flow chart of a fluid simulation method provided by an embodiment of the present application is shown;
[0038] Figure 2 This is a schematic diagram of the comparison of isentropic vortex calculation errors;
[0039] Figure 3 This is a partial schematic diagram of the grid for flow around a two-dimensional cylinder;
[0040] Figure 4 This is a schematic diagram of the vorticity distribution results of the fourth-order format for the two-dimensional flow around a cylinder;
[0041] Figure 5 This is a schematic diagram of the vorticity distribution results of the second-order format for the two-dimensional cylinder flow example;
[0042] Figure 6 It is a schematic diagram of the lift coefficient curve of the flow around a cylinder;
[0043] Figure 7 A schematic structural diagram of a fluid simulation device provided in an embodiment of the present application is shown;
[0044] Figure 8A schematic diagram of the hardware structure of the fluid simulation device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0045] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0046] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0047] In computer simulation of engineering fluids, the unstructured grid finite volume method is often used. The finite volume method ensures numerical conservation and is convenient for implanting complex flow control equations, such as turbulence patterns, chemical reaction equations, cavitation and discrete phases, and multiple flow media. It is widely used in the fields of aviation, automobiles, and chemical engineering. At the same time, in complex computational domains, mature algorithms can be used to quickly generate unstructured grids without complex manual intervention, so it can be used directly on general engineering models.
[0048] The widely used finite volume method currently uses second-order spatial discretization, which reconstructs the local distribution of physical variables by calculating a first-order polynomial within the unit. However, with more complex computational requirements, the spatial discretization accuracy of the second-order finite volume method cannot meet the requirements. As the grid is encrypted, the second-order finite volume method can generally only reduce the error quadratically. Therefore, in complex application scenarios, extremely fine grids are required, which can have a serious impact on computational efficiency.
[0049] For unstructured grids, existing high-order finite volume methods usually use k-Exact explicit least squares methods for reconstruction. In the calculation of large reconstruction templates, due to the uncertainty of template selection, slight changes in the grid may lead to sudden changes in the template range, resulting in sudden changes in the calculation results during grid deformation. At the boundary, the large template has to select more cells on the same side of the central cell, causing the template to be eccentric, greatly increasing the probability of reconstruction singularity. At the same time, since the geometric and topological information of more cells needs to be calculated, the large reconstruction template has a large amount of calculation; when performing regional decomposition parallel calculations, the large reconstruction template needs to transmit more information on the partition interface, which easily causes the inconsistency of parallel communication data structure and reduced communication efficiency.
[0050] In order to solve the problems of the traditional solution, the embodiment of the present application provides a fluid simulation method, device, equipment, medium and product. The fluid simulation method provided by the embodiment of the present application is first introduced below. Figure 1 FIG. 1 shows a flow chart of a fluid simulation method provided by an embodiment of the present application; Figure 1 As shown, the method comprises the following steps:
[0051] S101: Obtain the average value of the fluid parameters inside each control body in the unstructured grid.
[0052] Unstructured grids are generated based on the fluid space to be simulated. Unstructured grids are grids without regular topological relationships. Each element in the grid can be a two-dimensional polygon or a three-dimensional polyhedron, and there is no implicit connectivity between each element. Before performing spatial fluid simulation, it is necessary to generate a corresponding unstructured grid based on the fluid space to be simulated. The unstructured grid includes multiple control bodies (cells). The fluid in the fluid space to be simulated has corresponding fluid parameters, such as density, total energy, momentum or velocity, etc.
[0053] For S101, it can be any link in the iteration process, such as an artificially given initialization value. Specifically, when performing simulation, for the fluid parameters to be simulated, each control body is initialized, that is, each control body corresponds to an average value of the fluid parameters, and then the average value of the fluid parameters is continuously updated iteratively. The specific iteration method is to generate a k-order polynomial from the average value of the fluid parameters, and then obtain the flux from the polynomial, and then obtain a new average value of the fluid parameters.
[0054] S102: Based on the finite volume method, the average values of the fluid parameters are reconstructed to obtain an initial polynomial with unknown coefficients.
[0055] In the finite volume method, assuming that the numerical integration accuracy of surface elements and volume elements is sufficient, the reconstruction process determines the accuracy of spatial discretization, that is, the process of reconstructing high-order piecewise polynomial distribution through unit means. This application specifically adopts a variational reconstruction method.
[0056] The finite volume method is a widely used numerical method in computational fluid dynamics. It is based on conservation equations in integral form rather than differential equations. This method divides the computational domain into a series of non-repeating control volumes, with one control volume around each grid point. By dividing the differential equation to be solved for each control volume, a set of discrete equations is obtained. The discrete equations of the finite volume method require that the integral conservation of the dependent variable is satisfied for any set of control volumes, and naturally for the entire fluid space to be simulated.
[0057] The steps of the finite volume method include: 1. Divide the fluid space to be simulated into a grid and determine the location of each node and the volume of the node control volume. 2. Integrate the differential equation to be solved for each control volume to obtain a set of discrete equations. 3. Solve these discrete equations to obtain the value (average value) of the dependent variable at the grid point.
[0058] As mentioned above, each control volume corresponds to an average value of a fluid parameter, and then the average value of the fluid parameter needs to be continuously updated iteratively. The specific iteration method is to generate a k-order polynomial from the average value of the fluid parameter, and then obtain the flux from the polynomial, and then obtain a new average value of the fluid parameter. S102 is the process of generating a k-order polynomial from the average value of the fluid parameter.
[0059] S103: When the target functional takes a minimum value, determine the coefficient values of the initial polynomial to obtain the target polynomial.
[0060] For the target functional in S103, it is the sum of the IJI of all control volume interfaces. The IJI includes the derivatives of the initial polynomials of the two control volumes at the interface in all directions, and the derivatives in all directions are rotationally invariant. The smaller the IJI, the smaller the difference between the polynomials and their derivatives of the control volumes on both sides of the interface. The minimum value is taken to make the established polynomial smooth, and the target polynomial is obtained; and the functional uses the derivatives of all orders in all directions, and combines the derivatives in all directions into a special form that is rotationally invariant, to obtain a higher precision result.
[0061] S104: Based on the target polynomial, determine a new average value of the fluid parameters, and return to the step of reconstructing the average values of each fluid parameter based on the finite volume method to obtain an initial polynomial with unknown coefficients, until the iteration stop condition is met.
[0062] After solving the coefficients of the polynomial, the average value of the fluid parameters can be updated according to the target polynomial, and then the above steps are repeated until the iteration stop condition is met. The iteration stop condition can be set according to the actual situation. For example, when the fluid in the fluid space to be simulated is a steady flow, the iteration stop condition includes the average value of the fluid parameters tending to be stable; when the fluid in the fluid space to be simulated is an unsteady flow, the iteration stop condition includes updating to the target time point.
[0063] S105: Simulating the fluid flow in the fluid space to be simulated based on the updated average value of the fluid parameters.
[0064] Finally, based on the average value of the fluid parameters after the iteration stop condition is finally satisfied, the simulated flow of the fluid in the fluid space to be simulated can be completed.
[0065] The fluid simulation method provided in the embodiment of the present application generates an unstructured grid including multiple control bodies based on the fluid space to be simulated, and initializes the average value of the fluid parameters inside each control body. Then, based on the finite volume method, the average value of each fluid parameter is reconstructed to establish an initial polynomial with unknown coefficients. At this time, it is necessary to solve the polynomial coefficients, which is specifically realized by the target functional. The target functional is the sum of the IJI on the interface of all control bodies. The IJI includes the initial polynomials of the two control bodies at the junction in each direction. The derivatives in each direction have rotation invariance. When the target functional takes a minimum value, the coefficient values of the initial polynomial are determined to obtain the target polynomial; then based on the target polynomial, the average value of the fluid parameters is updated, and the steps of reconstructing the average value of each fluid parameter based on the finite volume method and establishing the initial polynomial with unknown coefficients are returned until the iteration stop condition is met. Finally, based on the updated average value of the fluid parameters, the fluid flow of the fluid space to be simulated is simulated. Through the functional, the present application can make the polynomials of each control body reconstructed smooth, so that the calculated flux accuracy is higher, and finally obtain the average value of the fluid parameters with higher accuracy to meet the actual needs.
[0066] The solution of the embodiment of the present application is described below in a specific implementation manner.
[0067] Assuming that the average value of the fluid parameters of all control volumes in the computational domain at the current moment is known (can be given artificially), the reconstruction algorithm needs to give a piecewise continuous k-order polynomial distribution of any component of the conserved variable in the computational domain, that is, in any control volume Ω i On the control volume Ω, use a k-degree polynomial to approximate u i Distribution in:
[0068]
[0069] Where: is the average value of fluid parameters, is the unknown polynomial coefficient, N(k) is the number of polynomial coefficients, for a two-dimensional problem For three-dimensional problems in Indicates the number of combinations; is a zero-mean basis function. Taking the two-dimensional case as an example, it can be defined as:
[0070]
[0071] Where: p, q are the degrees of the basis functions; dΩ is the volume element; x i and i is the centroid coordinate of the control volume; Δx i and Δy i is the characteristic scale used to non-dimensionalize the basis function. The non-dimensionalization of the basis function can overcome the problem that the condition number of the reconstruction matrix increases with the mesh encryption. The k-order polynomial is used for reconstruction, and the format can achieve k+1 order accuracy.
[0072] In fact, the variational reconstruction given in this scheme can use any complete polynomial basis function, and its dimensionless method is not limited to the above form. According to the above formula, a separate calculation module is compiled to handle the calculation of basis functions and partial derivatives of each order under any physical coordinates of each control body.
[0073] The dimensionless method given in this scheme adopts isotropic dimensionless method. Experiments show that in the calculation on the grid with extremely large aspect ratio, using Δx i =Δy i =R is the most stable, where R is the maximum distance from the control body node to the center.
[0074] In actual calculations, when calculating the interface flux, it is necessary to repeatedly obtain the basis function values at the interface integration points. Therefore, the basis functions of the interface integration points and all their partial derivatives can be stored in advance to reduce the amount of calculation.
[0075] Variational reconstruction is a general term for a class of high-precision reconstruction methods with compact templates. The principle of this type of reconstruction method is to define a functional, and the reconstruction relationship that needs to be determined just makes the functional take the minimum value. It is required that the functional reconstruction is based on a compact template and has the k-exact property. To meet this requirement, IJI can be defined on the interface between any two control bodies. That is, for a control body interface f, let the control bodies on the left and right sides be numbered L and R respectively, then the IJI definition on the interface f is (taking two dimensions as an example):
[0076]
[0077] Where: They are the geometric weight and derivative weight respectively. IJI is a measure of the difference in the distribution of the reconstructed polynomials and their derivatives of the control volumes on both sides of the grid interface. The smaller the IJI, the smaller the difference in the polynomials and their derivatives of the control volumes on both sides.
[0078] It can be seen that the coefficients of each order derivative in each direction in IJI include geometric weights and / or derivative weights. By corresponding weights, a proportional relationship is fixed, thereby improving the robustness and accuracy of the calculation. In addition, by combining partial derivatives in different directions through derivative weights, it can be made rotationally invariant.
[0079] The variational reconstruction functional I is the sum of the IJIs on the interfaces of all control volumes in the computational domain:
[0080]
[0081] Where: N f is the total number of control volume interfaces on the computational domain. In fact, when the average values of all control volumes are calculated by the same polynomial of degree not higher than k, and the reconstruction polynomial of each control volume is taken as this polynomial, I takes its minimum value 0. Therefore, this functional has the k-exact property, which can ensure the accuracy of reconstruction. Since I is a quadratic form of the vector u assembled with respect to the full-field reconstruction coefficients, its minimum problem is the linear problem of the normal equation. The obtained sparse linear equation system can be iteratively converged to obtain the reconstruction polynomial of the variational reconstruction.
[0082] In the implicit solution, the above-mentioned coefficient linear equations and the mean of the flow field are alternately iterated and converged synchronously, which can not only ensure the compactness of the reconstruction operation, but also obtain a high-order accurate polynomial distribution. It can be proved that compared with the traditional k-exact reconstruction, the variational reconstruction is non-singular, and there will be no additional singularity and loss of accuracy at the boundary. At the same time, the traditional k-exact reconstruction template is huge, while the variational reconstruction only needs the information of the compact template during the calculation process as long as the appropriate implicit iteration strategy is adopted, and it can be implanted without large-scale changes to the existing second-order finite volume program. At the same time, variational reconstruction is suitable for general unstructured grids and matches the mainstream fluid simulation software on the market. Therefore, variational reconstruction is a technical solution for improving fluid simulation software that can effectively improve accuracy, has high robustness and a relatively simple implementation framework.
[0083] In fact, the variational reconstruction of I f The definition of is not limited to the above form, as long as it is essentially the integral of the square of the jump size of the function value and the derivative value at each point, ensuring that the scalar I f is the reconstruction coefficient on both sides The quadratic function of is a variational reconstruction. fWhen all partial derivative components are applied, the non-singularity of the reconstruction problem is guaranteed.
[0084] This scheme uses functional weights with rotational invariance properties, where the two-dimensional derivative weights are:
[0085]
[0086] The corresponding three-dimensional is:
[0087]
[0088] If k=1, that is, second-order variational reconstruction, the following is used:
[0089] ω D (0) = ω D (1) = 1;
[0090] If k=2, that is, third-order variational reconstruction, use:
[0091] ω D (0) = 1, ω D (1)=0.4643,ω D (2) = 0.1559;
[0092] If k=3, that is, fourth-order variational reconstruction, we use:
[0093] ω D (0) = 1, ω D (1)=0.5295,ω D (2) = ω D (3) = 0.2117;
[0094] Mathematically, it can be proved that this set of derivative weights makes I f The size of has nothing to do with the orientation of the coordinate axes. Experiments have also shown that this set of derivative weights has good stability and accuracy in most cases.
[0095] The geometric weights in this scheme are adopted Where S is the area of the interface f, D f is the distance between the centers of the control volumes on both sides of the interface, and d is the dimension of the computational geometry.
[0096] After defining the functional, the program needs to calculate:
[0097]
[0098] The system of equations formed gives the following local linear equations:
[0099]
[0100] in:
[0101]
[0102] When designing the program, directly calculate the local reconstruction matrix and vector A i , b i , which constitute the local coefficients of the linear system.
[0103] The local reconstruction matrix and vector A are obtained in the program i , b i Then, the block-SOR iteration is used to solve the reconstruction coefficient u of each control volume i i .
[0104]
[0105] When designing a program, only persistent storage is performed after the mesh geometry is fixed. It is enough, there is no need to solve A every time i The local linear system is constructed. In the above formula, s is the number of iterations, and the relaxation factor ω is usually 1, which converges well on different grids.
[0106] The basic steps of using variational reconstruction in the finite volume procedure for compressible flows are explained below.
[0107] 1. Initialize the MPI environment and each process reads the pre-divided grid.
[0108] 2. Calculate the compact template S of the control volume i , for all control bodies i of each process, calculate S i For the neighboring control bodies that do not belong to this control body, the parallel communication structure is initialized and the grid information on all compact templates is obtained through communication.
[0109] 3. For all control volumes i in each process, calculate the geometric parameters, including volume, interface area, center point, and numerical integration points.
[0110] 4. Pre-calculate and store the basis functions and derivatives of each order of the interface integration points.
[0111] 5. According to the above A i , b i The formula is used to calculate each control volume i and j∈S i The reconstruction coefficient matrix and vector of It is obtained by SVD method to avoid the harm of numerical singularity.
[0112] 6. Initialize the control volume mean according to the initial conditions of the problem Reconstruction coefficient
[0113] 7. Time step step = 1, 2…step max cycle:
[0114] 7.1. Set the mean value of this step
[0115] 7.2. Calculate the time step size Δt according to the specific calculation strategy;
[0116] 7.3. Iteration step s = 1, 2…s max cycle;
[0117] 7.3.1. Update the reconstruction coefficient according to the following formula
[0118]
[0119] And according to the MPI communication structure, the reconstruction coefficients of the non-process control bodies on the compact template of each process are obtained
[0120] 7.3.2 Use The discrete residual of the finite volume method is calculated in combination with the specific time-marching format, and the residual of the non-process control volume on the compact template of each process is obtained according to the MPI communication structure.
[0121] 7.3.3. If the residual is small enough, exit the loop.
[0122] 7.3.34. Obtaining the mean increment according to a specific implicit solution strategy (such as LU-SGS iteration) And update the mean Then, the mean value of the non-process control volume on the compact template of each process is obtained according to the MPI communication structure.
[0123] 7.4. The control volume mean of the numerical solution of this step is
[0124] 7.5. Process result output, exit conditions, etc.
[0125] The finite volume method residual calculation, implicit solution, time marching format, etc. involved in this scheme can be implemented in the same way as the traditional second-order reconstruction algorithm.
[0126] According to the above parallel solution strategy, only the mean, residual and reconstruction coefficient are communicated during the iteration, and the communication structure is to obtain the value of the non-process on the compact template, and some communication-related data can be shared. The traditional high-order finite volume format needs to obtain the value of the entire reconstruction template when communicating the mean, and its communication structure is different from the communication structure of the residual and reconstruction coefficient. Compared with the traditional high-order finite volume format, the variational reconstruction of this scheme has a simple communication structure and smaller communication overhead when solving in parallel.
[0127] The embodiment of the present application aims to provide a practical technical solution, which constructs a high-precision finite volume program through a high-order precision variational reconstruction method, which can avoid the shortcomings of the traditional high-order finite volume method, simplify the program framework, and provide a high-efficiency and high-precision calculation solution for finite volume fluid simulation software. Compared with the traditional variational reconstruction finite volume method, the embodiment of the present application proposes a series of improved specific implementation plans, which can handle more complex unstructured grid inputs and have higher calculation efficiency.
[0128] The high-order variational reconstruction format specified in this application can achieve high accuracy, high robustness and high reliability in fluid simulation, reducing the requirements for grid density. Compared with traditional high-order methods, the high-order format of this application is more suitable for general unstructured grids, and has a compact template, simple implementation, higher computational efficiency and robustness, simple parallel implementation, simple communication, and easy application to large-scale calculations.
[0129] In addition, in practical applications, the specific conditions for stopping the iteration are not limited and can be set according to different situations. For example, when the fluid in the fluid space to be simulated is a steady flow, the condition for stopping the iteration may include that the average value of the fluid parameter tends to be stable. When the fluid in the fluid space to be simulated is an unsteady flow, the condition for stopping the iteration may include updating to a target time point.
[0130] The embodiment of the present application provides specific iterative stop conditions under two different situations, which can obtain the final stable average value of fluid parameters in steady flow, thereby realizing accurate fluid simulation. In unsteady flow, the average value of fluid parameters corresponding to the target time point can be obtained to obtain the result required at the target time.
[0131] Figure 2 This is a schematic diagram of the comparison of isentropic vortex calculation errors; Figure 2As shown in the figure, in the two-dimensional isentropic vortex example, the calculation errors of the traditional 2nd-order Gauss-Green formula reconstruction and the 4th-order variational reconstruction on different grids are compared. The calculation domain is the [0,10]×[0,10] area, divided into square grids. The calculation is to physical time 0.2. The calculation error of the 4th-order variational reconstruction in the figure is significantly lower than that of the 2nd-order format after the mesh is encrypted. The calculation error of the 4th-order format is less than one percent of the 2nd-order format on the same grid after the mesh is encrypted. At the same time, in terms of calculation time, the 4th-order format is about 3 times that of the 2nd-order format on the same grid.
[0132] Figure 3 is a local schematic diagram of the two-dimensional flow grid around a cylinder; Figure 3 As shown, the local grid is displayed. A hybrid unstructured grid is used in the simulation to improve the resolution of the wake vortex street. Figure 4 This is a schematic diagram of the vorticity distribution results of the fourth-order format for the two-dimensional flow around a cylinder; Figure 5 This is a schematic diagram of the vorticity distribution results of the second-order format for the two-dimensional cylinder flow example; Figure 4 and Figure 5 As shown in the figure, the results of the two-dimensional cylinder flow example are given, with a Mach number of 0.15, a Reynolds number of 100, and the initial conditions are all fully developed vortex shedding flow fields. The solution is solved with a time step of 0.025, and the time advancement format is ESDIRK4. In the simulation, the vorticity distribution of the 4th order format is significantly different from that of the 2nd order format. The numerical dissipation of the 2nd order format is large, and the vorticity decay in the wake is significantly faster. In this calculation, 64 cores are used in parallel. Due to the large calculation scale and the extra parallel overhead, the time consumption of the 4th order format is only about 160% of that of the 2nd order.
[0133] Figure 6 is a schematic diagram of the lift coefficient curve for flow around a cylinder; Figure 6 As shown in the figure, there are differences in the lift coefficient curves of the 4th-order and 2nd-order formats in the above-mentioned 2D cylinder flow example. According to the experiment, the peak value of the lift coefficient is 0.320, and the Strouhal number (dimensionless frequency) is 0.168. The peak value of the lift coefficient of the 4th-order format is about 0.322, with an error of less than 1%; the Strouhal number is 0.163, with an error of about 3%. The peak value of the lift coefficient of the 2nd-order format is about 0.282, with an error of more than 10%; the Strouhal number is 0.158, with an error of more than 6%.
[0134] Compared with the 4th order format, the 2nd order format has a smaller lift coefficient peak, a lower frequency, and a larger error. The 4th order format gives a more accurate result at the cost of a longer calculation time on the same grid.
[0135] In order to solve the above technical problems, the present application also provides a fluid simulation device. Figure 7 Schematic diagram of the structure of the fluid simulation device provided in the embodiment of the present application is shown; Figure 7 As shown, the device includes the following modules:
[0136] An acquisition module 701 is used to acquire the average value of the fluid parameters inside each control body in the unstructured grid; the unstructured grid is generated based on the fluid space to be simulated;
[0137] A reconstruction module 702 is used to reconstruct the average values of each fluid parameter based on the finite volume method to obtain an initial polynomial with unknown coefficients;
[0138] The determination module 703 is used to determine the coefficient values of the initial polynomial when the target functional takes a minimum value, so as to obtain the target polynomial; the target functional is the sum of the IJIs of all control volume interfaces, and the IJI includes the derivatives of the initial polynomials of the two control volumes at the interface in each direction, and the derivatives in each direction are rotationally invariant;
[0139] The determination module 703 is further used to determine a new average value of the fluid parameters based on the target polynomial, and return to the step of reconstructing the average values of each fluid parameter based on the finite volume method to obtain an initial polynomial with unknown coefficients until the iteration stop condition is met;
[0140] The simulation module 704 is used to simulate the fluid flow in the fluid space to be simulated based on the updated average value of the fluid parameters.
[0141] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.
[0142] The fluid simulation device provided in the embodiment of the present application corresponds to the fluid simulation method in the above embodiment, and both have the same beneficial effects, which will not be described in detail here.
[0143] Figure 8 FIG. 1 shows a schematic diagram of the hardware structure of the fluid simulation device provided in the embodiment of the present application; Figure 8 As shown, the fluid simulation device may include a processor 801 and a memory 802 storing computer program instructions.
[0144] Specifically, the processor 801 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0145] The memory 802 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 802 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 802 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 802 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 802 is a non-volatile solid-state memory.
[0146] The memory 802 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage media device, an optical storage media device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0147] The processor 801 implements any one of the fluid simulation methods in the above embodiments by reading and executing computer program instructions stored in the memory 802 .
[0148] In one example, the fluid simulation device may further include a communication interface 803 and a bus 804. The processor 801, the memory 802, and the communication interface 803 are connected via the bus 804 and communicate with each other.
[0149] The communication interface 803 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0150] Bus 804 includes hardware, software or both, and the parts of fluid simulation device are coupled to each other.For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In suitable cases, bus 804 may include one or more buses. Although the present application embodiment describes and shows specific bus, the application considers any suitable bus or interconnection.
[0151] In addition, in combination with the fluid simulation method in the above embodiment, the embodiment of the present application can provide a computer storage medium to implement. The computer storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the fluid simulation methods in the above embodiment is implemented.
[0152] An embodiment of the present application also provides a computer program product, including a computer program, which implements any one of the fluid simulation methods in the above embodiments when the computer program is processed and executed.
[0153] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0154] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0155] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0156] The above reference is to the flow chart and / or block diagram of the fluid simulation method, device, equipment, medium and product according to the embodiment of the present disclosure, and describes various aspects of the present disclosure. It should be understood that each box in the flow chart and / or block diagram and the combination of each box in the flow chart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flow chart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flow chart and the combination of boxes in the block diagram and / or flow chart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0157] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A fluid simulation method, characterized in that: include: Obtain the average value of fluid parameters inside each control volume in the unstructured grid; The unstructured grid is generated based on the fluid space to be simulated; Based on the finite volume method, the average values of the fluid parameters are reconstructed to obtain an initial polynomial with unknown coefficients; When the target functional takes a minimum value, the coefficient values of the initial polynomial are determined to obtain the target polynomial; the target functional is the sum of the interface jump integrals of all control body interfaces, and the interface jump integral includes the derivatives of the initial polynomials of the two control bodies at the interface in each direction, and the derivatives in each direction are rotationally invariant; Based on the target polynomial, determine a new average value of the fluid parameters, and return to the step of reconstructing the average values of the fluid parameters based on the finite volume method to obtain an initial polynomial with unknown coefficients until an iteration stop condition is met; Based on the updated average value of the fluid parameters, the fluid flow in the fluid space to be simulated is simulated.
2. The fluid simulation method according to claim 1, characterized in that: The coefficients of the derivatives of various orders in various directions in the interface hopping integral include geometric weights and / or derivative weights.
3. The fluid simulation method according to claim 2, characterized in that: The geometric weight is: Where S is the area of the interface f, D f is the distance between the centers of the cells on both sides of the interface, and d is the dimension of the computational geometry.
4. The fluid simulation method according to any one of claims 1 to 3, characterized in that: The initial polynomial includes: in, is the average value of the fluid parameter, are polynomial coefficients; N(k) is the number of polynomial coefficients, is the zero-mean basis function, and x is the coordinate.
5. The fluid simulation method according to claim 4, characterized in that: In the two-dimensional case, the zero-mean basis functions include: δx i =(xx i ) / Δx i ; δy i =(yy i ) / Δy i ; Among them, p, q are the degrees of the basis functions, dΩ is the volume element, x i and i is the centroid coordinate of the control volume, Δx i and Δy i is the characteristic scale used to non-dimensionalize the basis function.
6. The fluid simulation method according to claim 1, characterized in that: In the case where the fluid in the fluid space to be simulated is in steady flow, the iteration stop condition includes that the average value of the fluid parameter tends to be stable; In the case where the fluid in the fluid space to be simulated is an unsteady flow, the iteration stop condition includes updating to a target time point.
7. A fluid simulation device, characterized in that: The device comprises: An acquisition module, used to acquire the average value of the fluid parameters inside each control body in the unstructured grid; the unstructured grid is generated based on the fluid space to be simulated; A reconstruction module, used for reconstructing the average values of the fluid parameters based on the finite volume method to obtain an initial polynomial with unknown coefficients; A determination module, used for determining the coefficient values of the initial polynomial to obtain the target polynomial when the target functional takes a minimum value; the target functional is the sum of the interface jump integrals of all control body interfaces, and the interface jump integral includes the derivatives of the initial polynomial of the two control bodies at the interface in each direction, and the derivatives in each direction are rotationally invariant; The determination module is further used to determine a new average value of the fluid parameters based on the target polynomial, and return to the step of reconstructing the average values of the fluid parameters based on the finite volume method to obtain an initial polynomial with unknown coefficients until an iteration stop condition is met; The simulation module is used to simulate the fluid flow in the fluid space to be simulated based on the updated average value of the fluid parameters.
8. A fluid simulation device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the fluid simulation method according to any one of claims 1 to 7 is implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the fluid simulation method according to any one of claims 1 to 7 is implemented.
10. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the fluid simulation method as described in any one of claims 1 to 7.
Citation Information
Cited By
Method and device for determining flow surface parameters of runner blade, electronic equipment and blade
CN120124511A
Method, device, electronic equipment and blade for determining flow surface parameters of runner blade
CN120124511B
