Numerical and square cavity driven flow simulation method and system based on hybrid high-order compact difference method
By hybridizing the high-order compact difference method, the reharmonic equation is reduced to the coupled Poisson equation, and a specific difference format is used at the internal and boundary points, which solves the problem of high precision and low memory consumption in the existing technology and realizes efficient square cavity driven flow simulation.
Patent Information
- Application Number
- CN202411938204.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-12-26
AI Technical Summary
When solving the reharmonic equation, the existing differential method has difficulty in ensuring high accuracy while reducing computational memory consumption. It cannot meet the requirements of capturing the details of the primary and secondary vortices in the simulation of square cavity-driven flow, and the computational efficiency is low.
A hybrid high-order compact difference method is used to reduce the reharmonic equation to a coupled Poisson equation by constructing intermediate variables. Different difference schemes are used for discretization at the interior and boundary points, and the discrete linear system is solved in combination with direct or iterative methods.
Achieving high-precision numerical simulation on a coarser grid reduces computational memory consumption, improves simulation efficiency and accuracy, and can more accurately capture eddy flow details, making it suitable for high-oscillation models in multiple fields.
Smart Images

Figure CN119849245B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of high-order difference numerical simulation, and particularly relates to a numerical simulation method and system based on a mixed high-order compact difference method. BACKGROUND
[0002] Numerical simulation is equivalent to numerical experiment, that is, without high-cost physical experiments, the theory is verified, the phenomenon is explored, or the unknown result is predicted. In the research of fluid mechanics, numerical simulation can provide parameter reference for experimental design, and physical experiment is used to verify the simulation result, therefore, numerical simulation is widely applied in many fields.
[0003] The biharmonic equation is a fourth-order partial differential equation generated in the field of continuum mechanics. At present, the biharmonic equation is actively applied in many fields. In the field of elasticity, the biharmonic equation is used to describe the deformation of a thin plate when it is bent, and then the bending and deformation of structural components under load can be calculated in the structural analysis of bridges and buildings. In the field of fluid mechanics, the biharmonic equation is often used to describe the stream function and velocity potential of stable flow, to simulate and predict the flow patterns in the ocean and atmosphere, and to participate in the design and optimization of fluid conveying systems such as pipelines and ventilation systems. Therefore, numerical simulation based on the solution of the biharmonic equation is widely applied in many fields, and the accuracy of numerical solution is crucial.
[0004] In fluid mechanics, the study of square cavity driven flow can be used to optimize the design of mixing reactors to improve the efficiency of chemical production. For example, in a pharmaceutical factory, by simulating the square cavity driven flow, the distribution of velocity field, stream function and vortex function can be analyzed to identify the dead zones and low-efficiency vortex regions in the reactor. By adjusting the cover plate sliding speed and the cavity geometry (such as designing an arc-shaped bottom), the fluid mixing performance can be effectively improved, the mixing time can be reduced, and the product uniformity can be improved. At the same time, by analyzing the wall shear stress distribution through vortex function, the equipment structure can be optimized to avoid wear and failure caused by stress concentration. The optimized design can significantly improve the mixing efficiency and equipment stability, providing theoretical guidance for industrial practice.
[0005] In geofluid simulation, the square cavity driven flow model can be used to study the flow behavior in the magma cavity and reveal the influence of volcanic activity on the crustal structure. In the magma cavity, the magma produces complex flow due to thermal convection, density difference and pressure gradient, which directly affects the magma's ascent, cooling and chemical composition mixing process. By simulating the flow in the cavity, the motion patterns of magma under different geological conditions can be predicted, such as vortex formation, turbulent characteristics and heat exchange effects with surrounding rocks. These studies can help scientists understand the triggering mechanism, eruption scale and long-term influence of volcanic activity on crustal deformation, and provide theoretical basis for geological disaster prediction and magma resource development.
[0006] Therefore, the simulation of cavity driven flow based on solving the biharmonic equation is extremely important in the field.
[0007] Finite difference method (FDM) transforms continuous differential equations into algebraic equations by discretizing them, so as to calculate approximate solutions on discrete grids. Among them, high-order compact difference method performs well in capturing the details and characteristics of complex problems, especially in dealing with high-frequency wave problems in the fields of fluid mechanics, acoustics and electromagnetics, etc., which can more accurately simulate physical phenomena. However, in the prior art, when solving the biharmonic equation by using difference format, in order to obtain high-order accuracy, the compactness of the difference stencil is destroyed, that is, information outside one step of the center point is used; or in order to ensure the compactness of the difference stencil, the calculation accuracy at the boundary point is sacrificed, that is, the global error can only have one order or two orders of accuracy under the infinite norm estimation; or by introducing more basic unknown quantities to achieve the goal, the idea is similar to the combined compact difference format, and the number of basic unknown quantities increases with the increase of spatial dimensions, which easily causes the deterioration of calculation memory and calculation efficiency, and cannot meet the needs of high precision, low hardware cost, and the need of capturing the details of primary and secondary vortices in the simulation of cavity driven flow based on solving the biharmonic equation. SUMMARY
[0008] In order to solve the problems of precision and calculation memory consumption in the numerical simulation of the numerical model meeting the biharmonic equation by using the existing difference method, especially to meet the needs of high precision, low hardware cost in the simulation of cavity driven flow based on solving the biharmonic equation, so as to more accurately capture the vortices and secondary vortices, improve the precision of the numerical simulation results, and reduce the calculation memory consumption, the present application provides a numerical simulation method and system based on mixed high-order compact difference method.
[0009] To this end, the present application provides the following technical solutions:
[0010] On the one hand, the present application provides a numerical simulation method based on mixed high-order compact difference method, which is applied to the numerical simulation of target variables meeting the biharmonic equation in a target region Ω, and the method comprises the following steps:
[0011] S1: constructing a control equation of a target variable u represented by a biharmonic equation, and performing grid division on a target region Ω=[x l ,x r ]×[y l ,y r ] to obtain a discrete grid point region
[0012]
[0013] In the formula, f is a source term of the control equation, u n is the value of u on the boundary Normal derivative at g D is the specified Dirichlet boundary condition, g N is the specified Newman boundary condition, is the boundary of the target region Ω, (x i ,y j ) is the grid point coordinate, h is the grid step size, (N+1)×(N+1) is the number of grid points, i and j are the order of the grid points in the x and y directions, in means in the corresponding target area Ω, on means on the boundary x l ,x r ,y l ,y r is the grid boundary coordinate value;
[0014] S2: Define an intermediate variable v = Δu, and then reduce the control equation to two coupled Poisson equations Δu = v, Δv = f;
[0015] S3: Determine the input grid point (x i ,y j ) is an internal grid point or a boundary point of the target region Ω. If it is an internal grid point, the two coupled Poisson equations are discretized using a classical high-order compact difference scheme. If it is a boundary point and a corner point, the boundary conditions of the target variable u are differentiated to obtain the solution of the intermediate variable v at the corner point. If it is a boundary point and not a corner point, the boundary discrete equation of the intermediate variable v is constructed using a high-order difference scheme with a passive term extension of the Poisson equation Δu=v.
[0016] S4: After all grid points of the target area Ω are discretely input, a discrete linear system is constructed, and the discrete linear system is solved using a direct method or an iterative method to obtain numerical simulation results of the target variable u and the intermediate variable v of the target area Ω.
[0017] Preferably, if the input grid point (x i ,y j ) is a boundary point of the target region Ω and is not a corner point. Based on the Newman boundary condition, the passive term is used to extend the high-order difference format Poisson equation Δu=v for discretization, which is expressed as:
[0018]
[0019] in,
[0020] Where, are the coefficients of the difference equation, They are the target variable u and the intermediate variable v at point Approximate value of is the Newman boundary condition g N (y) at point The value at i k ,j k is the local index subscript, g N (y) represents the Newman boundary condition g of input y N .
[0021] The obtained high-order compact differential discrete equations at other boundary points other than corner points are expressed as:
[0022] (x0,y j )
[0023]
[0024] (x N ,y j )
[0025]
[0026] (x i ,y0):
[0027]
[0028] (x i ,y N )
[0029]
[0030] In the formula, (g N ) i g N At x=x i The value at (g N ) j g N (y) when y=y j The value at .
[0031] Preferably, if the input grid point (x i ,y j ) is the internal grid point of the target region Ω. When the two coupled Poisson equations are discretized using the classical high-order compact difference scheme, the internal point (x i ,y j ) is expressed as:
[0032]
[0033] Among them, f ij is the source term f at point (x i ,y j ); U and V are the approximate values of u and v respectively; the subscripts i and j in U, V, and f correspond to the coordinates of the grid points.
[0034] Preferably, the target variable is a stream function or a deflection of a thin plate.
[0035] Preferably, the target variable is a deflection ω' of the thin plate, and the corresponding control equation is represented as:
[0036] Δ 2 ω' = q / D
[0037] wherein q is an externally applied load, and D is a stiffness of the thin plate, both of which are known values given by a model of an actual problem.
[0038] wherein after obtaining the deflection distribution of the thin plate under the uniform load by using steps S1-S4, a maximum deformation position of the thin plate is identified based on the deflection distribution, or a bending moment and a shear stress of the thin plate are calculated based on the deflection distribution.
[0039] In the second aspect, the application further provides a square cavity driven flow simulation based on a hybrid high-order compact difference method, comprising the following steps:
[0040] Step 1: constructing a control equation of the square cavity driven flow, and performing grid division on a target region Ω, wherein (N+1)×(N+1) is a grid point number, and i and j are serial numbers of the grid points in x and y directions;
[0041] -μΔ 2 ψ = f, Ω = [0, 1] 2
[0042] ψ = 0, ψ n = 1 at the upper boundary;
[0043] ψ = 0, ψ n = 0 at other boundaries;
[0044] wherein ψ is the square cavity driven flow to be numerically simulated, μ is a given viscosity coefficient, f is an externally applied source term, i.e., a source term of the control equation, ψ n is a normal derivative value of the stream function on the boundary, Ω is the target region, ψ n is a normal derivative of ψ on the boundary, and a value of ψ on the boundary corresponds to a Dirichlet boundary condition g D ; a value of ψ n on the boundary corresponds to a Neumann boundary condition g N .
[0045] Step 2: introducing a vorticity ω as an intermediate variable, and reducing the original control equation to two coupled Poisson equations: Δψ = ω and -μΔω = f;
[0046] Step 3: judging whether an input grid point (x i ,y j) is an internal grid point or a boundary point of the target region Ω. If it is an internal grid point, the two coupled Poisson equations are discretized using a classical high-order compact difference scheme. If it is a boundary point and a corner point, the boundary conditions of the cavity-driven flow ψ are differentiated to obtain the solution of the vorticity ω at the corner point. If it is a boundary point and not a corner point, the Poisson equation of the stream function ψ is extended with a high-order difference scheme using the passive term Δψ=ω to construct a discrete equation at the boundary of the vorticity ω.
[0047] Step 4: When all grid points are input, the discrete linear system is obtained The vector formed by the boundary conditions and source terms at the grid points; directly solve or iteratively solve the discrete linear system to obtain the approximate values of flow and vorticity [ψ; ω].
[0048] Optionally, after obtaining the approximate values of the flow ψ and the vorticity ω in step 4, the method further comprises: drawing a contour map of the flow ψ or performing numerical differentiation on the flow ψ to obtain a velocity distribution of the fluid.
[0049] In a third aspect, the present invention provides a numerical simulation system based on the above method, comprising:
[0050] The construction module is used to construct the control equation of the target variable u expressed as a retuned equation and to calculate the target region Ω=[x l ,x r ]×[y l ,y r ]Mesh the grid to get the grid point area
[0051]
[0052] Where f is the source term of the control equation, u n For u at the border Normal derivative at g D is the specified Dirichlet boundary condition, g N is the specified Newman boundary condition, is the boundary of the target region Ω, (x i ,y i ) is the grid point coordinate, h is the grid step size, (N+1)×(N+1) is the number of grid points, i and j are the order of the grid points in the x and y directions, in means in the corresponding target area Ω, on means on the boundary x l ,x r ,y l ,y r is the grid boundary coordinate value;
[0053] a reduction module, configured to define an intermediate variable v = Δu, and to reduce the control equation to two coupled Poisson equations Δu = v, Δv = f;
[0054] a discretization module, configured to judge whether an input grid point (x i ,y j ) is an internal grid point or a boundary point of the target region Ω, if the input grid point is an internal grid point, discretize the two coupled Poisson equations by using a classical high-order compact difference format, if the input grid point is a boundary point and an angle point, differentiate a boundary condition of a target variable u to obtain a solution of an intermediate variable v at the angle point, and if the input grid point is a boundary point and not an angle point, construct a boundary discretization equation of the intermediate variable v by using a source-free term extension high-order difference format of the Poisson equation Δu = v.
[0055] a numerical calculation module, configured to, after all grid points of the target region Ω are discretized and input, construct a discrete linear system, and solve the discrete linear system by using a direct method or an iterative method to obtain a numerical simulation result of the target variable of the target region Ω.
[0056] In a fourth aspect, the present application provides a computer device, which at least comprises:
[0057] one or more processors;
[0058] a memory storing one or more computer programs;
[0059] wherein the processor invokes the computer program to implement:
[0060] a step of a numerical simulation method based on a mixed high-order compact difference method or a step of a square cavity driven flow simulation based on a mixed high-order compact difference method.
[0061] In a fifth aspect, the present application provides a computer readable storage medium storing a computer program, which is invoked by a processor to implement:
[0062] a step of a numerical simulation method based on a mixed high-order compact difference method or a step of a square cavity driven flow simulation based on a mixed high-order compact difference method.
[0063] Advantages
[0064] The technical scheme of the present application designs a brand-new high-order compact difference format, which is applied to numerical simulation of a model satisfying a biharmonic equation, so that the application space of the model satisfying the biharmonic equation in the fields of elasticity mechanics and fluid mechanics is further expanded, the high-precision numerical solution demand of the numerical simulation based on solving the biharmonic equation is met, high precision is obtained on a relatively coarse grid, the hardware requirement of high-precision numerical simulation is reduced, and the memory consumption is significantly reduced.
[0065] The high-order compact difference scheme designed in the technical scheme has the advantages that:
[0066] From the calculation examples, high-order accuracy is obtained on a coarse grid; high oscillation solutions are simulated more effectively, so that more accurate numerical simulation can be performed for high oscillation models; from the format itself, because the calculation template only involves grid points far away from h steps, it is more suitable for infinite regions and three-dimensional models, thereby reducing the required memory; from the theoretical analysis, it has a smaller error constant; the grid direction effect is greatly reduced; error analysis and optimal error estimation are easier to perform.
[0067] Especially when the numerical simulation method is specifically applied to square cavity driven flow simulation, it can capture the details of the primary vortex and secondary vortex sharply, laying a foundation for drawing the contour map of the flow ψ and obtaining the velocity distribution of the fluid, and further reducing the requirements for hardware and the memory consumption of square cavity driven flow simulation, so that the square cavity driven flow simulation can fully play its role in the pharmaceutical field and the field of geological fluids. When the numerical simulation method is applied to the thin plate field, the maximum deformation position of the thin plate can be clearly identified through the obtained high-precision deflection distribution, which usually corresponds to the stress concentration or weak support area, which is crucial for evaluating the strength and safety of the thin plate. In addition, the deflection distribution can be further used to calculate the bending moment and shear stress of the thin plate, revealing the internal stress distribution and stress concentration area, thereby providing a scientific basis for optimizing the geometric design, material selection and boundary support conditions of the thin plate. These analyses can effectively improve the bending stiffness and structural stability of the thin plate, ensuring its reliability and durability in actual use. BRIEF DESCRIPTION OF DRAWINGS
[0068] Figure 1 is a flow diagram of the technical idea of the numerical simulation method provided by the present application.
[0069] Figure 2 is a contour map of the flow ψ for square cavity driven flow simulation. DETAILED DESCRIPTION
[0070] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be described clearly and completely below in combination with the drawings in the embodiments of the present application. The embodiments described in the present application are only embodiments of part of the present application, rather than all embodiments. Based on the spirit of the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the protection scope of the present application.
[0071] The present application provides a numerical simulation method based on a mixed high-order compact difference method, which is used for numerical simulation of a target variable of a biharmonic equation in a target region Omega, that is, it can be understood that the variable model of the biharmonic equation can be used to realize numerical simulation of the variable. For example, the numerical simulation of the deformation of a thin plate when it is bent, the stream function of a fluid, and the vorticity. The technical idea of the present application is as follows:
[0072] S1: Construct a control equation of a target variable u represented by a biharmonic equation, and perform grid division on a target region Omega = [x l ,x r ] * [y l ,y r ] to obtain a grid
[0073]
[0074] In the formula, f is a source term of the control equation, u n is the normal derivative of u at the boundary , g D is a specified Dirichlet boundary condition, g N is a specified Neumann boundary condition, is the boundary of the target region Omega, (x i ,y j ) is the grid point coordinate, h is the grid step, (N+1) * (N+1) is the number of grid points, x l ,x r , y l ,y r are the grid boundary coordinate values;
[0075] S2: Define an intermediate variable v = Delta u, and then reduce the control equation of the fourth-order biharmonic equation to two coupled Poisson equations Delta u = v, Delta v = f.
[0076] It should be understood that in different applications, the target variable u is different, and the intermediate variable v defined is also different; however, the technical idea of numerical simulation of any specific target variable is universal, that is, to introduce an intermediate variable to reduce the control equation of the fourth-order biharmonic equation to two coupled Poisson equations.
[0077] S3: judge whether the input grid point (x i ,y j ) is an interior grid point or a boundary point of the target region Ω, if it is an interior grid point, use the classical high-order compact difference scheme to discretize the two coupled Poisson equations (Δu = v, Δv = f); if it is a boundary point and an angle point, differentiate the boundary condition of the target variable u to obtain the solution of the intermediate variable v at the angle point; if it is a boundary point and not an angle point, use the source-free extension high-order difference scheme to discretize the Poisson equation Δu = v to obtain the boundary discrete equation of the Poisson equation of v.
[0078] wherein, at the interior grid points (x i ,y j ) of the region, for the Poisson equation Δu = v, v is regarded as a source term for discretization, that is, the high-order compact difference discretization at the interior points can be obtained:
[0079]
[0080] wherein, f ij is the value of the source term f at the point (x i ,y j ); U and V are the approximate values of u and v respectively; the subscripts of U, V and f correspond to the grid point coordinates, such as U i,j represents the approximate value of u at the point (x i ,y j ).
[0081] At the boundary angle points, that is, the angle points (x l ,y l ), (x l ,y r ), (x r ,y l ) and (x r ,y r ), use the existing boundary conditions to derive the Dirichlet boundary conditions of the intermediate variable at the angle points of the solving region. Taking (x l ,y l ) as an example, from the Dirichlet boundary condition u = g D of u, it can be known that u(x l ,y) = g D (y) and u(x,y l ) = g D (x) at the boundaries (x l ,y) and (x,y l ). Therefore, through twice differentiation, the following equation can be obtained: Through the same method, the following equation can be obtained: l ,y r ), (x r ,y l ) and (xr , y r , i.e. to differentiate the boundary conditions. Such treatment can be regarded as the Dirichlet boundary condition imposed on the intermediate variable v at the corner points. For the sake of explanation, the following defines the target region Ω = [x l , x r ] x [y l , y r ] in which 0 < i, j < N, thus, the corner points can also be marked as: (x0, y0), (x0, y N ), (x N , y0), (x N , y N ).
[0082] At other boundary points (the four sides of the square region), i.e. {(x0, y j ), (x N , y j ), (x i , y0), (x i , y N )|0 < i, j < N}, taking the boundary point (x0, y j ) as an example, the Dirichlet boundary condition u = g D is directly assigned to the original variable u, and the non-extended Neumann boundary condition u n = g N is used for the intermediate variable v at the boundary point.
[0083] That is, the Neumann boundary condition u n = g N exists at the boundary and Δu = v is established. If v is regarded as the source term of the Poisson equation Δu = v, the high-order compact difference scheme of the Poisson equation Neumann boundary condition is used:
[0084]
[0085] Wherein:
[0086]
[0087] In the formula, h = b / a, Δx = a / h, Δy = b / h, and Δu = v = g (y) are given difference coefficients, are the approximate values of unknowns u, v at point , is the value of g N (y) at .
[0088] The above difference scheme is applied to the solution of the modified harmonic equation, i.e.:
[0089]
[0090] Similar methods can be used to obtain other boundaries (x N ,y j ),(x i ,y0),(x i ,y N ),
[0091] ·(x N ,y j )
[0092]
[0093] ·(x i ,y0):
[0094]
[0095] ·(x i ,y N )
[0096]
[0097] Among them, (g N ) i g N At x=x i The value at (g N ) j g N At y=y j The value at .
[0098] That is, the grid at the boundary points:
[0099]
[0100] v ij ={(g D ) xx +(g D ) yy} ij ,(i,j)=(0,0),(0,N),(N,0),(N,N);
[0101]
[0102] Among them, 0 <i,j<N;
[0103] (g D ) xx 、(g D ) yy The definition of g is DThe second-order derivative of (i, j) = (0, 0), (0, N), (N, 0), (N, N) is the corner point of the region, corresponding to (x0, y0), (x0, y N )、(x N ,y0)、(x N ,y N ).
[0104] S4: After all grid points of the target area Ω are discretely input, a coefficient matrix is assembled, and a direct method or an iterative method is used to solve the discrete linear system to obtain a numerical simulation result of the target parameter of the target area Ω.
[0105] Among them, for the Poisson equation of u, the discrete system constructed based on discrete points: A h U+BV=F1,A h , B, F1 are {U ij} corresponding coefficients form a matrix, {V ij The matrix formed by the corresponding coefficients, the Dirichlet boundary conditions and the vector consisting of 0 elements;
[0106] For the Poisson equation of v, the discrete system constructed based on discrete points: C h U+D h V=F2,C h 、D h , F2 are {U ij} corresponding coefficients form a matrix, {V ij}The matrix formed by the corresponding coefficients, the vector composed of Newman boundary conditions and source terms.
[0107] Then, the final algebraic system can be obtained by assembling the linear system after discretization of the coupled Poisson equation:
[0108]
[0109] By using direct solution or iterative solution method, high-precision numerical solutions U and V of the original harmonic equation can be obtained.
[0110] Examples:
[0111] The target variable is set as: u = sin(25x)cos(5y), and the calculation area is Ω = [0,1] × [0,1]. The solution is very oscillatory in the solution area, and it is difficult for the low-order format to obtain more accurate numerical results on a coarser grid. Table 1 gives the numerical solution errors under different coarse and fine grids. The 2nd to 3rd columns are the errors and j convergence orders of the target variables (basic unknowns) of the reharmonic equation, and the 4th to 5th columns are the errors and convergence orders of the intermediate variables (unknowns). Both can achieve high-order convergence; the 6th column is the condition number of the discrete linear system coefficient matrix. It can be found that for the fourth-order reharmonic equation, the condition number only maintains The study found that the format constructed by the present invention achieved better results in approximating the oscillating solution. In Table 2, the difference format constructed by the present invention (the final algorithm S1-S4 obtained by the entire invention) is compared with the 13-point second-order difference format. Whether in terms of error or coefficient matrix condition number, the format constructed by the present invention is more superior.
[0112] Table 1 Numerical results of high-order compact difference method for reharmonic equation
[0113]
[0114] Table 2 Comparison of high-order compact difference scheme and 13-point second-order scheme
[0115]
[0116] Problems without analytical solutions
[0117] Assuming the source term is zero in the entire region, the boundary conditions are:
[0118]
[0119] Since there is no analytical solution to this problem, the numerical solution of 2048×2048 grid is used as the reference solution, and Table 3 is obtained. It can be found from the table that the third-order convergence can still be maintained for the numerical solution.
[0120] Table 3 Numerical results of high-order compact difference method for reharmonic equation
[0121]
[0122] It should be understood that the technical concept of the present invention is applicable to the numerical simulation of the target variable in the target region Ω that satisfies the retuning equation. The following embodiments will be illustrated using the numerical simulation of cavity-driven flow as an example. Numerical simulation of cavity-driven flow can help optimize industrial processes, improve the efficiency and quality of mixing, cooling, and material processing, design and improve fluid equipment, and optimize the performance of microscale devices in microfluidics, thereby improving the accuracy and reliability of overall engineering design and operation.
[0123] This embodiment provides a square cavity driven flow simulation based on a hybrid high-order compact difference method, including the following steps:
[0124] Step 1:
[0125] The governing equations of the cavity-driven flow are constructed, and the target area Ω is meshed.
[0126] -μΔ 2 ψ=f,∈[0,1] 2
[0127] ψ = 0, ψ n = 1, at the upper boundary;
[0128] ψ = 0, ψ n = 0, at the other boundaries;
[0129] where ψ is the driven flow in a square cavity to be numerically simulated, μ is the given viscosity coefficient, which is set to be 1 in the present example, and f is the externally imposed source term, which is set to be 0 in the present example. ψ n is the normal derivative of ψ at the boundary, corresponding to formula 1, the value of ψ at the boundary corresponds to g D ; the value of ψ at the boundary corresponds to g n . N .
[0130] Step 2: Introduce an intermediate variable (vorticity ω) to reduce the original governing equation to two coupled Poisson equations: Δψ = ω and -μΔω = f.
[0131] Step 3: Determine whether the input grid point (x i , y j) is an internal grid point or a boundary point of the target region Ω. If it is an internal grid point, use the classical high-order compact difference format to discretize the two coupled Poisson equations; if it is a boundary point and an angle point, differentiate the boundary condition of the driven flow ψ in the square cavity to obtain the solution of vorticity ω at the angle point; if it is a boundary point and not an angle point, use the Poisson equation Δψ = ω of the driven flow ψ in the square cavity to construct a source-free term extension high-order difference format to discretize the vorticity ω.
[0132] where, based on the boundary conditions of the governing equation, the value of vorticity at the corner points of the solution region is calculated (i.e. the corresponding Dirichlet boundary condition); it is mainly obtained by differentiating the boundary condition of the flow ψ to obtain the value of vorticity ω at the corner point: ω(0, 0) = 0, ω(0, 1) = 0, ω(1, 0) = 0, ω(1, 1) = 0; where (0, 0), (0, 1), (1, 0), (1, 1) are the four corner points of the square cavity.
[0133] If it is an internal grid point, use the classical high-order compact difference format to discretize the coupled Poisson equations; if it is a boundary point, use the Poisson equation Δψ = ω of the driven flow ψ in the square cavity to construct a source-free term extension high-order difference format to discretize the vorticity ω.
[0134] The internal points use the classical high-order compact difference format to discretize the coupled Poisson equations:
[0135] For Δψ = ω and -μΔω = 0, the discrete equations at the internal points {(x i , y j ) | 0 < i, j < N} are as follows:
[0136]
[0137] Constructing high-order difference scheme of Poisson equation at Newman boundary points, i.e. constructing high-order difference scheme of source-free extension;
[0138] Take the left boundary of square cavity as an example:
[0139]
[0140] Where g N = 0, and
[0141]
[0142] At the boundary point grid (take the left boundary as an example, i.e. i = 0):
[0143] ψ ij = 0
[0144] ω ij = 0 at j = 0, N
[0145] i = 0, j ≠ 0, N Similarly, the discrete scheme at i = 0, j = 0, N + 1 can be obtained.
[0146] Step 4: When all the grid points are inputted, assemble the discrete linear system according to the input number order i + (N + 1) (j - 1) Directly solve or iteratively solve (BICGStab, GMRES, etc.) the discrete coupled Poisson equation, i.e. obtain the approximate value of flow and vorticity [ψ; ω].
[0147] Step 5: By drawing the contour plot of the driven flow ψ of square cavity, as shown in Figure 2 , a main vortex and two secondary vortices can be observed in detail on the coarse grid, and further numerical differentiation of the stream function can obtain the velocity distribution of the fluid.
[0148] It should be noted that the square cavity is understood as a square area, and the study of square cavity driven flow can be used to optimize the design of mixing reactors to improve the efficiency of chemical production. For example, in a pharmaceutical factory, by simulating the square cavity driven flow according to the technical scheme of the present application, analyzing the distribution of velocity field, flow function and vortex function, the dead zone and low efficiency vortex area in the reactor can be identified. Adjusting the cover plate sliding speed and cavity geometry (such as designing an arc-shaped bottom) of the reactor can effectively improve the fluid mixing performance, reduce the mixing time and improve the product uniformity. At the same time, after simulating the square cavity driven flow according to the technical scheme of the present application to obtain the vortex function distribution, the wall shear stress distribution is analyzed by the vortex function to optimize the equipment structure and avoid wear or failure caused by stress concentration. The optimized design can significantly improve the mixing efficiency and equipment stability, providing theoretical guidance for industrial practice. In geological fluid simulation, the square cavity driven flow model can be used to study the flow behavior in the magma cavity, revealing the influence of volcanic activity on the crustal structure. In the magma cavity, magma produces complex flow due to thermal convection, density difference and pressure gradient, which directly affects the process of magma rising, cooling and chemical composition mixing. By simulating the flow in the cavity according to the technical scheme of the present application (first set the relevant simulation parameters according to the application scenario, and then use the technical scheme of the present application for numerical simulation), the movement mode of magma under different geological conditions can be predicted, such as vortex formation, turbulent characteristics and heat exchange effect with surrounding rocks. These studies can help scientists understand the triggering mechanism of volcanic eruption, the scale of volcanic eruption and the long-term influence of volcanic activity on crustal deformation, and provide a theoretical basis for geological disaster prediction and magma resource development.
[0149] It should be understood that the present embodiment takes the square cavity driven flow as an example, and other feasible embodiments are not limited to the square cavity driven flow, such as the target variable being the deflection ω' of the thin plate, and the corresponding control equation is represented as:
[0150] Δ 2 ω'=q / D
[0151] In the formula, q is the external applied load, and D is the stiffness of the thin plate.
[0152] The bending problem of rectangular thin plate under uniform load is a classic application in thin plate mechanics. According to the technical scheme of the present application, the deflection distribution ω'(x, y) of the thin plate under uniform load can be obtained, and by analyzing the deflection distribution, the maximum deformation position of the thin plate can be clearly identified, which usually corresponds to the stress concentration or weak support area, which is crucial for evaluating the strength and safety of the thin plate. In addition, the deflection distribution can be further used to calculate the bending moment and shear stress of the thin plate, revealing the internal stress distribution and stress concentration area, thereby providing a scientific basis for optimizing the geometric design, material selection and boundary support conditions of the thin plate. These analyses can effectively improve the bending stiffness and structural stability of the thin plate, ensuring its reliability and durability in actual use.
[0153] In some embodiments, the present application provides a numerical simulation system based on the above method, comprising:
[0154] a construction module for constructing a control equation of a target variable u represented by a re-orthogonal equation and performing mesh partitioning on a target region Ω to obtain a mesh;
[0155]
[0156] a reduction module for defining an intermediate variable v = Δu, and then reducing the control equation to two coupled Poisson equations Δu = v, Δv = f;
[0157] a discretization module for judging whether an input mesh point (x i ,y j ) is an internal mesh point or a boundary point of the target region Ω, if it is an internal mesh point, discretizing the two coupled Poisson equations by using a classical high-order compact difference format, if it is a boundary point and an angle point, differentiating a boundary condition of the target variable u to obtain a solution of the intermediate variable v at the angle point, if it is a boundary point and not an angle point, constructing a boundary discretization equation of the intermediate variable v by using a source-free term extension high-order difference format of the Poisson equation Δu = v;
[0158] a numerical calculation module for assembling a coefficient matrix after all mesh points of the target region Ω are discretized and input, and solving the discretized linear system by using a direct method or an iterative method to obtain a numerical simulation result of the target variable of the target region Ω.
[0159] It should be understood that when the numerical simulation system is a square cavity driven flow simulation system, it is composed of the construction module, the reduction module, the discretization module, and the numerical calculation module, and has the same functions.
[0160] The specific implementation process of each module can refer to the above method content, which will not be described here again. The division of the above functional modules is only for example description. In some embodiments, part of the functional modules can be combined, part of the functional modules can be split, and each functional module can be implemented in a software manner or hardware or a combination of software and hardware. The software and hardware devices include but are not limited to general-purpose computer devices, programmable gate arrays, digital signal processors, microprocessors, and corresponding programming or burning software thereof.
[0161] In some embodiments, the present application also provides a computer device, which at least includes one or more processors and a memory storing one or more computer programs; wherein the processor invokes the computer program to implement the steps of the numerical simulation method based on the mixed high-order compact difference method.
[0162] Specific implementation:
[0163] constructing a control equation of a target variable u expressed by a reordering equation, and meshing a target region Ω to obtain a mesh;
[0164]
[0165] defining an intermediate variable v = Δu, and then reducing the order of the control equation to two coupled Poisson equations Δu = v, Δv = f;
[0166] judging whether an input mesh point (x i ,y j ) is an internal mesh point or a boundary point of the target region Ω, if it is an internal mesh point, discretizing the two coupled Poisson equations by using a classical high-order compact difference scheme, if it is a boundary point and an angle point, differentiating a boundary condition of the target variable u to obtain a solution of the intermediate variable v at the angle point, if it is a boundary point and not an angle point, constructing a boundary discrete equation of the intermediate variable v by using a source-free term extension high-order difference scheme of the Poisson equation Δu = v.
[0167] after all mesh points of the target region Ω are discretely input, assembling a coefficient matrix, and solving the discrete linear system by using a direct method or an iterative method to obtain a numerical simulation result of the target variable of the target region Ω.
[0168] The specific implementation process of each step can refer to the description of the foregoing method.
[0169] It should be understood that, in the embodiments of the present application, the processor can be a central processing unit (CPU), and the processor can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The memory can include read-only memory and random access memory, and provide instructions and data for the processor. A part of the memory can also include non-volatile random access memory. For example, the memory can also store device type information.
[0170] In some embodiments, the present application provides a computer readable storage medium storing a computer program, the computer program being invoked by a processor to implement the steps of the numerical simulation method based on the hybrid high-order compact difference method.
[0171] wherein the following is specifically implemented:
[0172] constructing a control equation of a target variable u expressed by a reordering and equation, and meshing a target region Ω to obtain a mesh;
[0173]
[0174] defining an intermediate variable v = Δu, and then reducing the order of the control equation to two coupled Poisson equations Δu = v, Δv = f;
[0175] judging whether an input mesh point (x i ,y j ) is an internal mesh point or a boundary point of the target region Ω, if it is an internal mesh point, discretizing the two coupled Poisson equations by using a classical high-order compact difference format, if it is a boundary point and an angle point, differentiating a boundary condition of the target variable u to obtain a solution of the intermediate variable v at the angle point, if it is a boundary point and not an angle point, constructing a boundary discrete equation of the intermediate variable v by using a sourceless term extension high-order difference format of the Poisson equation Δu = v.
[0176] after all mesh points of the target region Ω are discretely input, assembling a coefficient matrix, and solving the discrete linear system by using a direct method or an iterative method to obtain a numerical simulation result of the target variable of the target region Ω.
[0177] The specific implementation process of each step can refer to the description of the foregoing method.
[0178] The readable storage medium is a computer readable storage medium, which can be an internal storage unit of the software and hardware device in any of the foregoing embodiments, for example, a hard disk or a memory of the controller. The readable storage medium can also be an external storage device of the controller, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, and the like. Further, the readable storage medium can include both the internal storage unit and the external storage device of the controller. The readable storage medium is used to store the computer program and other programs and data required by the controller. The readable storage medium can also be used to temporarily store data that has been output or will be output.
[0179] Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art, or the whole or part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in various embodiments of the present application. The aforementioned readable storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0180] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-readable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage, etc.) containing computer usable program code. The present application is produced by referring to the flowcharts and the instructions executed by the processor of the method, device (system), and computer program product according to the embodiments of the present application to realize the functions specified in one or more flows of the flowcharts and / or one or more blocks of the block diagrams. These computer program instructions can also be stored in a computer readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer readable memory produce a manufactured product including instruction devices that realize the functions specified in one or more flows of the flowcharts and / or one or more blocks of the block diagrams. These computer program instructions can also be loaded into a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer implemented process, so that the instructions executed on the computer or other programmable device provide steps for realizing the functions specified in one or more flows of the flowcharts and / or one or more blocks of the block diagrams.
[0181] It should be emphasized that the examples described in the present application are illustrative rather than restrictive, and therefore the present application is not limited to the examples described in the specific embodiments, and any other embodiments derived by those skilled in the art from the technical solutions of the present application without departing from the purpose and scope of the present application, whether modified or replaced, also belong to the protection scope of the present application.
Claims
1. A numerical simulation method based on a hybrid high-order compact difference method, characterized by: The method is applied to numerical simulation of a target variable satisfying a retuned equation in a target region Ω, and the method comprises the following steps: S1: Construct the control equation of the target variable u expressed as a retuned equation, and calculate the target region Ω=[x l ,x r ]×[y l ,y r ]Mesh the area to get the discrete grid points Where f is the source term of the control equation, u n For u at the border Normal derivative at g D is the specified Dirichlet boundary condition, g N is the specified Newman boundary condition, is the boundary of the target region Ω, (x i ,y j ) is the grid point coordinate, h is the grid step size, (N+1)×(N+1) is the number of grid points, i and j are the order of the grid points in the x and y directions, in means in the corresponding target area Ω, on means on the boundary x l ,x r ,y l ,y r is the grid boundary value; S2: Define an intermediate variable v = Δu, and then reduce the control equation to two coupled Poisson equations Δu = v, Δv = f; S3: Determine the input grid point (x i ,y j ) is an internal grid point or a boundary point of the target region Ω. If it is an internal grid point, the two coupled Poisson equations are discretized using a classical high-order compact difference scheme. If it is a boundary point and a corner point, the boundary conditions of the target variable u are differentiated to obtain the solution of the intermediate variable v at the corner point. If it is a boundary point and not a corner point, the boundary discrete equation of the intermediate variable v is constructed using a high-order difference scheme with a passive term extension of the Poisson equation Δu=v. S4: After all grid points of the target area Ω are input, a discrete linear system is constructed, and the discrete linear system is solved using a direct method or an iterative method to obtain numerical simulation results of the target variable u and the intermediate variable v of the target area Ω; Wherein, if the target variable is a stream function of the fluid, the numerical simulation results of the flow and vorticity are obtained using steps S1-S4; If the target variable is the deflection ω' of the thin plate, after obtaining the deflection distribution of the thin plate under a uniformly distributed load using steps S1-S4, the maximum deformation position of the thin plate is identified based on the deflection distribution, or the bending moment and shear stress of the thin plate are calculated based on the deflection distribution. The corresponding control equation is expressed as: D 2 ω'=q / D Where q is the externally applied load and D is the stiffness of the plate.
2. The method according to claim 1, wherein: If the input grid point (x i ,y j ) is a boundary point of the target region Ω and is not a corner point. Based on the Newman boundary condition, the Poisson equation Δu=v of the intermediate variable v is discretized using the passive term extension high-order difference format, which is expressed as: in, Where, are the coefficients of the difference equation, They are the target variable u and the intermediate variable v at point Approximate value of is the Newman boundary condition g N (y) at point The value at i k ,j k is the local index subscript, g N (y) represents the Newman boundary condition g at point y N .
3. The method according to claim 1, wherein: If the input grid point (x i ,y j ) is the internal grid point of the target region Ω. When the two coupled Poisson equations are discretized using the classical high-order compact difference scheme, the internal point (x i ,y j ) is a high-order compact difference discrete equation, the specific form is: Among them, f ij is the source term f at point (x i ,y j ); U and V are the approximate values of u and v respectively; the subscripts i and j in U, V, and f correspond to the coordinates of the grid points.
4. A method for simulating cavity-driven flow based on a hybrid high-order compact difference method, characterized by: The following steps are involved: Step 1: Construct the governing equations for the cavity-driven flow and mesh the target area Ω, where (N+1)×(N+1) is the number of grid points, and i and j are the order of the grid points in the x and y directions. -mD 2 ψ=f,Ω=[0,1] 2 ψ=0,ψ n =1, at the upper boundary; ψ=0,ψ n =0, at other boundaries; Where ψ is the square cavity driven flow to be simulated, μ is the given viscosity coefficient, f is the externally applied source term, i.e., the source term of the control equation, and ψ n is the normal derivative of the stream function ψ on the boundary, Ω is the target area, and the value of ψ at the boundary corresponds to the Dirichlet boundary condition g D ψ at the boundary n The value corresponds to the Newman boundary condition g N ; Step 2: Introduce the vorticity ω as an intermediate variable and reduce the original control equation to two coupled Poisson equations; Δψ=ω and -μΔω=f; Step 3: Determine the input grid point (x i ,y j ) is an internal grid point or a boundary point of the target region Ω. If it is an internal grid point, the two coupled Poisson equations are discretized using a classical high-order compact difference scheme. If it is a boundary point and a corner point, the boundary conditions of the cavity-driven flow ψ are differentiated to obtain the solution of the vorticity ω at the corner point. If it is a boundary point and not a corner point, the Poisson equation of the stream function ψ is extended with a high-order difference scheme using the passive term Δψ=ω to construct a discrete equation at the boundary of the vorticity ω. Step 4: When all grid points are input, assemble the discrete linear system The vector formed by the boundary conditions and source terms at the grid points; directly solve or iteratively solve the discrete linear system to obtain the approximate values of flow and vorticity [ψ; ω].
5. The method according to claim 4, characterized in that: After obtaining the approximate values of the flow ψ and the vorticity ω in step 4, the method further includes: drawing a contour map of the flow ψ or performing numerical differentiation on the flow ψ to obtain a velocity distribution of the fluid.
6. A numerical simulation system based on the method according to any one of claims 1 to 3, characterized in that: include: The construction module is used to construct the control equation of the target variable u expressed as a retuned equation and to calculate the target region Ω=[x l ,x r ]×[y l ,y r ]Mesh the grid to get the grid point area Where f is the source term of the control equation, u n For u at the border Normal derivative at g D is the specified Dirichlet boundary condition, g N is the specified Newman boundary condition, is the boundary of the target region Ω, (x i ,y j ) is the grid point coordinate, h is the grid step size, (N+1)×(N+1) is the number of grid points, i and j are the order of the grid points in the x and y directions, in means in the corresponding target area Ω, on means on the boundary x l ,x r ,y l ,y r is the grid boundary coordinate value; An order reduction module is used to define an intermediate variable v=Δu, thereby reducing the control equation to two coupled Poisson equations Δu=v, Δv=f; Discrete module, used to determine the input grid point (x i ,y j ) is an internal grid point or boundary point of the target region Ω. If it is an internal grid point, the two coupled Poisson equations are discretized using a classical high-order compact difference scheme. If it is a boundary point and a corner point, the boundary conditions of the target variable u are differentiated to obtain the solution of the intermediate variable v at the corner point. If it is a boundary point and not a corner point, use the Poisson equation Δu=v passive term extension high-order difference format to construct the boundary discrete equation of the intermediate variable v; The numerical calculation module is used to complete the discrete input of all grid points in the target area Ω, construct a discrete linear system, and use a direct method or an iterative method to solve the discrete linear system to obtain the numerical simulation results of the target parameters of the target area Ω.
7. A computer device, characterized in that: At least: one or more processors; a memory storing one or more computer programs; The processor calls the computer program to implement: The steps of the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: A computer program is stored, which is called by a processor to implement: The steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Image denoising method based on mixed high-order partial differential equation model
CN111724318A
Multi-extreme learning machine model construction method and device and computer equipment
CN112070157A