An Efficient Synchronization Algorithm for Global Ignition Delay Time of OpenFOAM Simulation Results
By developing algorithms for modules such as MultiMeshChemFoam and idtFoam, the problem of inefficiency of existing tools when calculating ignition delay times in multi-mesh and multi-thermodynamic states is solved, and efficient and fast synchronous calculation of the whole-domain ignition delay time is achieved, simplifying the operation process.
Patent Information
- Application Number
- CN202410893658.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2044-07-04
AI Technical Summary
Existing tools for calculating ignition delay time can only calculate a single thermodynamic state in a single run, and the synchronous calculation of multiple grid cells and multiple thermodynamic states is inefficient and complex.
A full-domain ignition delay time efficient synchronization algorithm for OpenFOAM simulation results was developed. By expanding the MultiMeshChemFoam chemical solver and idtFoam extraction solver, ignition delay time synchronization calculation of multiple grid units and multiple thermodynamic states is realized.
It realizes efficient and rapid calculation of ignition delay time for any multiple grid cells and any multiple thermodynamic states, simplifies the operation process and significantly improves the calculation efficiency.
Smart Images

Figure CN118862730B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of computational fluid dynamics and numerical combustion, and in particular to an efficient global ignition delay time synchronization algorithm for OpenFOAM simulation results. Background Art
[0002] In the past few decades, computational fluid dynamics (CFD) has been widely used in simulating and studying chemical reaction flows. OpenFOAM is an object-oriented open-source C++ library based on the finite volume method, with significant advantages such as open source code, free access, easy expansion, and support for large-scale parallel computing. Compared with commonly used commercial CFD software such as ANSYS Fluent, STAR-CD, STAR-CCM+, and CFX, which have closed algorithms and high copyright costs, the source code of OpenFOAM is completely open, with extremely strong flexibility and expandability, enabling personalized customization and code development according to user research needs. It supports polyhedral meshes and can handle complex geometric configurations, and has powerful simulation and analysis capabilities for fluid flow, combustion, heat transfer, and various multi-physics coupling problems. Currently, it has become the most influential, widely used, and most popular open-source CFD platform globally, integrating a large number of solvers and applications for various problems. However, due to the diversity of the physical world and the richness of research problems, OpenFOAM is relatively weak in data post-processing.
[0003] For example, the ignition delay time is a very important concept in chemical reaction flows. It is generally defined as the time interval from when fuel is injected into the combustion chamber to the occurrence of combustion (such as the appearance of a flame, i.e., cold flame luminescence, or an increase in the pressure or temperature of the combustion chamber due to fuel combustion). For diffusion combustion systems such as various practical power plants, including internal combustion engines, gas turbines, aeroengines, rocket engines, and air-breathing ramjets, the ignition delay time is an important criterion for measuring the combustion performance of the combustion chamber and fuel. Whether the fuel can be efficiently ignited and stably burned within the limited residence time in the combustion chamber directly determines the ignition reliability, flame stability, and combustion efficiency of the power plant. For premixed combustion systems such as gas turbines using premixed combustion technology, a severe challenge is how to avoid untimely auto-ignition to weaken or even prevent engine knock combustion and control pollutant emission levels. It can be seen that the ignition delay time has an important impact on the combustion performance and fuel economy of various types of power plants. Optimizing the ignition delay time can improve the combustion efficiency of the engine, reduce exhaust emissions, and fuel consumption.
[0004] Therefore, when using OpenFOAM to simulate chemical reaction flows of various types of power plants, it is extremely necessary to accurately predict the distribution of ignition delay time on the entire computational domain and study the influence of local parameters on ignition occurrence. Predicting ignition delay time is also beneficial to the development of chemical reaction mechanisms. Testing and verifying new detailed or simplified mechanisms usually requires analyzing their ignition delay time. For example, an important verification technology for developing detailed mechanisms is to compare the ignition delay time predicted by calculation with the experimental data of shock tubes. Since the ignition delay time calculation is zero-dimensional, the influence of transport effects is eliminated, and the above comparison verification can better understand the real chemical reaction path. At present, the commonly used tools for calculating ignition delay time include the ignition delay subroutine library of the commercial software CHEMKIN, the chemFoam solver based on the OpenFOAM open source platform, and the open source software toolkit Cantera based on the Linux platform. Among them, CHEMKIN has been acquired by ANSYS (AnsysChemkin-Pro), and has the inherent defects of commercial software, such as non-disclosure of code and expensive copyright fees; Cantera requires a certain Linux foundation, has a high threshold for use, and needs to overcome the connection problem with OpenFOAM calculation data. chemFoam is the chemical solver that comes with OpenFOAM, but it only works on a single grid cell.
[0005] More importantly, the above-mentioned toolkits can usually only calculate the ignition delay time corresponding to a single thermodynamic state during a single run. Although CHEMKIN provides certain parametric research functions, the specific values of the parameters under study need to be manually entered. For example, under fixed pressure and equivalence ratio conditions, when studying the effect of each 1K increase in temperature in the range of 600K to 3000K on the fuel ignition delay time, it is necessary to manually enter 600K, 601K, ..., 3000K, which is a huge workload. You can also specify the upper and lower limits of the temperature and the growth rate, and automatically generate a column of data as the initial temperature according to the specified rules, but only specific initial temperature values can be obtained, and the application scenarios are very limited. In actual numerical simulations, temperature usually does not follow a specific simple distribution law in space (for example, uniformly changing from 600K to 3000K), and the temperature on adjacent grids may vary greatly. More generally, the temperature, pressure and component concentration that determine the ignition delay time are irregularly distributed in the entire numerical calculation domain, and CHEMKIN cannot simultaneously calculate the ignition delay time corresponding to the thermodynamic state of all grids. However, chemFoam and Cantera are designed for a single thermodynamic state point, and cannot simultaneously calculate the ignition delay time corresponding to multiple thermodynamic states. The shortcomings of the above research methods have greatly limited the research efficiency of the ignition problem. Summary of the invention
[0006] The object of the present invention is to provide an efficient global ignition delay time synchronization algorithm for OpenFOAM simulation results, which can accurately, efficiently and quickly calculate the global ignition delay time of actual OpenFOAM simulation results. It can not only calculate the ignition delay times corresponding to multiple grid cells and various thermodynamic states (temperature, pressure, composition) simultaneously, but also directly use the simulation results at any instant of the actual numerical calculation configuration as the initial condition input, and the actual operation is extremely simple.
[0007] To achieve the above object, the present invention provides an efficient global ignition delay time synchronization algorithm for OpenFOAM simulation results, including the following steps:
[0008] S1. Expand a chemical solver capable of synchronously calculating the ignition delay times of multiple grid cells and various thermodynamic states, and name it MultiMeshChemFoam;
[0009] S2. Based on the intermediate time results obtained from the zero-dimensional ignition simulation of MultiMeshChemFoam, develop an extraction solver for the ignition delay time on each grid cell, and name it idtFoam.
[0010] Preferably, the chemical solver MultiMeshChemFoam is used for seamless docking with the OpenFOAM simulation results, directly using the transient results at any time as the initial conditions for ignition delay calculation, and completing the zero-dimensional ignition process calculation of all grid cells on any number of grids.
[0011] Preferably, the step S1 specifically includes the following steps:
[0012] S11. In the main program of the chemFoam solver, modify the library file #include createSingleCellMesh.H for creating a single grid cell to the library file #include createMesh.H for creating multiple grid cells;
[0013] S12. In the createBaseFields.H file for creating basic field quantities, modify the reading of a single grid cell from each time folder to the reading of the temperature and pressure field quantities on multiple grid cells;
[0014] S13. In the readInitialConditions.H file for reading initial conditions, comment out the code for reading the initial component mole fraction or mass fraction on a single grid;
[0015] S14. Modify the initial component mass fractions, mixture enthalpy / internal energy, density, specific heat, and heat release in the readInitialConditions.H file from scalars to scalar fields;
[0016] S15. In the solveChemistry.H file for solving the zero-dimensional ignition control equation, modify the heat release rate and the heat release in time integration from scalar operations on a single grid to standard scalar field operations in OpenFOAM;
[0017] S16. In the hEqn.H file for updating the mixture enthalpy, modify the calculation of the mixture enthalpy from scalar operations on a single grid to standard OpenFOAM scalar field operations that traverse all grids;
[0018] S17. In the pEqn.H file for updating the pressure, density, and specific heat, modify the specific heat, pressure, and density from scalar operations on a single grid to standard OpenFOAM scalar field operations that traverse all grids.
[0019] Preferably, step S11 further includes commenting out the line code #define CREATE_MESH createSingleCellMesh.H and deleting the original library file of the single grid cell in the chemFoam solver directory.
[0020] Preferably, in step S13, the chemical solver MultiMeshChemFoam only supports mass fractions as input for components.
[0021] Preferably, in steps S14 to S17, when updating the state parameters or physical properties of the mixture, the scalar operations on a single grid need to be modified to standard field quantity operations based on the grid topology structure in OpenFOAM.
[0022] Preferably, step S2 specifically includes the following steps:
[0023] S21. Define several criteria for ignition occurrence, including the temperature reaching the critical value, the temperature time derivative, the intermediate component, and the heat release rate reaching the maximum value;
[0024] S22. Create static scalar field files corresponding to different criteria, IDT_T, IDT_dTdt, IDT_OH, IDT_Qdot, to store the corresponding ignition delay times on all grid cells;
[0025] S23. Create a global scalar IDT_T1 corresponding to the critical temperature ignition criterion, and then dynamically store the current time value when traversing all time moments;
[0026] S24. Create global scalar fields IDT_dTdt1, IDT_OH1, and IDT_Qdot1 corresponding to the maximum ignition criterion, and dynamically store the instantaneous scalar values of each grid cell.
[0027] S25. Traverse all time steps to read the scalar field results required for different criteria, including temperature, temperature time derivative, intermediate components, and heat release rate; S26. Traverse all grid cells and all time folders, and use the if condition according to different criteria to determine the ignition delay time on each grid.
[0028] S27. Write the above results into the scalar field files IDT_T, IDT_dTdt, IDT_OH, and IDT_Qdot files respectively to obtain data files that follow the OpenFOAM standard output results.
[0029] Preferably, in step S22, the created blank field file is consistent with the ignition criterion defined in step S21 to store the corresponding ignition delay time calculation results.
[0030] Preferably, in steps S23 to S26, traverse all time steps, search for the earliest time when each grid reaches the critical temperature, and the global scalar IDT_T1 dynamically stores this time value and transfers it to the IDT_T field file according to the grid; traverse all time steps to search for the maximum values of the temperature time derivative, intermediate components, and heat release rate of each grid, and dynamically store them in the IDT_dTdt1, IDT_OH1, and IDT_Qdot1 field files according to the grid, and then transfer them to the static field files IDT_dTdt, IDT_OH, and IDT_Qdot according to the grid correspondence.
[0031] Therefore, the present invention adopts the above-mentioned efficient synchronization algorithm for the global ignition delay time of OpenFOAM simulation results, and the beneficial effects are as follows:
[0032] (1) The calculation efficiency of the present invention is extremely high. In theory, as long as the computer performance is sufficient, the ignition delay time distribution of any number of grid cells and any number of thermodynamic states can be obtained after running one example.
[0033] (2) The algorithm provided by the present invention is more convenient and efficient in actual operation compared with the successive setting, calculation, and extraction of single points and single thermodynamic states in terms of example setting, operation, and post-processing analysis.
[0034] (3) The present invention can realize the data interaction between the ignition delay and ignition probability calculations and the OpenFOAM simulation results, obtain the ignition field quantity distribution of the entire domain of the real calculation configuration, and has a very wide application range and strong practicability.
[0035] (4) The algorithm provided by the present invention can establish a data interface with the OpenFOAM flow / combustion simulation results. Using the numerical simulation results of temperature, pressure, and components across the entire computational domain as the initial conditions for calculating the ignition delay time can significantly improve (by orders of magnitude) the calculation efficiency of the ignition delay time.
[0036] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Description of the Drawings
[0037] Figure 1 It is a schematic diagram of the ignition delay time synchronization calculation module MultiMeshChemFoam in an embodiment of the global ignition delay time efficient synchronization algorithm for OpenFOAM simulation results of the present invention;
[0038] Figure 2 It is a schematic diagram of the ignition delay time definition and extraction module idtFoam in an embodiment of the global ignition delay time efficient synchronization algorithm for OpenFOAM simulation results of the present invention;
[0039] Figure 3 It is the overall flowchart of an embodiment of the global ignition delay time efficient synchronization algorithm for OpenFOAM simulation results of the present invention;
[0040] Figure 4 It is a comparison of the calculation results of chemFoam and MultiMeshChemFoam in an embodiment of the global ignition delay time efficient synchronization algorithm for OpenFOAM simulation results of the present invention;
[0041] Figure 5 It is the evolution curves of temperature and heat release rate during the ignition process at different initial temperatures in an embodiment of the global ignition delay time efficient synchronization algorithm for OpenFOAM simulation results of the present invention;
[0042] Figure 6 It is a schematic diagram of a scramjet engine for OpenFOAM numerical simulation in an embodiment of the global ignition delay time efficient synchronization algorithm for OpenFOAM simulation results of the present invention;
[0043] Figure 7 It is the distribution of the ignition delay time in the scramjet mixing field and the entire computational domain in an embodiment of the global ignition delay time efficient synchronization algorithm for OpenFOAM simulation results of the present invention, where (a) is the hydrogen mass fraction, (b) is the ignition delay defined by the critical temperature, (c) is the ignition delay defined by the maximum heat release rate, and (d) is the ignition delay defined by the maximum OH concentration;
[0044] Figure 8It is the scatter distribution of temperature, pressure, and components at the ignition success position in an embodiment of the efficient synchronization algorithm for the global ignition delay time of the simulation results of the present invention facing OpenFOAM. Detailed implementation manners
[0045] The technical solutions of the present invention will be further described below with reference to the accompanying drawings and embodiments.
[0046] Unless otherwise defined, the technical terms or scientific terms used in the present invention shall have the ordinary meanings understood by those of ordinary skill in the field to which the present invention belongs.
[0047] An efficient synchronization algorithm for the global ignition delay time of the simulation results of OpenFOAM. This algorithm is based on the existing chemFoam chemical solver for a single grid and a single thermodynamic state in OpenFOAM (taking version v8 as an example), and is implemented and generates an executable file through C++ computer code programming. This algorithm mainly includes three major modules: the data interface with the simulation results of OpenFOAM, the zero-dimensional ignition process calculation on each grid cell, and the definition and extraction of the ignition delay time calculated globally. The data interface with the simulation results of OpenFOAM and the synchronous calculation module of the multi-grid ignition delay time are implemented by modifying the chemFoam solver, mainly including the following steps:
[0048] S1. Expand a chemical solver that can synchronously calculate the ignition delay time of multiple grid cells and multiple thermodynamic states, and name it MultiMeshChemFoam; the chemical solver MultiMeshChemFoam is used for seamless docking with the simulation results of OpenFOAM, directly using the transient results at any moment of the numerical simulation as the initial conditions for ignition delay calculation, and completing the zero-dimensional ignition process calculation of all grid cells on any number of grids. Specifically, it includes the following steps:
[0049] S11. In the main program of the chemFoam solver, modify the library file "#include createSingleCellMesh.H" for creating a single grid cell to the library file "#include createMesh.H" for creating multiple grid cells; it also includes commenting out the line code "#define CREATE_MESH createSingleCellMesh.H", and deleting the original library file createSingleCellMesh.H for the single grid cell under the chemFoam solver directory.
[0050] S12. In the createBaseFields.H file for creating the basic field quantities, modify the reading of each time folder for a single grid cell to read the temperature and pressure field quantities on multiple grid cells;
[0051] S13. In the readInitialConditions.H file for reading the initial conditions, comment out the code for reading the initial component mole fraction or mass fraction (both of which are scalar list types) on a single grid; Since OpenFOAM usually solves the component transport equation based on mass fraction rather than mole fraction, in this invention, the chemical solver MultiMeshChemFoam uses the component mass fraction as the input for the ignition delay.
[0052] S14. Modify the initial component mass fraction, mixture enthalpy / internal energy, density, specific heat, and heat release in the readInitialConditions.H file from scalar to scalar field;
[0053] S15. In the solveChemistry.H file for solving the zero-dimensional ignition control equation, modify the heat release rate and the heat release in the time integration from scalar operations on a single grid to standard scalar field operations in OpenFOAM;
[0054] S16. In the hEqn.H file for updating the mixture enthalpy, modify the calculation of the mixture enthalpy from scalar operations on a single grid to standard OpenFOAM scalar field operations that traverse all grids;
[0055] S17. In the pEqn.H file for updating the pressure, density, and specific heat, modify the specific heat, pressure, and density from scalar operations on a single grid to standard OpenFOAM scalar field operations that traverse all grids.
[0056] In steps S14 to S17, when updating the state parameters or physical properties of the mixture, the scalar operations on a single grid need to be modified to standard field quantity operations in OpenFOAM based on the grid topology.
[0057] Through the above steps, obtain the chemical solver MultiMeshChemFoam. MultiMeshChemFoam needs to run for a long enough time (significantly higher than the residence time of the fuel in the computational domain) to ensure that all possible ignition processes on all grids have fully developed.
[0058] S2. Then, based on the results at the intermediate moments of the ignition process obtained by the chemical solver MultiMeshChemFoam, develop an extraction solver for the ignition delay time on each grid cell, named idtFoam, which specifically includes the following steps:
[0059] S21. Define several criteria for ignition occurrence, including the temperature reaching the critical value, the temperature time derivative, the intermediate component, and the heat release rate reaching the maximum value, etc.; here, it is not limited to the several ignition criteria listed, and any other reasonable criteria can be written as needed. The criteria should be unified when comparing with experimental data or other chemical solvers.
[0060] S22. Create static scalar field files corresponding to different criteria, IDT_T, IDT_dTdt, IDT_OH, IDT_Qdot, to store the corresponding ignition delay times on all grid cells; the blank field files created here are consistent with the ignition criteria defined in step S21 and are used to store the calculation results of the corresponding ignition delay times. Here, the intermediate component is only taken as OH for example.
[0061] S23. Create a global scalar IDT_T1 corresponding to the ignition criterion of the critical temperature (such as 2600K), and then traverse all times to dynamically store the current time value.
[0062] S24. Create global scalar field IDT_dTdt1, IDT_OH1, IDT_Qdot1 corresponding to the maximum value ignition criterion, and dynamically store the instantaneous scalar values of each grid cell.
[0063] S25. Traverse all times to read the scalar field results required by different criteria, including temperature, temperature time derivative, intermediate component, and heat release rate.
[0064] S26. Traverse all grid cells and all time folders, and use the if condition according to different criteria to determine the ignition delay time on each grid.
[0065] In steps S23 to S26, traverse all times, search for the earliest time when each grid reaches the critical temperature, and the global scalar IDT_T1 dynamically stores this time value and passes it to the IDT_T field file according to the grid; traverse all times to search for the maximum values of the temperature time derivative, intermediate component, and heat release rate of each grid, and dynamically store them in the IDT_dTdt1, IDT_OH1, and IDT_Qdot1 field files according to the grid, and then pass them to the static field files IDT_dTdt, IDT_OH, and IDT_Qdot according to the grid correspondence.
[0066] S27. Write the above results into the scalar field files IDT_T, IDT_dTdt, IDT_OH, IDT_Qdot respectively to obtain data files that follow the OpenFOAM standard output results.
[0067] Through the above steps, an efficient algorithm is presented that can synchronously calculate the ignition delay times of arbitrarily many grids and arbitrarily many thermodynamic states, and the ignition delay time distribution on all grids at any instant in the OpenFOAM flow / combustion simulation can be obtained. The results are stored in a file in the form of OpenFOAM standard field quantities, corresponding to the grid topology and directly visualized, which can facilitate the mechanism and application research of the ignition problem. The grid with the shortest ignition delay usually corresponds to the location where ignition occurs first. Repeating the above calculation at different initial times can obtain the ignition probability distribution on all grids.
[0068] For the ignition delay time calculation module, the main differences between chemFoam and MultiMeshChemFoam are shown as Figure 1 , and can be summarized into the following three points:
[0069] ① When creating the computational grid, the former creates a single grid cell, while the latter creates multiple grid cells;
[0070] ② When reading the initial conditions or proceeding to the next calculation and reading the results of the previous step, the former reads a list of scalars (temperature, pressure, composition, enthalpy / internal energy, density, specific heat, and heat release, etc.) on a single grid, while the latter reads the corresponding scalar fields on multiple grid cells;
[0071] ③ When calculating the ignition delay, the former performs scalar calculations, while the latter performs OpenFOAM scalar field operations.
[0072] On a single grid, both solve the following zero-dimensional unsteady composition and enthalpy evolution equations and close them through the ideal gas state equation:
[0073]
[0074] where p, T, ρ, h, e 0 are the mixture pressure, temperature, density, enthalpy, and initial internal energy respectively, Y i , M i , are the mass fraction, molar mass, and chemical reaction rate of component i respectively, is the heat release rate, t is the time, N is the total number of components, and R u is the universal gas constant.
[0075] For the definition and extraction module of the ignition delay time, the idtFoam process is shown as Figure 2 , and mainly includes the following three steps:
[0076] ① Define the criterion for ignition occurrence. Only four are listed in the figure, and other custom criteria can be written as needed in practice;
[0077] ② Create a blank field file corresponding to the above criteria to store the calculation results of the ignition delay time under different criteria;
[0078] ③ Create a global scalar or scalar field, traverse all grids and all time steps to obtain the ignition occurrence time of each grid and write it into a file.
[0079] Finally, the ignition delay time corresponding to each criterion and corresponding to the OpenFOAM grid topology is obtained, and it has values throughout the calculation domain.
[0080] Finally, the synchronous calculation module of the ignition delay time needs to be coupled with the definition and extraction modules, as shown in Figure 3 . The initial thermodynamic state (temperature, pressure, composition) input for the ignition delay time calculation comes from the transient results at any time step of the OpenFOAM numerical simulation. Therefore, MultiMeshChemFoam is docked with the actual calculation configuration.
[0081] When iteratively solving the zero-dimensional ignition model synchronously and independently on each grid, first calculate the chemical reaction rates and reaction heat release of each component, then update the component concentrations, then update the mixture enthalpy and temperature, and finally update the pressure. Enter the next iteration with the new thermodynamic state until all possible ignition processes on all grids have fully developed. A large number of intermediate calculation results saved by MultiMeshChemFoam are used as the input of idtFoam. Traverse all time steps and all grids to obtain the ignition times corresponding to different ignition criteria.
[0082] The functions and effects of the algorithm of the present invention will be further described below in conjunction with two specific embodiments. The embodiments described below by referring to the accompanying drawings are exemplary and are only used to explain the present invention, rather than limiting the applicable scenarios of the present invention.
[0083] Embodiment 1
[0084] Based on the chemFoam chemical solver provided by OpenFOAM, which is only applicable to a single grid and a single thermodynamic state, the present invention has developed a MultiMeshChemFoam chemical solver that can efficiently and synchronously calculate the ignition delay time of any number of grid cells and any number of thermodynamic states. Whether the code implementation of this solver is completely correct and whether the definition and extraction module idtFoam of the ignition delay time can run properly are the questions that should be answered first before the practical application of the present invention and are also the questions to be verified in this embodiment. Compare the calculation results of the ignition delay time and the ignition process between chemFoam and MultiMeshChemFoam to verify the correctness of MultiMeshChemFoam and the feasibility of idtFoam.
[0085] In this embodiment, only the detailed chemical reaction mechanism of 9 components of hydrogen and 19 reaction steps is taken as an example. In fact, the algorithm of the present invention is not limited to any chemical reaction mechanism. The ignition delay times of stoichiometric hydrogen / air mixtures under an initial pressure of 0.1 MPa, an initial temperature of 950 - 2400 K, and constant volume conditions are calculated using chemFoam and MultiMeshChemFoam respectively. Since the calculation efficiency of chemFoam is low and only one initial temperature can be set for a single calculation, only 15 operating conditions are designed in this embodiment, that is, the initial temperatures are 1000 K, 1100 K, 1200 K, …, 2400 K respectively. While the calculation and post-processing efficiency of MultiMeshChemFoam is extremely high, and all results can be obtained by setting only one case. A total of 1551 temperature points are designed in this embodiment, that is, uniformly varying from 950 K to 2400 K with an increment of 1 K. When the temperature is lower than 945 K, the ignition delay time exceeds 3 milliseconds; when the temperature is higher than 2400 K, the ignition delay time reaches the microsecond order of magnitude. Therefore, a wider temperature range is not considered in this embodiment, but the algorithm of the present invention is not limited by the number of thermodynamic states.
[0086] The chemFoam solver does not require the user to design a grid additionally, and a single grid cell has been default created in the program. When setting up a case in MultiMeshChemFoam, first use the grid tool blockMesh in OpenFOAM to generate a one-dimensional computational domain containing 1551 grid cells. In the 0 time folder, set a uniform pressure field of 0.1 MPa and a stoichiometric hydrogen / air component field, while the temperature field varies from 950 K to 2400 K with an increment of 1 K. The calculation stop time of both solvers is set to 3 milliseconds. Figure 4 The hydrogen ignition delay time curves of the chemFoam and MultiMeshChemFoam solvers at different initial temperatures are given, and the calculation results are in complete agreement. In the figure, τ T , τ dTdt and τ OH respectively represent the ignition delay times characterized by the critical temperature (2600 K), the maximum heat release rate, the maximum temperature time derivative, and the highest OH mass fraction. Since the ignition delay time is a zero-dimensional calculation and the only reason for the temperature change is the heat release from the reaction, therefore, and τ dTdt curves almost completely coincide, while they have significant differences from τ T and τ OH
[0087] In addition, due to the relatively large temperature interval (100 K) in the calculation of chemFoam, some detailed change trends cannot be captured, such as when the temperature is relatively high (above 2100 K) and τdTdt There are step-like jumps, τ OH There are strong oscillations. The calculated temperature interval of MultiMeshChemFoam is very small (1K, and it can be made even smaller according to needs), which can effectively capture the above phenomena. Therefore, in addition to higher calculation efficiency, MultiMeshChemFoam also has higher accuracy in capturing the trend of detail changes.
[0088] Figure 5 The evolution curves of temperature and heat release rate during the ignition process calculated by the two solvers are given under the conditions of initial temperatures of 1200K, 1600K, and 2000K. It can be seen from the figure that the corresponding results of the two are exactly the same; the results are also exactly the same at other temperatures, and will not be shown repeatedly. Therefore, this embodiment verifies that the C++ code of the target algorithm is correctly implemented in the program of the present invention, and all three modules of this algorithm can run correctly and effectively. For this simple example, it is roughly estimated that the calculation efficiency of MultiMeshChemFoam is more than 100 times higher than that of chemFoam, fully proving the feasibility, high efficiency, and convenience of the algorithm of the present invention.
[0089] Embodiment 2
[0090] As Figure 6 , this embodiment is an integrated scramjet configuration of an inlet - combustor - nozzle for actual calculation, simulating a flight Mach number of 9.7. This configuration includes two-stage compression inlets with lengths of 134.3mm and 45mm respectively, and compression angles of 18° and 24° respectively. The subsequent combustor has a length of 380mm and a height of 26mm, and the final nozzle has a length of 195.6mm and an expansion angle of 18°. The width of the combustor (perpendicular to the paper plane) is 75mm. Hydrogen is injected into the engine through 4 spray holes with a diameter of 2mm at an angle of 45° in the first-stage inlet. The spray holes are 95mm away from the inlet, with 2 on each of the upper and lower walls and evenly distributed in the width direction. The free-stream Mach number at the engine inlet is 7.3, the velocity is 2830m / s, the static temperature is 370K, the static pressure is 4.1kPa, and the composition is air (23.3% oxygen plus 76.7% nitrogen by mass fraction); the global equivalence ratio of hydrogen injection is 0.8.
[0091] The total number of computational grids is 185 million, which means that MultiMeshChemFoam needs to synchronously complete the ignition process calculation for all grid cells within 3 milliseconds on such a large number of grids. This is an impossible task for chemical solvers such as chemFoam and Cantera that can only calculate a single grid and a single thermodynamic state at a time! Moreover, the workload of extracting such a huge amount of transient simulation results as the initial condition input for the CHEMKIN ignition delay calculation module is also unimaginable! Only the algorithm of the present invention can efficiently achieve the above goals.
[0092] After using OpenFOAM to complete the cold flow field simulation of the actual calculation configuration, select any converged mixed flow field simulation result at a certain instant as the initial moment (denoted as the 0 moment) for the ignition delay time calculation. Use MultiMeshChemFoam to run for a long enough time (3 ms in this example, which is equivalent to the residence time of the fuel in the computational domain), and save the intermediate moment results of a large number of ignition delay calculations. Then use idtFoam to extract the ignition delay time defined by the critical temperature (2600 K), the maximum heat release rate, and the maximum OH mass fraction. The initial mixed flow field (H 2 mass fraction) simulated by OpenFOAM and the ignition delay time results calculated by MultiMeshChemFoam are as Figure 7 .
[0093] Due to the extremely high incoming flow Mach number, two oblique shock waves are induced when hydrogen is injected at the upper and lower walls and meet near the centerline. Coupled with the extremely high total incoming flow temperature (reaching about 4300 K), the premixed hydrogen / air mixture ignites spontaneously in a very short time at the shock wave intersection and near the wall region. Around the engine centerline, the ignition process in the fuel-containing area has fully developed within the calculation time, but its ignition delay is longer than that in the near-wall region. In the region upstream of the intake duct oblique shock wave and the center region of the tail nozzle, the absence of fuel results in an infinite ignition delay time. In the transition zone between the near-wall region and the center region of the tail nozzle, the ignition delay time distribution is significantly affected by turbulent vortices. There are certain differences in the results obtained by the three ignition delay time definition methods, but all can characterize the main regions where ignition occurs.
[0094] Figure 8 Further, on the grid cells where ignition is successful (with τ T ≤3 ms as the criterion), the temperature T and the ignition delay time τ TThe scatter distribution is colored by pressure p. As can be seen from the figure, the position with the shortest ignition delay time generally appears in the grid cells with relatively high pressure and temperature (upper left corner). Various parameters, such as temperature, pressure, mixture composition, local turbulence intensity, etc., can be analyzed with a similar approach to study the statistical influence laws of these parameters on the ignition delay time and the success of ignition, thereby revealing the physical mechanism of ignition occurrence. In terms of engineering applications, it can support the optimization design of ignition devices in actual combustion systems, improving flame robustness and the probability of successful ignition; in terms of basic theory, it can support the development of more advanced, higher-dimensional, and more parameterized complex ignition theoretical models.
[0095] Therefore, the present invention adopts the above-mentioned efficient global ignition delay time synchronization algorithm for OpenFOAM simulation results, which can accurately, efficiently, and quickly complete the synchronous calculation of ignition delay times for any number of grids and any variety of thermodynamic states, and seamlessly interface with the numerical calculation results based on OpenFOAM simulation. Any transient simulation results (temperature, pressure, composition) of any actual calculation configuration can be used as the input for ignition delay time calculation, which has extremely strong practicality and extremely convenient operability, greatly promoting the basic and applied research on ignition problems.
[0096] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that they can still modify or equivalently replace the technical solutions of the present invention, and these modifications or equivalent replacements do not make the modified technical solutions deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for efficient synchronization of global ignition delay time for OpenFOAM simulation results, characterized in that: The following steps are involved: S1. Expand a chemical solver capable of simultaneously calculating multiple mesh units and ignition delay times of multiple thermodynamic states, and name it MultiMeshChemFoam; S2. Based on the intermediate time results obtained by the MultiMeshChemFoam zero-dimensional ignition simulation, an extraction solver for the ignition delay time on each grid cell was developed and named idtFoam. The step S1 specifically includes the following steps: S11. In the main program of the chemFoam solver, modify the library file #includecreateSingleCellMesh.H for creating a single mesh cell to the library file #include createMesh.H for creating multiple mesh cells; S12. In the createBaseFields.H file for creating basic field quantities, the temperature and pressure field quantities on multiple grid cells are changed from reading a single grid cell from each time folder; S13. In the readInitialConditions.H file for reading initial conditions, comment out the code for reading the initial component mole fraction or mass fraction on a single grid; S14, modify the initial component mass fraction, mixture enthalpy / internal energy, density, specific heat, and heat release in the readInitialConditions.H file from scalars to scalar fields; S15. In the solveChemistry.H file for solving the zero-dimensional ignition control equation, the heat release rate and time-integrated heat release are modified from scalar operations on a single grid to standard scalar field operations in OpenFOAM. S16. In the hEqn.H file that updates the mixture enthalpy, the calculation of the mixture enthalpy is changed from a scalar operation on a single grid to an OpenFOAM standard scalar field operation that traverses all grids; S17. In the pEqn.H file that updates pressure, density, and specific heat, change the specific heat, pressure, and density from scalar operations on a single grid to OpenFOAM standard scalar field operations that traverse all grids; Step S2 specifically includes the following steps: S21. Define several criteria for ignition occurrence, including temperature reaching a critical value, temperature-time derivative, intermediate components, and heat release rate taking a maximum value; S22, creating static scalar field files corresponding to different criteria, IDT_T, IDT_dTdt, IDT_OH, IDT_Qdot, storing the corresponding ignition delay time on all grid cells; S23, creating a global scalar IDT_T1 corresponding to the critical temperature ignition criterion, and then dynamically storing the current time value when traversing all moments; S24, creating global scalar fields IDT_dTdt1, IDT_OH1, IDT_Qdot1 corresponding to the maximum ignition criterion, and dynamically storing the instantaneous scalar value of each grid cell; S25, traversing all moments to read the scalar field results required for different criteria, including temperature, temperature time derivative, intermediate components, and heat release rate; S26, traversing all grid cells and all time folders, and determining the ignition delay time on each grid using if conditions according to different criteria; S27. Write the above results into the scalar field files IDT_T, IDT_dTdt, IDT_OH, and IDT_Qdot files respectively to obtain data files that comply with the OpenFOAM standard output results.
2. The method for efficient synchronization of global ignition delay time for OpenFOAM simulation results according to claim 1, characterized in that: The chemical solver MultiMeshChemFoam is used to seamlessly connect with the simulation results of OpenFOAM, using the transient results of the numerical simulation at any time directly as the initial conditions for the ignition delay calculation, and completing the zero-dimensional ignition process calculation of all grid cells on any number of grids.
3. The method for efficient synchronization of global ignition delay time for OpenFOAM simulation results according to claim 2, characterized in that: Step S11 also includes commenting the line code #define CREATE_MESHcreateSingleCellMesh.H, and deleting the original single mesh cell library file in the chemFoam solver directory.
4. The method for efficient synchronization of global ignition delay time for OpenFOAM simulation results according to claim 3, characterized in that: In step S13, the chemical solver MultiMeshChemFoam only supports mass fraction as input for components.
5. The method for efficient synchronization of global ignition delay time for OpenFOAM simulation results according to claim 4, characterized in that: In step S14 to step S17, when updating the state parameters or physical properties of the mixture, the scalar operation on the single grid needs to be modified to the standard field quantity operation based on the grid topology structure in OpenFOAM.
6. The method for efficient synchronization of global ignition delay time for OpenFOAM simulation results according to claim 5, characterized in that: In step S22, the static scalar field files corresponding to different criteria are created to be consistent with the ignition criterion defined in step S21 to store the corresponding ignition delay time calculation results.
7. The method for efficient synchronization of global ignition delay time for OpenFOAM simulation results according to claim 6, characterized in that: In step S23 to step S26, all moments are traversed to search for the earliest moment when each grid reaches the critical temperature. The global scalar IDT_T1 dynamically stores the time value and passes it to the IDT_T field file by grid; all moments are traversed to search for the maximum value of the temperature-time derivative, intermediate components and heat release rate of each grid, and dynamically stored in the IDT_dTdt1, IDT_OH1 and IDT_Qdot1 field files by grid, and then passed to the static field files IDT_dTdt, IDT_OH and IDT_Qdot by grid.
Citation Information
Patent Citations
Proton exchange membrane hydrogen fuel cell transient condition numerical simulation method based on OpenFOAM platform
CN114050294A
Method for constructing self-adaptive reaction mechanism to simulate supersonic combustion flow
CN114171127A