Method for fusing OpenFOAM low-dimensional unsteady-state simulation Euler field domain data
By setting the working root directory in OpenFOAM and reading discrete grid files, the intermediate time data of low-dimensional non-steady state simulation is fused, and the problem of inefficient data processing in OpenFOAM is solved, and efficient data fusion and visual analysis are achieved.
Patent Information
- Application Number
- CN202510330540.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2025-06-17
AI Technical Summary
The large amount of intermediate time data generated by OpenFOAM in low-dimensional non-steady state simulation lacks efficient post-processing methods, resulting in inefficient data processing and difficulty in conducting in-depth analysis and visualization.
A method is proposed to set the current working root directory of OpenFOAM, read discrete grid files, create global blank files, read and fuse Euler field data from multiple intermediate moments in order, and write it to a single file, making it easy to read and visualize.
It realizes efficient integration of the intermediate data generated by OpenFOAM low-dimensional non-steady state simulation, improves data processing efficiency, and supports visualization and in-depth analysis of the results of flow and combustion problems.
Smart Images

Figure CN120162010A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computational fluid dynamics data post - processing, and specifically to a method for integrating Euler field data of low - dimensional unsteady simulation in OpenFOAM. Background Technique
[0002] With the rapid development of computer hardware and software technologies, computational fluid dynamics (CFD) has been widely applied in many fields such as aerospace, ordnance industry, shipbuilding and oceanography, energy and power, vehicle transportation, heavy industrial machinery, electronic appliances, etc. As an object - oriented open - source CFD software package, OpenFOAM has convenient modular design, powerful multi - physical - field coupling, flexible code customization, and high - efficiency parallel computing capabilities, and has received extensive attention in the academic and industrial communities in recent years. Compared with commonly used commercial CFD software such as ANSYS Fluent, STAR - CD, STAR - CCM +, CFX, etc., which have closed algorithms and expensive copyrights, the source code of OpenFOAM is completely open, and there is no need to pay additional software fees. At the same time, it supports polyhedral meshes, can handle complex geometric configurations, and has powerful simulation and analysis capabilities for problems such as flow, combustion, heat transfer, and other various multi - physical - field couplings.
[0003] However, due to the diversity of the physical world and the richness of research problems, in the actual application of OpenFOAM, sometimes in order to simplify the physical model and highlight key features, low - dimensional (such as one - dimensional or two - dimensional) low - order computational configurations are adopted for three - dimensional configurations. While maintaining the main physical characteristics and computational accuracy, it can effectively reduce the computational amount and simplify the computational model, which is a widely adopted numerical simulation research scheme at present. When performing unsteady calculations using OpenFOAM, a large number of intermediate - time results are often saved to analyze the instantaneous characteristics of variables, but there is usually a lack of research on its complete evolution process. In addition, OpenFOAM is relatively weak in data post - processing. For specific research problems, users usually need to develop appropriate post - processing codes by themselves, and the application scope is limited.
[0004] For example, when simulating complex unsteady gas-phase combustion problems, OpenFOAM will obtain a large amount of Eulerian field data including pressure, temperature, velocity, heat release rate, component mass fraction, and chemical reaction rate, etc. These data are usually stored separately in different time folders in the form of independent files. Suppose that in a certain calculation, 100 Eulerian field variables are output at a single moment, and a total of 1000 moments are output, then 100,000 independent and scattered OpenFOAM standard output files will be obtained. When carrying out data post-processing and result extraction and analysis, a large amount of manual operations or script support are required, which is inefficient and error-prone. For a large number of intermediate moment results, various data post-processing software directly or indirectly supported by OpenFOAM (requiring file format conversion of OpenFOAM original data), such as ParaView, Tecplot, and Origin, etc., lack the ability to process a large number of time series data, which limits the analysis of the time evolution process of key variables. Therefore, there is an urgent need for an automatic and efficient method to integrate the low-dimensional and unsteady simulation Eulerian field data of OpenFOAM to improve data processing efficiency and support the result visualization and in-depth analysis and research of flow and combustion problems. Summary of the Invention
[0005] In view of the above problems of the prior art, the present invention provides a method for integrating the low-dimensional unsteady simulation Eulerian field data of OpenFOAM, which has the advantages of efficiently and conveniently integrating the specified physical field quantities in the simulation results of any number of intermediate moments, and after integrating in a certain order, writing them into a single file in a format that is easy to read and visualize by common data post-processing software, providing a one-stop solution for the post-processing of a large amount of intermediate data generated by the low-dimensional unsteady numerical simulation of OpenFOAM.
[0006] To achieve the above object, the present invention proposes a method for integrating the low-dimensional unsteady simulation Eulerian field data of OpenFOAM, the method comprising the following steps:
[0007] S1. Set the current working root directory of OpenFOAM, read the OpenFOAM discrete grid file and create a structured or unstructured grid for the case;
[0008] S2. Create a global blank file in the working root directory for storing the Eulerian field data of the simulation results of each intermediate moment integrated in a certain order subsequently;
[0009] S3. Write the variable names corresponding to the Eulerian field data to be read by the program on the first line of the global blank file to distinguish different Eulerian field variables;
[0010] S4, according to the order of variable names written in S3, read multiple Euler field data stored independently in the form of OpenFOAM standard output files in the time folder in turn, and traverse all the moments in the working root directory;
[0011] S5. Create a blank file in the time folder directory at each moment. The format of the blank file at each moment is not restricted and has the same type at each moment. The file format is customized and output according to user needs. The blank file in each time directory is used to store the Euler field data results at the current moment. Traverse all moments under the working root directory. Combining these local files in chronological order is equivalent to a global file.
[0012] S6. Write each Euler field data corresponding to the variable name in the global blank file in sequence according to the grid number, and traverse all the moments under the working root directory;
[0013] S7, write the variable name and the Euler field data corresponding to the current time in the blank files in the directory of each time folder in turn according to the grid number;
[0014] S8. After traversing all time periods and all grids and completing data reading, fusion, and output, information is printed on the screen to indicate that the operation is complete, and the program ends.
[0015] Preferably, in S1, the information carried by the OpenFOAM mesh file includes node coordinates, mesh unit owners, adjacent mesh units, mesh surfaces and boundary condition definitions, and the information carried by the OpenFOAM mesh file is generated by the blockMesh tool provided by OpenFOAM and imported by third-party software.
[0016] Preferably, in S1, the example grid includes a one-dimensional grid, a two-dimensional grid and a three-dimensional grid, the one-dimensional grid reads the x coordinate of the center of each grid unit, the two-dimensional grid reads its x and y coordinates, and the three-dimensional grid reads the x, y, and z coordinates; the one-dimensional grid x coordinate and the time axis t constitute an xt two-dimensional image, the two-dimensional grid x and y coordinates and the time axis t constitute an xyt three-dimensional image, and the three-dimensional grid x, y, z and the time axis t constitute an xyzt four-dimensional image.
[0017] Preferably, in S2, the format of the global blank file is not restricted, and the file format is customized and output according to user needs; the fusion order of the Euler field data is not restricted, and different variables can be arbitrarily sorted according to user preferences; the number of time folders for storing intermediate results is not restricted, and the time folders are not required to be distributed at equal intervals. The specific process of storing intermediate results is to use the OpenFOAM standard forAll loop to start from the initial moment and read in sequence to the end moment according to the time increment.
[0018] Preferably, in S3, the Euler field variables include scalars, vectors, and tensors. If they are vectors or tensors, the variable names of their respective components need to be defined, and any other existing Euler field data or new variables can be selected according to user requirements. The variable names are separated by spaces for the data post-processing software to recognize; the Euler data of the combustion flow field and their variable names include pressure p, temperature T, velocity components Ux, Uy, Uz, heat release rate Qdot, mass fraction Yi of component i, and chemical reaction rate Ri.
[0019] Preferably, in S4, the method of reading multiple Euler field data independently stored in the time folders further includes defining and calculating new variables through the standard field quantity operations of OpenFOAM under each time folder.
[0020] Preferably, in S4, the number of Euler field variables to be read is not limited and corresponds to the aforementioned variable names. The total number of files read is the product of the number of time instances read and the number of equivalent Euler scalars at each time instance. The calculation formula is: N f ×Ns; where N f is the number of time instances read, and Ns is the number of equivalent Euler scalars at each time instance; the number of equivalent Euler scalars is the sum of the number of scalar fields plus the number of vector fields multiplied by the number of effective components (1 for one-dimensional, 2 for two-dimensional, and 3 for three-dimensional), plus the number of tensor fields multiplied by the number of effective components (1 for one-dimensional, 4 for two-dimensional, and 9 for three-dimensional); file reading and writing are completed through the IOdictionary class of the OpenFOAM standard file reading and writing mechanism. And the specific processing process is that for the Euler field quantities already stored in each time folder, the files must be read and not written; for the new quantities that need to be calculated, the files are not read but only written.
[0021] Preferably, in S6, at each time instance, all grid cells are traversed with a forAll loop, and specific judgment conditions are added to filter out physical regions that meet certain characteristics:
[0022] S61. When using a fixed grid and without adding specific judgment conditions, the data written to the global file at each time instance has the same organizational structure, and all time instances write the field quantity values of each cell in sequence according to the fixed field quantity and grid number order.
[0023] S62. When using a fixed grid and adding specific judgment conditions, the data written to the global file at each time instance has different grid structures, and each time instance writes different subsets of all grid cells, and follows the same grid numbering rule.
[0024] S63. When using a variable grid, regardless of whether specific judgment conditions are added, the data written to the global file at each time instance has different grid structures.
[0025] Preferably, in S7, the specific process of writing the variable name and the corresponding Euler field data at the current moment into the blank files in each time folder directory in sequence according to the grid number is as follows:
[0026] S71. Write the variable name into the blank file in the current moment folder, and the order of writing the Euler field variables at each moment is the same as the writing order in the global file;
[0027] S72. Traverse all grid cells through a forAll loop for the current moment. The operations during the traversal process, including whether to add specific judgment conditions and the similarities and differences in data organizational structures, are the same as the corresponding situations in S6.
[0028] Preferably, in S8, after the program runs to completion, a global file that combines the specified Euler field data at all moments and local files that combine the specified Euler field data at the current moment are obtained in the N f time folder directories. The total number of data points contained in the global file is the sum of the products of the number of equivalent Euler scalars at each moment and the number of grids written at each moment. The calculation formula is: In the formula, N j is the number of grids written at the jth moment; the total number of data points contained in the local file is the product of the number of equivalent Euler scalars at each moment and the number of grids written at each moment. In the directory at the jth moment, the calculation formula for the total number of data points contained in the local file is: Ν t,j = N s ·N j .
[0029] Therefore, the present invention proposes a method for fusing Euler field data in OpenFOAM low-dimensional unsteady simulations, and its beneficial effects are as follows:
[0030] (1) The present invention can fuse any number of intermediate moments and any number of Euler field variables generated by OpenFOAM low-dimensional and unsteady simulations into a single file and save it in a format that can be easily read by common data processing software such as Origin and Tecplot, etc.; at the same time, at each moment, the Euler field variables at the current moment are fused into a single file and saved. The former is used to analyze the time-space evolution process of Euler field variables during the entire calculation cycle, and the latter is used to study the spatial distribution characteristics of Euler field quantities at any instant.
[0031] (2) For OpenFOAM low-dimensional unsteady simulations, the present invention can automatically read a large amount of transient Euler field data, such as pressure, temperature, velocity, heat release rate, component mass fraction, and chemical reaction rate, etc.; it can efficiently fuse multiple Euler field data from different moments in the specified order, while associating time and position information, and supports the selective extraction of global or sub-domain data.
[0032] (3) Through standard file reading and writing operations, the present invention realizes the rapid fusion, output, and saving of a large amount of data in a format supported by common data processing software, facilitating further visualization and analysis.
[0033] 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
[0034] Figure 1 is a flowchart of fusing OpenFOAM low-dimensional unsteady Euler field data in a method for fusing OpenFOAM low-dimensional unsteady simulation Euler field data of the present invention;
[0035] Figure 2 is a schematic diagram of the physical model of a premixed hydrogen / air one-dimensional detonation problem in a method for fusing OpenFOAM low-dimensional unsteady simulation Euler field data of the present invention;
[0036] Figure 3 is a temperature spatio-temporal evolution cloud map of a premixed hydrogen / air one-dimensional detonation in a method for fusing OpenFOAM low-dimensional unsteady simulation Euler field data of the present invention;
[0037] Figure 4 is a pressure spatio-temporal evolution cloud map of a premixed hydrogen / air one-dimensional detonation in a method for fusing OpenFOAM low-dimensional unsteady simulation Euler field data of the present invention;
[0038] Figure 5 is an OH spatio-temporal evolution cloud map of a premixed hydrogen / air one-dimensional detonation in a method for fusing OpenFOAM low-dimensional unsteady simulation Euler field data of the present invention;
[0039] Figure 6 is a schematic diagram of a model scramjet combustion chamber simulation problem in a method for fusing OpenFOAM low-dimensional unsteady simulation Euler field data of the present invention;
[0040] Figure 7 is the temperature time-space distribution of the combustion chamber over a period of time in a method for fusing OpenFOAM low-dimensional unsteady simulation Euler field data of the present invention;
[0041] Figure 8 is the Mach number time-space distribution of the combustion chamber over a period of time in a method for fusing OpenFOAM low-dimensional unsteady simulation Euler field data of the present invention. Detailed Embodiments
[0042] To make the technical solutions, advantages and objectives of the present invention clearer, the technical solutions of the embodiments of the present invention will be described clearly and completely below. The described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the described embodiments of the present invention without creative efforts fall within the protection scope of this application.
[0043] Unless otherwise defined, the technical terms or scientific terms used in the present invention shall have the ordinary meaning understood by those with ordinary skills in the field to which the present invention pertains.
[0044] The process of integrating the low-dimensional unsteady Euler field data of OpenFOAM in the present invention is as Figure 1 shown, and specifically includes the following steps:
[0045] First, read the necessary time parameter control file of the OpenFOAM case. The time parameter control file contains the createTime.H library file to create a time object (runTime), and initializes the time object by reading the control dictionary controlDict, so as to control the time step (advancing from the initial moment to the end moment in increasing time) and the output of the results (the moments and frequencies at which the results are written).
[0046] Second, read the discretized grid file that follows the OpenFOAM specification. The OpenFOAM structured or unstructured grid mainly includes the points file carrying all the grid node coordinate information, the owner file of the grid cell owner information, the neighbour file of the adjacent grid cell information, the faces file of the grid face information, and the boundary file of the grid boundary information, and performs topological sorting according to specific rules.
[0047] Third, determine whether the case grid is static (the grid does not change during the calculation, and the same set of grids is shared at all times) or dynamic (the grid topology structure or resolution changes at different times). If it is a static grid, it is read in once at the initial moment. If it is a dynamic grid, the grid at the current moment is read in before reading the result file at each moment.
[0048] Third, create a global blank file named AllVar.dat with the name and type in the working root directory to store the Euler field data that integrates the simulation results at each intermediate moment. Write the time t, spatial coordinates x, y, z, and the variable names of the Euler field data to be integrated (including p, T, Ux, Uy, Uz, Qdot, Yi, Ri, etc.) on the first line of this file.
[0049] Next, traverse all time steps through the standard forAll function in OpenFOAM, and sequentially read the required Euler field variables in the intermediate results. Every time a time step is entered, a blank file named InstVar.csv with the specified name and type is created in its directory to store the Euler field data at that time step. Meanwhile, write the same Euler field variable names as those in the aforementioned global file at the first line of this file.
[0050] Finally, traverse all grids through the standard forAll function in OpenFOAM within each time folder, and sequentially write the Euler field data of all grids at the current time step into the AllVar.dat and InstVar.csv files. During time stepping, continuously add the results of the new time step to the AllVar.dat file, and simultaneously create a new InstVar.csv file in the new time step directory and write the Euler field data at the current time step until the program ends when the final time step is reached.
[0051] The functions and effects of the algorithm of the present invention will be further described below through two specific embodiments.
[0052] Embodiment 1
[0053] A schematic diagram of a premixed hydrogen / air one-dimensional detonation tube is shown in Figure 2 , with a total length of 1 m. The left end is denoted as x = 0, which is an adiabatic solid wall; the right end (x = 1 m) is a non-reflecting outlet. The tube is pre-filled with a stoichiometric hydrogen / air mixture with an initial pressure of p = 0.1 MPa, an initial temperature of T = 300 K, and an initial velocity of Ux = 0. At t = 0, an ignition hot spot with a temperature of 2000 K and a pressure of 5 MPa is set in the region of x = 0 - 0.005 m. A one-dimensional uniform grid with an element size of 10 μm is used, and the calculation results are saved every 1 μs starting from t = 0.
[0054] Under the action of the initial high-temperature and high-pressure ignition hot spot, after a period of reaction induction, the premixed combustible gas in the detonation tube undergoes deflagration and there is a complex physical-chemical process of deflagration-to-detonation transition and self-sustained propagation of the detonation wave. After using OpenFOAM to complete the simulation of this typical low-dimensional, unsteady gas-phase combustion problem, the algorithm of the present invention is used to fuse the spatio-temporal evolution data of the key field quantities in this one-dimensional pipeline, including temperature, pressure, component mass fraction, etc. Starting from the calculation at t = 0 to the moment when the detonation wave leaves the right end of the pipeline at t = 0.5 ms, a total of 500 one-dimensional simulation results at different time steps are saved.
[0055] Use the present invention to perform data fusion on the intermediate results. Figure 3 After fusion, the spatio-temporal distribution of temperature in the detonation tube at different time steps is shown in Figure 4 The spatio-temporal distribution of pressure is shown in Figure 5is the spatiotemporal distribution of the OH mass fraction. As Figures 4 - 5 shown, it clearly demonstrates the complete spatiotemporal evolution process of the corresponding field variables during this process. Since the calculation itself is one-dimensional, the displayed contour plot will be two-dimensional, that is, the x-t images of the corresponding Eulerian field variables (such as T, p, YOH).
[0056] Embodiment 2
[0057] A schematic diagram of the physical problems of the combustor of the strut configuration scramjet engine model is as Figure 6 , the height (y direction) of the combustor inlet is 50 mm and the total length (x direction) is 340 mm. At x0 = 77 mm downstream of the combustor inlet, a wedge-shaped strut with a length of 32 mm and a height of 6 mm is placed along the centerline of y = 25 mm. A circular hole with a diameter of 1 mm is opened on the back of the strut (located at x2 = 109 mm) for the injection of hydrogen fuel. The upper wall of the combustor has a 3-degree inclination angle starting from x1 = 100 mm. This embodiment adopts a two-dimensional calculation configuration.
[0058] The Mach number of the air inflow at the combustor inlet is Ma = 2.0, the static temperature is T = 340 K, and the static pressure is p = 0.1 MPa. Calculated by mass fraction, the composition of the polluted air is 73.6% nitrogen, 23.2% oxygen plus 3.2% water vapor. Pure hydrogen is injected into the combustor at a speed of 1200 m / s at the speed of sound, with a static temperature of T = 250 K and a static pressure of p = 0.1 MPa. After hydrogen is mixed with air, forced ignition is carried out, and combustion is organized downstream of the strut. Under the complex shock-wave-flame-turbulence interaction, this is a typical low-dimensional unsteady flow and combustion system.
[0059] Using OpenFOAM for simulation, an intermediate calculation result with a duration of 1 ms (denoted as t = 0–1 ms) is intercepted. The intermediate results are saved every 0.1 ms, so there are a total of 10 transient results. The data fusion of these 10 transient two-dimensional simulation results is carried out using the present invention. Figure 7 After fusion, it is the contour plot of the combustor temperature distribution at different times, Figure 8 and it is the Mach number distribution contour plot. Since the calculation itself is two-dimensional, the displayed contour plot will be three-dimensional, that is, the x-y-t images of the corresponding Eulerian field variables (such as T, Ma).
[0060] In summary, the algorithm of the present invention can efficiently and conveniently fuse any Eulerian field variables at any intermediate time of the OpenFOAM low-dimensional unsteady simulation results, and save them as a single file in a way that is easy to read by common data post-processing software for further visualization and analysis.
[0061] Therefore, the present invention provides a method for integrating Euler field data from low-dimensional unsteady simulations of OpenFOAM, which can automatically and efficiently read transient data, including key physical quantities such as pressure and temperature, improving the convenience of data processing. It supports integrating data at multiple moments in sequence to ensure accurate time position information. Users can selectively extract global or sub-domain data to meet diverse analysis requirements. Through standard file reading and writing, it quickly outputs compatible data for easy visualization and in-depth analysis, accelerating the transformation from simulation to insight.
[0062] 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 enable the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for integrating OpenFOAM low-dimensional non-steady-state simulation Euler field data, characterized in that: The method comprises the following steps: S1. Set the current working root directory of OpenFOAM, read the OpenFOAM discrete grid file and create a structured or unstructured grid for the example; S2. Create a global blank file in the working root directory to store the Euler field data of the simulation results of each intermediate moment that are subsequently fused in a certain order; S3. Write the variable name corresponding to the Euler field data to be read by the program in the first line of the global blank file to distinguish different Euler field variables; S4, according to the order of variable names written in S3, read multiple Euler field data stored independently in the form of OpenFOAM standard output files in the time folder in turn, and traverse all the moments in the working root directory; S5. Create a blank file in the time folder directory at each moment. The format of the blank file at each moment is not restricted and has the same type at each moment. The file format is customized and output according to user needs. The blank file in each time directory is used to store the Euler field data results at the current moment. Traverse all moments under the working root directory. Combining these local files in chronological order is equivalent to a global file. S6. Write each Euler field data corresponding to the variable name in the global blank file in sequence according to the grid number, and traverse all the moments under the working root directory; S7, write the variable name and the Euler field data corresponding to the current time in the blank files in the directory of each time folder in turn according to the grid number; S8. After traversing all time periods and all grids and completing data reading, fusion, and output, information is printed on the screen to indicate that the operation is complete, and the program ends.
2. A method for fusing OpenFOAM low-dimensional non-steady-state simulation Euler field data according to claim 1, characterized in that: In S1, the information carried by the OpenFOAM mesh file includes node coordinates, mesh unit owners, adjacent mesh units, mesh surfaces and boundary condition definitions. The information carried by the OpenFOAM mesh file is generated by the blockMesh tool provided by OpenFOAM and imported by third-party software.
3. The method for fusing OpenFOAM low-dimensional non-steady-state simulation Euler field data according to claim 1, characterized in that: In S1, the example grid includes a one-dimensional grid, a two-dimensional grid and a three-dimensional grid. The one-dimensional grid reads the x coordinate of the center of each grid unit, the two-dimensional grid reads its x and y coordinates, and the three-dimensional grid reads the x, y, and z coordinates; the one-dimensional grid x coordinate and the time axis t constitute an xt two-dimensional image, the two-dimensional grid x and y coordinates and the time axis t constitute an xyt three-dimensional image, and the three-dimensional grid x, y, z and the time axis t constitute an xyzt four-dimensional image.
4. The method for fusing OpenFOAM low-dimensional non-steady-state simulation Euler field data according to claim 1, characterized in that: In S2, the format of the global blank file is not restricted, and the file format is customized according to user needs; the fusion order of the Euler field data is not restricted, and different variables can be sorted arbitrarily according to user preferences; the number of time folders for storing intermediate results is not restricted, and the time folders are not required to be distributed at equal intervals. The specific process of storing intermediate results is to use the OpenFOAM standard forAll loop to start from the initial moment and read in sequence to the end moment according to the time increment.
5. The method for fusing OpenFOAM low-dimensional non-steady-state simulation Euler field data according to claim 1, characterized in that: In S3, the Euler field variables include scalars, vectors and tensors. If it is a vector or a tensor, the variable name of each component needs to be defined, and any other existing Euler field data or new variables can be selected according to user needs. The variable names are separated by spaces for easy recognition by the data post-processing software; the combustion flow field Euler data and its variable names include pressure p, temperature T, velocity components Ux, Uy, Uz, heat release rate Qdot, mass fraction Yi of component i and chemical reaction rate Ri.
6. The method for fusing OpenFOAM low-dimensional non-steady-state simulation Euler field data according to claim 1, characterized in that: In S4, the method for reading multiple Euler field data independently stored in the time folder also includes defining and calculating new variables in each time folder through field quantity operations of the OpenFOAM standard.
7. The method for fusing OpenFOAM low-dimensional non-steady-state simulation Euler field data according to claim 1, characterized in that: In S4, the number of Euler field variables to be read is not limited and corresponds to the aforementioned variable names. The total number of files read is the product of the number of moments read and the number of equivalent Euler scalars at each moment. The calculation formula is: N f ×Ns; where N f is the number of moments to be read, Ns is the number of equivalent Euler scalars at each moment; the number of equivalent Euler scalars is the number of scalar fields plus the number of vector fields multiplied by the number of valid components, which is 1 for one dimension, 2 for two dimensions, and 3 for three dimensions, plus the number of tensor fields multiplied by the number of valid components, which is 1 for one dimension, 4 for two dimensions, and 9 for three dimensions; file reading and writing are completed through the OpenFOAM standard file reading and writing mechanism IOdictionary class, and the specific processing process is the Euler field quantities stored in each time folder, and the file must be read but not written; for new quantities that need to be calculated, the file is not read but only written.
8. The method for fusing OpenFOAM low-dimensional non-steady-state simulation Euler field data according to claim 1, characterized in that: In S6, forAll loops are used to traverse all grid cells at each moment, and specific judgment conditions are added to filter out physical areas that meet certain characteristics: S61. When a fixed grid is used and no specific judgment condition is added, the data written into the global file at each moment has the same organizational structure, and the field quantity values of each unit are written in sequence according to the fixed field quantity and grid number sequence at all moments; S62, when a fixed grid is used and a specific judgment condition is added, the data written into the global file at each moment has a different grid structure, and different subsets of all grid cells are written at each moment, and follow the same grid numbering rule; S63. When a variable grid is used, regardless of whether a specific judgment condition is added, the data written into the global file at each moment has a different grid structure.
9. The method for fusing OpenFOAM low-dimensional non-steady-state simulation Euler field data according to claim 1, characterized in that: In S7, the specific processing process of writing the variable name and the Euler field data corresponding to the current time into the blank files in the directory of each time folder in turn according to the grid number is as follows: S71, write the variable name in the blank file in the current moment folder, and the order of the Euler field variables written at each moment remains the same as the order in the global file; S72. For the current moment, all grid cells are traversed through a forAll loop, wherein the operations in the traversal process, including whether to add specific judgment conditions and the differences and similarities of the data organization structure, are consistent with the corresponding situations in S6.
10. The method for fusing OpenFOAM low-dimensional non-steady-state simulation Euler field data according to claim 1, characterized in that: In S8, after the program runs, a global file integrating all the specified Euler field data at all times is obtained and the N f The local file integrating the specified Euler field data at the current moment is obtained in the time folder directory. The total number of data points contained in the global file is the sum of the product of the number of equivalent Euler scalars at each moment and the number of grids written at each moment. The calculation formula is: Where N j is the number of grids written at time j; the total number of data points contained in the local file is the product of the number of equivalent Euler scalars at each time and the number of grids written at each time. The total number of data points contained in the local file in the directory at time j is calculated as follows: t,j =N s ·N j .
Citation Information
Cited By
Method for fusing OpenFOAM unsteady state simulation result boundary surface Euler field domain data
CN122021429A