Fluid mechanics calculation method and system based on CFD simulation optimization

Through the fluid mechanics calculation method based on CFD simulation optimization, through the identification of key areas of the flow field, grid constraint update and dynamic selection of turbulence models, the problems of insufficient accuracy and low efficiency in traditional fluid mechanics calculations are solved, and fluid mechanics simulation with higher accuracy and efficiency is achieved.

CN120654591AInactive Publication Date: 2025-09-16TAIYUAN INST OF TECH
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202510625393.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-15
Publication Date
2025-09-16
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional fluid mechanics computational methods suffer from insufficient accuracy and low solution efficiency when dealing with complex flow fields, especially those involving three-dimensional turbulence, unsteady flow and multi-physics field coupling.

Method used

Through the fluid mechanics calculation method based on CFD simulation optimization, including the identification of key flow area, grid constraint update, dynamic selection of turbulence model and finite volume partitioning, the grid division and turbulence model selection of the flow field calculation domain are optimized, the numerical error is reduced, and the calculation accuracy and efficiency are improved.

Benefits of technology

It improves the accuracy and stability of fluid mechanics calculations, can better reflect the dynamic changes of the flow field, enhances the reliability and efficiency of calculations, and provides more accurate fluid behavior simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120654591A_ABST
    Figure CN120654591A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computational simulation, in particular to a fluid mechanics calculation method and system based on CFD simulation optimization. The method comprises the following steps: acquiring a flow field CFD original simulation model corresponding to fluid mechanics; generating a fluid mechanics flow field key grid area by setting the size of a flow field calculation domain grid and performing calculation domain grid division and flow field key area identification; the method comprises the following steps of: obtaining a grid length-width ratio and torsion resistance corresponding to each grid subunit in the grid, and carrying out grid constraint updating to generate a fluid mechanics flow field updating grid region; a corresponding Reynolds number and a turbulence scale are obtained through the fluid mechanics flow field updating grid area, turbulence model dynamic selection modeling is carried out, and a flow field grid area dynamic turbulence model is generated; and carrying out finite volume division and error simulation correction optimization on the dynamic turbulence model of the flow field grid region to obtain a corrected fluid mechanics flow field quantity calculation result. According to the method, collaborative improvement of fluid mechanics calculation precision and efficiency can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computational simulation technology, and in particular to a fluid mechanics calculation method and system based on CFD simulation optimization. Background Art

[0002] Fluid mechanics, as a discipline that studies the flow patterns of fluids (liquids and gases) under different conditions, is widely used in a variety of fields, including aerospace, automotive industry, construction engineering, and energy development. In these fields, accurately calculating and optimizing fluid flow characteristics, especially physical quantities such as flow velocity, pressure, and temperature, is of great practical significance. In recent years, computational fluid dynamics (CFD) has been widely used in fluid mechanics calculations as a numerical simulation method. CFD can simulate and predict the flow behavior of fluids under different boundary conditions and complex geometric shapes by discretizing and solving fluid mechanics equations. However, traditional fluid mechanics calculation methods mainly rely on analytical solutions or simplified approximate models. These methods often suffer from insufficient accuracy and low solution efficiency when dealing with complex flow fields, especially when involving three-dimensional turbulence, unsteady flow, and multi-physics field coupling. Summary of the Invention

[0003] Based on this, it is necessary for the present invention to provide a fluid mechanics calculation method and system based on CFD simulation optimization to solve at least one of the above technical problems.

[0004] To achieve the above objectives, a fluid mechanics calculation method based on CFD simulation optimization includes the following steps:

[0005] Step S1: obtaining a flow field CFD original simulation model corresponding to fluid mechanics; setting a flow field calculation domain grid size, and dividing the flow field CFD original simulation model into calculation domain grids based on the flow field calculation domain grid size to obtain various flow field calculation domain grid sub-units; identifying flow field key areas of the flow field CFD original simulation model based on the various flow field calculation domain grid sub-units to generate fluid mechanics flow field key grid areas;

[0006] Step S2: obtaining the mesh aspect ratio and distortion corresponding to each mesh sub-unit in the key mesh area of ​​the fluid dynamics flow field, and performing mesh constraint update on the key mesh area of ​​the fluid dynamics flow field based on the mesh aspect ratio and distortion corresponding to each mesh sub-unit to generate an updated mesh area of ​​the fluid dynamics flow field;

[0007] Step S3: obtaining the corresponding Reynolds number and turbulence scale by updating the grid area of ​​the fluid mechanics flow field, and dynamically selecting and modeling the turbulence model for the updated grid area of ​​the fluid mechanics flow field based on the Reynolds number and turbulence scale to generate a dynamic turbulence model for the flow field grid area;

[0008] Step S4: performing finite volume division on the dynamic turbulence model of the flow field grid area to obtain the dynamic turbulence finite subunit models of each flow field; performing error simulation correction optimization on the corresponding original solution in the dynamic turbulence model of the flow field grid area based on the dynamic turbulence finite subunit models of each flow field to obtain the corrected fluid mechanics flow field quantity calculation results.

[0009] Furthermore, step S1 includes the following steps:

[0010] Step S11: obtaining the original CFD simulation model of the flow field corresponding to fluid mechanics;

[0011] Step S12: setting the flow field calculation domain grid size and dividing the flow field CFD original simulation model into calculation domain grids based on the flow field calculation domain grid size to obtain various flow field calculation domain grid sub-units;

[0012] Step S13: Calculating the velocity gradient and pressure gradient corresponding to each grid sub-unit through each grid sub-unit of the flow field calculation domain;

[0013] The velocity gradient is specifically:

[0014] The pressure gradient is specifically:

[0015] in, represents the divergence operator, u represents the fluid velocity vector, They represent the velocity change rate of the fluid along the x, y and z directions of the flow field, p represents the fluid pressure, They represent the pressure change rate of the fluid along the x, y and z directions of the flow field, Represent the unit vectors in the x, y and z directions of the flow field respectively;

[0016] Step S14: Calculate the turbulence intensity corresponding to each grid sub-unit through each flow field calculation domain grid sub-unit; wherein the turbulence intensity is specifically in and They represent the root mean square values ​​of the velocity components corresponding to the fluid turbulence in the x, y and z directions of the flow field, Indicates the average flow velocity of the fluid;

[0017] Step S15: Based on the velocity gradient and pressure gradient corresponding to each grid sub-unit and in combination with the turbulence intensity corresponding to each grid sub-unit, the flow field key area of ​​the original CFD simulation model is identified to generate the fluid mechanics flow field key grid area.

[0018] Furthermore, step S15 includes the following steps:

[0019] Step S151: performing grid sub-region identification on each corresponding grid sub-unit of the flow field calculation domain based on the velocity gradient and pressure gradient corresponding to each grid sub-unit and in combination with the turbulence intensity corresponding to each grid sub-unit, so as to obtain the boundary layer sub-grid, shock wave sub-grid, and vortex sub-grid corresponding to the flow field calculation domain;

[0020] Step S152: performing subgrid set processing on the boundary layer subgrids, shock wave subgrids, and vortex subgrids corresponding to the flow field calculation domain, so as to calculate the corresponding distance between any two adjacent corresponding boundary layer subgrids, shock wave subgrids, or vortex subgrids. If the distance between any two adjacent corresponding boundary layer subgrids, shock wave subgrids, or vortex subgrids is 1, they are grouped in the same block set; otherwise, they are divided into two corresponding block sets, thereby obtaining each flow field boundary layer grid block, flow field shock wave grid block, and flow field vortex grid block.

[0021] Step S153: Divide the flow field CFD original simulation model into key flow field areas based on the block ranges corresponding to each flow field boundary layer grid block, flow field shock wave grid block, and flow field vortex grid block to generate the fluid mechanics flow field key grid area.

[0022] Furthermore, the process of identifying the grid sub-area is as follows: if the trend corresponding to the velocity gradient is increasing from zero, the pressure gradient is in the negative region and the turbulence intensity changes sharply, then the corresponding flow field calculation domain grid sub-unit is determined as the boundary layer sub-grid; if the trend corresponding to the velocity gradient and the pressure gradient is a sudden change and the turbulence intensity changes sharply, then the corresponding flow field calculation domain grid sub-unit is determined as the shock wave sub-grid; if the corresponding curl is calculated according to the velocity gradient in represents the Laplace operator, They represent the velocity curvature of the fluid along the x, y, and z directions of the flow field, respectively. When the corresponding trend is judged to be significantly increased, the pressure gradient is relatively gentle, and the turbulence intensity changes sharply, the corresponding flow field calculation domain grid subunit is determined to be a vortex subgrid.

[0023] Furthermore, step S2 includes the following steps:

[0024] Step S21: obtaining the grid length and grid width corresponding to each grid sub-unit in the key grid area of ​​the fluid mechanics flow field;

[0025] Step S22: Calculate the aspect ratio value based on the grid length and grid width corresponding to each grid sub-unit to obtain the grid aspect ratio corresponding to each grid sub-unit. Where L represents the grid length and H represents the grid width;

[0026] Step S23: Obtain the Jacobian matrix corresponding to each grid sub-unit in the key grid area of ​​the fluid mechanics flow field, and calculate the grid torsional strength according to the Jacobian matrix corresponding to each grid sub-unit to obtain the torsional strength corresponding to each grid sub-unit. Where J represents the Jacobian matrix corresponding to the grid sub-unit, J0 represents the Jacobian matrix of the ideal grid unit, and det() represents the determinant of the matrix;

[0027] Step S24: The grid aspect ratio and distortion corresponding to each grid sub-unit are used as grid quality constraints, and based on the grid quality constraints, the grid constraints of the corresponding grid sub-units in the key grid area of ​​the fluid mechanics flow field are updated, so as to adjust the corresponding grid layout in real time according to the corresponding grid quality constraints to generate an updated grid area of ​​the fluid mechanics flow field.

[0028] Furthermore, step S3 includes the following steps:

[0029] Step S31: Update the grid area through the fluid mechanics flow field to obtain the corresponding Reynolds number Where ρ represents the fluid density, U represents the fluid velocity, C represents the fluid length, and μ represents the fluid viscosity;

[0030] Step S32: Calculate the corresponding turbulence scale by updating the grid area through the fluid mechanics flow field Where k represents the turbulent kinetic energy, ∈ represents the turbulent dissipation rate, and C μ represents the empirical constant, with a value of 0.09;

[0031] Step S33: Based on the Reynolds number and the turbulence scale, the turbulence model is dynamically selected for the updated grid area of ​​the fluid mechanics flow field. If the turbulence scale is greater than or equal to the preset threshold, it is determined to be an end area far away from the wall and its fluid flow is in a high Reynolds number and fully developed turbulence state, and the corresponding k-∈ model is preferentially selected; if the turbulence scale is less than the preset threshold, it is determined to be an end area near the wall and its fluid flow is in a low Reynolds number and boundary layer turbulence state, and the corresponding k-ω model is preferentially selected, thereby modeling and generating a dynamic turbulence model of the flow field grid area.

[0032] Furthermore, the k-∈ model described in step S33 includes equation 1 describing the turbulent kinetic energy k and an equation describing the turbulent dissipation rate ∈, which are specifically:

[0033] Equation 1 describing the turbulent kinetic energy k:

[0034] Where j represents the turbulent kinetic energy, specifically t represents the time variable, u represents the fluid velocity vector, represents the gradient of turbulent kinetic energy, μ tIt represents the viscosity of the turbulent flow away from the wall, specifically P k represents the turbulent kinetic energy generation term, specifically P k =μS 2 , where μ represents the fluid viscosity, S represents the shear stress corresponding to the fluid, and ∈ represents the turbulent dissipation rate;

[0035] The equation describing the turbulent dissipation rate ∈ is:

[0036] Among them, C ∈1 and C ∈2 are the model constants corresponding to the equation describing the turbulent dissipation rate ∈, specifically any non-zero constants, represents the gradient of the turbulent dissipation rate.

[0037] Furthermore, the k-ω model described in step S33 includes equation 2 describing the turbulent kinetic energy k and the equation describing the turbulent frequency ω, which are specifically:

[0038] Equation 2 describing the turbulent kinetic energy k:

[0039] Among them, μ c It represents the viscosity of turbulent flow near the wall, specifically β * represents the model constant corresponding to equation 2 describing the turbulent kinetic energy k, and ω represents the turbulence frequency;

[0040] The equation describing the turbulence frequency ω is:

[0041] Among them, α and β are the model constants corresponding to the equation describing the turbulence frequency ω.

[0042] Furthermore, step S4 includes the following steps:

[0043] Step S41: performing finite volume partitioning on the dynamic turbulence model of the flow field grid area to obtain the dynamic turbulence finite subunit model of each flow field;

[0044] Step S42: Calculate the corresponding local truncation error T through each flow field dynamic turbulence finite subunit model, wherein the local truncation error T can be calculated by a discrete equation on the corresponding finite subunit, wherein the discrete equation is specifically:

[0045]

[0046] in, represents the solution of the scalar variable φ of the i-th finite subunit at time n+1, represents the solution of the scalar variable φ of the i-th finite subunit at time n, Δt represents the time step, specifically the time interval between two adjacent time steps, V i represents the volume of the i-th finite subunit, F f represents the convective flux vector on the finite subelement f, which is used to describe the transmission rate of the scalar variable φ through the surface f, φ f represents the value of the scalar variable φ on the surface f, Γ f represents the diffusion coefficient on the surface f, represents the gradient of the scalar variable φ on the surface f, S f represents the area vector on the surface f, ε i represents the amount of scalar variable φ generated in the i-th finite subunit;

[0047] Among them, the solution of the scalar variable of the i-th finite subunit at time n is satisfy:

[0048]

[0049] The solution of the scalar variable of its finite subunit at time n+1 is Perform Taylor expansion:

[0050]

[0051] Substituting it into the discrete equation and simplifying it, we can get:

[0052]

[0053] The local truncation error T can be obtained by solving The difference between the satisfied equation and the discretized equation is calculated as:

[0054]

[0055] Step S43: Based on the local truncation error T, the original solution φ corresponding to the dynamic turbulence model in the flow field grid area is calculated. i Error simulation correction optimization is performed to obtain the corrected fluid mechanics flow field calculation results, where the corrected fluid mechanics flow field calculation results are specifically as follows:

[0056] Furthermore, the present invention also provides a fluid dynamics calculation system based on CFD simulation optimization, which is used to execute the fluid dynamics calculation method based on CFD simulation optimization as described above. The fluid dynamics calculation system based on CFD simulation optimization includes:

[0057] The flow field key area identification module is used to obtain the flow field CFD original simulation model corresponding to fluid mechanics; by setting the flow field calculation domain grid size and dividing the flow field CFD original simulation model into calculation domain grids based on the flow field calculation domain grid size, each flow field calculation domain grid sub-unit is obtained; based on each flow field calculation domain grid sub-unit, the flow field key area of ​​the flow field CFD original simulation model is identified, thereby generating the fluid mechanics flow field key grid area;

[0058] A grid constraint update module is used to obtain the grid aspect ratio and distortion corresponding to each grid sub-unit in the key grid area of ​​the fluid dynamics flow field through the key grid area of ​​the fluid dynamics flow field, and perform grid constraint update on the key grid area of ​​the fluid dynamics flow field based on the grid aspect ratio and distortion corresponding to each grid sub-unit to generate an updated grid area of ​​the fluid dynamics flow field;

[0059] The turbulence dynamic modeling module is used to obtain the corresponding Reynolds number and turbulence scale by updating the grid area of ​​the fluid mechanics flow field, and dynamically select and model the turbulence model of the updated grid area of ​​the fluid mechanics flow field based on the Reynolds number and turbulence scale, thereby generating a dynamic turbulence model of the flow field grid area;

[0060] The flow field original solution error optimization module is used to perform finite volume division on the dynamic turbulence model of the flow field grid area to obtain the dynamic turbulence finite sub-unit model of each flow field; based on the dynamic turbulence finite sub-unit model of each flow field, the error simulation correction and optimization of the corresponding original solution in the dynamic turbulence model of the flow field grid area is performed to obtain the corrected fluid mechanics flow field quantity calculation results.

[0061] Beneficial effects of the present invention:

[0062] 1. The fluid mechanics calculation method based on CFD simulation optimization proposed in the present invention has the beneficial effect of finely dividing the calculation area of ​​the flow field into grids by setting the grid size of the flow field calculation domain. This process is based on the complexity of the flow field and reasonably selects the grid size to ensure that the flow changes can be fully reflected in detail. The accuracy of the grid division directly affects the accuracy and efficiency of the subsequent fluid mechanics calculation. The key areas of the flow field usually include boundary layers, shock waves, and vortices. These areas need to be further analyzed by finer grids. Through such a precise division and identification process, the accuracy and reliability of the flow field simulation calculation can be effectively improved in the subsequent steps, ensuring that the dynamic changes of the flow field can be fully reflected. Secondly, the quality of the grid is detected by evaluating the aspect ratio and distortion of each grid sub-unit in the key grid area of ​​the flow field. The aspect ratio and distortion are important parameters for measuring whether the grid shape is ideal. The ideal grid should have an aspect ratio close to 1 and a small distortion to ensure that the error in the numerical calculation is minimized. A grid with an aspect ratio that is too large or a distortion that is too high will lead to an increase in the numerical error during the calculation process and even cause convergence problems. Therefore, in this step, rigorous mesh quality testing is performed to determine which meshes require adjustment. Next, based on the quality assessment of these mesh subunits, mesh constraint updates are performed. This update process involves optimizing the shape and size of the mesh to ensure that it better reflects the motion characteristics of the fluid in important areas (such as the boundary layer, shock waves, and vortex zones). This optimization not only improves the accuracy of the simulation calculations, but also enhances the stability and efficiency of the calculations, allowing subsequent calculations to more efficiently and accurately simulate the behavior of the fluid. The Reynolds number and turbulence scale within the grid region are then updated by calculating the flow field, and an appropriate turbulence model is dynamically selected based on the turbulent characteristics of the flow. The Reynolds number is an important indicator of the turbulent characteristics of a flow. Generally, higher Reynolds numbers indicate more turbulent flows, requiring more sophisticated and adaptable turbulence model selection. The turbulence scale is a key parameter that describes the intensity of turbulent fluctuations and the size of eddies, which affects the accuracy of the turbulence model. The most appropriate turbulence model, such as the k-∈ model or the k-ω model, is dynamically selected based on the different Reynolds numbers and turbulence scales of the flow field. This dynamic modeling process allows for real-time adjustment of computational complexity and accuracy based on flow changes, providing more accurate flow field information. This better reflects the impact of turbulence on fluid behavior and improves the reliability of simulation calculations under high Reynolds numbers and complex flow conditions. Finally, by performing finite volume partitioning on the dynamic turbulence model within the flow grid region, the computational domain is further subdivided into smaller finite subcells. These subcells are the basic units for numerical calculations. By solving the conservation equations for these subcells, the distribution of various physical quantities in the flow field can be obtained.In addition, the original solution is further error-corrected and simulated for optimization based on the dynamic turbulence finite subunit model of the flow field. In the actual calculation process, due to numerical errors and approximate processing, there are certain deviations in the preliminary simulation results. Through error simulation correction and optimization, the preliminary results can be adjusted to reduce numerical errors and obtain more accurate fluid mechanics calculation results. This process not only optimizes the accuracy of the calculation, but also improves the efficiency of the solution.

[0063] 2. The fluid mechanics calculation system based on CFD simulation optimization proposed in the present invention is composed of a flow field key area identification module, a grid constraint update module, a turbulence dynamic modeling module and a flow field original solution error optimization module. It can realize any fluid mechanics calculation method based on CFD simulation optimization described in the present invention, and is used to combine the operations between computer programs running on each module to realize the fluid mechanics calculation method based on CFD simulation optimization. The internal structures of the system cooperate with each other, which can greatly reduce duplication of work and manpower investment, and can quickly and effectively provide a more accurate and efficient fluid mechanics calculation process based on CFD simulation optimization, thereby simplifying the operation process of the fluid mechanics calculation system based on CFD simulation optimization. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] Other features, objects and advantages of the present invention will become more apparent upon reading the detailed description of non-limiting embodiments thereof made with reference to the following drawings:

[0065] Figure 1 Schematic diagram of the steps of the fluid mechanics calculation method based on CFD simulation optimization of the present invention;

[0066] Figure 2 for Figure 1 Detailed step flow diagram of step S1;

[0067] Figure 3 for Figure 2 Detailed step flow chart of step S15. DETAILED DESCRIPTION

[0068] The following is a clear and complete description of the technical method of the present invention in conjunction with the accompanying drawings. It is obvious that the embodiments described are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making any creative efforts are within the scope of protection of the present invention.

[0069] In addition, the accompanying drawings are merely schematic illustrations of the present invention and are not necessarily drawn to scale. Identical reference numerals in the figures denote identical or similar parts, and thus repetitive descriptions thereof will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor and / or microcontroller approaches.

[0070] It should be understood that although the terms "first," "second," and the like may be used herein to describe various elements, these elements should not be limited by these terms. These terms are used solely to distinguish one element from another. For example, a first element may be referred to as a second element, and similarly, a second element may be referred to as a first element, without departing from the scope of the exemplary embodiments. The term "and / or" as used herein includes any and all combinations of one or more of the listed associated items.

[0071] To achieve this, please refer to Figures 1 to 3 The present invention provides a fluid mechanics calculation method based on CFD simulation optimization, the method comprising the following steps:

[0072] Step S1: obtaining a flow field CFD original simulation model corresponding to fluid mechanics; setting a flow field calculation domain grid size, and dividing the flow field CFD original simulation model into calculation domain grids based on the flow field calculation domain grid size to obtain various flow field calculation domain grid sub-units; identifying flow field key areas of the flow field CFD original simulation model based on the various flow field calculation domain grid sub-units to generate fluid mechanics flow field key grid areas;

[0073] Step S2: obtaining the mesh aspect ratio and distortion corresponding to each mesh sub-unit in the key mesh area of ​​the fluid dynamics flow field, and performing mesh constraint update on the key mesh area of ​​the fluid dynamics flow field based on the mesh aspect ratio and distortion corresponding to each mesh sub-unit to generate an updated mesh area of ​​the fluid dynamics flow field;

[0074] Step S3: obtaining the corresponding Reynolds number and turbulence scale by updating the grid area of ​​the fluid mechanics flow field, and dynamically selecting and modeling the turbulence model for the updated grid area of ​​the fluid mechanics flow field based on the Reynolds number and turbulence scale to generate a dynamic turbulence model for the flow field grid area;

[0075] Step S4: performing finite volume division on the dynamic turbulence model of the flow field grid area to obtain the dynamic turbulence finite subunit models of each flow field; performing error simulation correction optimization on the corresponding original solution in the dynamic turbulence model of the flow field grid area based on the dynamic turbulence finite subunit models of each flow field to obtain the corrected fluid mechanics flow field quantity calculation results.

[0076] In the embodiment of the present invention, please refer to Figure 1 FIG. 1 is a flow chart of the steps of the fluid mechanics calculation method based on CFD simulation optimization of the present invention. In this example, the fluid mechanics calculation method based on CFD simulation optimization includes the following steps:

[0077] Step S1: obtaining a flow field CFD original simulation model corresponding to fluid mechanics; setting a flow field calculation domain grid size, and dividing the flow field CFD original simulation model into calculation domain grids based on the flow field calculation domain grid size to obtain various flow field calculation domain grid sub-units; identifying flow field key areas of the flow field CFD original simulation model based on the various flow field calculation domain grid sub-units to generate fluid mechanics flow field key grid areas;

[0078] In the embodiment of the present invention, when performing fluid mechanics calculation based on CFD simulation optimization, the original CFD simulation model of the flow field corresponding to fluid mechanics is first obtained from the professional CFD simulation project library. Taking a high-speed train external flow field simulation project as an example, the model is built by ANSYS Fluent software and stored in .cas format. The original simulation model is loaded into the workspace. The model contains complete information such as the train geometry, boundary conditions (such as far-field pressure and velocity), and initial flow field parameters (such as temperature and density). Fluent's grid setting module sets the grid size of the flow field calculation domain, and sets the global grid size to 0.05 meters based on the train model size and simulation accuracy requirements. The train surface and key parts (such as the front and bogie areas) are locally encrypted, and the encryption level is set to level 3. The software uses hybrid grid technology to generate unstructured tetrahedral grids for the train surface and near-wall areas to ensure boundary layer flow capture; structured hexahedral grids are generated for areas far away from the train to improve computing efficiency. After division, a model containing 50,000 flow field calculation domain grid sub-units is obtained. Based on these grid sub-units, Python is combined with the NumPy library to write a key area identification program, and the velocity and pressure data of each grid sub-unit are extracted from the result file output by Fluent. The velocity gradient and pressure gradient are calculated. Then, the velocity gradient corresponding to each grid sub-unit is obtained from the original flow field CFD simulation model. , pressure gradient and turbulence intensity, and use Python's NumPy library to process these data. For each grid sub-unit, the grid sub-area is identified according to specific rules. If the velocity gradient increases from zero, for example, in a certain grid sub-unit, the velocity gradient gradually increases from the initial 0.01 to 0.1; the pressure gradient is in the negative region, such as the pressure gradient is -0.05; and the turbulence intensity changes sharply, such as the turbulence intensity increases from 0.2 to 0.8 in a short time, then the flow field calculation domain grid sub-unit is determined as the boundary layer sub-grid; if the velocity gradient and pressure gradient show a sudden change, such as the velocity gradient changes from 0.2 to 0.8 instantly, the pressure gradient changes from 0.01 to 0.1, and the turbulence intensity changes dramatically, such as from 0.3 to 0.9, then the grid sub-unit is determined to be a shock wave sub-grid; and for the identification of the vortex sub-grid, the corresponding curl is calculated according to the velocity gradient, and the formula is used. in represents the Laplace operator, Respectively represent the velocity curvature of the fluid along the x, y and z directions of the flow field. When the calculated curl increases significantly, such as from 0.02 to 0.1, the pressure gradient is relatively gentle, such as the pressure gradient fluctuates between 0.01-0.02, and the turbulence intensity changes sharply, such as from 0.2 to 0.7, the grid sub-unit is determined as a vortex sub-grid, and the distance between two adjacent sub-grids is calculated. If it is 1, it means that they are directly adjacent, and they are grouped in the same block set. If the distance is not 1, they are divided into different boundary layer block sets. At the same time, the flow field key area of ​​the original CFD simulation model is divided based on the range of these blocks. , in order to use Python's Matplotlib library to assist in visualizing these blocks. For each block, its range in the flow field calculation domain is determined, that is, the coordinate range of all sub-grids contained in the block. By traversing all sub-grids in the block, the minimum and maximum coordinate values ​​are found to determine the boundary of the block, thereby determining the specific range of the block in the flow field. The range of these blocks is marked in the original CFD simulation model of the flow field to form the key grid area of ​​the fluid mechanics flow field, which contains the type of each key grid area (boundary layer, shock wave, vortex), coordinate range and other information, and finally generates the key grid area of ​​the fluid mechanics flow field.

[0079] Step S2: obtaining the mesh aspect ratio and distortion corresponding to each mesh sub-unit in the key mesh area of ​​the fluid dynamics flow field, and performing mesh constraint update on the key mesh area of ​​the fluid dynamics flow field based on the mesh aspect ratio and distortion corresponding to each mesh sub-unit to generate an updated mesh area of ​​the fluid dynamics flow field;

[0080] In the embodiment of the present invention, the geometric information of each grid sub-unit in the key grid area of ​​the fluid mechanics flow field is obtained by using Python's PyMesh library. For each grid sub-unit, the grid length L and grid width H are obtained by calculating the side lengths of the grid sub-unit in the x-direction and the y-direction in the Cartesian coordinate system, and then the grid aspect ratio is calculated. At the same time, the Jacobian matrix is ​​calculated using the built-in function of the PyMesh library according to the node coordinates of the grid sub-unit. The formula The mesh distortion is calculated, and the mesh quality constraints are set: the mesh aspect ratio must satisfy 0.3≤λ≤3, and the mesh distortion τ≤0.1. For mesh sub-units that do not meet the conditions, OpenFOAM's mesh repair tools checkMesh and refineMesh are used to adjust them. For example, if the aspect ratio of a mesh sub-unit is 4, which exceeds the threshold, its shape is adjusted by proportionally scaling the node coordinates; if the distortion is 0.15, which is greater than the threshold, the local mesh reconstruction algorithm is used to regenerate the node and unit topology structure. After iterative adjustment, the updated mesh area of ​​the fluid mechanics flow field that meets the quality requirements is finally generated.

[0081] Step S3: obtaining the corresponding Reynolds number and turbulence scale by updating the grid area of ​​the fluid mechanics flow field, and dynamically selecting and modeling the turbulence model for the updated grid area of ​​the fluid mechanics flow field based on the Reynolds number and turbulence scale to generate a dynamic turbulence model for the flow field grid area;

[0082] In the embodiment of the present invention, the grid information corresponding to the grid area of ​​the fluid dynamics flow field update is extracted from the previous step, and the Reynolds number and turbulence scale are calculated by combining the flow field data calculated by ANSYS Fluent. The Reynolds number calculation formula is: Where ρ represents the fluid density, U represents the fluid velocity, C represents the fluid length, and μ represents the fluid viscosity. For example, at a certain grid subunit, ρ = 1.225 kg / m 3 , U=30m / s, C=0.2m, μ=1.7894×10 -5 Pa·s, substituting into the formula, we can get Re≈4.1×10 5 , the turbulence scale calculation formula is Where k represents the turbulent kinetic energy, ∈ represents the turbulent dissipation rate, and C μ represents the empirical constant, with a value of 0.09. The turbulence scale threshold is set to 0.15 meters. If the turbulence scale of a grid subunit is greater than the threshold and the Reynolds number is greater than 10 5 , then the k-∈ model is selected; if it is less than the threshold, the k-ω model is selected, and all grid sub-units are traversed to select the appropriate turbulence model for each area, and finally the dynamic turbulence model of the flow field grid area is generated.

[0083] Step S4: performing finite volume division on the dynamic turbulence model of the flow field grid area to obtain the dynamic turbulence finite subunit models of each flow field; performing error simulation correction optimization on the corresponding original solution in the dynamic turbulence model of the flow field grid area based on the dynamic turbulence finite subunit models of each flow field to obtain the corrected fluid mechanics flow field quantity calculation results.

[0084] In an embodiment of the present invention, based on the model parameters and calculation results obtained from the previous analysis, a finite volume partition is performed on the dynamic turbulence model of the flow field grid area, and the mesh processing tool snappyHexMesh of the OpenFOAM software is used to perform the partitioning operation. The mesh partitioning parameters are set in the control file of the software, and the entire flow field grid area is discretized according to the hexahedral grid structure. During the partitioning process, the software automatically divides each grid sub-unit into multiple smaller finite sub-units. Each finite sub-unit model has clear geometric boundaries and volume information. The grid file generated by snappyHexMesh is stored in .poly format, and the vertex coordinates, volume, and adjacent relationships of each finite sub-unit are recorded in detail in the file. Secondly, by reading the various flow field dynamic turbulence finite sub-unit models obtained from the previous partitioning, a calculation program is written using Python combined with the NumPy library to calculate the corresponding local truncation error of each flow field dynamic turbulence finite sub-unit model. For example, relevant parameters are obtained from the calculation results of the flow field grid area dynamic turbulence model, and the corresponding discrete equations are constructed as follows: in, represents the solution of the scalar variable φ of the i-th finite subunit at time n+1, represents the solution of the scalar variable φ of the i-th finite subunit at time n, Δt represents the time step, specifically the time interval between two adjacent time steps, V i represents the volume of the i-th finite subunit, F f represents the convective flux vector on the finite subelement f, which is used to describe the transmission rate of the scalar variable φ through the surface f, φ f represents the value of the scalar variable φ on the surface f, Γ f represents the diffusion coefficient on the surface f, represents the gradient of the scalar variable φ on the surface f, S f represents the area vector on the surface f, ε i represents the amount of scalar variable φ generated in the i-th finite sub-element; the solution of the scalar variable in the i-th finite sub-element at time n is satisfy: The solution of the scalar variable of its finite subunit at time n+1 is Perform Taylor expansion: Substituting it into the discrete equation and simplifying it, we can get: Therefore, the local truncation error T can be obtained by solving The difference between the satisfied equation and the discretized equation is calculated as: For example, assuming that the time step Δt = 1s, the local truncation error is calculated. After calculation, the local truncation error of the finite sub-element is about 0.5. The above calculation process is repeated for all 50,000 finite sub-elements to obtain the corresponding local truncation error. Then, by reading the corresponding local truncation error and the original solution data of the dynamic turbulence model in the flow field grid area, an error correction program is written in Python. Taking the finite sub-element numbered 10001 as an example, the value of its original solution in a certain physical quantity is 20, and the corresponding local truncation error is 0.5. According to the correction formula The corrected fluid dynamics flow field quantity calculation result, i.e. 20-0.5=19.5, is calculated. The same error correction operation is performed on the original solutions of all 50,000 finite sub-elements. The original solution data array and the local truncation error array are traversed, and the corresponding local truncation error is subtracted from the original solution of each finite sub-element to obtain the corrected result. These corrected results will be used for subsequent more accurate fluid dynamics analysis, such as calculating the aerodynamic force, aerodynamic heat and other parameters of the aircraft, providing more reliable data support for fluid dynamics calculations based on CFD simulation optimization.

[0085] Furthermore, step S1 includes the following steps:

[0086] Step S11: obtaining the original CFD simulation model of the flow field corresponding to fluid mechanics;

[0087] Step S12: setting the flow field calculation domain grid size and dividing the flow field CFD original simulation model into calculation domain grids based on the flow field calculation domain grid size to obtain various flow field calculation domain grid sub-units;

[0088] Step S13: Calculating the velocity gradient and pressure gradient corresponding to each grid sub-unit through each grid sub-unit of the flow field calculation domain;

[0089] The velocity gradient is specifically: The pressure gradient is specifically:

[0090] in, represents the divergence operator, u represents the fluid velocity vector, They represent the velocity change rate of the fluid along the x, y and z directions of the flow field, p represents the fluid pressure, They represent the pressure change rate of the fluid along the x, y and z directions of the flow field respectively;

[0091] Step S14: Calculate the turbulence intensity corresponding to each grid sub-unit through each flow field calculation domain grid sub-unit; wherein the turbulence intensity is specifically in and They represent the root mean square values ​​of the velocity components corresponding to the fluid turbulence in the x, y and z directions of the flow field, Indicates the average flow velocity of the fluid;

[0092] Step S15: Based on the velocity gradient and pressure gradient corresponding to each grid sub-unit and in combination with the turbulence intensity corresponding to each grid sub-unit, the flow field key area of ​​the original CFD simulation model is identified to generate the fluid mechanics flow field key grid area.

[0093] As an embodiment of the present invention, refer to Figure 2 As shown, Figure 1 Detailed step flow diagram of step S1 in FIG. 1 , in this embodiment, step S1 includes the following steps:

[0094] Step S11: obtaining the original CFD simulation model of the flow field corresponding to fluid mechanics;

[0095] In an embodiment of the present invention, in a fluid mechanics calculation task based on CFD simulation optimization, the original CFD simulation model of the flow field corresponding to fluid mechanics is first obtained from a professional CFD simulation software project library. Taking a certain aircraft aerodynamics simulation project as an example, the model is created by ANSYS Fluent software and stored as a .cas format file. The file is directly called in the project folder path of the computer's local disk, or the model file is loaded using the file management function of the ANSYS Workbench platform. The model contains complete information such as the aircraft's geometric shape, boundary conditions, initial flow field parameters, such as the aircraft's wing shape, fuselage size and other geometric data, as well as parameters such as the Mach number of 0.8 and the temperature of 288K set by the far-field boundary conditions, providing basic data support for subsequent calculations and analysis.

[0096] Step S12: setting the flow field calculation domain grid size and dividing the flow field CFD original simulation model into calculation domain grids based on the flow field calculation domain grid size to obtain various flow field calculation domain grid sub-units;

[0097] In the embodiment of the present invention, after obtaining the original CFD simulation model of the flow field, the computational domain meshing operation is performed in the mesh setting module of the ANSYS Fluent software to set the mesh size of the flow field computational domain according to the simulation requirements and model complexity. For the above-mentioned aircraft external flow field simulation, the global mesh size is set to 0.01 meters in the mesh size input box of the software. The software adopts a hybrid meshing method, and uses unstructured tetrahedral meshes to finely divide the aircraft surface and the nearby flow field area to capture complex boundary layer flow and shock wave flow characteristics; and uses structured hexahedral meshes to divide the flow field area away from the aircraft to improve computational efficiency. During the division process, the software automatically divides the flow field calculation domain into multiple grid sub-units according to the set grid size and model geometry. After calculation, a flow field calculation domain grid containing 500,000 grid sub-units is obtained. Each grid sub-unit has a clear spatial position and geometric shape in the Cartesian coordinate system. For example, the grid sub-unit numbered 1000 has a minimum coordinate of (0.1, 0.2, 0.3) meters and a maximum coordinate of (0.11, 0.21, 0.31) meters, forming a discretized flow field calculation area, laying the foundation for the calculation of subsequent physical quantities.

[0098] Step S13: Calculating the velocity gradient and pressure gradient corresponding to each grid sub-unit through each grid sub-unit of the flow field calculation domain;

[0099] The velocity gradient is specifically:

[0100] The pressure gradient is specifically:

[0101] in, represents the divergence operator, u represents the fluid velocity vector, They represent the velocity change rate of the fluid along the x, y and z directions of the flow field, p represents the fluid pressure, They represent the pressure change rate of the fluid along the x, y and z directions of the flow field, Represent the unit vectors in the x, y and z directions of the flow field respectively;

[0102] In the embodiment of the present invention, after completing the grid division of the flow field calculation domain, the solver function of the ANSYS Fluent software is used to calculate the velocity gradient and pressure gradient of each grid sub-unit of the flow field calculation domain. The software solves each grid sub-unit through the discretized control equation based on the finite volume method. For the velocity gradient calculation, according to the formula That is to say in represents the divergence operator, u represents the fluid velocity vector, Respectively represent the velocity change rate of the fluid along the x, y and z directions of the flow field. Taking the grid subunit numbered 2000 as an example, the software obtains the velocity change rate of the grid subunit in the x direction through iterative calculation Velocity change rate in the y direction Velocity change rate in the z direction The velocity gradient is calculated as For pressure gradient calculation, according to the formula That is to say Taking the grid cell numbered 2000 as an example, the pressure change rate in the x direction is calculated. Pressure change rate in the y direction Pressure change rate in the z direction The pressure gradient is then obtained as The software stores the velocity gradient and pressure gradient calculation results of all grid sub-cells in the data file for subsequent analysis.

[0103] Step S14: Calculate the turbulence intensity corresponding to each grid sub-unit through each flow field calculation domain grid sub-unit; wherein the turbulence intensity is specifically in and They represent the root mean square values ​​of the velocity components corresponding to the fluid turbulence in the x, y and z directions of the flow field, Indicates the average flow velocity of the fluid;

[0104] In the embodiment of the present invention, after calculating the velocity gradient and pressure gradient, the turbulence intensity corresponding to each grid sub-unit is calculated using ANSYS Fluent software to calculate the turbulence intensity according to the turbulence intensity calculation formula. in and They represent the root mean square values ​​of the velocity components corresponding to the fluid turbulence in the x, y and z directions of the flow field, Represents the average flow velocity of the fluid. The software obtains the turbulence-related parameters of each grid sub-element by solving the Reynolds-averaged Navier-Stokes equations (RANS) and turbulence model equations (such as the standard k-∈ model). In the discretized flow field calculation domain grid sub-element, it is assumed that within a certain grid sub-element, the turbulent velocity component in the x direction is sampled n times, and the obtained velocity component values ​​are u′1, u′2, ..., u′ n , its RMS value The calculation formula is RMS values ​​in the y and z directions and The calculation method is the same as that of the average flow velocity of the fluid. When calculating the average flow velocity of the fluid, if it is known that the velocities of the fluid in the x, y and z directions are u, v and w respectively within a certain period of time, then the average flow velocity of the fluid is The calculation formula is Taking the grid subunit numbered 3000 as an example, the software calculates the root mean square value of the turbulent velocity component in the x direction in y direction In the z direction At the same time, the average flow velocity of the fluid in the grid sub-unit is calculated Substituting these parameters into the formula, we obtain turbulence intensity I = 0.1. The software performs the same calculation on all grid sub-units and stores the turbulence intensity results of each grid sub-unit in a dedicated data array, providing important turbulence characteristic data for identifying key areas of the flow field, and ultimately obtaining the turbulence intensity corresponding to each grid sub-unit.

[0105] Step S15: Based on the velocity gradient and pressure gradient corresponding to each grid sub-unit and in combination with the turbulence intensity corresponding to each grid sub-unit, the flow field key area of ​​the original CFD simulation model is identified to generate the fluid mechanics flow field key grid area.

[0106] In an embodiment of the present invention, the velocity gradient, pressure gradient and turbulence intensity data corresponding to each grid sub-unit are obtained from the original CFD simulation model of the flow field, and these data are processed using Python's NumPy library. For each grid sub-unit, the grid sub-area is identified according to specific rules. If the velocity gradient increases from zero, for example, in a certain grid sub-unit, the velocity gradient gradually increases from the initial 0.01 to 0.1; the pressure gradient is in the negative value area, such as the pressure gradient is -0.05; and the turbulence intensity changes sharply, such as the turbulence intensity increases from 0.2 to 0.8 in a short time, then the flow field calculation domain grid sub-unit is determined as a boundary layer sub-grid; if the velocity gradient and pressure gradient show a sudden change, such as the velocity gradient instantly changes from 0.2 to 0.8, the pressure gradient changes from 0.01 to 0.1, and the turbulence intensity changes dramatically, such as from 0.3 to 0.9, then the grid sub-unit is determined to be a shock wave sub-grid; and for the identification of the vortex sub-grid, the corresponding curl is calculated according to the velocity gradient, and the formula is used. in represents the Laplace operator, Respectively represent the velocity curvature of the fluid along the x, y and z directions of the flow field. When the calculated curl increases significantly, such as from 0.02 to 0.1, the pressure gradient is relatively gentle, such as the pressure gradient fluctuates between 0.01-0.02, and the turbulence intensity changes sharply, such as from 0.2 to 0.7, the grid sub-unit is determined to be a vortex sub-grid. Secondly, for each type of sub-grid, the distance between any two adjacent sub-grids (including any two boundary layer sub-grids, shock wave sub-grids or vortex sub-grids) in all boundary layer sub-grids, shock wave sub-grids or vortex sub-grids is calculated. If the distance between two adjacent sub-grids is 1, it means that they are directly adjacent and are grouped in the same block set. If the distance is not 1, they are divided into different boundary layer block sets. The same is done for shock wave sub-grids and vortex sub-grids. The above operation is performed, and then, after obtaining the boundary layer grid block, shock wave grid block and vortex grid block, the flow field CFD original simulation model is divided into key areas of the flow field based on the range of these blocks, so as to assist in visualizing these blocks by using Python's Matplotlib library. For each block, its range in the flow field calculation domain is determined, that is, the coordinate range of all sub-grids contained in the block, and the minimum and maximum coordinate values ​​are found by traversing all sub-grids in the block to determine the boundary of the block, thereby determining the specific range of the block in the flow field, and marking the range of these blocks in the flow field CFD original simulation model to form a fluid mechanics flow field key grid area, which contains information such as the type of each key grid area (boundary layer, shock wave, vortex), coordinate range, etc., and finally generates the fluid mechanics flow field key grid area.

[0107] Furthermore, step S15 includes the following steps:

[0108] Step S151: performing grid sub-region identification on each corresponding grid sub-unit of the flow field calculation domain based on the velocity gradient and pressure gradient corresponding to each grid sub-unit and in combination with the turbulence intensity corresponding to each grid sub-unit, so as to obtain the boundary layer sub-grid, shock wave sub-grid, and vortex sub-grid corresponding to the flow field calculation domain;

[0109] Step S152: performing subgrid set processing on the boundary layer subgrids, shock wave subgrids, and vortex subgrids corresponding to the flow field calculation domain, so as to calculate the corresponding distance between any two adjacent corresponding boundary layer subgrids, shock wave subgrids, or vortex subgrids. If the distance between any two adjacent corresponding boundary layer subgrids, shock wave subgrids, or vortex subgrids is 1, they are grouped in the same block set; otherwise, they are divided into two corresponding block sets, thereby obtaining each flow field boundary layer grid block, flow field shock wave grid block, and flow field vortex grid block.

[0110] Step S153: Divide the flow field CFD original simulation model into key flow field areas based on the block ranges corresponding to each flow field boundary layer grid block, flow field shock wave grid block, and flow field vortex grid block to generate the fluid mechanics flow field key grid area.

[0111] As an embodiment of the present invention, refer to Figure 3 As shown, Figure 2 Detailed step flow diagram of step S15 in the embodiment, step S15 includes the following steps:

[0112] Step S151: performing grid sub-region identification on each corresponding grid sub-unit of the flow field calculation domain based on the velocity gradient and pressure gradient corresponding to each grid sub-unit and in combination with the turbulence intensity corresponding to each grid sub-unit, so as to obtain the boundary layer sub-grid, shock wave sub-grid, and vortex sub-grid corresponding to the flow field calculation domain;

[0113] In an embodiment of the present invention, the velocity gradient, pressure gradient and turbulence intensity data corresponding to each grid sub-unit are obtained from the original CFD simulation model of the flow field, and these data are processed using Python's NumPy library. For each grid sub-unit, the grid sub-area is identified according to specific rules. If the velocity gradient increases from zero, for example, in a certain grid sub-unit, the velocity gradient gradually increases from the initial 0.01 to 0.1; the pressure gradient is in the negative value area, such as the pressure gradient is -0.05; and the turbulence intensity changes sharply, such as the turbulence intensity increases from 0.2 to 0.8 in a short time, then the flow field calculation domain grid sub-unit is determined as a boundary layer sub-grid; if the velocity gradient and pressure gradient show a sudden change, such as the velocity gradient instantly changes from 0.2 to 0.8, the pressure gradient changes from 0.01 to 0.1, and the turbulence intensity changes dramatically, such as from 0.3 to 0.9, then the grid sub-unit is determined to be a shock wave sub-grid; and for the identification of the vortex sub-grid, the corresponding curl is calculated according to the velocity gradient, and the formula is used. in represents the Laplace operator, They represent the velocity curvature of the fluid along the x, y, and z directions of the flow field, respectively. When the calculated curl increases significantly, such as from 0.02 to 0.1, the pressure gradient is relatively gentle, such as the pressure gradient fluctuates between 0.01 and 0.02, and the turbulence intensity changes sharply, such as from 0.2 to 0.7, the grid sub-unit is determined to be a vortex sub-grid. By performing the above judgment on all grid sub-units, the boundary layer sub-grid, shock wave sub-grid, and vortex sub-grid corresponding to the flow field calculation domain are finally obtained.

[0114] Step S152: performing subgrid set processing on the boundary layer subgrids, shock wave subgrids, and vortex subgrids corresponding to the flow field calculation domain, so as to calculate the corresponding distance between any two adjacent corresponding boundary layer subgrids, shock wave subgrids, or vortex subgrids. If the distance between any two adjacent corresponding boundary layer subgrids, shock wave subgrids, or vortex subgrids is 1, they are grouped in the same block set; otherwise, they are divided into two corresponding block sets, thereby obtaining each flow field boundary layer grid block, flow field shock wave grid block, and flow field vortex grid block.

[0115] In an embodiment of the present invention, after completing the grid sub-area identification, the boundary layer sub-grid, shock wave sub-grid and vortex sub-grid are subjected to sub-grid set processing, which is implemented by using Python's list and loop structure. For each type of sub-grid, the distance between any two adjacent sub-grids (including any two boundary layer sub-grids, shock wave sub-grids or vortex sub-grids) in all boundary layer sub-grids, shock wave sub-grids or vortex sub-grids is calculated respectively. The distance here is defined as the number of grid cells between the center points of two adjacent sub-grids. All sub-grids are traversed through a double loop. For example, for the boundary layer sub-grid, starting from the first sub-grid, it is calculated in turn with respect to it and all other adjacent boundary layer sub-grids. The distance between two adjacent subgrids is 1, which means they are directly adjacent. Group them in the same block set. You can use Python lists to store these block sets. Each list element represents a block set, which contains the subgrid numbers belonging to the block. For example, if boundary layer subgrid A and boundary layer subgrid B are adjacent and the distance is 1, add their numbers to the same list as a boundary layer block set. If the distance is not 1, they are divided into different boundary layer block sets. For shock wave subgrids and vortex subgrids, perform the above operations in the same way, and finally obtain each flow field boundary layer grid block, flow field shock wave grid block, and flow field vortex grid block.

[0116] Step S153: Divide the flow field CFD original simulation model into key flow field areas based on the block ranges corresponding to each flow field boundary layer grid block, flow field shock wave grid block, and flow field vortex grid block to generate the fluid mechanics flow field key grid area.

[0117] In an embodiment of the present invention, after obtaining the flow field boundary layer grid block, the flow field shock wave grid block and the flow field vortex grid block, the flow field CFD original simulation model is divided into key flow field areas based on the range of these blocks, so as to assist in visualizing these blocks by using Python's Matplotlib library. For each block, its range in the flow field calculation domain is determined, that is, the coordinate range of all sub-grids contained in the block, and the minimum and maximum coordinate values ​​are found by traversing all sub-grids in the block, thereby determining the boundary of the block. For example, for a flow field boundary layer grid block, traverse the sub-grids therein. All sub-grids are recorded, and the minimum and maximum values ​​of their x, y, and z coordinates are recorded to determine the specific range of the block in the flow field. The range of these blocks is marked in the original CFD simulation model of the flow field to form the key grid area of ​​the fluid mechanics flow field. The information of these key grid areas can be stored in a new file, such as in CSV format, which contains information such as the type of each key grid area (boundary layer, shock wave, vortex), coordinate range, etc. In this way, the division of the key areas of the flow field is completed, which provides an important basis for subsequent fluid mechanics calculations and optimizations, and finally generates the key grid areas of the fluid mechanics flow field.

[0118] Furthermore, the process of identifying the grid sub-area is as follows: if the trend corresponding to the velocity gradient is increasing from zero, the pressure gradient is in the negative region and the turbulence intensity changes sharply, then the corresponding flow field calculation domain grid sub-unit is determined as the boundary layer sub-grid; if the trend corresponding to the velocity gradient and the pressure gradient is a sudden change and the turbulence intensity changes sharply, then the corresponding flow field calculation domain grid sub-unit is determined as the shock wave sub-grid; if the corresponding curl is calculated according to the velocity gradient in represents the Laplace operator, They represent the velocity curvature of the fluid along the x, y, and z directions of the flow field, respectively. When the corresponding trend is judged to be significantly increased, the pressure gradient is relatively gentle, and the turbulence intensity changes sharply, the corresponding flow field calculation domain grid subunit is determined to be a vortex subgrid.

[0119] Furthermore, step S2 includes the following steps:

[0120] Step S21: obtaining the grid length and grid width corresponding to each grid sub-unit in the key grid area of ​​the fluid mechanics flow field;

[0121] In the embodiment of the present invention, the geometric parameter information of each grid sub-unit in the generated fluid mechanics flow field key grid area is stored in the grid data file of the CFD simulation model. Taking the simulation model of the air intake flow field of an aircraft engine as an example, its key grid area contains 2000 grid sub-units, and the grid data file adopts the general CGNS (CFD General Notation System) format, so that the file can be read by using Python combined with the PyCGNS library. The node coordinate information of each grid sub-unit in the Cartesian coordinate system can be directly obtained through the function pycgns.read in the library. For each grid sub-unit, the grid length and grid width are determined by calculating the difference between its node coordinates in the x-direction and the y-direction. For example, if the minimum node coordinate of a grid sub-unit in the x-direction is x_min=10 and the maximum node coordinate is x_max=12, then the grid length L=x_max-x_min=2; the minimum node coordinate in the y-direction is y_min=5 and the maximum node coordinate is y_max=6, then the grid width H=y_max-y_min=1. The grid length and grid width information corresponding to all grid sub-units are stored in the memory in the form of a two-dimensional array. The first dimension corresponds to the grid sub-unit number, and the second dimension stores the length and width values ​​respectively, forming a grid parameter table, which provides basic data for subsequent calculations. Finally, the grid length and grid width corresponding to each grid sub-unit are obtained.

[0122] Step S22: Calculate the aspect ratio value based on the grid length and grid width corresponding to each grid sub-unit to obtain the grid aspect ratio corresponding to each grid sub-unit. Where L represents the grid length and H represents the grid width;

[0123] In the embodiment of the present invention, the grid length L and grid width H data of each grid sub-unit are extracted from the previously obtained grid parameter table, and the Python NumPy library is used for numerical calculation. By writing a simple array operation code, the aspect ratio value of each grid sub-unit is calculated. For the grid sub-unit numbered i, its grid aspect ratio λ i The calculation formula is Taking the key grid area of ​​the fluid mechanics flow field containing 100 grid sub-units as an example, a for loop is used to traverse each row of data in the grid parameter table and calculate each grid sub-unit one by one. For example, the grid sub-unit numbered 15 has a grid length L 15 =3, grid width H 15 =1.5, substituting into the formula we can get λ 15=3 / 1.5=2. After the calculation is completed, the grid aspect ratio results of all grid sub-units are stored in a new one-dimensional array. The index of the array corresponds to the grid sub-unit number one by one, and finally the grid aspect ratio corresponding to each grid sub-unit is obtained.

[0124] Step S23: Obtain the Jacobian matrix corresponding to each grid sub-unit in the key grid area of ​​the fluid mechanics flow field, and calculate the grid torsional strength according to the Jacobian matrix corresponding to each grid sub-unit to obtain the torsional strength corresponding to each grid sub-unit. Where J represents the Jacobian matrix corresponding to the grid sub-unit, J0 represents the Jacobian matrix of the ideal grid unit, and det() represents the determinant of the matrix;

[0125] In the embodiment of the present invention, the Jacobian matrix information of each grid sub-unit is also stored in the grid data file in the CFD simulation model. Taking the flow field simulation data file generated by ANSYS Fluent as an example, the file is read using the Python pyFluent library. By calling the pyFluent.get_jacobian_matrix function, the Jacobian matrix J corresponding to each grid sub-unit can be obtained. The Jacobian matrix J0 of the ideal grid unit is the unit matrix, and its element value in the two-dimensional case is In the three-dimensional case, For each grid subcell, according to the formula Calculate the mesh torsional strength, where J represents the Jacobian matrix corresponding to the mesh subunit, J0 represents the Jacobian matrix of the ideal mesh unit, and det() represents the determinant of the matrix. For example, the Jacobian matrix of a mesh subunit is Its determinant det(J) = 0.9×1.1-0.1×(-0.1) = 1, and the determinant of the ideal grid cell Jacobian matrix det(J0) = 1. Substituting into the formula, we can obtain the torsional strength T = |1-1| / 1 = 0. By looping through all grid sub-units, their torsional strengths are calculated in turn, and the results are stored in a new array corresponding to the grid sub-unit number to form a grid torsional strength table, which provides a quantitative indicator for evaluating grid quality.

[0126] Step S24: The grid aspect ratio and distortion corresponding to each grid sub-unit are used as grid quality constraints, and based on the grid quality constraints, the grid constraints of the corresponding grid sub-units in the key grid area of ​​the fluid mechanics flow field are updated, so as to adjust the corresponding grid layout in real time according to the corresponding grid quality constraints to generate an updated grid area of ​​the fluid mechanics flow field.

[0127] In an embodiment of the present invention, the previously obtained mesh aspect ratio and mesh torsional strength are used as mesh quality constraints, and the optimization algorithm module scipy.optimize in the Python SciPy library is used in combination with the mesh generation interface of the CFD simulation software (such as the mesh generation tool snappyHexMesh of OpenFOAM). The mesh sub-units in the key mesh area of ​​the fluid mechanics flow field are constrained and updated. Taking the key mesh area of ​​a certain automobile external flow field simulation model as an example, the reasonable range of the mesh aspect ratio is set to 0.5≤λ≤2, and the torsional strength threshold is τ≤0.1. For the mesh sub-units that do not meet the constraints, the mesh shape and layout are changed by adjusting their node coordinates. For example, if the grid aspect ratio λ=3 of a grid sub-unit exceeds the reasonable range, it will be adjusted according to certain rules (such as proportionally scaling the node coordinates in the x and y directions); if the torsional strength τ=0.15, which is greater than the threshold, the Jacobian matrix will be recalculated by moving the node position until the torsional strength meets the requirements. During the update process, the grid quality constraints are monitored in real time, and iterative adjustments are made repeatedly until all grid sub-units meet the constraints. Finally, an updated grid area of ​​the fluid mechanics flow field that meets the quality requirements is generated, and the updated grid data is output in a format compatible with the CFD simulation software (such as OpenFOAM's .poly format) for subsequent more accurate fluid mechanics calculations and analysis.

[0128] Furthermore, step S3 includes the following steps:

[0129] Step S31: Update the grid area through the fluid mechanics flow field to obtain the corresponding Reynolds number Where ρ represents the fluid density, U represents the fluid velocity, C represents the fluid length, and μ represents the fluid viscosity;

[0130] In the embodiment of the present invention, after the generation of the updated grid area of ​​the fluid dynamics flow field is completed, the corresponding Reynolds number is obtained. Taking the updated grid area of ​​the external flow field simulation of a certain aircraft as an example, the required parameters are extracted from the database of the CFD simulation software (such as ANSYS Fluent). The fluid density ρ can be obtained from the set initial flow field conditions. Assume that in this simulation, the fluid density ρ is set to 1.225 kg / m 3 The fluid velocity U is obtained by solving the flow field equation. The fluid velocity U at a certain position in the grid area is 50 m / s. The fluid length C is the characteristic length of the aircraft wing, which is set to 2 m. The fluid viscosity μ is determined according to the fluid properties. For air, its viscosity μ is 1.7894×10 -5 Pa·s, and by using Python to write a calculation program, the above parameters are substituted into the Reynolds number calculation formula The numerical calculation is performed using the numpy library. The calculation process is: Re = 1.225 × 50 × 2 / 1.7894 × 10-5 ≈6.84×10 6 The calculated Reynolds number is stored in the data file of the simulation project. The file records the Reynolds number value corresponding to each grid sub-area in detail to provide data support for subsequent analysis.

[0131] Step S32: Calculate the corresponding turbulence scale by updating the grid area through the fluid mechanics flow field Where k represents the turbulent kinetic energy, ∈ represents the turbulent dissipation rate, and C μ represents the empirical constant, with a value of 0.09;

[0132] In the embodiment of the present invention, the turbulence scale is calculated by updating the grid area based on the fluid mechanics flow field. Taking the external flow field simulation of the aircraft as an example, the turbulent kinetic energy k and the turbulent dissipation rate ∈ are obtained from the calculation results of the CFD simulation software. In a specific grid sub-unit of the grid area, the turbulent kinetic energy k is obtained by solving the software to be 0.5m 2 / s 2 , the turbulent dissipation rate ∈ is 0.2m 2 / s 3 , using Python program, according to the turbulence scale calculation formula The empirical constant C μ Take the value as 0.09, substitute the obtained parameters into the formula for calculation, that is, l≈0.16m, repeat the above calculation process for all grid sub-units in the updated grid area of ​​the fluid dynamics flow field, record the grid sub-unit number and the corresponding turbulence scale value in table form, and finally obtain the corresponding turbulence scale.

[0133] Step S33: Based on the Reynolds number and the turbulence scale, the turbulence model is dynamically selected for the updated grid area of ​​the fluid mechanics flow field. If the turbulence scale is greater than or equal to the preset threshold, it is determined to be an end area far away from the wall and its fluid flow is in a high Reynolds number and fully developed turbulence state, and the corresponding k-∈ model is preferentially selected; if the turbulence scale is less than the preset threshold, it is determined to be an end area near the wall and its fluid flow is in a low Reynolds number and boundary layer turbulence state, and the corresponding k-ω model is preferentially selected, thereby modeling and generating a dynamic turbulence model of the flow field grid area.

[0134] In the embodiment of the present invention, after obtaining the Reynolds number and turbulence scale, a turbulence model is dynamically selected and modeled, and the preset threshold corresponding to the turbulence scale is set to 0.2m. The corresponding Reynolds number and turbulence scale are read by a program written in Python. For each grid sub-unit of the fluid mechanics flow field update grid area, the relationship between its turbulence scale and the preset threshold is judged. If the turbulence scale of a grid sub-unit is greater than or equal to 0.2m and the Reynolds number is greater than 10 5(High Reynolds number judgment standard), for example, in the area with grid subunit number 5000, the turbulence scale is 0.25m and the Reynolds number is 8×10 6 , then the region is determined to be far away from the wall end area, and the fluid flow is in a high Reynolds number, fully developed turbulent state, and the k-∈ model is preferred. In the k-∈ model, equation 1 describing the turbulent kinetic energy is Where k represents the turbulent kinetic energy, specifically t represents the time variable, u represents the fluid velocity vector, represents the gradient of turbulent kinetic energy, μ t It represents the viscosity of the turbulent flow away from the wall, specifically P k represents the turbulent kinetic energy generation term, specifically P k =μS 2 , where μ represents the fluid viscosity, S represents the shear stress corresponding to the fluid, and ∈ represents the turbulent dissipation rate; and the equation describing the turbulent dissipation rate ∈ is: Among them, C ∈1 and C ∈2 are the model constants corresponding to the equation describing the turbulent dissipation rate ∈, specifically any non-zero constants, It represents the gradient of turbulent dissipation rate and can be adjusted by setting the model constant C ∈1 =1.44, C ∈2 =1.92 to solve the equation; if the turbulence scale of a grid subunit is less than 0.2m, for example, the area with grid subunit number 1000 has a turbulence scale of 0.1m and a Reynolds number of 5×10 4 , then the region is determined to be the near-wall end region, and the fluid flow is in a turbulent state with low Reynolds number and boundary layer flow. The k-ω model is preferred. In the k-ω model, equation 2 describing the turbulent kinetic energy k is: Among them, μ c It represents the viscosity of turbulent flow near the wall, specifically β * represents the model constant corresponding to equation 2 describing the turbulent kinetic energy k, and ω represents the turbulence frequency; the equation describing the turbulence frequency ω is: Among them, α and β are the model constants corresponding to the equation describing the turbulence frequency ω. The model constant β is set to * =0.09, α=5 / 9, β=0.075, and the parameters are substituted for calculation. By judging and calculating all grid sub-units, a dynamic turbulence model of the flow field grid area is finally generated, providing an accurate turbulence simulation basis for subsequent fluid mechanics calculations based on CFD simulation optimization.

[0135] Furthermore, step S4 includes the following steps:

[0136] Step S41: performing finite volume partitioning on the dynamic turbulence model of the flow field grid area to obtain the dynamic turbulence finite subunit model of each flow field;

[0137] In an embodiment of the present invention, based on the model parameters and calculation results obtained from the previous analysis, a finite volume partitioning is performed on the dynamic turbulence model of the flow field grid area. The mesh processing tool snappyHexMesh of the OpenFOAM software is used to perform the partitioning operation. The mesh partitioning parameters are set in the control file of the software, and the entire flow field grid area is discretized according to the hexahedral grid structure. Taking the dynamic turbulence model of the flow field grid area of ​​a certain aircraft external flow field as an example, the model contains 10,000 grid sub-units. The grid refinement level is set to 3 in the snappyHexMesh tool, and the key areas in the model (such as the leading edge and trailing edge of the wing) are locally encrypted. During the partitioning process, the software automatically divides each grid sub-unit into multiple smaller finite sub-units, and finally obtains a flow field dynamic turbulence finite sub-unit model containing 50,000. Each finite sub-unit model has a clear geometric boundary and volume information. For example, the finite sub-unit numbered 10001 has a volume of 0.001m 3 The mesh file generated by snappyHexMesh is stored in .poly format, which records in detail the vertex coordinates, volume, and adjacent relationship of each finite sub-unit.

[0138] Step S42: Calculate the corresponding local truncation error T through each flow field dynamic turbulence finite subunit model, wherein the local truncation error T can be calculated by a discrete equation on the corresponding finite subunit, wherein the discrete equation is specifically:

[0139]

[0140] in, represents the solution of the scalar variable φ of the i-th finite subunit at time n+1, represents the solution of the scalar variable φ of the i-th finite subunit at time n, Δt represents the time step, specifically the time interval between two adjacent time steps, V i represents the volume of the i-th finite subunit, F f represents the convective flux vector on the finite subelement f, which is used to describe the transmission rate of the scalar variable φ through the surface f, φ f represents the value of the scalar variable φ on the surface f, Γ f represents the diffusion coefficient on the surface f, represents the gradient of the scalar variable φ on the surface f, S f represents the area vector on the surface f, ε i represents the amount of scalar variable φ generated in the i-th finite subunit;

[0141] Among them, the solution of the scalar variable of the i-th finite subunit at time n is satisfy:

[0142]

[0143] The solution of the scalar variable of its finite subunit at time n+1 is Perform Taylor expansion:

[0144]

[0145] Substituting it into the discrete equation and simplifying it, we can get:

[0146]

[0147] The local truncation error T can be obtained by solving The difference between the satisfied equation and the discretized equation is calculated as:

[0148]

[0149] In the embodiment of the present invention, by reading the dynamic turbulence finite subunit models of each flow field obtained by the previous division, a calculation program is written using Python combined with the NumPy library to calculate the corresponding local truncation error of each dynamic turbulence finite subunit model of the flow field. Taking the finite subunit numbered 10001 as an example, the relevant parameters are obtained from the calculation results of the dynamic turbulence model of the flow field grid area, and the corresponding discrete equation is constructed as follows: in, represents the solution of the scalar variable φ of the i-th finite subunit at time n+1, represents the solution of the scalar variable φ of the i-th finite subunit at time n, Δt represents the time step, specifically the time interval between two adjacent time steps, V i represents the volume of the i-th finite subunit, F f represents the convective flux vector on the finite subelement f, which is used to describe the transmission rate of the scalar variable φ through the surface f, φ f represents the value of the scalar variable φ on the surface f, Γ f represents the diffusion coefficient on the surface f, represents the gradient of the scalar variable φ on the surface f, S f represents the area vector on the surface f, ε i represents the amount of scalar variable φ generated in the i-th finite sub-element; the solution of the scalar variable in the i-th finite sub-element at time n is satisfy: The solution of the scalar variable of its finite subunit at time n+1 is Perform Taylor expansion: Substituting it into the discrete equation and simplifying it, we can get: Therefore, the local truncation error T can be obtained by solving The difference between the satisfied equation and the discretized equation is calculated as: Assuming that the time step Δt=1s, the local truncation error is calculated. The local truncation error of the finite sub-element is calculated to be about 0.5. The above calculation process is repeated for all 50,000 finite sub-elements to finally obtain the corresponding local truncation error.

[0150] Step S43: Based on the local truncation error T, the original solution φ corresponding to the dynamic turbulence model in the flow field grid area is calculated. i Error simulation correction optimization is performed to obtain the corrected fluid mechanics flow field calculation results, where the corrected fluid mechanics flow field calculation results are specifically as follows:

[0151] In the embodiment of the present invention, the error correction program is written in Python by reading the original solution data of the corresponding local truncation error and the dynamic turbulence model of the flow field grid area. Taking the finite subunit numbered 10001 as an example, the value of its original solution on a certain physical quantity is 20, and the corresponding local truncation error is 0.5. According to the correction formula The corrected fluid dynamics flow field quantity calculation result, i.e. 20-0.5=19.5, is calculated. The same error correction operation is performed on the original solutions of all 50,000 finite sub-elements. The original solution data array and the local truncation error array are traversed, and the corresponding local truncation error is subtracted from the original solution of each finite sub-element to obtain the corrected result. These corrected results will be used for subsequent more accurate fluid dynamics analysis, such as calculating the aerodynamic force, aerodynamic heat and other parameters of the aircraft, providing more reliable data support for fluid dynamics calculations based on CFD simulation optimization.

[0152] Furthermore, the present invention also provides a fluid dynamics calculation system based on CFD simulation optimization, which is used to execute the fluid dynamics calculation method based on CFD simulation optimization as described above. The fluid dynamics calculation system based on CFD simulation optimization includes:

[0153] The flow field key area identification module is used to obtain the flow field CFD original simulation model corresponding to fluid mechanics; by setting the flow field calculation domain grid size and dividing the flow field CFD original simulation model into calculation domain grids based on the flow field calculation domain grid size, each flow field calculation domain grid sub-unit is obtained; based on each flow field calculation domain grid sub-unit, the flow field key area of ​​the flow field CFD original simulation model is identified, thereby generating the fluid mechanics flow field key grid area;

[0154] A grid constraint update module is used to obtain the grid aspect ratio and distortion corresponding to each grid sub-unit in the key grid area of ​​the fluid dynamics flow field through the key grid area of ​​the fluid dynamics flow field, and perform grid constraint update on the key grid area of ​​the fluid dynamics flow field based on the grid aspect ratio and distortion corresponding to each grid sub-unit to generate an updated grid area of ​​the fluid dynamics flow field;

[0155] The turbulence dynamic modeling module is used to obtain the corresponding Reynolds number and turbulence scale by updating the grid area of ​​the fluid mechanics flow field, and dynamically select and model the turbulence model of the updated grid area of ​​the fluid mechanics flow field based on the Reynolds number and turbulence scale, thereby generating a dynamic turbulence model of the flow field grid area;

[0156] The flow field original solution error optimization module is used to perform finite volume division on the dynamic turbulence model of the flow field grid area to obtain the dynamic turbulence finite sub-unit model of each flow field; based on the dynamic turbulence finite sub-unit model of each flow field, the error simulation correction and optimization of the corresponding original solution in the dynamic turbulence model of the flow field grid area is performed to obtain the corrected fluid mechanics flow field quantity calculation results.

[0157] The present invention is therefore intended to be illustrative and non-restrictive in all respects, with the scope of the invention being defined by the appended claims rather than the foregoing description, and all changes that come within the meaning and range of equivalents of the application documents are intended to be embraced therein.

[0158] The foregoing description is intended only to provide specific embodiments of the present invention, which will enable those skilled in the art to understand and implement the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not intended to be limited to the embodiments shown herein, but is to be construed in the widest possible manner consistent with the principles and novel features disclosed herein.

Claims

1. A fluid mechanics calculation method based on CFD simulation optimization, characterized in that: The following steps are involved: Step S1: Obtain the original CFD simulation model of the flow field corresponding to fluid mechanics; By setting the flow field calculation domain grid size, and dividing the calculation domain grid of the flow field CFD original simulation model based on the flow field calculation domain grid size, each flow field calculation domain grid sub-unit is obtained; based on each flow field calculation domain grid sub-unit, the flow field key area of ​​the flow field CFD original simulation model is identified to generate the fluid mechanics flow field key grid area; Step S2: obtaining the mesh aspect ratio and distortion corresponding to each mesh sub-unit in the key mesh area of ​​the fluid dynamics flow field, and performing mesh constraint update on the key mesh area of ​​the fluid dynamics flow field based on the mesh aspect ratio and distortion corresponding to each mesh sub-unit to generate an updated mesh area of ​​the fluid dynamics flow field; Step S3: obtaining the corresponding Reynolds number and turbulence scale by updating the grid area of ​​the fluid mechanics flow field, and dynamically selecting and modeling the turbulence model for the updated grid area of ​​the fluid mechanics flow field based on the Reynolds number and turbulence scale to generate a dynamic turbulence model for the flow field grid area; Step S4: performing finite volume partitioning on the dynamic turbulence model of the flow field grid area to obtain the dynamic turbulence finite subunit model of each flow field; Based on the dynamic turbulence finite subunit model of each flow field, the error simulation correction and optimization of the corresponding original solution in the dynamic turbulence model of the flow field grid area are performed to obtain the corrected fluid mechanics flow field quantity calculation results.

2. The fluid mechanics calculation method based on CFD simulation optimization according to claim 1, characterized in that: Step S1 includes the following steps: Step S11: obtaining the original CFD simulation model of the flow field corresponding to fluid mechanics; Step S12: setting the flow field calculation domain grid size and dividing the flow field CFD original simulation model into calculation domain grids based on the flow field calculation domain grid size to obtain various flow field calculation domain grid sub-units; Step S13: Calculating the velocity gradient and pressure gradient corresponding to each grid sub-unit through each grid sub-unit of the flow field calculation domain; The velocity gradient is specifically: The pressure gradient is specifically: in, represents the divergence operator, u represents the fluid velocity vector, They represent the velocity change rate of the fluid along the x, y and z directions of the flow field, p represents the fluid pressure, They represent the pressure change rate of the fluid along the x, y and z directions of the flow field, Represent the unit vectors in the x, y and z directions of the flow field respectively; Step S14: Calculate the turbulence intensity corresponding to each grid sub-unit through each flow field calculation domain grid sub-unit; wherein the turbulence intensity is specifically in and They represent the root mean square values ​​of the velocity components corresponding to the fluid turbulence in the x, y and z directions of the flow field, Indicates the average flow velocity of the fluid; Step S15: Based on the velocity gradient and pressure gradient corresponding to each grid sub-unit and in combination with the turbulence intensity corresponding to each grid sub-unit, the flow field key area of ​​the original CFD simulation model is identified to generate the fluid mechanics flow field key grid area.

3. The fluid mechanics calculation method based on CFD simulation optimization according to claim 2, characterized in that: Step S15 includes the following steps: Step S151: performing grid sub-region identification on each corresponding grid sub-unit of the flow field calculation domain based on the velocity gradient and pressure gradient corresponding to each grid sub-unit and in combination with the turbulence intensity corresponding to each grid sub-unit, so as to obtain the boundary layer sub-grid, shock wave sub-grid, and vortex sub-grid corresponding to the flow field calculation domain; Step S152: performing subgrid set processing on the boundary layer subgrids, shock wave subgrids, and vortex subgrids corresponding to the flow field calculation domain, so as to calculate the corresponding distance between any two adjacent corresponding boundary layer subgrids, shock wave subgrids, or vortex subgrids. If the distance between any two adjacent corresponding boundary layer subgrids, shock wave subgrids, or vortex subgrids is 1, they are grouped in the same block set; otherwise, they are divided into two corresponding block sets, thereby obtaining each flow field boundary layer grid block, flow field shock wave grid block, and flow field vortex grid block. Step S153: Divide the flow field CFD original simulation model into key flow field areas based on the block ranges corresponding to each flow field boundary layer grid block, flow field shock wave grid block, and flow field vortex grid block to generate the fluid mechanics flow field key grid area.

4. The fluid mechanics calculation method based on CFD simulation optimization according to claim 3, characterized in that: The specific process of identifying the grid sub-area is as follows: if the trend corresponding to the velocity gradient is increasing from zero, the pressure gradient is in the negative region, and the turbulence intensity changes sharply, then the corresponding flow field calculation domain grid sub-unit is determined as a boundary layer sub-grid; If the trend of the velocity gradient and pressure gradient is a sudden change and the turbulence intensity changes dramatically, the corresponding flow field calculation domain grid sub-unit is determined as the shock wave sub-grid; if the corresponding curl is calculated according to the velocity gradient in represents the Laplace operator, They represent the velocity curvature of the fluid along the x, y, and z directions of the flow field, respectively. When the corresponding trend is judged to be significantly increased, the pressure gradient is relatively gentle, and the turbulence intensity changes sharply, the corresponding flow field calculation domain grid subunit is determined to be a vortex subgrid.

5. The fluid mechanics calculation method based on CFD simulation optimization according to claim 1, characterized in that: Step S2 includes the following steps: Step S21: obtaining the grid length and grid width corresponding to each grid sub-unit in the key grid area of ​​the fluid mechanics flow field; Step S22: Calculate the aspect ratio value based on the grid length and grid width corresponding to each grid sub-unit to obtain the grid aspect ratio corresponding to each grid sub-unit. Where L represents the grid length and H represents the grid width; Step S23: Obtain the Jacobian matrix corresponding to each grid sub-unit in the key grid area of ​​the fluid mechanics flow field, and calculate the grid torsional strength according to the Jacobian matrix corresponding to each grid sub-unit to obtain the torsional strength corresponding to each grid sub-unit. Where J represents the Jacobian matrix corresponding to the grid sub-unit, J0 represents the Jacobian matrix of the ideal grid unit, and det() represents the determinant of the matrix; Step S24: The grid aspect ratio and distortion corresponding to each grid sub-unit are used as grid quality constraints, and based on the grid quality constraints, the grid constraints of the corresponding grid sub-units in the key grid area of ​​the fluid mechanics flow field are updated, so as to adjust the corresponding grid layout in real time according to the corresponding grid quality constraints to generate an updated grid area of ​​the fluid mechanics flow field.

6. The fluid mechanics calculation method based on CFD simulation optimization according to claim 1, characterized in that: Step S3 includes the following steps: Step S31: Update the grid area through the fluid mechanics flow field to obtain the corresponding Reynolds number Where ρ represents the fluid density, U represents the fluid velocity, C represents the fluid length, and μ represents the fluid viscosity; Step S32: Calculate the corresponding turbulence scale by updating the grid area through the fluid mechanics flow field Where k represents the turbulent kinetic energy, ∈ represents the turbulent dissipation rate, and C μ represents the empirical constant, with a value of 0.09; Step S33: Based on the Reynolds number and the turbulence scale, the turbulence model is dynamically selected for the updated grid area of ​​the fluid mechanics flow field. If the turbulence scale is greater than or equal to the preset threshold, it is determined to be an end area far away from the wall and its fluid flow is in a high Reynolds number and fully developed turbulence state, and the corresponding k-∈ model is preferentially selected; if the turbulence scale is less than the preset threshold, it is determined to be an end area near the wall and its fluid flow is in a low Reynolds number and boundary layer turbulence state, and the corresponding k-ω model is preferentially selected, thereby modeling and generating a dynamic turbulence model of the flow field grid area.

7. The fluid mechanics calculation method based on CFD simulation optimization according to claim 6, characterized in that: The k-∈ model described in step S33 includes equation 1 describing the turbulent kinetic energy k and the equation describing the turbulent dissipation rate ∈, which are specifically: Equation 1 describing the turbulent kinetic energy k: Where k represents the turbulent kinetic energy, specifically t represents the time variable, u represents the fluid velocity vector, represents the gradient of turbulent kinetic energy, μ t It represents the viscosity of the turbulent flow away from the wall, specifically P k represents the turbulent kinetic energy generation term, specifically P k =μS 2 , where μ represents the fluid viscosity, S represents the shear stress corresponding to the fluid, and ∈ represents the turbulent dissipation rate; The equation describing the turbulent dissipation rate ∈ is: Among them, C ∈1 and C ∈2 are the model constants corresponding to the equation describing the turbulent dissipation rate ∈, specifically any non-zero constants, represents the gradient of the turbulent dissipation rate.

8. The fluid mechanics calculation method based on CFD simulation optimization according to claim 7, characterized in that: The k-ω model described in step S33 includes equation 2 describing the turbulent kinetic energy k and the equation describing the turbulent frequency ω, which are specifically: Equation 2 describing the turbulent kinetic energy k: Among them, μ c It represents the viscosity of turbulent flow near the wall, specifically β * represents the model constant corresponding to equation 2 describing the turbulent kinetic energy k, and ω represents the turbulence frequency; The equation describing the turbulence frequency ω is: Among them, α and β are the model constants corresponding to the equation describing the turbulence frequency ω.

9. The fluid mechanics calculation method based on CFD simulation optimization according to claim 1, characterized in that: Step S4 includes the following steps: Step S41: performing finite volume partitioning on the dynamic turbulence model of the flow field grid area to obtain the dynamic turbulence finite subunit model of each flow field; Step S42: Calculate the corresponding local truncation error T through each flow field dynamic turbulence finite subunit model, wherein the local truncation error T can be calculated by a discrete equation on the corresponding finite subunit, wherein the discrete equation is specifically: in, represents the solution of the scalar variable φ of the i-th finite subunit at time n+1, represents the solution of the scalar variable φ of the i-th finite subunit at time n, Δt represents the time step, specifically the time interval between two adjacent time steps, V i represents the volume of the i-th finite subunit, F f represents the convective flux vector on the finite subelement f, which is used to describe the transmission rate of the scalar variable φ through the surface f, φ f represents the value of the scalar variable φ on the surface f, Γ f represents the diffusion coefficient on the surface f, represents the gradient of the scalar variable φ on the surface f, S f represents the area vector on the surface f, ε i represents the amount of scalar variable φ generated in the i-th finite subunit; Among them, the solution of the scalar variable of the i-th finite subunit at time n is satisfy: The solution of the scalar variable of its finite subunit at time n+1 is Perform Taylor expansion: Substituting it into the discrete equation and simplifying it, we can get: The local truncation error T can be obtained by solving The difference between the satisfied equation and the discretized equation is calculated as: Step S43: Based on the local truncation error T, the original solution φ corresponding to the dynamic turbulence model in the flow field grid area is calculated. i Error simulation correction optimization is performed to obtain the corrected fluid mechanics flow field calculation results, where the corrected fluid mechanics flow field calculation results are specifically as follows:

10. A fluid mechanics calculation system based on CFD simulation optimization, characterized in that: For executing the fluid mechanics calculation method based on CFD simulation optimization as claimed in claim 1, the fluid mechanics calculation system based on CFD simulation optimization comprises: The flow field key area identification module is used to obtain the flow field CFD original simulation model corresponding to fluid mechanics; by setting the flow field calculation domain grid size and dividing the flow field CFD original simulation model into calculation domain grids based on the flow field calculation domain grid size, each flow field calculation domain grid sub-unit is obtained; based on each flow field calculation domain grid sub-unit, the flow field key area of ​​the flow field CFD original simulation model is identified, thereby generating the fluid mechanics flow field key grid area; A grid constraint update module is used to obtain the grid aspect ratio and distortion corresponding to each grid sub-unit in the key grid area of ​​the fluid dynamics flow field through the key grid area of ​​the fluid dynamics flow field, and perform grid constraint update on the key grid area of ​​the fluid dynamics flow field based on the grid aspect ratio and distortion corresponding to each grid sub-unit to generate an updated grid area of ​​the fluid dynamics flow field; The turbulence dynamic modeling module is used to obtain the corresponding Reynolds number and turbulence scale by updating the grid area of ​​the fluid mechanics flow field, and dynamically select and model the turbulence model of the updated grid area of ​​the fluid mechanics flow field based on the Reynolds number and turbulence scale, thereby generating a dynamic turbulence model of the flow field grid area; The flow field original solution error optimization module is used to perform finite volume division on the dynamic turbulence model of the flow field grid area to obtain the dynamic turbulence finite sub-unit model of each flow field; based on the dynamic turbulence finite sub-unit model of each flow field, the error simulation correction and optimization of the corresponding original solution in the dynamic turbulence model of the flow field grid area is performed to obtain the corrected fluid mechanics flow field quantity calculation results.

Citation Information

Cited By

  • Simulation method and system for ocean turbulence

    CN121279193A

  • CFD calculation method and system based on neural network and adaptive parameter optimization

    CN121809350A

  • Simulation configuration generation method and system based on physical-numerical constraint feasible region

    CN122065734A

  • A Simulation Configuration Generation Method and System Based on Physics-Numerical Constraints and Feasible Regions

    CN122065734B