A method for extracting and post-processing numerical calculation data of a three-dimensional giant factory building flooding
By using 3D modeling and data format conversion, key meshes were extracted from the flood simulation data of a giant factory building, and CGNS format files were output. This solved the problem of slow data processing speed in the flood simulation data of a giant factory building and achieved efficient data post-processing.
Patent Information
- Application Number
- CN202411626582.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-11-14
AI Technical Summary
Existing technologies require high computer memory resources and have slow processing speeds when processing simulated flooding data of giant factories, which affects the efficiency of data post-processing.
Through 3D modeling, mesh generation, data format conversion, and Python program renaming, surface and volume meshes with secondary phase volume fractions exceeding specified values are extracted within the computational domain. Other data are discarded, and CGNS format files are output for image processing using post-processing software.
Significantly reduced data volume, shortened data conversion time, reduced memory usage, and improved post-processing efficiency. Data volume was reduced from 1GB to 50MB, conversion time was shortened by 97%, and memory usage was reduced by 93%.
Smart Images

Figure CN119598563B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of three-dimensional numerical simulation technology, and in particular to a method for extracting and post-processing numerical calculation data of a three-dimensional giant factory building flooding. Background Technology
[0002] With rapid industrialization and urbanization, the construction of giant underground power plants is becoming increasingly common. Due to their massive scale and complex structure, these plants pose a significant threat to personnel safety and property in the event of flooding. Therefore, predicting and analyzing flooding scenarios using numerical simulation methods is of great importance for disaster prevention, mitigation, and emergency response.
[0003] Currently, using commercial simulation software such as Fluent for flood simulation has become an industry standard. However, when dealing with large-scale underground power plants, the amount of data to be processed increases due to the expanded computational domain. In a typical giant power plant flood simulation, a single data file often exceeds 1GB in size, and the entire flooding process may generate thousands of such data files. This not only places extremely high demands on computer memory resources during data post-processing but also severely impacts the efficiency of data post-processing. Traditional data processing methods often require loading large amounts of data files completely into memory for processing, which is often limited by hardware resources in practice and affects processing speed and efficiency. Therefore, finding a technology that can quickly and efficiently process large-scale flood simulation data has become an urgent need in the industry. Summary of the Invention
[0004] The purpose of this invention is to provide a method for extracting and post-processing numerical calculation data of three-dimensional giant factory flooding, which can improve the processing speed and efficiency of simulation data of giant factory flooding and reduce the dependence on computer hardware performance.
[0005] The technical solution adopted by this invention to solve its technical problem is as follows:
[0006] A method for extracting and post-processing numerical calculation data of a three-dimensional giant factory building submersion includes the following steps:
[0007] S1. Use 3D modeling software to create a 3D model of the large factory building, and then use mesh generation software to generate a mesh for the 3D model.
[0008] S2. Set air as the main phase and water as the secondary phase, and acquire transient data in "dat.h5" format;
[0009] S3. Use a Python program to rename each transient data in "dat.h5" format;
[0010] S4. For each renamed "dat.h5" format transient data, extract the surface meshes with a secondary phase volume fraction exceeding the first specified value and the volume meshes with a volume fraction of the second specified value within the computational domain. Discard other secondary phase data and surface and volume meshes with a primary phase volume fraction exceeding 99.9% within the computational domain. Change the data export mode to "legacy" and output a "CGNS" format file.
[0011] S5. Repeat step S4 to obtain all "CGNS" format files;
[0012] S6. Import the 3D model into the post-processing software as the background, and import all "CGNS" format files into the post-processing software for image processing of the flood simulation.
[0013] Furthermore, in step S1, the 3D modeling software is Ansys SCDM, UG, AutoCAD, Creo, or Solidworks, and the mesh generation software is Ansys Fluent Meshing.
[0014] In step S6, the post-processing software is Paraview.
[0015] Furthermore, step S2 includes the following steps:
[0016] S21. Select the ANSYS Fluent solver in the mesh generation software;
[0017] S22. Import the meshed 3D model into the ANSYS Fluent solver;
[0018] S23. Select the VOF multiphase flow model, setting air as the main phase and water as the secondary phase;
[0019] S24. Set the step size to 1 second and the total step size to 36000 seconds. Set the transient data in "dat.h5" format to be automatically saved every 60 seconds of physical time. Perform multiphase flow transient simulation calculation. After the calculation is completed, output all transient data in "dat.h5" format.
[0020] Furthermore, step S3 refers to:
[0021] Using the rename.py utility in Python, each transient data point in the format "dat.h5" is renamed in batches to "physical time.dat.h5".
[0022] Furthermore, in step S4, the first specified value is 0.01 and the second specified value is 0.5.
[0023] Furthermore, when the first specified value is 0.01 and the second specified value is 0.5, step S4 includes:
[0024] A surface is created using the "expression-volume..." method, with the expression: Volumefraction(phase='phase-2')>0.01, named "expression-volume0.01"; then, a surface is created using the "Iso-surface" method, with the phase-2 volume fraction as the variable, to obtain an isosurface with an Iso-Value of 0.5, named "volume-fraction-0.5";
[0025] In the reference, change the Ansys Fluent data output format to "legacy";
[0026] Read in transient data in "dat.h5" format, export it as CGNS format data that can be read by post-processing software, select only "expression-volume0.01" and "volume-fraction-0.5", and select only "volumefraction(phase-2)" as the variable.
[0027] Furthermore, in step S5, when acquiring all “CGNS” format files, all transient data in “dat.h5” format are processed in batches.
[0028] Furthermore, the batch processing of all transient data in "dat.h5" format includes the following steps:
[0029] Record step S5 as a journal script and modify the recorded script file;
[0030] The modified script is read into Ansys Fluent and all transient data in "dat.h5" format is converted into "CGNS" format files.
[0031] Furthermore, step S6 includes the following steps:
[0032] Import the 3D model from step S1 into Paraview as the background, and import all the "CGNS" format files obtained in step S5 into Paraview.
[0033] In Paraview, draw a contour map based on the secondary phase volume fraction. In the colormap, select the same color for all data points. Set the transparency to 0 for data points with a secondary phase volume fraction of 0, set the transparency to 1 for data points with a volume fraction of 1, and change the transparency of the remaining data points linearly according to the volume fraction of 0 to 1.
[0034] The beneficial effects of this invention are as follows: Through the above-mentioned method for extracting and post-processing numerical calculation data of a three-dimensional giant factory building flooding, firstly, a three-dimensional model of the large factory building is created using three-dimensional modeling software, and then the three-dimensional model is meshed using mesh generation software; secondly, air is set as the primary phase and water as the secondary phase, and transient data in "dat.h5" format is obtained; then, each "dat.h5" format transient data is renamed using a Python program; next, for each renamed "dat.h5" format transient data, surface meshes with a secondary phase volume fraction exceeding a first predetermined value and volume meshes with a volume fraction exceeding a second predetermined value are extracted from the computational domain. Other data of the secondary phase and surface and volume meshes with a primary phase volume fraction exceeding 99.9% are discarded, and the data export mode is changed to "legacy," outputting a "CGNS" format file until all "CGNS" format files are obtained; finally, the three-dimensional model is imported into the post-processing software as a background, and all "CGNS" format files are imported into the post-processing software for image processing of flooding simulation.
[0035] Therefore, this invention can significantly reduce the amount of output data, shrinking the original 1GB "dat.h5" file to a "CGNS" file of about 50MB, greatly shortening the data conversion time, reducing memory usage and improving post-processing efficiency. Attached Figure Description
[0036] Figure 1 This is a flowchart of a method for extracting and post-processing numerical calculation data of a three-dimensional giant factory building flooding according to Embodiment 1 of the present invention;
[0037] Figure 2 Three-dimensional perspective view of the flow field in the underground powerhouse in Embodiment 2 of the present invention
[0038] Figure 3 Grid diagram of underground powerhouse in Embodiment 2 of the present invention;
[0039] Figure 4 The data image output in "CGNS" format in Embodiment 2 of this invention;
[0040] Figure 5 The post-processed image from the flood simulation in Paraview in Embodiment 2 of this invention. Detailed Implementation
[0041] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Example 1
[0042] This embodiment provides a method for extracting and post-processing numerical calculation data of a three-dimensional giant factory building flooding. The flowchart is shown below. Figure 1 The method includes the following steps:
[0043] S1. Use 3D modeling software to create a 3D model of the large factory building, and then use mesh generation software to generate a mesh for the 3D model.
[0044] S2. Set air as the main phase and water as the secondary phase, and acquire transient data in "dat.h5" format;
[0045] S3. Use a Python program to rename each transient data in "dat.h5" format;
[0046] S4. For each renamed "dat.h5" format transient data, extract the surface meshes with a secondary phase volume fraction exceeding the first specified value and the volume meshes with a volume fraction of the second specified value within the computational domain. Discard other secondary phase data and surface and volume meshes with a primary phase volume fraction exceeding 99.9% within the computational domain. Change the data export mode to "legacy" and output a "CGNS" format file.
[0047] S5. Repeat step S4 to obtain all "CGNS" format files;
[0048] S6. Import the 3D model into the post-processing software as the background, and import all "CGNS" format files into the post-processing software for image processing of the flood simulation.
[0049] In this embodiment, the excessively large size of the "dat.h5" format data file is due to the output of all data from the entire model (including density, pressure, velocity, etc.). During the plant flooding simulation, we generally only care about the location of water propagation within the model, i.e., the areas where water is present. Therefore, this embodiment needs to reduce the data volume and the burden of post-processing. Thus, this embodiment only extracts the secondary phase (water) volume fraction, discarding other data (including density, pressure, velocity, etc.), and only outputs the areas containing the secondary phase (water) in the model, discarding areas containing only air, thereby reducing the number of output meshes. To this end, this embodiment extracts surface meshes with a secondary phase volume fraction exceeding 0.01 (i.e., 1%, indicating the presence of "water" within the mesh), thus marking the submerged surface meshes. It also extracts volume meshes with a volume fraction of 0.5, thus outputting the meshes of the free liquid surface in the model. Furthermore, when exporting to a "CGNS" data file, only the volume fraction information of "water" within the aforementioned meshes is selected for output.
[0050] Therefore, this embodiment can significantly reduce the amount of output data, shrinking the original 1GB 'dat.h5' file to a 50MB 'CGNS' file, shortening the data conversion time by 97%, greatly reducing memory usage, and improving post-processing efficiency. Example 2
[0051] Based on Example 1, in step S1 of this example, the 3D modeling software can be AnsysSCDM, UG, AutoCAD, Creo, or Solidworks, and the mesh generation software can be Ansys Fluent Meshing; in step S6, the post-processing software can be Paraview.
[0052] Therefore, this embodiment provides a method for extracting and post-processing numerical calculation data of a three-dimensional giant factory building submersion, including the following steps:
[0053] S1, see also Figures 2-5 The large factory building was modeled in 3D using the 3D modeling software Ansys SCDM, and then meshed using the meshing software Ansys Fluent Meshing.
[0054] S2. Set air as the primary phase and water as the secondary phase, and acquire transient data in “dat.h5” format; in this embodiment, there are 600 transient data points, each with a size of about 1GB.
[0055] Step S2 includes the following steps:
[0056] S21. Select the ANSYS Fluent solver in the mesh generation software;
[0057] S22. Import the meshed 3D model into the ANSYS Fluent solver;
[0058] S23. Select the VOF multiphase flow model, setting air as the main phase and water as the secondary phase;
[0059] S24. Set the step size to 1 second and the total step size to 36,000 seconds. Set the system to automatically save a transient data point in "dat.h5" format every 60 seconds of physical time. Perform multiphase flow transient simulation calculations and output all transient data in "dat.h5" format after the calculation is complete. Here, considering computational accuracy and cost, and because the model scale is large, a complete flooding simulation would take more than 10 hours of physical time. Therefore, the total step size is set to 36,000 seconds. Furthermore, Fluent will output a large amount of transient data after the calculation is complete.
[0060] S3. Rename each transient data file in "dat.h5" format using a Python program. Here, since the post-processing software Paraview cannot directly read Fluent's "dat.h5" files, it needs to output the file in the more universal "CGNS" format. To facilitate subsequent automated data processing, the filenames need to be standardized. Therefore, step S3 refers to:
[0061] Using the rename.py utility in Python, each transient data point in the format "dat.h5" is renamed in batches to "physical time.dat.h5".
[0062] S4. For each renamed "dat.h5" format transient data, extract the surface meshes with a secondary phase volume fraction exceeding a first specified value and the volume meshes with a volume fraction of a second specified value within the computational domain. Discard other secondary phase data and surface and volume meshes with a primary phase volume fraction exceeding 99.9% within the computational domain. Change the data export mode to "legacy" and output a "CGNS" format file. The first specified value is preferably 0.01, and the second specified value is preferably 0.5.
[0063] Here, the value 0.01 can be adjusted. Depending on the required numerical precision, a value between 0.001 and 0.01 is preferred. The value 0.5 can also be adjusted. It is generally considered that a 50% water and 50% air content in the mesh indicates that the mesh is at a free surface. However, since the obtained volumetric mesh position is very close to that when the value is in the range of 0.1 to 0.9, it can also be set to 0.1 to 0.9, preferably 0.5. Therefore, the result of step S4 can reduce the data volume by more than 95%.
[0064] It should be noted that, in this embodiment, when the first specified value is 0.01 and the second specified value is 0.5, step S4 may include:
[0065] A surface is created using the "expression-volume…" method, with the expression: Volumefraction(phase='phase-2')>0.01, named "expression-volume0.01", which extracts the surface mesh of the secondary phase (water); then a surface is created using the "Iso-surface" method, with the phase-2 volume fraction as the variable, to obtain an isosurface with an Iso-Value of 0.5, named "volume-fraction-0.5", which extracts the volume mesh of the secondary phase (water);
[0066] In the reference, change the Ansys Fluent data output format to "legacy";
[0067] Read in transient data in "dat.h5" format, export it as CGNS format data that can be read by post-processing software, select only "expression-volume0.01" and "volume-fraction-0.5", and select only "volumefraction(phase-2)" as the variable.
[0068] Here, step S4 can also include an operation to determine the submerged water depth during the simulation process:
[0069] S401. Create a point "point-1" at the lowest point of the plant model using the "point" method. In Solution - XYPlot, select "xy-plot-1" and set the output parameter to "total pressure". Select "point-1" in Surfaces.
[0070] S402. In Solution-XY Plot, save the pressure at "point-1" as a ".xy" format file;
[0071] S403. Start the journal script and record step S402.
[0072] S404. Add the script content from step S403 to the journal script file recorded in step S5. Use the Python code xy-Jou.py to copy and modify the script, generating a new journal script file "xy.jou". Reading this file into Fluent will automatically complete the reading, data extraction, conversion, and output of the pressure file at the lowest point of the plant at each moment for all "dat.h5" files. In this embodiment, a total of 600 "physical time.cgns" format files and 600 "physical time.xy" format files are obtained.
[0073] S405. Use the Python code "pressure.py" to write the pressure values and physical time values from the filenames of 600 ".xy" format files into a text file;
[0074] S406, According to the water depth formula The flooding depth at each moment can then be calculated, where P is the pressure value at "point-1". For the density of water, This is the acceleration due to gravity.
[0075] S5. Repeat step S4 to obtain all "CGNS" format files. Since the post-processing software Paraview cannot directly read Fluent's "dat.h5" file, it is necessary to output the format as the more universal "CGNS" format file.
[0076] In step S5, when acquiring all "CGNS" format files, all transient data in "dat.h5" format are batch processed; the batch processing of all transient data in "dat.h5" format may include the following steps:
[0077] Record step S5 as a journal script and modify the recorded script file;
[0078] The modified script is read into Ansys Fluent and all transient data in "dat.h5" format is converted into "CGNS" format files.
[0079] Therefore, a script file can be generated using Python code in conjunction with Fluent scripts to automatically execute on all dat.h5 transient data files. Fluent can then read this script file to automatically repeat the user's required operations, significantly saving labor costs and improving data extraction efficiency.
[0080] S6. Import the 3D model into the post-processing software Paraview as a background, and import all "CGNS" format files into Paraview for image processing of the flooding simulation. Here, since only the mesh information containing the secondary phase was output in steps S4-S5, the factory model obtained during post-processing is incomplete. Therefore, in step S7 of this embodiment, Paraview has the function of using the geometric model as a background, which can make up for the problems that occurred in the above steps. Importing the factory model established in S1 into Paraview as the background for data post-processing allows the entire factory to be seen during data image and video demonstrations.
[0081] Step S6 includes the following steps:
[0082] Import the 3D model from step S1 into Paraview as the background, and import all the "CGNS" format files obtained in step S5 into Paraview.
[0083] In Paraview, draw a contour map based on the secondary phase volume fraction. In the colormap, select the same color for all data points. Set the transparency to 0 for data points with a secondary phase volume fraction of 0, set the transparency to 1 for data points with a volume fraction of 1, and change the transparency of the remaining data points linearly according to the volume fraction of 0 to 1.
[0084] Here, blue is preferred as the color of water, and the volume fraction is represented by transparency, which can improve the visibility of water in the model.
[0085] Therefore, in this embodiment, when converting Fluent data to the "CGNS" format, only surface meshes with a secondary phase volume fraction exceeding 0.01 and volume meshes with a volume fraction of 0.5 are output, discarding other surface and volume meshes within the computational domain. This significantly reduces the amount of output data, shrinking the original 1GB "dat.h5" file to a "CGNS" file of approximately 50MB, shortening the data conversion time by 97%, without affecting the visualization of the flooding process. Paraview can simultaneously read and process 600 transient data points, reducing memory usage by over 93% and increasing the data cloud map output rate by over 5 times, significantly reducing resource consumption while improving post-processing efficiency.
[0086] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for extracting and post-processing numerical calculation data of a three-dimensional giant factory building submersion, characterized in that, Includes the following steps: S1. Use 3D modeling software to create a 3D model of the large factory building, and then use mesh generation software to generate a mesh for the 3D model. S2. Set air as the main phase and water as the secondary phase, and acquire transient data in "dat.h5" format; S3. Use a Python program to rename each transient data in "dat.h5" format; S4. For each renamed "dat.h5" format transient data, extract the surface meshes with a secondary phase volume fraction exceeding the first specified value and the volume meshes with a volume fraction of the second specified value within the computational domain. Discard other secondary phase data and surface and volume meshes with a primary phase volume fraction exceeding 99.9% within the computational domain. Change the data export mode to "legacy" and output a "CGNS" format file. When the first specified value is 0.01 and the second specified value is 0.5, step S4 includes: A surface is created using the "expression-volume…" method, with the expression: volumefractionphase='phase-2'>0.01, and named "expression-volume0.01"; then, a surface is created using the "Iso-surface" method, with the phase-2 volume fraction as the variable, to obtain an isosurface with an Iso-Value of 0.5, named "volume-fraction-0.5"; In the reference, change the Ansys Fluent data output format to "legacy"; Read in transient data in "dat.h5" format, export it as CGNS format data that can be read by post-processing software, select only "expression-volume0.01" and "volume-fraction-0.5", and select only "volumefractionphase-2" as the variable; S5. Repeat step S4 to obtain all "CGNS" format files; S6. Import the 3D model into the post-processing software as the background, and import all "CGNS" format files into the post-processing software for image processing of the flood simulation.
2. The method for extracting and post-processing numerical calculation data of a three-dimensional giant factory building flooding according to claim 1, characterized in that, In step S1, the 3D modeling software is Ansys SCDM, UG, AutoCAD, Creo, or Solidworks, and the mesh generation software is Ansys Fluent Meshing. In step S6, the post-processing software is Paraview.
3. The method for extracting and post-processing numerical calculation data of a three-dimensional giant factory building flooding according to claim 1, characterized in that, Step S2 includes the following steps: S21. Select the ANSYS Fluent solver in the mesh generation software; S22. Import the meshed 3D model into the ANSYS Fluent solver; S23. Select the VOF multiphase flow model, setting air as the main phase and water as the secondary phase; S24. Set the step size to 1 second and the total step size to 36000 seconds. Set the transient data in "dat.h5" format to be automatically saved every 60 seconds of physical time. Perform multiphase flow transient simulation calculation. After the calculation is completed, output all transient data in "dat.h5" format.
4. The method for extracting and post-processing numerical calculation data of a three-dimensional giant factory building flooding according to claim 1, characterized in that, Step S3 refers to: Using the rename.py utility in Python, each transient data point in the format "dat.h5" is renamed in batches to "physical time.dat.h5".
5. The method for extracting and post-processing numerical calculation data of a three-dimensional giant factory building flooding according to claim 1, characterized in that, In step S5, when acquiring all "CGNS" format files, all transient data in "dat.h5" format are processed in batches.
6. The method for extracting and post-processing numerical calculation data of a three-dimensional giant factory building flooding according to claim 5, characterized in that, The batch processing of all transient data in "dat.h5" format includes the following steps: Record step S5 as a journal script and modify the recorded script file; The modified script is read into Ansys Fluent and all transient data in "dat.h5" format is converted into "CGNS" format files.
7. The method for extracting and post-processing numerical calculation data of a three-dimensional giant factory building flooding according to claim 2, characterized in that, Step S6 includes the following steps: Import the 3D model from step S1 into Paraview as the background, and import all the "CGNS" format files obtained in step S5 into Paraview. In Paraview, draw a contour map based on the secondary phase volume fraction. In the colormap, select the same color for all data points. Set the transparency to 0 for data points with a secondary phase volume fraction of 0, set the transparency to 1 for data points with a volume fraction of 1, and change the transparency of the remaining data points linearly according to the volume fraction of 0 to 1.
Citation Information
Patent Citations
Method for automatically generating hexahedral unstructured grid
CN114969860A
Small-scale wind field simulation method under terrain influence
CN118657082A