A computational fluid dynamics simulation optimization design method and system

By combining ANSYS Workbench with MATLAB, automated fluid dynamics simulation and optimization design is achieved, solving the problem of low efficiency in manually drawing models and realizing efficient and accurate fluid dynamics optimization design.

CN119442958BActive Publication Date: 2025-10-24NORTH CHINA ELECTRIC POWER UNIV
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In numerical simulations of fluid mechanics, manually drawing three-dimensional models is a labor-intensive process, resulting in low optimization efficiency.

Method used

The data interface between ANSYS Workbench and MATLAB is used to realize the fluid dynamics simulation optimization design through automated scripts, including recording automated scripts for modeling, mesh generation, numerical simulation and result storage, and using MATLAB to solve the optimization algorithm.

Benefits of technology

It achieves seamless integration of fluid dynamics simulation and optimization algorithms, improves design efficiency, reduces the workload of manually drawing models, and ensures the accuracy and stability of design results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119442958B_ABST
    Figure CN119442958B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of parameterized design, and specifically discloses a computational fluid dynamics simulation optimization design method and system, which comprises the following steps: recording an automatic script in a MATLAB main program, specifying initial values of a plurality of design variables, calling ANSYS Workbench based on the automatic script to model the initial values of the plurality of design variables and obtain a geometric model; calling MESH software based on the automatic script to automatically mesh the geometric model and obtain a mesh file; calling FLUENT software to perform fluid mechanics numerical simulation on the mesh file and obtain numerical simulation calculation results, and calling CFD-POST software to store the numerical simulation calculation results in a specified file; reading the numerical simulation calculation results in the specified file based on MATLAB and performing optimization, and outputting optimization results; and updating the initial values of the plurality of design variables and parameters of the mesh file based on the optimization results. The method reduces the workload of manually drawing models in optimization and improves the work efficiency of optimization.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of parametric design, and particularly relates to a computational fluid dynamics simulation optimization design method and system. BACKGROUND

[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 changing the size, shape and other related properties of the model 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, etc., which improves design efficiency and flexibility, and also helps to reduce errors and speed up innovation.

[0003] Numerical simulation, also known as computer simulation, is a technique for studying engineering, physical and other natural problems through numerical calculation and image display; the running time of computer simulation ranges from a few minutes to several hours, or even several days. Computer simulation can be used to solve a wider range of events and problems, and through simulation, complex physical phenomena, the behavior of engineering systems, various phenomena in nature, etc. can be studied and predicted, which provides a powerful tool for scientific research, engineering design, decision support, etc. to help 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 computational fluid dynamics numerical simulation (CFD), optimization requires calculating multiple models and repeating calculations multiple times to obtain better optimization results; however, if a three-dimensional model needs to be manually drawn each time, the workload will be very large and the efficiency will be very low. SUMMARY

[0005] To solve the above problems, one object of the present application is to provide a computational fluid dynamics simulation optimization design method based on ANSYS Workbench and MATLAB data interface to realize the simulation optimization design of computational fluid dynamics (CFD), which reduces the workload of manually drawing models in optimization and improves the work efficiency of optimization.

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

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

[0008] S100: record an ANSYS Workbench automation script in a MATLAB main program, specify initial values of a plurality of design variables, call ANSYS Workbench based on the ANSYS Workbench automation script to model the initial values of the plurality of design variables, and obtain a geometric model;

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

[0010] S300: read the numerical simulation calculation results in the specified file based on MATLAB and perform optimization, and output optimization results; update the initial values of the plurality of design variables and parameters of the mesh file based on the optimization results.

[0011] Preferably, the step S100 of recording the ANSYS Workbench automation script comprises:

[0012] record a DesignModeler batch processing script, a MESH batch processing script, a FLUENT batch processing script, and a CFD-POST batch processing script.

[0013] Preferably, the step S100 comprises:

[0014] call DesignModeler in ANSYS Workbench based on the ANSYS Workbench automation script to perform two-dimensional parametric modeling on the initial values of the plurality of design variables, and obtain a geometric model.

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

[0016] Preferably, the step S200 comprises:

[0017] During the running process of the MATLAB main program, call MESH based on the MESH batch processing script recorded in the ANSYS Workbench automation script to perform automatic meshing on the geometric model;

[0018] The grid file is read according to the FLUENT batch processing script recorded in the ANSYS Workbench automation script, and a fluid mechanics numerical simulation mathematical solving model and boundary condition parameters are automatically set based on the grid file, so that automatic numerical solving is realized, and a numerical simulation calculation result is obtained.

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

[0020] Preferably, the step S200 further comprises:

[0021] The numerical simulation calculation result is presented to the user in the form of a curve, a graph or a data table by calling the CFD POST software based on the CFD POST batch processing script.

[0022] Preferably, the step S300 comprises:

[0023] During the running process of the MATLAB main program, the MATLAB is called to perform optimization solving by using a simplified conjugate gradient algorithm, and the MATLAB main program writes the optimization result into a.csv format file after each iteration of the optimization algorithm program is completed in the solving process, and the DesignModeler software modifies the initial values of a plurality of design variables according to the optimization result, and the MESH software modifies the parameters of the grid file according to the optimization result.

[0024] Preferably, the optimization solving by using the simplified conjugate gradient algorithm comprises:

[0025] constructing a target function and iteratively solving;

[0026] judging whether the difference value of the target function after each iteration is minimized, if yes, outputting the optimization result, and if no, calculating the sensitivity coefficients and the conjugate gradient coefficients of all design variables, calculating a search direction and outputting the optimization result.

[0027] Preferably, the target function is represented by the following formula:

[0028]

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

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

[0031] The second technical solution adopted by the present application is a computational fluid dynamics simulation optimization design system, comprising a structure parameterization module, a CFD numerical simulation analysis module and a MATLAB optimization algorithm module.

[0032] The structure parameterization module is configured to record an ANSYS Workbench automation script in a MATLAB main program, specify initial values of a plurality of design variables, call ANSYS Workbench to model the initial values of the plurality of design variables based on the ANSYS Workbench automation script, and obtain a geometric model.

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

[0034] The MATLAB optimization algorithm module is configured to read the numerical simulation calculation results in the specified file based on MATLAB and perform optimization, output optimization results, and update the initial values of the plurality of design variables and parameters of the mesh file based on the optimization results.

[0035] The beneficial effects of the above technical solution are:

[0036] (1) The computational fluid dynamics simulation optimization design method disclosed by the present application combines the powerful fluid mechanics modeling and simulation capabilities of ANSYS Workbench and the optimization algorithm of MATLAB, and realizes efficient and accurate fluid mechanics optimization design. Compared with traditional CFD simulation methods, the present application first realizes the effective connection of fluid mechanics simulation and optimization algorithm, avoids the bottleneck and error of information transmission between simulation results and optimization algorithm; secondly, through this method, fluid mechanics optimization design can be realized in the early stage of engineering design, which shortens the design cycle and cost and improves the design efficiency; finally, this method also provides an efficient data transmission interface between fluid mechanics simulation and optimization algorithm, ensuring the accuracy and stability of the design results.

[0037] (2) In order to improve efficiency, the application uses an automated method to generate a three-dimensional model, easily changes the size, shape and other properties of the model by adjusting parameter values, and quickly generates a new model; in optimization, the workload of manually drawing models is greatly reduced, and the work efficiency of optimization is improved.

[0038] (3) The data interface between ANSYS Workbench and MATLAB can realize the seamless integration of the two software, use the powerful calculation, data analysis and optimization function of MATLAB in ANSYS Workbench, and combine CFD simulation and optimization design process; this makes it more convenient and efficient to complete multiple tasks in a unified environment; at the same time, integrating MATLAB and ANSYS Workbench can take advantage of the programming ability and flexibility of MATLAB, MATLAB has rich programming language and tools, which can be customized programming and scripting for CFD simulation and optimization design process, through programming, highly customized optimization design method can be realized, and the efficiency and accuracy of simulation and optimization can be improved.

[0039] (4) The operation basis of the computational fluid dynamics simulation optimization design system disclosed in the application is the structure parameterization module, the CFD numerical simulation analysis module and the MATLAB optimization algorithm module; wherein the structure parameterization module can quickly realize the modification of geometric parameters, and provide adjustable and flexible model basis for subsequent CFD numerical simulation; the CFD numerical simulation analysis module is the premise of realizing optimization design, the module carries out fluid mechanics simulation analysis, obtains the numerical results (i.e. numerical simulation calculation results) of various key parameters, and outputs them to the optimization algorithm module for further analysis; the MATLAB optimization algorithm module uses the main program to call MATLAB software to realize the optimization screening of numerical simulation calculation results, through the module, various advanced mathematical models and optimization algorithms can be applied for parameter optimization, so as to minimize the design objective function and obtain the optimal design scheme; through the mutual cooperation between the structure 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 application uses ANSYS Workbench simulation integrated platform to integrate various software, including pretreatment software (DesignModeler, MESH), fluid simulation software FLUENT and post-processing software CFD-POST, which has great convenience in practical application; is widely used in flow heat exchange analysis problems, and has a complete parameterized modeling process, and has outstanding advantages in optimization problem analysis. The application first uses the drawing module DesignModeler of ANSYS to create a geometric model, establishes a calculation domain, and this area is used for CFD simulation analysis; the geometric model is divided into a grid by the MESH software; secondly, FLUENT is a core solver, which is relatively accurate for heat conduction and fluid flow simulation with complex shape, FLUENT has a rich turbulence model, and also has a Reynolds stress model for solving strong vortex and anisotropic flow, which is suitable for many fields such as multiphase mixing process, heat exchanger, wind turbine, battery simulation, rotating machinery and the like; CFD-POST can present the calculation results of the solver to the user in the form of curves, graphics or data tables, and the output data of the parameter optimization process is provided to the optimization algorithm for iterative update.

[0041] (6) The application builds an automatic optimization platform, uses MATLAB to write an optimization program, calls ANSYS Workbench through a command, makes it solve the positive problem parameterization automatically according to the macro command, feeds back the calculation results to MATLAB, obtains new optimization variables through the analysis of the optimization algorithm, and assigns the new optimization variables to ANSYS Workbench, so as to circulate repeatedly until the optimal variable value is obtained; the whole optimization process is fully automated. BRIEF DESCRIPTION OF DRAWINGS

[0042] Figure 1 A flow chart of a computational fluid dynamics simulation optimization design method is provided for an embodiment of the application.

[0043] Figure 2 A schematic diagram of the ANSYS Workbench part is provided for an embodiment of the application.

[0044] Figure 3 A two-dimensional structure diagram of a straight rib channel is provided for an embodiment of the application.

[0045] Figure 4 A three-dimensional structure diagram of a straight rib channel is provided for an embodiment of the application.

[0046] Figure 5 A three-dimensional grid part diagram of a straight rib channel is provided for an embodiment of the application.

[0047] Figure 6A detail view of a straight rib channel two-dimensional grid division for an embodiment of the present application

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

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

[0050] In the description of the present application, it should be noted that, unless otherwise specified, the meaning of "a plurality of" is two or more; the terms "first", "second", etc. are only for the purpose of description, and cannot be understood as indicating or implying relative importance; the above-mentioned terms can be understood in the specific meaning in the present application by the person skilled in the art according to the specific circumstances.

[0051] Example 1

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

[0053] S100: Record the ANSYS Workbench automation script in the MATLAB main program, specify the initial values of a plurality of design variables, and call ANSYS Workbench based on the ANSYS Workbench automation script to model the initial values of the plurality of design variables to obtain a geometric model;

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

[0055] Structural parameterization: as 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, so that when one parameter changes, other related parameters will also be updated.

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

[0057] S200: based on the automation script, calling MESH software 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 into a specified file;

[0058] (1) Based on the MESH batch processing script, the MESH software is automatically called by MATLAB to automatically mesh the geometric model;

[0059] During the running of the MATLAB main program, MESH needs to be called to automatically mesh the geometric model according to the MESH batch processing script recorded in the ANSYS Workbench automation script. Recording the MESH batch processing script belongs to the secondary development of MESH, and the script recording menu needs to be set when recording the script, and the.wbjn script file is saved after recording.

[0060] Based on the MESH batch processing script, the MESH software is automatically called by MATLAB to automatically mesh the geometric model to obtain a mesh file; common three-dimensional channel meshing is as shown in Figure 5 As shown, considering the calculation time, the three-dimensional channel is converted into a two-dimensional channel for calculation; as shown in Figure 6 As shown in the automatic numerical simulation process, MESH software can clearly see the edge of the heating surface at the bottom of the channel according to the mesh of the geometric model, and the mesh automatic division has a relatively obvious encryption.

[0061] (2) calling FLUENT software based on the FLUENT batch processing script 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, the grid file needs to be read according to the FLUENT batch processing script recorded in the ANSYS Workbench automation script, and the CFD mathematical solving model and boundary conditions and other parameters are automatically set based on the grid file to realize automatic numerical solving (such as solving flow and heat transfer equations); when recording the FLUENT batch processing script, the recorded FLUENT batch processing script needs to be saved as a.wbjn file, and at the same time, a residual value and a detection point (a point set on the bottom plate of the heat exchange channel for monitoring whether the FLUENT calculation process is normal and whether it converges) need to be set during recording; 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 relatively accurate for simulating heat conduction and fluid flow with complex shape, and FLUENT has rich turbulence models, Reynolds stress models for solving strong rotational flow and anisotropic flow, etc., which are suitable for many fields such as multiphase mixing process, heat exchanger, wind turbine, battery simulation, rotating machinery, etc.

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

[0064] Based on the CFD POST batch processing script, CFD POST software is called to output the numerical simulation calculation results to a.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 into a result.xlsx text file, output and saved, and then the data in the result.xlsx file is read by MATLAB for subsequent optimization and updating. When recording the CFD POST batch processing script, the numerical solving results output by FLUENT are converted into the numerical simulation calculation results to be solved through the edited formula, and are set as output parameters, which are automatically solved when calling.wbjn.

[0065] Further, in one embodiment, the application 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, graphics or data tables.

[0066] The application is based on the FLUENT batch processing script to automatically call the FLUENT software to read the grid file through MATLAB, and to perform CFD numerical simulation on the grid file, to realize automatic numerical solution, and to write the detection point data into a result.xlsx text file as the numerical simulation calculation result through the CFDPOST software, to output and save, and then to read the data in the result.xlsx file through MATLAB for subsequent optimization update.

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

[0068]

[0069]

[0070] S300: reading the numerical simulation calculation result in a specified file based on MATLAB and optimizing, outputting the optimization result; updating the initial values of the design variables and the parameters of the grid file based on the optimization result.

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

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

[0073] Constructing the objective function J k and iteratively solving; judging the difference of the objective function after each iteration whether it is minimized, if so, output the result; if not, calculating the sensitivity coefficient of all design variables and the conjugate gradient coefficient calculating the search direction and outputting the optimization result; updating all design variables based on the optimization result, and outputting the final result, for example, including the set target value and the fin height h1-h5, and the set target value includes the Nusselt number Nu, the friction resistance coefficient f, Nu / Nu0 / (f / f0) 1 / 3and the maximum temperature difference of the bottom wall surface ΔT, etc.

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

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

[0076] The simplified conjugate gradient algorithm needs to calculate the gradient of the objective function and construct the conjugate direction for the updated design variable through sensitivity analysis; the first step search direction takes the negative gradient direction of the objective function:

[0077]

[0078] Among them, the sensitivity coefficient is defined by adding a small perturbation Δx i to the design variable x i , and the sensitivity analysis is used to evaluate the sensitivity of the objective function to each design variable; then, the new design variable after each search can be updated according to the following formula:

[0079]

[0080] Among them, x i k and x i k+1 respectively represent the design variables of the iteration steps k and k+1 searches, λ i k is the step size of the design variable at iteration step k; the search direction of the design variable x i at iteration step k+1 can be defined by the linear combination of the negative gradient direction of the updated objective function and the search direction of the previous step α i k

[0081]

[0082] Among them, the conjugate gradient coefficient γ i k+1 needs to ensure that α i k and are conjugate, which can be defined as:

[0083]

[0084] In the traditional conjugate gradient method, the optimal search step size λ i needs to be accurately calculated during the optimization processk , 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 size when .

[0085] After the k-th search, the objective function can be written as:

[0086]

[0087] Where, 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 wall surface △T, etc. are the design variables x at iteration step k 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 Step size (i=1,2,…,N); are the design variables x at iteration step k i (i=1,2,…,N) search direction.

[0088] The traditional conjugate gradient method requires a sensitivity analysis of 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 convergence loss. A different constant step size value is selected for each design variable based on the sensitivity of the design variable to the objective function. The gradient of the objective function with respect to each design variable is calculated using differences. Although the fixed step size leads to slow convergence, there is no need to determine the optimal step size, so the total optimization time 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] The DesignModeler batch processing script in ANSYS Workbench is called to modify the geometric parameters (i.e. the initial values of several design variables) in the geometric model. During the running process of the MATLAB main program, the macro command file (i.e. the part of the script that automatically modifies the geometric dimensions of the geometric model) recorded in advance is constantly called to modify the geometric parameters of the geometric model, i.e. the geometric parameters are constantly updated by calling the DesignModeler software.

[0092] ① The ANSYS Workbench command is called to couple ANSYS Workbench and MATLAB:

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

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

[0095] ② The batch processing command of 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 constantly modify the geometric parameters according to the optimization results, and the program 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] The MESH batch processing script in ANSYS Workbench is called to realize automatic updating of parameters during mesh division and encryption, complete new mesh division and encryption; during the running of the MATLAB main program, the MESH software is called to update the parameters of the mesh file according to the macro command file recorded in advance.

[0105] The batch processing command of the MESH software is as follows:

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

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

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

[0109] The MESH software needs to modify the mesh parameters according to the optimization results, and the program for executing the modification of the mesh parameters is as follows:

[0110]

[0111] Example Two

[0112] As Figure 7 shown, one embodiment of the application provides a computational fluid dynamics simulation optimization design system, comprising a structure parameterization module, a CFD numerical simulation analysis module and a MATLAB optimization algorithm module;

[0113] The structure parameterization module is used for recording an ANSYS Workbench automation script in a MATLAB main program, specifying initial values of a plurality of design variables, modeling the initial values of the plurality of design variables by calling ANSYS Workbench based on the ANSYS Workbench automation script, and obtaining a geometric model;

[0114] The CFD numerical simulation analysis module is used for automatically dividing a mesh of the geometric model by calling MESH software based on the ANSYS Workbench automation script, obtaining a mesh file; and performing fluid mechanics numerical simulation on the mesh file by calling FLUENT software, obtaining numerical simulation calculation results, and storing the numerical simulation calculation results into a specified file by calling CFD-POST software;

[0115] The MATLAB optimization algorithm module is configured to read the numerical simulation calculation result in the specified file based on MATLAB and perform optimization, and output an optimization result; and update the initial value of the design variables and the parameters of the grid file based on the optimization result.

[0116] Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in the embodiments of the present application can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0117] In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. For example, the apparatus embodiments described above are merely schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units or components shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.

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

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

[0120] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the parts of the present application that essentially contribute to the prior art or the parts of the technical solutions can be embodied in the form of software products. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes various storage media that can store program codes, such as a U disk, a mobile hard disk, a ROM, a RAM, a magnetic disk or an optical disk.

[0121] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A computational fluid dynamics simulation optimization design method, characterized by, The method comprises the following steps: S100: recording an ANSYS Workbench automation script in a MATLAB main program, specifying initial values of a plurality of design variables, modeling the initial values of the plurality of design variables based on the ANSYS Workbench automation script to obtain a geometric model; S200: calling MESH software to automatically mesh the geometric model based on the ANSYS Workbench automation script 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; S300: reading the numerical simulation calculation results in the specified file based on MATLAB and performing optimization, and outputting optimization results; updating the initial values of the plurality of design variables and the parameters of the mesh file based on the optimization results; wherein step S300 comprises: during the running process of the MATLAB main program, calling MATLAB to perform optimization and solving by using a simplified conjugate gradient algorithm, and whenever the optimization algorithm program is iterated, the MATLAB main program writes the optimization results into a.csv format file, and DesignModeler software modifies the initial values of the plurality of design variables according to the optimization results, and MESH software modifies the parameters of the mesh file according to the optimization results; the optimization and solving by using the simplified conjugate gradient algorithm comprises: constructing an objective function and iteratively solving; the objective function is represented by the following formula: In the formula, J k Nu is the Nusselt number, C f is the friction resistance coefficient, and ΔT is the maximum temperature difference of the bottom wall. design variables at iteration step k - 1 i (i = 1, 2,..., N); design variables at iteration step k - 1 design variables at iteration step k - 1 i (i = 1, 2,..., N); design variables at iteration step k - 1 i (i = 1, 2,..., N); determining the difference of the objective function after each iteration whether the minimization is completed, if yes, outputting the optimization result; if no, calculating the sensitivity coefficient and the conjugate gradient coefficient of all design variables, and outputting the optimization result after calculating the search direction.

2. The computational fluid dynamics simulation optimization design method of claim 1, wherein, recording the ANSYS Workbench automation script in step S100 comprises: recording 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 of claim 1, wherein, The step S100 comprises: calling DesignModeler in ANSYS Workbench to perform two-dimensional parametric modeling on the initial values of the plurality of design variables based on the ANSYS Workbench automation script to obtain a geometric model.

4. The computational fluid dynamics simulation optimization design method of claim 1, wherein, The step S100 further comprises: correlating different geometric features during the modeling process.

5. The computational fluid dynamics simulation optimization design method of claim 1, wherein, The step S200 comprises: during the running process of the MATLAB main program, calling MESH to automatically mesh the geometric model according to the MESH batch processing script recorded in the ANSYS Workbench automation script; reading the mesh file according to the FLUENT batch processing script recorded in the ANSYS Workbench automation script, and automatically setting a fluid mechanics numerical simulation mathematical solving model and boundary condition parameters based on the mesh file to realize automatic numerical solving and obtain numerical simulation calculation results; The CFD POST software is called based on the CFD POST batch processing script recorded in the ANSYS Workbench automation script to output the numerical simulation calculation result to a.csv file.

6. The computational fluid dynamics simulation optimization design method of claim 1, wherein, The step S200 further includes: The CFD POST software is called based on the CFD POST batch processing script to present the numerical simulation calculation result to a user in the form of a curve, a graph or a data table.

7. A computational fluid dynamics simulation optimization design system, characterized by, The structure parameterization module, the CFD numerical simulation analysis module and the MATLAB optimization algorithm module are included; The structure parameterization module is configured to record an ANSYS Workbench automation script in a MATLAB main program, specify initial values of a plurality of design variables, call the ANSYS Workbench to model the initial values of the plurality of design variables based on the ANSYS Workbench automation script, and obtain a geometric model; The CFD numerical simulation analysis module is configured to call MESH software to automatically mesh the geometric model based on the ANSYS Workbench automation script, and obtain a mesh file; And call FLUENT software to perform fluid mechanics numerical simulation on the mesh file, obtain a numerical simulation calculation result, and call CFD-POST software to store the numerical simulation calculation result in a specified file; The MATLAB optimization algorithm module is configured to read the numerical simulation calculation result in the specified file and perform optimization based on MATLAB, output an optimization result, and update the initial values of the plurality of design variables and parameters of the mesh file based on the optimization result; wherein the MATLAB optimization algorithm module is configured to call MATLAB to perform optimization and solution by using a simplified conjugate gradient algorithm during running of a MATLAB main program, and write the optimization result into a.csv format file every time the optimization algorithm program is iterated in the solution process, and DesignModeler software modifies the initial values of the plurality of design variables and MESH software modifies parameters of the mesh file according to the optimization result; The optimization and solution by using the simplified conjugate gradient algorithm include: Constructing an objective function and iteratively solving; the objective function is represented by the following formula: In the formula, J k Nu is the Nusselt number, C f is the friction resistance coefficient, and ΔT is the maximum temperature difference of the bottom wall. design variables at iteration step k - 1 i (i = 1, 2,..., N); design variables at iteration step k - 1 design variables at iteration step k - 1 i (i = 1, 2,..., N); design variables at iteration step k - 1 i (i = 1, 2,..., N); determining the difference of the objective function after each iteration whether the minimum is reached, if yes, output the optimization result; if no, calculate the sensitivity coefficient and the conjugate gradient coefficient of all design variables, and output the optimization result after calculating the search direction.

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