Method, device, equipment and storage medium for generating state parameters of fluid model
By processing the coefficient matrix and residual vector of the fluid model in a preset small-dimensional subspace, the target state parameters of the fluid model are generated, which solves the problem of long time in generating the state parameters of the fluid model and achieves faster analysis and prediction.
Patent Information
- Application Number
- CN202311011806.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-11
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2043-08-11
AI Technical Summary
In the existing technology, the calculation and generation time of fluid model state parameters is long, which affects the timeliness of fluid state data analysis and prediction, especially when the grid unit scale is large and the number of iterative calculations is large.
By obtaining the first coefficient matrix and the first residual vector of the fluid model, performing specified preprocessing to reduce the matrix condition number, and then determining the subspace coefficient vector and basis vector based on the second coefficient matrix and the second residual vector in a subspace of a preset small dimension, the target state parameters of the fluid model are generated.
It reduces the time for generating state parameters, improves the timeliness of fluid state analysis and prediction, and maintains computational stability when the grid size increases.
Smart Images

Figure CN119476068B_ABST
Abstract
Description
Technical Field
[0001] The embodiments in this specification relate to the field of fluid simulation, and specifically to a method, apparatus, device, and storage medium for generating state parameters of a fluid model. Background Art
[0002] By simulating the state changes of fluids under various complex situations, we can better understand the complex physical phenomena from fluid dynamics and thermodynamics, and predict the movement and change process of fluids in various application scenarios such as engineering, manufacturing, climate, and energy, thereby providing data support for related product development, risk assessment and other activities.
[0003] At present, the simulation of fluid state is mainly based on computer simulation technology. By constructing a fluid model and dividing it into discrete grid units, calculations are then performed based on the problems and needs in the actual application scenario, and the relevant state parameters of the fluid model are generated to represent the state of the simulated fluid.
[0004] However, in related technologies, the calculation and generation of fluid model state parameters involve a large number of grid units, so it takes a long time, which to some extent affects the timeliness of predicting related problems based on simulated fluid state data. Summary of the Invention
[0005] In view of this, multiple embodiments of this specification are dedicated to providing a method, device, equipment and storage medium for generating state parameters of a fluid model, which can reduce the time for calculating and generating the state parameters of the fluid model, so as to improve the timeliness of analyzing and predicting related problems based on simulated fluid state data to a certain extent.
[0006] Multiple embodiments in this specification provide a method for generating state parameters of a fluid model. The fluid model is used to simulate the state change of the fluid over time, and the fluid model is divided into multiple grid units; the method includes: obtaining a first coefficient matrix and a first residual vector of the fluid model; wherein the first coefficient matrix includes a set of coefficients obtained based on the state parameters of the multiple grid units at the previous moment of a specified moment; the first residual vector includes a set of residual quantities obtained based on the state parameters of the multiple grid units at the previous moment of a specified moment; performing a specified preprocessing operation on the first coefficient matrix and the first residual vector to obtain a second coefficient matrix and a second residual vector; the specified preprocessing operation is used to reduce the matrix condition number; within a preset subspace, based on the second coefficient matrix and the second residual vector, determining a subspace coefficient vector and a set of basis vectors of the preset subspace; wherein the dimension of the preset subspace is smaller than the dimension of the first residual vector; generating the target state parameters of the fluid model at the specified moment according to the subspace coefficient vector and a set of basis vectors of the preset subspace.
[0007] One embodiment of the present specification provides a state parameter generation device for a fluid model. The fluid model is used to simulate the state change of a fluid over time, and the fluid model is divided into a plurality of grid units; the device includes: an acquisition module for acquiring a first coefficient matrix and a first residual vector of the fluid model; wherein the first coefficient matrix includes a coefficient set obtained based on the state parameters of the plurality of grid units at a moment before a specified moment; the first residual vector includes a residual set obtained based on the state parameters of the plurality of grid units at a moment before a specified moment; a preprocessing module for performing a specified preprocessing operation on the first coefficient matrix and the first residual vector to obtain a second coefficient matrix and a second residual vector; the specified preprocessing operation is used to reduce the matrix condition number; a determination module for determining, within a preset subspace, a subspace coefficient vector and a set of basis vectors of the preset subspace based on the second coefficient matrix and the second residual vector; wherein the dimension of the preset subspace is smaller than the dimension of the first residual vector; and a generation module for generating the target state parameter of the fluid model at a specified moment based on the subspace coefficient vector and the set of basis vectors of the preset subspace.
[0008] The embodiments of this specification provide a computer device including a memory and a processor. The memory stores a computer program, and the processor implements the method described in the above embodiments when executing the computer program.
[0009] The embodiments of this specification provide a computer-readable storage medium having computer program instructions stored thereon. When the program is executed by a processor, the method described in the above embodiments is implemented.
[0010] The multiple implementation methods provided in this specification obtain the first coefficient matrix and the first residual vector of the multiple grid units at the specified moment based on the state parameters of the multiple grid units of the fluid model at the moment before the specified moment, and then obtain the second coefficient matrix and the second residual vector after performing a specified preprocessing operation that can reduce the matrix condition number on the first coefficient matrix and the first residual vector. Then, in a subspace of a preset small dimension, the subspace coefficient vector and a group of basis vectors of the subspace are determined according to the second coefficient matrix and the second residual vector, and then the target state parameters of the fluid model at the specified moment are generated according to the subspace coefficient vector and the group of basis vectors. By mapping the matrix formed by the set of state parameters to be generated to a preset subspace of a smaller dimension for calculation, the number of iterative calculations required is reduced, thereby reducing the time for generating state parameters, and to a certain extent, improving the timeliness of analysis or prediction based on the simulated fluid state. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 A schematic diagram of a method for generating state parameters of a fluid model provided in one embodiment of this specification.
[0012] Figure 2 A schematic diagram of a device for generating state parameters of a fluid model provided in one embodiment of this specification.
[0013] Figure 3 A schematic diagram of a computer device provided for one embodiment of this specification. DETAILED DESCRIPTION
[0014] The simulation of fluid states plays a very important role in engineering, manufacturing, climate forecasting, urban planning, energy development and other fields. By simulating the state change process of fluids in different problem scenarios, it can help developers or researchers better understand the complex physical phenomena and their interactions from fluid dynamics and thermodynamics, such as heat transfer, flow field changes, etc., and then predict the behavior of fluids in these problem scenarios, and provide support and assistance for related product development, risk analysis and assessment activities. For example, through fluid state simulation, the movement state of products under different stress, temperature and other environments can be analyzed and predicted, so as to better carry out the design, evaluation and optimization of large-scale transportation products such as ships and aircraft; for example, through fluid state simulation, data support can be provided for research on climate change, sea-air interaction and other aspects, thereby providing a basis for predicting weather and climate change.
[0015] Currently, fluid state simulation is typically achieved through computer simulation technology. This involves constructing a fluid model and dividing it into discrete grid cells. This is then calculated and the state parameters are generated based on the specific scenario's problems and requirements. For example, computational fluid dynamics (CFD) is a method that uses discretization and numerical methods to simulate and predict the changes in various physical quantities in fluids.
[0016] In the process of simulating fluid motion by computer technology, for example, in the process of using CFD simulation, it is necessary to calculate the state parameters of the constructed fluid model at all times from the initial state to the stable state. The state parameters at each moment need to be calculated based on the linear relationship between the coefficient matrix and residual matrix of each grid unit obtained based on the state parameters of the previous moment and the state parameters of that moment. It can be seen that when the scale of the divided grid units is large, the calculation of the state parameters at each moment will be more complicated. In the related art, some classic iterative methods are usually used to calculate and generate the state parameters at each moment. However, when the scale of the grid units is large, the number of iterative calculations required is large, and the time required to generate the state parameters of the fluid model is long, which to a certain extent affects the timeliness of analysis or prediction based on the simulated fluid state.
[0017] Therefore, it is necessary to provide a method for generating state parameters of a fluid model, which can obtain the first coefficient matrix and the first residual vector of the multiple grid units at a specified moment based on the state parameters of the multiple grid units of the fluid model at a moment before the specified moment, and then obtain the second coefficient matrix and the second residual vector after performing a specified preprocessing operation that can reduce the matrix condition number on the first coefficient matrix and the first residual vector, and then determine the subspace coefficient vector and a group of basis vectors of the subspace in a preset small-dimensional subspace according to the second coefficient matrix and the second residual vector, and then generate the target state parameters of the fluid model at the specified moment according to the subspace coefficient vector and the group of basis vectors. The method for generating state parameters of a fluid model provided in the embodiment of this specification reduces the number of iterative calculations required by mapping the matrix formed by the set of state parameters to be generated to a preset subspace of smaller dimension for calculation, thereby reducing the time required to generate state parameters and, to a certain extent, improving the timeliness of analysis or prediction based on simulated fluid states. Moreover, since the state parameter generation method of the fluid model provided in the embodiment of this specification performs calculations by mapping the matrix formed by the set of state parameters to be generated to a preset fixed-dimensional subspace, the number of required iterative calculations will not fluctuate significantly when the scale of the fluid model grid increases, thereby enhancing the stability of the time required to generate the state parameters to a certain extent, thereby improving the timeliness of analysis or prediction based on the simulated fluid state.
[0018] See also Figure 1 One embodiment of the present specification provides a method for generating state parameters of a fluid model. The fluid model is used to simulate the state changes of a fluid over time, and the fluid model is divided into a plurality of grid units.
[0019] Fluid models can be used to simulate the motion behavior of fluids in different scenarios. By simulating the state changes of a fluid over time, a fluid model can reflect the motion patterns and behavioral characteristics of the fluid. A fluid model can be a mathematical model used to describe the motion behavior of a fluid. Fluid models can be appropriately defined and abstracted based on the problem requirements and the nature of the solution. Different models can include different assumptions and conditions. For example, fields such as oceanography, atmosphere, and hydrology use different fluid models to solve different problems. Specifically, a fluid model can describe fluid motion as a mathematical equation using physical equations (such as the Euler equations and the Navier-Stokes equations). By solving these equations, relevant state parameters such as the fluid's temperature, velocity, and pressure can be obtained, facilitating the prediction, design, and optimization of fluid behavior. Specifically, in practical applications, based on the fluid model, numerical methods can be used to simulate the fluid's motion process, generating simulation results for further analysis and application. For example, when using CFD technology to simulate fluid states, the CFD solver needs to integrate the partial derivative equations over time. Therefore, it is necessary to iterate using time increments to calculate small changes in the fluid system and stop when the system becomes stable.
[0020] The state parameters of a fluid model can be used to represent the state of the simulated fluid at a certain moment. The state parameters can include physical quantities used to describe the state of the simulated fluid. Specifically, for example, the state parameters can include physical quantities such as density, temperature, pressure, velocity, and energy.
[0021] Grid cells can be obtained by dividing the fluid model according to the motion area of the simulated fluid. The grid cell can be understood as a discrete representation of the spatial continuous domain of the fluid problem to be solved. Each spatial point can be considered as a node, and a grid cell can be defined by the volume bounded by a group of adjacent nodes. The division of the grid cells can be selected according to the specific division method of the problem. Specifically, for example, the grid cells can be divided based on the finite volume method (FVM), or other methods such as the adaptive grid division method can be used to divide the grid cells.
[0022] In the FVM method, the numerical grid is divided into multiple grid cells, the local volume associated with each grid cell is considered, and the integral conservation law is applied. This law states that the changes in all variables of the fluid within the volume depend only on the flux F on its surface S. The FVM can satisfy the conservation properties of the fluid dynamics equations. The conservation equation can be written as follows:
[0023]
[0024] After the spatially continuous domain is discretized using mesh elements, the mathematical operators of the equations to be solved also need to be discretized. This approximation of the equations can be achieved through numerical schemes. Two types of numerical schemes can be considered: time-integrated and spatial. Time-integrated schemes model the time integral of the variables to be solved, starting from the initial state of the fluid, while spatial schemes represent the spatial gradients of these variables to be solved.
[0025] Furthermore, based on the above discretization numerical scheme and solution, the numerical grid of space can be solved. In the discretization representation of Formula 1, the differential operation is replaced by numerical approximation, and the implicit Euler format is selected to handle the time differential. Formula 1 is discretized into the following expression:
[0026]
[0027] Among them, U n Indicates the fluid state of all grid cells at the nth moment (i.e., the nth integration), U n ={U i},i=0,1,2...,N-1,U i =(ρ,ρu,ρv,E) i , U i represents the fluid state of the i-th grid cell, ρ represents the fluid density, u and v represent the two components of the fluid velocity in two-dimensional coordinates, E represents the total energy per unit mass of fluid, b n+1 (U n+1 ) represents the residual at the n+1th moment, and it is the same as U n Related functions.
[0028] Let ΔU n =U n+1 -U n ,So:
[0029]
[0030] Substituting Equation 3 into Equation 2 yields:
[0031]
[0032] Among them, δ i,i' δ j,j' Represents parameters related to the coordinate information of the grid cells.
[0033] make Then Formula 4 can be equivalent to the following form:
[0034] A(U n )ΔU n =-b n (Un )...Formula 5
[0035] Among them, A(U n ) represents the coefficient matrix at the nth moment, that is, the Jacobian matrix at the nth moment, and the coefficient matrix is n Related functions, b n (U n ) represents the residual at the nth moment. In this way, in order to calculate the state parameters of the simulated fluid when it is in a stable state, it can be transformed into a linear system A(U n )ΔU n =-b n (U n ) is an iterative calculation problem. When N grid units are divided and there is only one physical state to be solved, A(U n ) can be an N×N matrix, ΔU n It can be an N×1 column vector. When N grid cells are divided and there are 4 physical states to be solved, A(U n ) can be a 4N×4N matrix, ΔU n It can be a 4N×1 column vector. It can be understood that the dimension of the above linear system is related to the number of physical states to be solved. Specifically, the greater the number of physical states to be solved, the larger the scale of the above linear system. Specifically, during the calculation process, the initial state parameters U of each grid unit can be obtained. 0 , calculate A 0 and b 0 , then we can calculate U 1 , then you can use U 1 Calculate U 2 , continue iterative calculation, when b n (U n ) approaches the preset accuracy, it means that the modulus of the vector formed by the difference between the state parameters of the simulated fluid at the n+1th moment and the nth moment tends to the preset accuracy. The preset accuracy can be a value close to 0, such as 1e-4, 1e-6, etc. At this time, it further means that the state change between the n+1th moment and the nth moment tends to 0, and the state parameter at the n+1th moment can be used to represent the stable state of the simulated fluid.
[0036] It can be seen that in the process of solving a linear system with 4 physical states to be solved, each iterative solution process needs to solve a linear equation group with a dimension of 4N×4N. For a solution process, some classical methods are usually used for iterative calculation and solution. When this type of method is iterated, generally speaking, the number of iterations will increase with the increase of the dimension of the linear system. However, in some cases, the grid unit scale of the fluid model is relatively large. Accordingly, it is very complicated to use this type of method for iterative calculation, the number of iterations is large, and the time required is long, which affects the timeliness of generating state parameters. The implementation method of this specification reduces the number of iterative calculations required by mapping the matrix formed by the set of state parameters to be generated to a preset subspace of smaller dimension for calculation, thereby reducing the time required to generate state parameters, and thus improving the timeliness of analysis or prediction based on the simulated fluid state.
[0037] In this embodiment, the method for generating state parameters of the fluid model may include the following steps.
[0038] Step S110: Obtain a first coefficient matrix and a first residual vector of the fluid model; wherein the first coefficient matrix includes a set of coefficients obtained based on the state parameters of the multiple grid units at the previous moment of the specified moment; and the first residual vector includes a set of residual quantities obtained based on the state parameters of the multiple grid units at the previous moment of the specified moment.
[0039] In this embodiment, the first coefficient matrix of the fluid model can be understood as A(U n ), the first coefficient matrix can represent the state parameters of each grid unit at the nth moment (i.e., U in Formula 5 n ) The related Jacobian matrix can be calculated based on U n With grid coordinate information according to The first residual vector of the fluid model can be understood as b in formula 5 n (U n ), the first residual vector can represent a set of residual quantities related to the state parameters of each grid unit at the nth moment, and can be calculated based on a functional relationship between the first residual vector and the state parameters of each grid unit at the nth moment. By obtaining the first coefficient matrix and the first residual vector of the fluid model, the first coefficient matrix and the first residual vector can be used as known quantities and calculated according to Formula 5 to obtain the state parameters of the fluid model at the n+1th moment.
[0040] In this embodiment, the designated moment can be used as a time reference for obtaining the first coefficient matrix and the first residual vector of the fluid model, and can further be used as a time reference for generating the target state parameters of the fluid model. Specifically, in order to simulate the change of fluid state, in the time integration scheme, the moment when the fluid is in the initial state can be used as the initial moment, and integral modeling can be performed from the initial moment. According to the above derivation, the state parameters at each moment can satisfy the equation shown in Formula 5. In this way, starting from the initial moment, in chronological order to the n+1 moment, each moment in between can be used as a designated moment, that is, as the time reference for the method of generating the state parameters of the fluid model. For example, the designated moment can include the initial moment, or the moment after the initial moment, and of course, it can also include the nth moment, or the n+1 moment.
[0041] In this embodiment, obtaining the first coefficient matrix and the first residual vector can directly obtain the results calculated by the fluid model based on the state parameters at the moment before the specified moment, so as to be used to solve the target state parameters at the specified moment according to Formula 5. Specifically, for example, if the specified moment is moment n, the first coefficient matrix and the first residual vector calculated based on the functional relationship satisfied by the state parameters at moment n-1 and the first coefficient matrix and the first residual vector, respectively, can be directly obtained to be used to solve the target state parameters at moment n according to Formula 5.
[0042] In some embodiments, the first coefficient matrix and the first residual vector may be obtained by receiving data regarding the first coefficient matrix and the first residual vector from another application or device, or by a user inputting calculation results into a model. This specification does not specifically limit the method for obtaining the first coefficient matrix and the first residual vector.
[0043] Step S120: performing a specified preprocessing operation on the first coefficient matrix and the first residual vector to obtain a second coefficient matrix and a second residual vector; the specified preprocessing operation is used to reduce the matrix condition number.
[0044] In some cases, since the grid cells are usually large in scale, it can be understood that the linear equation system composed of the first coefficient matrix and the first residual vector, as shown in Formula 5, is also large in scale. In order to solve the target state parameters, when performing iterative calculations on such a large-scale linear equation system, the accuracy and stability of the calculation may be affected due to the large matrix condition number, thereby increasing the number of iterations required and reducing the time required to solve the target state parameters. By performing a specified preprocessing operation on the first coefficient matrix and the first residual vector to reduce the matrix condition number, and then performing iterative calculations based on the second coefficient matrix and the second residual vector obtained after the preprocessing, the influence of errors or disturbances on the solution results can be reduced during the calculation, the calculation accuracy and stability can be improved, and the number of iterations can be reduced to increase the speed of generating the target state parameters.
[0045] In this embodiment, the specified preprocessing operation can be used to reduce the matrix condition number to improve the accuracy and stability of the calculation of the linear equation system. The specified preprocessing operation can include dividing each row of the first coefficient matrix and the first residual vector by the main diagonal elements of the first coefficient matrix.
[0046] In some embodiments, the specified preprocessing operation may also include using a matrix preprocessing method such as a matrix decomposition method, by converting the original matrix into a preprocessing matrix through a certain mathematical transformation.
[0047] Step S130: Within a preset subspace, based on the second coefficient matrix and the second residual vector, determine a subspace coefficient vector and a set of basis vectors of the preset subspace; wherein the dimension of the preset subspace is smaller than the dimension of the first residual vector.
[0048] In some cases, when calculating a linear system of equations such as that shown in Formula 5, some classic iterative methods are usually used for direct calculation. However, when the grid unit size is large, such calculation methods require more iterations, which not only takes a long time to calculate, but may also be limited by storage and computing resources, resulting in a slow speed in solving the target state parameters, affecting the timeliness of subsequent analysis and prediction activities. By using a subspace algorithm to map a linear system of equations with a larger dimension to a subspace of smaller dimension for solution, the problem of solving a large-scale linear system of equations can be transformed into a problem of searching for an approximate solution that meets the accuracy in the subspace, reducing the complexity of the problem and the number of iterations required for solving it, thereby reducing the time required for calculation and improving the speed of generating the target state parameters.
[0049] In this embodiment, the subspace coefficient vector can be used as a vector to be solved in the linear equation system of smaller dimensions obtained by mapping the large-dimensional linear equation system shown in Formula 5 to a preset subspace. Specifically, for example, the large-dimensional linear equation system can be mapped to a Krylov subspace, and the best approximate solution of its analytical solution can be found in the subspace. For linear problems such as Ax=b in Formula 5, where A is a non-singular full-rank n-dimensional matrix. Given an initial solution x0, there is an initial residual r0=b-Ax0. Then, is the m-order Krylov subspace of the matrix A and the initial residual r0. Assume v1,v2,......v m yes A set of basis vectors, then Any vector x can be expressed as: x=y1v1+y2v2+......+y m v m =V m y m , where y m =[y1,y2,......,y m ] T is the linear coefficient, V m =[v1,v2,......v m ] including the A set of basis vectors. It can be understood that Find the best approximate solution x in (m) The problem can be transformed into: finding a set of suitable basis vectors v1, v2, ... v m , and solve for x (m) The linear expression coefficient y under this set of basis vectors m The set of basis vectors V m =[v1,v2,......v m ] can be understood as a set of basis vectors of the preset subspace determined in this embodiment, and the set of basis vectors V m =[v1,v2,......v m ] can be a set of standard orthogonal bases, which can be obtained by pairing {r0,Ar0,A 2 r0,…,A m-1 r0} is obtained by unit orthogonalization. m It can be understood as the subspace coefficient vector determined in this embodiment, y mIt can be solved based on the relationship between it and an upper Hessenberg matrix determined in the process of determining the standard orthogonal basis. In this embodiment, the dimension of the subspace can be preset according to the requirements of the problem or accuracy, and the dimension can be smaller than the dimension of the first residual vector, that is, the dimension of the solution space of the target state parameter to be determined. The dimension of the preset subspace can be a fixed value so that the number of iterations required for the calculation is not easily affected by the increase in the size of the grid unit and is kept at a small number. Specifically, for example, the subspace The dimension m can be set to 20, 30, or other values.
[0050] Step S140: generating target state parameters of the fluid model at a specified time according to the subspace coefficient vector and a set of basis vectors of the preset subspace.
[0051] In this embodiment, after determining a set of basis vectors and subspace coefficient vectors of the preset subspace, the best approximate solution in the preset subspace can be calculated, and the target state parameters at a specified time can be generated based on the best approximate solution. Specifically, for example, for the linear problem shown in Formula 5, based on the subspace coefficient vectors determined in the above steps and a set of basis vectors of the preset subspace, ΔU is calculated. n The best approximate solution of ΔU n =U n+1 -U n By calculating the best approximate solution and adding the state parameter matrix at the previous moment, the target state parameter matrix at the specified moment can be generated.
[0052] In some embodiments, the number of rows of the first coefficient matrix is the same as the number of rows of the first residual vector, and the multiple rows included in the first coefficient matrix correspond one-to-one to the multiple rows included in the first residual vector; each row of the first coefficient matrix includes a specified element located on the main diagonal of the first coefficient matrix; the step of performing preprocessing operations on the first coefficient matrix and the first residual vector to obtain the second coefficient matrix and the second residual vector includes: dividing each element in the first coefficient matrix by the specified element in the row where the element is located, and the result forms the second coefficient matrix; dividing each element in the first residual vector by the specified element in the corresponding row of the first coefficient matrix corresponding to the row where the element is located, and the result forms the second residual vector.
[0053] In this embodiment, the first coefficient matrix can be an n-order square matrix, and the target state parameters of each grid unit to be determined can be an n×1 column vector. According to the linear relationship shown in Formula 5 satisfied between the first residual vector and the first coefficient matrix and the target state parameter matrix to be determined, the first residual vector can also be an n×1 column vector to represent the residual amount of the state parameter of each grid unit.
[0054] In this embodiment, each row of the first coefficient matrix may include a designated element located on the main diagonal of the first coefficient matrix. The designated element may be used to perform a preprocessing operation on the first coefficient matrix and the first residual vector. Specifically, for example, for an n-order square matrix A, the designated element may include A 11 , A 22 ,...A ij,(i=j) .
[0055] In this embodiment, the preprocessing operation includes dividing each element in the first coefficient matrix by a specified element in the row where the element is located, and the result is formed into the second coefficient matrix. Specifically, for example, for a first coefficient matrix The preprocessing operation can be to divide the elements in the first row of the matrix by 1, the elements in the second row by 3, and the elements in the third row by 2. The second coefficient matrix obtained can be
[0056] In this embodiment, the preprocessing operation further includes dividing each element in the first residual vector by the specified element in the corresponding row of the first coefficient matrix corresponding to the row where the element is located, and the result is formed into the second residual vector. Specifically, for example, for the first coefficient matrix With the first residual vector The preprocessing operation for the first residual vector can be to divide the elements in the first row of the matrix by 1, the elements in the second row by 3, and the elements in the third row by 2. The obtained second residual vector can be
[0057] In some embodiments, the subspace includes a Krylov subspace; the step of determining the subspace coefficient vector and a set of basis vectors of the preset subspace based on the second coefficient matrix and the second residual vector in the preset subspace includes: based on the generalized minimum residual method, in the preset Krylov subspace, according to the second coefficient matrix and the second residual vector, after performing iterative operations, obtaining the subspace coefficient matrix and a set of standard orthogonal bases of the preset Krylov subspace; according to the subspace coefficient matrix, calculating the subspace coefficient vector.
[0058] In some cases, the Krylov subspace method is used to project the target state parameters to be solved. When searching for an approximate solution that meets the accuracy requirements in the Krylov subspace, the generalized minimum residual method (GMRES) can be used to directly start from the condition of minimizing the modulus of the residual r. The optimal criterion can be described as: finding Solution For any vector Existence Vector So that x∈x (0) +V m y m , you can have: Furthermore, due to V m+1 The column vectors of are orthonormal, so Therefore, in the GMRES method, the problem can be transformed into solving H m+1,m y m =βe1 problem.
[0059] In this embodiment, H m+1,m y m =H in βe1 m+1,m It can be understood as the subspace coefficient matrix, H m+1,m It can be the Hessenberg matrix calculated based on the second coefficient matrix and the second residual vector. Based on the generalized minimum residual method, the large-dimensional linear problem of solving the target state parameters of the fluid model shown in Formula 5 is mapped to the preset Krylov subspace and converted into the H in the preset Krylov subspace. m+1,m y m =βe1 problem, the H m+1,m y m =βe1 problem can be understood as a problem of solving a linear equation system with a smaller dimension. According to its linear expression coefficient y m The above relationship between them can be calculated to get y m , that is, the subspace coefficient vector can be calculated based on the subspace coefficient matrix.
[0060] In this embodiment, the subspace coefficient vector obtained by calculation can be calculated by QR decomposition method, or by using some iterative algorithms, such as using Kaczmarz algorithm to solve the subspace coefficient vector. Specifically, for example, for H m+1,m y m =βe1 This linear equation system is solved for y m The problem can be solved by using QR decomposition when the dimension of the preset subspace is not very large. where Q m+1is an orthogonal matrix, R m+1,m It is an upper triangular matrix, and then we can get the following process:
[0061]
[0062] where q1 is Q m+1 The first column, R m R m+1,m The first m rows of . Therefore y m This can be solved by solving βq1(1:m)=R m y m This upper triangular system of equations is obtained, where q1(1:m) represents the vector consisting of the first m elements of the q1 vector.
[0063] In some embodiments, the step of calculating the subspace coefficient vector according to the subspace coefficient matrix includes: according to the linear relationship Hy between the subspace coefficient matrix and the subspace coefficient vector m =βe1, using the Kaczmarz algorithm to perform an iterative operation process to obtain the subspace coefficient vector; wherein H represents the subspace coefficient matrix; y m represents the subspace coefficient vector; β represents a determined value calculated based on the second coefficient matrix and the second residual vector; e1 = [1, 0, ... 0] T , the number of rows in e1 is the same as the number of rows in H.
[0064] In this embodiment, β can be calculated based on the second coefficient matrix and the second residual vector. Specifically, β can be ||r0||2, where r0=b-Ax (0) , b represents the second residual vector, A represents the second coefficient matrix, x (0) Represents the ΔU to be solved as shown in Formula 5 n The preset initial value of can be preset to 0, or it can be preset to other values according to the requirements of the simulated fluid in the specific problem scenario.
[0065] In this embodiment, the process of calculating the subspace coefficient vector can be iteratively calculated using the Kaczmarz algorithm. m =βe1 This linear equation system is solved for y m For this problem, we can preset an initial iteration point y0, select a row i of the matrix according to the specified selection rule in each iteration, and orthogonally project the current iteration point onto the hyperplane where the selected row is located, and use the obtained projection point as the next iteration point y kWhen the number of iterations is m, all rows of the matrix will be scanned, and then the row information of the matrix will be recycled until the specified maximum number of iterations or accuracy conditions are met, and the result will be used as y m .
[0066] In some embodiments, the step of generating the target state parameters of the fluid model at a specified time based on the subspace coefficient vector and a set of basis vectors of the preset subspace includes: calculating a state fluctuation vector based on the subspace coefficient vector and a set of basis vectors of the preset subspace; wherein the state fluctuation vector includes a set of changes between the target state parameters at the specified time and the state parameters at the time before the specified time; the subspace coefficient vector, the set of basis vectors of the preset subspace, and the preset initial value of the state fluctuation vector satisfy the following relationship: x = x (0) +V m y m ; x represents the state fluctuation vector; x (0) V represents the preset initial value of the state fluctuation vector; m A set of basis vectors representing the preset subspace; y m Representing the subspace coefficient vector; determining the target state parameters of the fluid model at the specified time based on the state fluctuation vector and the state parameters at the previous moment of the specified time.
[0067] In some cases, after calculating the subspace coefficient vector in the preset subspace, it is necessary to further calculate the approximate solution of the linear equation problem in the original dimension as shown in Formula 5, that is, ΔU in Formula 5 n The approximate solution is used as the state parameter change between the target state parameter at a specified moment and the state parameter at the previous moment, that is, U n+1 -U n In this way, according to the state parameter U before the specified time n , it is possible to determine the target state parameters of the fluid model at a specified time, that is, time n+1.
[0068] In this embodiment, the state fluctuation vector can be understood as ΔU as shown in Formula 5 n , that is U n+1 -U n , used to represent the change in state parameters between the target state parameter at a specified moment and the state parameter at the previous moment. (0) It can represent the preset initial value of the state fluctuation vector, that is, the ΔU to be solved as shown in Formula 5 n The preset initial value of can be preset to 0, or it can be preset to other values according to the requirements of the simulated fluid in the specific problem scenario.
[0069] In some embodiments, for large-scale linear equations, since the amount of computation and storage required for each iteration of the GMRES method increases as the number of iterations increases, when the number of iterations is large, the computation time and storage amount will increase significantly. In this case, a restarted GMRES method can be used, that is, a maximum number of iterations m is preset (usually much smaller than n, such as 20, 50, etc.). If GMRES still does not meet the accuracy conditions after iterating to m steps, an approximate solution is calculated and used as a new initial value for the iteration, and the GMRES method is restarted. This process can be repeated until an approximate solution that meets the accuracy conditions is found. Specifically, for example, after m iterations based on the GMRES method, y is obtained. m , but it does not meet the accuracy conditions at this time, then according to y m and V m First calculate the approximate solution x, and then use x as the initial value of the iteration x (0) , restart the GMRES method to iterate until the accuracy condition is met, and the solved y m Used to calculate the approximate solution x of the linear equation problem in the original dimension.
[0070] In this embodiment, by executing the state parameter generation method steps of the fluid model provided in this specification, the large-scale linear problem is converted into a small-dimensional problem in the subspace for calculation and solution, so as to generate the target state parameters of the fluid model at a specified time. Not only can the time required for iterative calculation be reduced to improve the speed of generating the target state parameters by multiple iterations, but also because the subspace dimension is fixed, the number of iterative calculations required will not fluctuate significantly when the scale of the fluid model grid increases, thereby enhancing the stability of the time required to generate the state parameters. In order to illustrate that this embodiment has the above beneficial technical effects, based on the following test environment, the number of iterations and time required for the state parameter generation method of the fluid model provided in this embodiment are compared and tested, and compared with the number of iterations and time required to generate the target state parameters using the classic iterative method. The test results are shown in Table 1.
[0071] Test environment: WIN10 64-bit operating system, x64-based processor
[0072] CPU: 12 cores Memory RAM: 16G
[0073] Processor: Intel(R)Core(TM)i5-10500 CPU@3.10GHZ
[0074] OS: win10 professional version
[0075] Accuracy condition: residual error is less than 1e-6
[0076] Test results:
[0077] Table 1
[0078]
[0079] It can be seen from the test results in Table 1 that when the target state parameters are generated using the classical iterative method, the number of iteration steps is large and the time required is also long. As the dimension of the linear system increases, the number of iteration steps and the time required also increase, and the fluctuation is large. Compared with the classical method, the number of iteration steps and the time required for generating the state parameters of the fluid model provided by this embodiment are both smaller, and the larger the linear system dimension, the more obvious the improvement relative to the classical iterative method, and it is also relatively stable. In this way, using this embodiment to iterate to generate the target state parameters of the fluid model at a specified time can reduce the number of iterations and calculation time, improve the speed of generating the target parameters, and thus to a certain extent improve the timeliness of analysis or prediction based on the simulated fluid state.
[0080] In some embodiments, there are multiple designated moments, and each designated moment represents a different time point; the multiple designated moments include at least an initial moment and a first moment, wherein the first moment includes the moment after the initial moment; the method also includes: obtaining the initial state parameters of the fluid model, the initial state parameters include the state parameters of the multiple grid units at the initial moment; accordingly, the first coefficient matrix includes a set of coefficients obtained based on the initial state parameters; the first residual vector includes a set of residual quantities obtained based on the initial state parameters; accordingly, the step of generating the target state parameters of the fluid model at the specified moment according to the subspace coefficient vector and a set of basis vectors of the preset subspace includes: generating the target state parameters of the fluid model at the first moment according to the subspace coefficient vector and a set of basis vectors of the preset subspace.
[0081] In some cases, the number of designated moments may be multiple, used to represent different time points, and the multiple designated moments may form a time series in chronological order, such as {0, 1, 2, 3...n}. In this embodiment, moment 0 may represent the initial moment, and moment 1 may represent the first moment. It can be understood that the state parameters of the fluid model at the initial moment and the state parameters at the first moment satisfy A(U 0 )(U 1 -U 0 )=-b 0 (U 0 ), so the fluid model obtains the state parameters of multiple grid units at the initial moment, that is, obtains U 0The first coefficient matrix and the first residual vector can be obtained accordingly. Further, according to the state parameter generation method of the fluid model, the target state parameters of the fluid model at the first moment are generated.
[0082] In some embodiments, the fluid model has specified accuracy conditions; the specified accuracy conditions include: the target state parameter is used to represent the value range of the modulus of the first residual vector when the simulated fluid is in a stable state; the method also includes: using the target state parameter of the first moment as the state parameter of the moment before the specified moment described in the fluid model state parameter generation method proposed in the embodiment of this specification, executing the method described in the fluid model state parameter generation method proposed in the embodiment of this specification to generate the target state parameter of the fluid model at the second moment; wherein, the second moment includes the moment after the first moment; iteratively perform the above steps in the time sequence of the multiple specified moments; when the modulus of the first residual vector meets the specified accuracy conditions, generate the target state parameter of the corresponding specified moment; the target state parameter represents the stable state of the simulated fluid.
[0083] In some cases, the fluid model can simulate the process of the fluid moving from the initial state to the stable state over time, and obtain the target state parameters of the fluid model when the fluid is in the stable state. Based on the obtained initial state parameters of the fluid model, the fluid model state parameter generation method proposed in the embodiment of this specification is used to obtain the state parameters at the first moment, and the state parameters at the first moment are used as input to obtain the state parameters at the second moment. This is iterated continuously in chronological order. When the first residual vector b at time n is equal to n (U n ) approaches 0, the fluid can be considered to be in a stable state. At this time, the state parameters at the current moment, that is, the n+1 moment, can be output to represent the stable state of the simulated fluid.
[0084] In this embodiment, a specified accuracy condition is used as a cutoff condition for the chronological iteration of the fluid model. Specifically, the specified accuracy can represent the degree to which the residual of the state parameter of each grid unit included in the first residual vector approaches zero. The smaller the residual, the smaller the change in the state parameter of the fluid model at the current moment, and the closer the simulated fluid is to a stable state. The specified accuracy condition can include: the target state parameter is used to represent the range of values that the modulus of the first residual vector meets when the simulated fluid is in a stable state. Specifically, for example, the specified accuracy condition can include that the modulus of the first residual vector is less than a certain value. Of course, the specified accuracy condition can also include the range of values that each element in the first residual vector meets. For example, the accuracy condition can include that each element is less than a certain value. The specified accuracy condition can be specifically determined based on the problem requirements involved in the fluid model. Specifically, for example, the accuracy condition can be set to: the modulus of the first residual vector is less than 1e-6, or it can be set to: the modulus of the first residual vector is less than 1e-4.
[0085] In some embodiments, the state parameter of the fluid model represents the physical state of the simulated fluid; the physical state includes at least one of physical quantities such as density, velocity, pressure, and temperature.
[0086] In some cases, the physical state of the simulated fluid can be measured by the numerical changes of the physical quantities of the simulated fluid during its motion. Specifically, for example, the state parameters of the fluid model at each moment can constitute a state parameter vector, and the elements in this vector can include the numerical set of physical quantities of each grid unit of the fluid model at the current moment to represent the physical state of the simulated fluid at the current moment. Specifically, for example, the fluid model is divided into N grid units, and the physical state to be determined is one, then the first coefficient matrix at a certain moment is an N×N matrix, where the number of rows N represents the number of grid units, and the elements of each row can represent the physical quantity on the node of the grid unit, the first residual vector is an N×1 column vector, and the state parameter vector composed of the target state parameters at this moment is an N×1 column vector, and the elements in this vector can represent the physical state of the simulated fluid at this moment. For another example, when there are four physical states to be determined, the first coefficient matrix at a certain moment is a 4N×4N matrix, the first residual vector is a 4N×1 column vector, and the state parameter vector composed of the target state parameters at that moment is a 4N×1 column vector, which represents the physical state of the simulated fluid at that moment.
[0087] In this embodiment, the physical quantities may include unknown quantities such as density, velocity, and temperature in the mass equation, momentum equation, and energy equation. Velocity may include velocity components u and v in two directions in two dimensions, or may include velocity components u, v, and w in three directions in three dimensions. In some embodiments, the physical quantities may also include other unknown quantities, such as pressure.
[0088] See also Figure 2 One embodiment of the present specification further provides a device for generating state parameters of a fluid model. The fluid model is used to simulate the state changes of the fluid over time, and the fluid model is divided into a plurality of grid units; the device for generating state parameters of the fluid model may include:
[0089] an acquisition module, configured to acquire a first coefficient matrix and a first residual vector of the fluid model; wherein the first coefficient matrix includes a coefficient set obtained based on state parameters of the plurality of grid cells at a moment before a specified moment; and the first residual vector includes a residual set obtained based on state parameters of the plurality of grid cells at a moment before a specified moment;
[0090] a preprocessing module, configured to perform a specified preprocessing operation on the first coefficient matrix and the first residual vector to obtain a second coefficient matrix and a second residual vector; the specified preprocessing operation is configured to reduce a matrix condition number;
[0091] a determination module, configured to determine, within a preset subspace, a subspace coefficient vector and a set of basis vectors of the preset subspace based on the second coefficient matrix and the second residual vector; wherein the dimension of the preset subspace is smaller than the dimension of the first residual vector;
[0092] A generating module is used to generate target state parameters of the fluid model at a specified time according to the subspace coefficient vector and a set of basis vectors of the preset subspace.
[0093] Regarding the specific functions and effects achieved by the state parameter generation device of the fluid model, please refer to the other embodiments of this specification for comparison and explanation, and will not be repeated here. The various modules in the state parameter generation device of the fluid model can be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0094] See also Figure 3. An embodiment of this specification also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and is characterized in that when the processor executes the computer program, it implements the state parameter generation method of the fluid model in any of the above embodiments. The computer device may include a processor, a non-volatile storage medium, an internal memory, a communication interface, a display device, and an input device connected by a system bus. The non-volatile storage medium may store an operating system and related computer program instructions.
[0095] The embodiments of this specification also provide a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a computer, the computer executes the method for generating state parameters of a fluid model in any of the above embodiments.
[0096] The embodiments of this specification also provide a computer program product comprising instructions, which, when executed by a computer, enables the computer to execute the method for generating state parameters of a fluid model in any of the above embodiments.
[0097] It should be understood that the specific examples herein are only intended to help those skilled in the art better understand the embodiments of this specification, rather than to limit the scope of the present invention.
[0098] It can be understood that in the various implementations of this specification, the size of the serial number of each process 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 implementation methods of this specification.
[0099] It can be understood that the various embodiments described in this specification can be implemented individually or in combination, and the embodiments in this specification are not limited to this.
[0100] Unless otherwise indicated, all technical and scientific terms used in the embodiments of this specification have the same meaning as those commonly understood by those skilled in the art in the technical field of this specification. The terms used in this specification are only for the purpose of describing specific embodiments and are not intended to limit the scope of this specification. The term "and / or" used in this specification includes any and all combinations of one or more related listed items. The singular forms "a", "above", and "the" used in the embodiments of this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise.
[0101] It is understood that the processor in the embodiments of this specification can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiment can be completed by hardware integrated logic circuits in the processor or software instructions. The above processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of this specification can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this specification can be directly implemented as a hardware decoding processor, or can be implemented by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0102] It will be understood that the memory in the embodiments of this specification may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0103] Those skilled 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. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this specification.
[0104] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, devices and units can refer to the corresponding processes in the aforementioned method implementation methods and will not be repeated here.
[0105] In the several embodiments provided in this specification, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, 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.
[0106] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of this embodiment.
[0107] In addition, each functional unit in each embodiment of this specification 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.
[0108] 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 this specification, or the part that contributes to the prior art, or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of this specification. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0109] The above description is merely a specific embodiment of this specification, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this specification should be included in the scope of protection of this specification. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A method for generating state parameters of a fluid model, characterized in that: The fluid model is used to simulate the state change of the fluid over time, and the fluid model is divided into a plurality of grid units; the method includes: Obtaining a first coefficient matrix and a first residual vector of the fluid model; wherein the first coefficient matrix includes a coefficient set obtained based on state parameters of the plurality of grid units at a moment before a specified moment; and the first residual vector includes a residual set obtained based on state parameters of the plurality of grid units at a moment before a specified moment; performing a specified preprocessing operation on the first coefficient matrix and the first residual vector to obtain a second coefficient matrix and a second residual vector; the specified preprocessing operation is used to reduce a matrix condition number; Determining, within a preset subspace, a subspace coefficient vector and a set of basis vectors of the preset subspace based on the second coefficient matrix and the second residual vector; wherein the dimension of the preset subspace is smaller than the dimension of the first residual vector; The target state parameters of the fluid model at a specified time are generated according to the subspace coefficient vector and a group of basis vectors of the preset subspace.
2. The method according to claim 1, characterized in that The number of rows of the first coefficient matrix is the same as the number of rows of the first residual vector, and there is a one-to-one correspondence between the multiple rows included in the first coefficient matrix and the multiple rows included in the first residual vector; each row of the first coefficient matrix includes a specified element located on the main diagonal of the first coefficient matrix; The step of performing a preprocessing operation on the first coefficient matrix and the first residual vector to obtain a second coefficient matrix and a second residual vector comprises: Divide each element in the first coefficient matrix by the specified element in the row where the element is located, and the obtained results form the second coefficient matrix; Each element in the first residual vector is divided by the designated element in the corresponding row of the first coefficient matrix corresponding to the row where the element is located, and the obtained result forms the second residual vector.
3. The method according to claim 2, characterized in that The subspace includes a Krylov subspace; and the step of determining, within the preset subspace, a subspace coefficient vector and a set of basis vectors of the preset subspace based on the second coefficient matrix and the second residual vector includes: Based on the generalized minimum residual method, in a preset Krylov subspace, after performing an iterative operation based on the second coefficient matrix and the second residual vector, a subspace coefficient matrix and a set of standard orthogonal bases of the preset Krylov subspace are obtained; According to the subspace coefficient matrix, a subspace coefficient vector is calculated.
4. The method according to claim 3, characterized in that The step of calculating the subspace coefficient vector according to the subspace coefficient matrix includes: According to the linear relationship Hy between the subspace coefficient matrix and the subspace coefficient vector m =βe1, using the Kaczmarz algorithm to perform an iterative operation process to obtain the subspace coefficient vector; wherein H represents the subspace coefficient matrix; y m represents the subspace coefficient vector; β represents a determined value calculated based on the second coefficient matrix and the second residual vector; e1 = [1, 0, ... 0] T , the number of rows in e1 is the same as the number of rows in H.
5. The method according to claim 4, characterized in that The step of generating target state parameters of the fluid model at a specified time according to the subspace coefficient vector and a set of basis vectors of the preset subspace includes: A state fluctuation vector is obtained by calculating the subspace coefficient vector and a set of basis vectors of the preset subspace; wherein the state fluctuation vector includes a set of changes between the target state parameter at the specified moment and the state parameter at the moment before the specified moment; the subspace coefficient vector, the set of basis vectors of the preset subspace, and the preset initial value of the state fluctuation vector satisfy the following conditions: x = x (0) +V m y m ; x represents the state fluctuation vector; x (0) V represents the preset initial value of the state fluctuation vector; m A set of basis vectors representing the preset subspace; y m represents the subspace coefficient vector; Based on the state fluctuation vector and the state parameter at a previous moment of the designated moment, the target state parameter of the fluid model at the designated moment is determined.
6. The method according to claim 1, characterized in that There are multiple designated moments, each designated moment represents a different time point; the multiple designated moments include at least an initial moment and a first moment, wherein the first moment represents a moment after the initial moment; the method further includes: Acquiring initial state parameters of the fluid model, wherein the initial state parameters include state parameters of the plurality of grid units at an initial moment; Accordingly, the first coefficient matrix includes a coefficient set obtained based on the initial state parameters; the first residual vector includes a residual amount set obtained based on the initial state parameters; Correspondingly, the step of generating the target state parameters of the fluid model at a specified moment based on the subspace coefficient vector and a set of basis vectors of the preset subspace includes: generating the target state parameters of the fluid model at the first moment based on the subspace coefficient vector and a set of basis vectors of the preset subspace.
7. The method according to claim 6, characterized in that The fluid model has a specified accuracy condition; the specified accuracy condition includes: the target state parameter is used to represent the range of values that the modulus of the first residual vector conforms to when the simulated fluid is in a stable state; the method further includes: The method of claim 1 is performed by using the target state parameter of the first moment as the state parameter of the moment before the designated moment described in claim 1 to generate the target state parameter of the fluid model at the second moment; wherein the second moment represents the moment after the first moment; Iteratively execute the above steps according to the time sequence of the multiple designated moments; When the modulus of the first residual vector meets the specified accuracy condition, a target state parameter at the corresponding specified moment is generated; the target state parameter represents the stable state of the simulated fluid.
8. The method according to claim 1, characterized in that The state parameters of the fluid model represent the physical state of the simulated fluid; the physical state includes at least one of physical quantities such as density, velocity, pressure and temperature.
9. A device for generating state parameters of a fluid model, characterized in that: The fluid model is used to simulate the state change of the fluid over time, and the fluid model is divided into a plurality of grid units; the device includes: an acquisition module, configured to acquire a first coefficient matrix and a first residual vector of the fluid model; wherein the first coefficient matrix includes a coefficient set obtained based on state parameters of the plurality of grid cells at a moment before a specified moment; and the first residual vector includes a residual set obtained based on state parameters of the plurality of grid cells at a moment before a specified moment; a preprocessing module, configured to perform a specified preprocessing operation on the first coefficient matrix and the first residual vector to obtain a second coefficient matrix and a second residual vector; the specified preprocessing operation is configured to reduce a matrix condition number; a determination module, configured to determine, within a preset subspace, a subspace coefficient vector and a set of basis vectors of the preset subspace based on the second coefficient matrix and the second residual vector; wherein the dimension of the preset subspace is smaller than the dimension of the first residual vector; A generating module is used to generate target state parameters of the fluid model at a specified time according to the subspace coefficient vector and a set of basis vectors of the preset subspace.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 8 is implemented.
11. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Computational fluid dynamics simulation method and device based on quantum algorithm, and equipment
CN114091363A
Fluid dynamics calculation system based on quantum calculation and quantum computer
CN115809705A