CN-122021473-A - Automatic CFD solving method for internal flow field of dual-mode scramjet engine
Abstract
The invention discloses an automatic CFD solving method for an internal flow field of a bimodal scramjet engine, which comprises the steps of constructing AnsysFluent an automatic solving environment by using a Python script, loading a grid file of a bimodal scramjet engine model, configuring a physical model and boundary conditions of the bimodal scramjet engine by using the Python script, completing the setting of a numerical discrete format and a solving method by using the Python script, constructing a flow field initial value of a calculation domain, using the flow field initial value as an iteration starting point, executing dynamic climbing calculation under first-order precision by using the Python script to obtain stable initial flow field distribution, using the stable initial flow field distribution as a calculation initial value, and using the Python script to switch second-order high-precision calculation and perform convergence judgment. The method effectively solves the problems of complicated manual intervention, difficult shock wave capturing and subjective convergence judgment in high Mach number strong compressible flow calculation.
Inventors
- WU KEXIN
- LI JIASHENG
Assignees
- 浙江理工大学
Dates
- Publication Date
- 20260512
- Application Date
- 20260414
Claims (10)
- 1. An automatic CFD solving method for an internal flow field of a bimodal scramjet engine is characterized by comprising the following steps: constructing an Ansys Fluent automatic solving environment by using a Python script, and loading a grid file of a dual-mode scramjet engine model; According to the grid file, a Python script is utilized to configure a physical model and boundary conditions of the dual-mode scramjet engine; According to the configuration of the physical model and boundary conditions, combining hypersonic flow characteristics of a dual-mode scramjet engine model, completing setting of a numerical discrete format and a solving method and constructing a flow field initial value of a calculation domain by using a Python script; taking the initial flow field value as an iteration starting point, and executing dynamic climbing calculation under first-order precision by using a Python script to obtain stable initial flow field distribution; And taking the stable initial flow field distribution as a calculation initial value, switching second-order high-precision calculation by using a Python script, and monitoring the fluctuation of the mass flow in real time in the second-order high-precision calculation process to carry out convergence judgment.
- 2. The method for automatically solving the CFD of the internal flow field of the bimodal scramjet engine according to claim 1, wherein constructing an Ansys Fluent automatic solving environment by using a Python script, loading a grid file of a bimodal scramjet engine model, comprises the following steps: Constructing starting configuration parameters of Ansys Fluent by using a Python script, wherein the starting configuration parameters comprise the number of CPU physical cores for appointed parallel calculation, selecting a double-precision solving mode suitable for hypersonic flow characteristics of a double-mode scramjet engine, and instantiating a Fluent solver object based on the starting configuration parameters; And reading a grid file of the dual-mode scramjet engine by using the Fluent solver object.
- 3. The automated CFD solving method for the internal flow field of the dual-mode scramjet engine as recited in claim 2, further comprising: And scaling the grid size in the grid file in a unit conversion way through script instructions, and executing the check of the negative volume and the orthogonality property of the grid.
- 4. The method for automatically solving the CFD of the internal flow field of the dual-mode scramjet engine according to claim 1, wherein the physical model and the boundary condition of the dual-mode scramjet engine are configured by using a Python script according to the grid file, and the method comprises the following steps: Identifying a fluid domain in the grid file through script instructions, changing the density of working fluid in a material tab into ideal gas, and setting the viscosity as the salsep law; Activating a turbulence model as a physical model by script instructions according to the material configuration of the working fluid; according to the physical model, setting the gauge pressure and Mach number of the boundary condition of the inlet, setting the gauge pressure in the boundary condition of the outlet and setting the operating pressure in the boundary condition to be 0Pa through script instructions.
- 5. The automatic CFD solving method for the internal flow field of the bimodal scramjet engine according to claim 1, wherein according to the configuration of the physical model and the boundary condition, combining hypersonic flow characteristics of the bimodal scramjet engine model, setting a numerical discrete format and a solving method and constructing a flow field initial value of a calculation domain are completed by using a Python script, and the method comprises the following steps: According to the configuration of the physical model and boundary conditions, combining hypersonic flow characteristics of a dual-mode scramjet engine model, and utilizing script instructions to configure a solver into a density-based solver in a steady-state and implicit format; According to the configuration requirement of the density-based solver, modifying the flux type into an AUSM format by utilizing a script instruction, locking the gradient format into a least square method based on a unit body, uniformly setting the momentum, turbulent kinetic energy and specific dissipation ratio under a space discretization option in a solving method tab into a first-order windward format, and executing a calculation initialization command to obtain a flow field initial value of a calculation domain.
- 6. The method for automatically solving the CFD of the internal flow field of the bimodal scramjet engine according to claim 1, wherein the method for solving the CFD of the internal flow field of the bimodal scramjet engine is characterized in that the initial flow field value is used as an iteration starting point, dynamic climbing calculation under first-order precision is performed by using a Python script, and stable initial flow field distribution is obtained, and the method comprises the following steps: According to the initial value of the flow field as an iteration starting point of dynamic climbing calculation under first-order precision, and maintaining a first-order discrete format and an AUSM flux type, a script command synchronously promotes a Brownian number, turbulent kinetic energy, specific dissipation rate and turbulent viscosity to a set maximum value according to a preset step length; After the Brownian number, the turbulent kinetic energy, the specific dissipation rate and the turbulent viscosity reach the set maximum values and the corresponding iterative calculation is completed, stable initial flow field distribution is obtained, and the script commands reset the Brownian number, the turbulent kinetic energy, the specific dissipation rate and the turbulent viscosity value to the set minimum values.
- 7. The automated CFD solving method for internal flow fields of a dual-mode scramjet engine according to claim 1, wherein the method is characterized in that the stable initial flow field distribution is used as a calculation initial value, a Python script is used for switching second-order high-precision calculation, and real-time monitoring of mass flow fluctuation in the second-order high-precision calculation process is used for convergence judgment, and the method comprises the following steps: Under the condition that the values of the Brownian number, the turbulent kinetic energy, the specific dissipation rate and the turbulent viscosity are set to be minimum values, the script instructions switch the momentum, the turbulent kinetic energy and the specific dissipation rate under the space discretization option in the solution method option card to a second-order windward format; under the condition that each parameter of the space discretization option is set to be in a second-order windward format, the script instruction synchronously promotes the Brownian number, the turbulence kinetic energy, the specific dissipation rate and the turbulence viscosity to the set maximum value according to the preset step length to carry out second-order high-precision calculation; according to the second-order high-precision calculation process, starting a convergence judging program in the process, and carrying out convergence judgment according to the fluctuation of the mass flow; during convergence judgment, the script command constructs a flow field stability monitoring window containing a preset fixed iteration step number, and extracts historical iteration data in the monitoring window in real time to calculate the numerical range of the import and export net mass flow; And comparing the numerical value range with a preset convergence threshold, and if and only if the numerical value range is continuously smaller than the convergence threshold in a current window, judging that the internal flow field of the dual-mode scramjet engine reaches steady-state convergence and automatically storing current data, and ending the Ansys Fluent solving process.
- 8. The automatic CFD solving method for the internal flow field of the bimodal scramjet engine according to claim 6 or 7, wherein the preset step length synchronously improves the number of the cursors, the turbulence kinetic energy, the specific dissipation rate and the turbulence viscosity, wherein the initial value, the target maximum value, the total climbing step number and the iteration step number of the control parameters are defined in the script, the parameters in the control tab are modified through the API instruction, and the current number of the cursors, the turbulence kinetic energy, the specific dissipation rate and the turbulence viscosity are increased by an increment after the set iteration step number until the parameters reach the target maximum value.
- 9. The automated CFD solving method for the internal flow field of the dual-mode scramjet engine according to claim 8, wherein the increment is calculated according to the formula: ; Where, delta is the increment, For the initial value of the value, At the maximum value of the target value, Is the total order of climbing.
- 10. An electronic device, comprising: one or more processors; A memory for storing one or more programs; the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-9.
Description
Automatic CFD solving method for internal flow field of dual-mode scramjet engine Technical Field The application relates to the technical field of intersection of aerospace power engineering and Computational Fluid Dynamics (CFD), in particular to an automatic CFD solving method for an internal flow field of a bimodal scramjet engine. Background In the field of aerospace power engineering, the aerodynamic performance evaluation of supersonic air inlets, laval nozzles and hypersonic aircraft outflow fields is a key link in engine design. Such flow fields generally have typically complex aerodynamic characteristics of high mach numbers, strong shock interference, and severe reverse pressure gradients. When such problems are numerically modeled using commercial software (e.g., using a commercial solver such as ANSYS Fluent, CFX, etc.), the solution process presents a significant challenge. In particular, the control equation set for hypersonic flow has extremely strong nonlinearity and rigidity. If a high-precision discrete format (such as a second-order windward format) is directly adopted in the calculation initialization stage, numerical oscillation near shock waves in a flow field is extremely easy to cause, so that a non-physical phenomenon of a negative value appears from thermodynamic parameters, and finally calculation divergence is caused. The existing mainstream solutions rely heavily on manual experience and real-time intervention by CFD engineers. The traditional calculation requires an engineer to manually set a first-order calculation to blur a shock wave structure to maintain the stability of the initial calculation stage, the engineer needs to manually pause the calculation after the residual curve is reduced to a certain degree, manually switch the discrete format into a second-order windward format and attempt to raise the CFL number to accelerate convergence, and in the second-order calculation process, once the residual jump or abnormal flow field is found, the engineer needs to immediately interrupt the calculation, and back off the parameters and try again. The traditional operation mode of manual debugging has the obvious defects of low efficiency and incapability of being large-scale, engineers need to monitor residual curves at all times, so that a great deal of manpower time and cost are wasted, and the traditional operation mode cannot meet the batch automatic calculation requirements of hundreds or thousands of working points in a flight envelope. The traditional method is mainly based on whether the algebraic residual errors fall into an expected range or not to judge convergence, and the actual stable state of physical quantities (such as import and export flow) is ignored. For a complex flow field with small-amplitude periodic oscillation, erroneous judgment is very easy to cause. While some commercial software provides simple batch scripts, these scripts have limited functionality and cannot dynamically adjust control parameters based on real-time feedback during the solution, resulting in very poor robustness of the script and failure once the conditions of severe shock wave position changes are encountered. Disclosure of Invention The embodiment of the application aims to provide a method, a device and electronic equipment, which are used for solving the problems of complicated manual intervention, improper initialization of a numerical format, strong subjectivity in convergence judgment and the like of hypersonic internal flow field calculation in the related technology, effectively improving the solving efficiency, realizing an unmanned solution path and further improving the stability and reliability of high Mach number strong compressible flow calculation. According to a first aspect of an embodiment of the present application, there is provided a method for automatically solving CFD of an internal flow field of a dual-mode scramjet engine, including: constructing an Ansys Fluent automatic solving environment by using a Python script, and loading a grid file of a dual-mode scramjet engine model; According to the grid file, a Python script is utilized to configure a physical model and boundary conditions of the dual-mode scramjet engine; According to the configuration of the physical model and boundary conditions, combining hypersonic flow characteristics of a dual-mode scramjet engine model, completing setting of a numerical discrete format and a solving method and constructing a flow field initial value of a calculation domain by using a Python script; taking the initial flow field value as an iteration starting point, and executing dynamic climbing calculation under first-order precision by using a Python script to obtain stable initial flow field distribution; And taking the stable initial flow field distribution as a calculation initial value, switching second-order high-precision calculation by using a Python script, and monitoring the fluctuation of the mass flow in