Computational fluid mechanics simulation optimization design method and system

By recording ANSYS Workbench automation scripts in MATLAB, the optimization design of fluid mechanics simulation is realized, which solves the problem of low efficiency in manual drawing models in numerical simulation of fluid mechanics, and achieves efficient and accurate optimization design of fluid mechanics.

CN119442958AActive Publication Date: 2025-02-14NORTH CHINA ELECTRIC POWER UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411491117.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2024-07-18
Filing Date
2024-10-24
Publication Date
2025-02-14
Estimated Expiration
2044-10-24

AI Technical Summary

Technical Problem

In numerical simulation of fluid mechanics, multiple models need to be frequently calculated and optimized, resulting in high workload and low efficiency in manual drawing of three-dimensional models.

Method used

By recording ANSYS Workbench automation scripts in MATLAB, we realize the optimization design of fluid mechanics simulation, automatically generate three-dimensional models and meshing, and combine MATLAB's optimization algorithm to reduce manual operations and repeated calculations.

Benefits of technology

The workload of manually drawing models is greatly reduced, the efficiency and accuracy of fluid mechanics-optimized design is improved, and the design cycle and cost are shortened.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119442958A_ABST
    Figure CN119442958A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of parameterization design, and particularly discloses a computational fluid mechanics simulation optimization design method and system.The method comprises the steps that an automatic script is recorded in an MATLAB main program, initial values of a plurality of design variables are specified, ANSYS Workbench is called based on the automatic script to conduct modeling on the initial values of the design variables, and a geometric model is obtained; calling MESH software based on the automatic script to carry out automatic grid division on the geometric model to obtain a grid file; and calling FLUENT software to carry out fluid mechanics numerical simulation on the grid file to obtain a numerical simulation calculation result, and calling CFD-POST software to store the numerical simulation calculation result into a specified file. Reading a numerical simulation calculation result in the specified file based on MATLAB, optimizing the numerical simulation calculation result, and outputting an optimization result; and updating the initial values of the plurality of design variables and the parameters of the grid file based on the optimization result. According to the method, the workload of manually drawing the model in optimization is reduced, and the working efficiency of optimization is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of parametric design, and in particular to a computational fluid dynamics simulation optimization design method and system. Background Art

[0002] Parametric design is a computer-aided design method that creates models by using basic features provided by the system and can modify geometric parameters; parametric design allows the size, shape and other related properties of the model to be changed by adjusting parameter values, thereby achieving rapid design and iteration. This design method is widely used in many fields, such as engineering design, product design, and architectural design. It improves design efficiency and flexibility, while also helping to reduce errors and speed up innovation.

[0003] Numerical simulation, also known as computer simulation, is a technique that uses numerical calculations and graphic display methods to study engineering, physical and other natural problems; the running time of computer simulations ranges from a few minutes to a few hours or even days. Computer simulation can be used to solve an increasingly wide range of events and problems. Through simulation, complex physical phenomena, the behavior of engineering systems, various phenomena in nature, etc. can be studied and predicted. It provides a powerful tool for scientific research, engineering design, decision support, etc., helping us better understand and solve practical problems.

[0004] In numerical simulation, optimization usually refers to obtaining the best solution to a problem through an algorithm; in numerical simulation of fluid mechanics (CFD), optimization requires calculating multiple models and repeating the calculations many times to obtain better optimization results; however, if each calculation requires manual drawing of a three-dimensional model, the workload will be very large and the efficiency will be extremely low. Summary of the invention

[0005] In view of the above problems, an object of the present invention is to provide a computational fluid dynamics simulation optimization design method, which implements the simulation optimization design of computational fluid dynamics (CFD) based on ANSYS Workbench and MATLAB data interface, reduces the workload of manual model drawing in optimization, and improves the work efficiency of optimization.

[0006] The second object of the present invention is to provide a computational fluid dynamics simulation optimization design system.

[0007] The first technical solution adopted by the present invention is: a computational fluid dynamics simulation optimization design method, comprising the following steps:

[0008] S100: recording an ANSYS Workbench automation script in a MATLAB main program, specifying initial values ​​of several design variables, and calling ANSYS Workbench based on the ANSYS Workbench automation script to model the initial values ​​of several design variables to obtain a geometric model;

[0009] S200: Based on the ANSYS Workbench automation script, call the MESH software to automatically mesh the geometric model to obtain a mesh file; and call the FLUENT software to perform fluid mechanics numerical simulation on the mesh file to obtain numerical simulation calculation results, and call the CFD-POST software to store the numerical simulation calculation results in a specified file;

[0010] S300: reading the numerical simulation calculation results in the specified file based on MATLAB and optimizing them, and outputting the optimization results; and updating the initial values ​​of the plurality of design variables and the parameters of the grid file based on the optimization results.

[0011] Preferably, recording the ANSYS Workbench automation script in step S100 includes:

[0012] Record DesignModeler batch processing scripts, MESH batch processing scripts, FLUENT batch processing scripts and CFD-POST batch processing scripts.

[0013] Preferably, the step S100 includes:

[0014] Based on the ANSYS Workbench automation script, the drawing software DesignModeler in ANSYS Workbench is called to perform two-dimensional parametric modeling on the initial values ​​of several design variables to obtain the geometric model.

[0015] Preferably, the step S100 further comprises: in the modeling process, associating different geometric features.

[0016] Preferably, the step S200 includes:

[0017] During the running of the MATLAB main program, MESH is called according to the MESH batch processing script recorded in the ANSYS Workbench automation script to automatically mesh the geometric model;

[0018] Read the grid file according to the FLUENT batch processing script recorded in the ANSYS Workbench automation script, and automatically set the mathematical solution model and boundary condition parameters of the fluid mechanics numerical simulation based on the grid file to achieve automated numerical solution and obtain the numerical simulation calculation results;

[0019] The CFD POST software is called according to the CFD POST batch processing script recorded in the ANSYS Workbench automation script to output the numerical simulation calculation results into a .csv file.

[0020] Preferably, the step S200 further includes:

[0021] Based on the CFD POST batch processing script, the CFD POST software is called to present the numerical simulation calculation results to the user in the form of curves, graphs or data tables.

[0022] Preferably, the step S300 includes:

[0023] During the running of the MATLAB main program, MATLAB is called to use the simplified conjugate gradient algorithm for optimization and solution. During the solution process, each time the optimization algorithm program is iterated, the MATLAB main program writes the optimization results into a .csv format file. The DesignModeler software modifies the initial values ​​of several design variables according to the optimization results, and the MESH software modifies the parameters of the mesh file according to the optimization results.

[0024] Preferably, the optimization solution using a simplified conjugate gradient algorithm includes:

[0025] Construct the objective function and solve it iteratively;

[0026] Determine the difference of the objective function after each iteration Is it minimization? If so, output the optimization result; if not, calculate the sensitivity coefficients and conjugate gradient coefficients of all design variables, calculate the search direction, and then output the optimization result.

[0027] Preferably, the objective function is expressed by the following formula:

[0028]

[0029] In the formula, J k is the objective function value, including Nusselt number, friction resistance coefficient and maximum temperature difference between bottom and wall;

[0030] are the design variables x at iteration step k respectively. i (i=1,2,…,N); is the design variable x1 at iteration step k-1; are the design variables x at iteration step k-1 respectively. i (i=1,2,…,N) step size; are the design variables x at iteration step k respectively. i (i=1,2,…,N) search direction.

[0031] The second technical solution adopted by the present invention is: a computational fluid dynamics simulation optimization design system, including a structural parameterization module, a CFD numerical simulation analysis module and a MATLAB optimization algorithm module;

[0032] The structural parameterization module is used to: record an ANSYS Workbench automation script in a MATLAB main program, specify initial values ​​of several design variables, call ANSYS Workbench based on the ANSYS Workbench automation script to model the initial values ​​of several design variables, and obtain a geometric model;

[0033] The CFD numerical simulation analysis module is used to: call the MESH software based on the ANSYS Workbench automation script to automatically mesh the geometric model to obtain a mesh file; and call the FLUENT software to perform fluid mechanics numerical simulation on the mesh file to obtain numerical simulation calculation results, and call the CFD-POST software to store the numerical simulation calculation results in a specified file;

[0034] The MATLAB optimization algorithm module is used to: read the numerical simulation calculation results in the specified file based on MATLAB and optimize them, and output the optimization results; update the initial values ​​of the several design variables and the parameters of the grid file based on the optimization results.

[0035] Beneficial effects of the above technical solution:

[0036] (1) The present invention discloses a computational fluid dynamics simulation optimization design method which combines the powerful fluid dynamics modeling and simulation capabilities of ANSYS Workbench and the optimization algorithm of MATLAB to achieve efficient and accurate fluid dynamics optimization design. Compared with the traditional CFD simulation method, the present invention firstly achieves the effective connection between fluid dynamics simulation and optimization algorithm, avoiding the bottleneck and error of information transmission between simulation results and optimization algorithm. Secondly, through this method, fluid dynamics optimization design can be achieved in the early stage of engineering design, shortening the design cycle and cost and improving the design efficiency. Finally, the present method also provides an efficient data transmission interface between fluid dynamics simulation and optimization algorithm, ensuring the accuracy and stability of the design results.

[0037] (2) In order to improve efficiency, the present invention adopts an automated method to generate a three-dimensional model. By adjusting parameter values, the size, shape and other properties of the model can be easily changed, thereby quickly generating a new model. The workload of manually drawing the model is greatly reduced during optimization, thereby improving the optimization work efficiency.

[0038] (3) The data interface between ANSYS Workbench and MATLAB enables seamless integration of the two software. The powerful computing, data analysis, and optimization functions of MATLAB can be used in ANSYS Workbench to combine CFD simulation and optimization design processes. This makes it more convenient and efficient to complete multiple tasks in a unified environment. At the same time, the integration of MATLAB and ANSYS Workbench can take advantage of the programming capabilities and flexibility of MATLAB. MATLAB has a rich programming language and tools that can be used to customize and script CFD simulation and optimization design processes. Through programming, highly customized optimization design methods can be implemented to improve the efficiency and accuracy of simulation and optimization.

[0039] (4) The operation basis of a computational fluid dynamics simulation optimization design system disclosed in the present invention is a structural parameterization module, a CFD numerical simulation analysis module and a MATLAB optimization algorithm module; wherein, the structural parameterization module can quickly realize the modification of geometric parameters, and provide an adjustable and flexible model basis for subsequent CFD numerical simulation; the CFD numerical simulation analysis module is the prerequisite for realizing the optimization design, and this module performs fluid mechanics simulation analysis, obtains the numerical results of various key parameters (i.e., numerical simulation calculation results), and outputs them to the optimization algorithm module for further analysis; the MATLAB optimization algorithm module utilizes the main program to call MATLAB software to realize the optimization screening of the numerical simulation calculation results, and through this module, various advanced mathematical models and optimization algorithms can be applied to perform parameter optimization to minimize the design objective function and obtain the optimal design scheme; through the mutual cooperation between the structural parameterization module, the CFD numerical simulation analysis module and the MATLAB optimization algorithm module, a complete fluid mechanics optimization design platform is realized.

[0040] (5) The present invention uses the ANSYS Workbench simulation integration platform to integrate multiple software, including pre-processing software (DesignModeler, MESH), fluid simulation software FLUENT and post-processing software CFD-POST, which is very convenient in practical applications; it is widely used in flow and heat transfer analysis problems, and has a complete parametric modeling process, which has outstanding advantages in optimization problem analysis. The present invention first uses the ANSYS drawing module DesignModeler to create a geometric model and establish a calculation domain, which is used for CFD simulation analysis; the geometric model is meshed using MESH software; secondly, FLUENT is the core solver, which is more accurate in simulating heat conduction and complex fluid flow. FLUENT has a wealth of turbulence models, as well as Reynolds stress models for solving strong swirl and anisotropic flows, etc., and is suitable for multiphase mixing processes, heat exchangers, wind turbines, battery simulation, rotating machinery and many other fields; CFD-POST can present the calculation results of the solver to the user in the form of curves, graphs or data tables. In the parameter optimization process, its output data is provided to the optimization algorithm for iterative update.

[0041] (6) The present invention builds an automatic optimization platform, uses MATLAB to write an optimization program, and calls ANSYS Workbench through commands to enable it to automatically solve the positive problem parameterization according to macro commands, and feeds back the calculated results to MATLAB. After analysis by the optimization algorithm, new optimization variables are obtained, and the new optimization variables are assigned to ANSYS Workbench. This cycle is repeated until the optimal variable value is obtained; the entire optimization process is fully automated. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 A schematic flow chart of a computational fluid dynamics simulation optimization design method provided for one embodiment of the present invention;

[0043] Figure 2 A schematic diagram of an ANSYS Workbench portion provided for one embodiment of the present invention;

[0044] Figure 3 A two-dimensional structural diagram of a straight rib channel provided for one embodiment of the present invention;

[0045] Figure 4 A three-dimensional structural diagram of a straight rib channel provided for one embodiment of the present invention;

[0046] Figure 5 A partial diagram of a three-dimensional grid of a straight rib channel provided for one embodiment of the present invention;

[0047] Figure 6Detailed diagram of two-dimensional mesh division of a straight rib channel provided for an embodiment of the present invention

[0048] Figure 7 A schematic structural diagram of a computational fluid dynamics simulation optimization design system provided for one embodiment of the present invention. DETAILED DESCRIPTION

[0049] The following detailed description of the embodiments of the present invention is further described in detail in conjunction with the accompanying drawings and examples. The detailed description of the following embodiments and the accompanying drawings are used to exemplarily illustrate the principles of the present invention, but cannot be used to limit the scope of the present invention, that is, the present invention is not limited to the preferred embodiments described, and the scope of the present invention is defined by the claims.

[0050] In the description of the present invention, it should be noted that, unless otherwise specified, “plurality” means two or more than two; the terms “first”, “second”, etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance; for ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances.

[0051] Embodiment 1

[0052] In order to solve the technical problem of low efficiency in calculating multiple models during CFD numerical simulation optimization, such as Figure 1 As shown, an embodiment of the present invention provides a computational fluid dynamics simulation optimization design method, comprising the following steps:

[0053] S100: recording an ANSYS Workbench automation script in a MATLAB main program, specifying initial values ​​of several design variables, and calling ANSYS Workbench based on the ANSYS Workbench automation script to model the initial values ​​of several design variables to obtain a geometric model;

[0054] Recording ANSYS Workbench automation scripts includes recording DesignModeler batch processing scripts, MESH batch processing scripts, FLUENT batch processing scripts and CFD-POST batch processing scripts.

[0055] Structural parameterization: Figure 2As shown, based on the DesignModeler batch processing script, the drawing software DesignModeler (i.e., geometry) in ANSYS Workbench is called to perform two-dimensional parametric modeling on the initial values ​​of several design variables to obtain a geometric model; and the initial values ​​of several design variables (i.e., geometric parameters) are saved in CSV format, and the shape and size of the geometric model are adjusted by editing the parameter values. In addition, in the parametric modeling process, different geometric features can be associated with each other, so that when one parameter changes, other related parameters will also be updated accordingly.

[0056] For example, Figure 3 and Figure 4 As shown, the initial values ​​of the design variables are specified: the fin heights h1~h5 of the five fins, the fin spacing s and some encryption parameters when drawing the grid. The initial values ​​h1~h5 are all 10mm, the fin spacing s is 100mm, and the geometric model of the two-dimensional channel obtained by modeling. The fluid flows in from the inlet and flows out from the outlet.

[0057] S200: Calling MESH software based on the automated script to automatically mesh the geometric model to obtain a mesh file; and calling FLUENT software to perform fluid mechanics numerical simulation on the mesh file to obtain numerical simulation calculation results, and calling CFD-POST software to store the numerical simulation calculation results in a specified file;

[0058] (1) automatically calling the MESH software through MATLAB based on the MESH batch processing script to automatically mesh the geometric model;

[0059] During the running of the MATALB main program, it is necessary to call MESH to perform automatic meshing on the geometric model according to the MESH batch processing script recorded in the ANSYS Workbench automation script; recording the MESH batch processing script is a secondary development of MESH, and the script recording menu needs to be set when recording the script, and the .wbjn script file needs to be saved after recording.

[0060] Based on the MESH batch processing script, MATLAB automatically calls the MESH software to automatically mesh the geometric model to obtain a mesh file; commonly used three-dimensional channel meshing is as follows: Figure 5 As shown, considering the computation time, the three-dimensional channel is converted into a two-dimensional channel for calculation; Figure 6 As shown in the figure, during the automated numerical simulation process, the mesh divided by the MESH software based on the geometric model can clearly show the edge of the heating surface at the bottom of the channel, and the mesh is obviously encrypted during automated division.

[0061] (2) Based on the FLUENT batch processing script, the FLUENT software is called to perform CFD numerical simulation on the grid file to realize fluid mechanics calculation and output numerical simulation calculation results;

[0062] During the running of the MATLAB main program, it is necessary to read the grid file according to the FLUENT batch processing script recorded in the ANSYS Workbench automation script, and automatically set the CFD mathematical solution model and boundary conditions and other parameters based on the grid file to achieve automated numerical solution (such as solving flow and heat transfer equations); when recording the FLUENT batch processing script, it is necessary to save the recorded FLUENT batch processing script as a .wbjn file, and at the same time, it is necessary to set the residual value and the detection point during recording (the detection point is a point set on the bottom plate of the heat exchange channel to monitor whether the FLUENT calculation process is normal and convergent). When the residual converges to less than the set residual value and the temperature of the detection point no longer changes, it means that the calculation is completed, and FLUENT outputs the numerical simulation calculation results; FLUENT software is the core solver, which is more accurate in simulating heat conduction and complex fluid flow. FLUENT has a wealth of turbulence models, as well as Reynolds stress models for solving strong swirl and anisotropic flows, etc., which are suitable for multiphase mixing processes, heat exchangers, wind turbines, battery simulation, rotating machinery and many other fields.

[0063] (3) calling CFD-POST software to store the numerical simulation calculation results into a specified file;

[0064] Based on the CFD POST batch processing script, the CFD POST software is called to output the numerical simulation calculation results to the .csv file, and the calculated case file and the .csv file storing the output results are saved; that is, the numerical simulation calculation results are written to the result.xlsx text file, output and save, and then the data in the result.xlsx file is read through MATLAB for subsequent optimization and update. When recording the CFD POST batch processing script, the numerical solution results output by FLUENT are converted into the required numerical simulation calculation results through the edited formula, and set as the output parameter, which will be automatically solved when calling .wbjn.

[0065] Furthermore, in one embodiment, the present invention also calls CFD POST software based on the CFD POST batch processing script to present the numerical simulation calculation results to the user in the form of curves, graphs or data tables.

[0066] The present invention is based on the FLUENT batch processing script, automatically calls FLUENT software through MATLAB to read the grid file, performs CFD numerical simulation on the grid file, realizes automated numerical solution, writes the detection point data into the result.xlsx text file through CFDPOST software as the numerical simulation calculation result, outputs and saves it, and then reads the data in the result.xlsx file through MATLAB for subsequent optimization and updating.

[0067] Call the FLUENT and CFD-POST batch processing scripts in ANSYS Workbench to realize fluid dynamics calculation and data post-processing, and output the calculated data to a .csv file, and save the calculated case file and the .csv file storing the output results; the calling program is as follows:

[0068]

[0069]

[0070] S300: Based on MATLAB, the numerical simulation calculation results in the specified file are read and optimized, and the optimization results are output; based on the optimization results, the initial values ​​of the several design variables and the parameters of the grid file are updated.

[0071] MATLAB optimization algorithm: During the running of the MATLAB main program, the MATLAB optimization algorithm program (a code program written in MATLAB based on the simplified conjugate gradient algorithm) is called to perform optimization and solution. During the solution process, each time the optimization algorithm program is iterated, the MATLAB main program needs to write the optimization results into a .csv format file. The DesignModeler modeling software then modifies the initial values ​​of several design variables (i.e., geometric parameters) based on the optimization results, and the MESH software modifies the parameters of the mesh file based on the optimization results.

[0072] The simplified conjugate gradient algorithm is used for optimization, including:

[0073] Constructing the objective function J k Solve iteratively; determine the difference of the objective function after each iteration Is it minimization? If so, output the result; if not, calculate the sensitivity coefficients of all design variables. and the conjugate gradient coefficient After calculating the search direction, the optimization result is output; based on the optimization result, all design variables are updated and the final result is output. The final result includes, for example, the set target value and fin height h1~h5. The set target value includes Nusselt number Nu, friction resistance coefficient f, Nu / Nu0 / (f / f0) 1 / 3And the maximum temperature difference between the bottom and wall △T, etc.

[0074] Objective function J k The design variable x can be defined as i (i=1,2,…,N) function, such as

[0075] J k =F(x1,x2,...,N)(1)

[0076] The simplified conjugate gradient algorithm requires calculating the gradient of the objective function and constructing the conjugate direction for the updated design variables through sensitivity analysis; the first step of the search direction is to take the negative gradient direction of the objective function:

[0077]

[0078] Among them, the sensitivity coefficient is obtained by changing the design variable x i Add a small disturbance △x i The sensitivity analysis is used to evaluate the sensitivity of this objective function to each design variable; then, after each search, the new design variable can be updated as follows:

[0079]

[0080] Among them, x i k and x i k+1 denote the design variables for iteration step k and k+1 search, respectively, i k is the step size of the design variable at iteration step k; the design variable x at iteration step k+1 i The search direction can be obtained by updating the negative gradient direction of the objective function and the previous step α i k The search direction is defined by a linear combination of these two:

[0081]

[0082] The conjugate gradient coefficient γ i k+1 It is necessary to ensure that α i k and Conjugation can be defined as:

[0083]

[0084] In the traditional conjugate gradient method, the optimal search step length λ needs to be accurately calculated during the optimization process. ik , the search step size at the kth iteration is defined as λ i k , the objective function needs to be along the negative gradient direction of λ i k-1 When performing a one-dimensional search, keep other design variables unchanged; when the objective function obtains the optimal value during the search process, the corresponding λ i k-1 The kth search for x i k The optimal search step length when .

[0085] After the kth search, the objective function can be written as:

[0086]

[0087] In the formula, J k is the objective function value, such as Nusselt number Nu, friction coefficient f, Nu / Nu0 / (f / f0) 1 / 3 The maximum temperature difference between the bottom and the wall, △T, etc. are the design variables x at iteration step k respectively. i (i=1,2,…,N); is the design variable x1 at iteration step k-1; are the design variables x at iteration step k-1 respectively. i (i=1,2,…,N) step size; are the design variables x at iteration step k respectively. i (i=1,2,…,N) search direction.

[0088] The traditional conjugate gradient method needs to perform sensitivity analysis on the design variables to determine the optimal search step size, which requires the objective function to have a quadratic form, making the optimization process cumbersome and time-consuming. The simplified conjugate gradient method (SCGM) fixes the step size to a constant and ignores the convergence loss. According to the sensitivity of the design variable to the objective function, a different constant step size value is selected for each design variable. The gradient of the objective function for each design variable is calculated by difference. Although the fixed step size leads to slow convergence, there is no need to determine the optimal step size, so the total time used for optimization does not increase significantly.

[0089] The optimization solution is performed by, for example, using a simplified conjugate gradient optimization algorithm, and its calling format is as follows:

[0090]

[0091] Call the DesignModeler batch processing script in ANSYS Workbench to modify the geometric parameters (i.e., the initial values ​​of several design variables) in the geometric model. During the running of the MATLAB main program, according to the pre-written and recorded macro command file (i.e., the part of the script that automatically modifies the geometric dimensions of the geometric model), continuously call the DesignModeler software to modify the geometric parameters of the geometric model, that is, continuously call the DesignModeler software to update the geometric parameters.

[0092] ①Call the ANSYS Workbench command to couple ANSYS Workbench and MATLAB:

[0093] system('D:\"Program Files"\"ANSYS2020R2"\"ANSYS Inc"\v202\Framework\bin\Win64\RunWB2.exe-XR finaljournal.wbjn');

[0094] Among them, finaljournal.wbjn is a macro command file.

[0095] ②The batch processing command for calling DesignModeler software is as follows:

[0096] system1=GetSystem(Name="Geom")

[0097] geometryComponent1=system1.GetComponent(Name="Geometry")

[0098] geometryComponent1.Update(AllDependencies=True).

[0099] ③ The DesignModeler software needs to continuously modify the geometric parameters according to the optimization results. The procedure for modifying the geometric parameters is as follows:

[0100] parameter1=Parameters.GetParameter(Name="P7")

[0101] designPoint1.SetParameterExpression(

[0102] Parameter = parameter1,

[0103] Expression = "3.0002[mm]").

[0104] Call the MESH batch processing script in ANSYS Workbench to realize the automatic update of parameters set during mesh division and encryption, and complete the division and encryption of the new mesh; during the running of the MATLAB main program, call the MESH software according to the macro command file written and recorded in advance to update the parameters of the mesh file.

[0105] ①The batch processing command for calling MESH software is as follows:

[0106] system2=GetSystem(Name="SYS")

[0107] meshComponent1=system2.GetComponent(Name="Mesh")

[0108] meshComponent1.Update(AllDependencies=True).

[0109] ②MESH software needs to continuously modify mesh parameters according to the optimization results. The procedure for modifying mesh parameters is as follows:

[0110]

[0111] Embodiment 2

[0112] like Figure 7 As shown, an embodiment of the present invention provides a computational fluid dynamics simulation optimization design system, including a structural parameterization module, a CFD numerical simulation analysis module and a MATLAB optimization algorithm module;

[0113] The structural parameterization module is used to: record an ANSYS Workbench automation script in a MATLAB main program, specify initial values ​​of several design variables, call ANSYS Workbench based on the ANSYS Workbench automation script to model the initial values ​​of several design variables, and obtain a geometric model;

[0114] The CFD numerical simulation analysis module is used to: call the MESH software based on the ANSYS Workbench automation script to automatically mesh the geometric model to obtain a mesh file; and call the FLUENT software to perform fluid mechanics numerical simulation on the mesh file to obtain numerical simulation calculation results, and call the CFD-POST software to store the numerical simulation calculation results in a specified file;

[0115] The MATLAB optimization algorithm module is used to: read the numerical simulation calculation results in the specified file based on MATLAB and optimize them, and output the optimization results; update the initial values ​​of the several design variables and the parameters of the grid file based on the optimization results.

[0116] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0117] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0118] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0119] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0120] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.

[0121] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A computational fluid dynamics simulation optimization design method, characterized in that: The following steps are involved: S100: recording an ANSYS Workbench automation script in a MATLAB main program, specifying initial values ​​of several design variables, and calling ANSYS Workbench based on the ANSYS Workbench automation script to model the initial values ​​of several design variables to obtain a geometric model; S200: Calling MESH software based on the ANSYS Workbench automation script to automatically mesh the geometric model to obtain a mesh file; and calling FLUENT software to perform fluid mechanics numerical simulation on the grid file to obtain numerical simulation calculation results, and calling CFD-POST software to store the numerical simulation calculation results in a specified file; S300: Reading the numerical simulation calculation results in the specified file based on MATLAB and optimizing them, and outputting the optimization results; The initial values ​​of the plurality of design variables and the parameters of the grid file are updated based on the optimization result.

2. The computational fluid dynamics simulation optimization design method according to claim 1, characterized in that: The step S100 of recording the ANSYS Workbench automation script includes: Record DesignModeler batch processing scripts, MESH batch processing scripts, FLUENT batch processing scripts and CFD-POST batch processing scripts.

3. The computational fluid dynamics simulation optimization design method according to claim 1, characterized in that: The step S100 includes: Based on the ANSYS Workbench automation script, the drawing software DesignModeler in ANSYS Workbench is called to perform two-dimensional parametric modeling on the initial values ​​of several design variables to obtain the geometric model.

4. The computational fluid dynamics simulation optimization design method according to claim 1, characterized in that: The step S100 also includes: in the modeling process, associating different geometric features.

5. The computational fluid dynamics simulation optimization design method according to claim 1, characterized in that: The step S200 includes: During the running of the MATLAB main program, MESH is called according to the MESH batch processing script recorded in the ANSYS Workbench automation script to automatically mesh the geometric model; Read the grid file according to the FLUENT batch processing script recorded in the ANSYS Workbench automation script, and automatically set the mathematical solution model and boundary condition parameters of the fluid mechanics numerical simulation based on the grid file to achieve automated numerical solution and obtain the numerical simulation calculation results; The CFD POST batch processing script recorded in the ANSYS Workbench automation script is used to call the CFD POST software to output the numerical simulation calculation results into a .csv file.

6. The computational fluid dynamics simulation optimization design method according to claim 1, characterized in that: The step S200 further includes: Based on the CFD POST batch processing script, the CFD POST software is called to present the numerical simulation calculation results to the user in the form of curves, graphs or data tables.

7. The computational fluid dynamics simulation optimization design method according to claim 1, characterized in that: The step S300 includes: During the running of the MATLAB main program, MATLAB is called to use the simplified conjugate gradient algorithm for optimization and solution. During the solution process, each time the optimization algorithm program is iterated, the MATLAB main program writes the optimization results into a .csv format file. The DesignModeler software modifies the initial values ​​of several design variables according to the optimization results, and the MESH software modifies the parameters of the mesh file according to the optimization results.

8. The computational fluid dynamics simulation optimization design method according to claim 7, characterized in that: The optimization solution using the simplified conjugate gradient algorithm includes: Construct the objective function and solve it iteratively; Determine the difference of the objective function after each iteration Is it minimization? If so, output the optimization result; if not, calculate the sensitivity coefficients and conjugate gradient coefficients of all design variables, calculate the search direction, and then output the optimization result.

9. The computational fluid dynamics simulation optimization design method according to claim 8, characterized in that: The objective function is expressed by the following formula: In the formula, J k is the objective function value, including Nusselt number, friction resistance coefficient and maximum temperature difference between bottom and wall; are the design variables x at iteration step k respectively. i (i=1,2,…,N); is the design variable x1 at iteration step k-1; are the design variables x at iteration step k-1 respectively. i (i=1,2,…,N) step size; are the design variables x at iteration step k respectively. i (i=1,2,…,N) search direction.

10. A computational fluid dynamics simulation optimization design system, characterized in that: Including structural parameterization module, CFD numerical simulation analysis module and MATLAB optimization algorithm module; The structural parameterization module is used to: record an ANSYS Workbench automation script in a MATLAB main program, specify initial values ​​of several design variables, call ANSYS Workbench based on the ANSYS Workbench automation script to model the initial values ​​of several design variables, and obtain a geometric model; The CFD numerical simulation analysis module is used to: call the MESH software based on the ANSYS Workbench automation script to automatically mesh the geometric model and obtain a mesh file; and calling FLUENT software to perform fluid mechanics numerical simulation on the grid file to obtain numerical simulation calculation results, and calling CFD-POST software to store the numerical simulation calculation results in a specified file; The MATLAB optimization algorithm module is used to: read the numerical simulation calculation results in the specified file based on MATLAB and optimize them, and output the optimization results; The initial values ​​of the plurality of design variables and the parameters of the grid file are updated based on the optimization result.

Citation Information

Patent Citations

  • CFD numerical simulation optimization design method based on ANSYS and MATLAB data interface

    CN111444557A

  • Bionic fish hydrodynamic prediction method based on CFD and MLP

    CN114065663A