Three-dimensional huge plant submerging numerical calculation data extraction and post-processing method
Through three-dimensional modeling and grid division, key data in the flood simulation data of giant factory buildings are extracted and CGNS format files are output, which solves the problem of low efficiency in flood simulation data processing of giant factory buildings and realizes efficient data processing and post-processing.
Patent Information
- Application Number
- CN202411626582.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-11-14
AI Technical Summary
During the flood simulation of giant underground factory buildings, the expansion of the computing domain leads to a huge amount of data. Traditional data processing methods are limited by hardware resources, which affect processing speed and efficiency.
Three-dimensional modeling software is used for three-dimensional modeling and mesh division, setting air as the main phase and water as the secondary phase, obtaining transient data and renaming it through Python programs, extracting surface mesh and volume mesh with a secondary phase volume fraction exceeding a certain value, discarding other data, outputting CGNS format files, and performing image processing in post-processing software.
Significantly reduce the output data volume, reduce the 1GB "dat.h5" file to about 50MB of "CGNS" file, shorten the data conversion time, reduce memory usage, and improve post-processing efficiency.
Smart Images

Figure CN119598563A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of three-dimensional numerical simulation, and in particular to a method for extracting and post-processing numerical calculation data of a three-dimensional giant plant flooding. Background Art
[0002] With the rapid development of industrialization and urbanization, the construction of giant underground power plants is becoming more and more common. Due to their huge size and complex structure, these power plants will pose a great threat to personnel safety and property once a flood accident occurs. Therefore, predicting and analyzing flooding through numerical simulation methods is of great significance for disaster prevention, mitigation and emergency response.
[0003] At present, the use of commercial simulation software such as Fluent for flooding simulation has become an industry standard. However, when faced with large-scale underground powerhouses, the amount of data that needs to be processed also increases due to the expansion of the computational domain. In a typical giant powerhouse flooding simulation, the size of a single data file often exceeds 1GB, 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 seriously affects the efficiency of data post-processing. Traditional data processing methods often require a large number of data files to be read into memory for processing, which is often limited by hardware resources in actual operations and affects processing speed and efficiency. Therefore, seeking a technology that can quickly and efficiently process large-scale flooding simulation data has become an urgent need in the industry. Summary of the invention
[0004] The purpose of the present invention is to provide a three-dimensional giant powerhouse flooding numerical calculation data extraction and post-processing method, which can improve the processing speed and efficiency of giant powerhouse flooding simulation data and reduce the dependence on computer hardware performance.
[0005] The present invention solves the technical problem and adopts the following technical solution: A method for extracting and post-processing numerical calculation data of three-dimensional giant powerhouse flooding, comprising the following steps: S1. Perform three-dimensional modeling of a large factory building using three-dimensional modeling software to obtain a three-dimensional model of the large factory building, and perform meshing of the three-dimensional model using meshing software; S2. Set air as the primary phase and water as the secondary phase, and obtain transient data in the "dat.h5" format; S3. Use the python program to rename each transient data in the "dat.h5" format; S4. For each transient data in the renamed "dat.h5" format, extract the surface meshes whose volume fraction of the secondary phase in the calculation domain exceeds the first specified value, and the volume meshes whose volume fraction is the second specified value, discard other data of the secondary phase in the calculation domain and the surface meshes and volume meshes whose volume fraction of the primary phase exceeds 99.9%, and change the data export mode to "legacy" to output a "CGNS" format file; S5, repeat step S4 to obtain all "CGNS" format files; S6. Import the three-dimensional model into the post-processing software as a background, and import all "CGNS" format files into the post-processing software for image processing of flooding simulation.
[0006] Furthermore, in step S1, the 3D modeling software is Ansys SCDM, UG, AutoCAD, Creo or Solidworks, and the meshing software is Ansys fluent meshing; In step S6, the post-processing software is Paraview.
[0007] Furthermore, step S2 includes the following steps: S21. Select the ANSYS FLUENT solver in the meshing software; S22, importing the meshed 3D model into the ANSYS FLUENT solver; S23, select the VOF multiphase flow model, set 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 system to automatically save a transient data in the "dat.h5" format every 60 seconds of physical time to perform multiphase flow transient simulation calculations. After the calculation is completed, output all transient data in the "dat.h5" format.
[0008] Furthermore, step S3 refers to: Use rename.py in the Python program to batch rename each transient data in the "dat.h5" format to "physical time.dat.h5".
[0009] Furthermore, in step S4, the first prescribed value is 0.01, and the second prescribed value is 0.5.
[0010] Furthermore, when the first specified value is 0.01 and the second specified value is 0.5, step S4 includes: Use the "expression-volume..." method to create a surface, the expression is: Volumefraction(phase='phase-2')>0.01, named "expression-volume0.01"; then use the "Iso-surface" method to create a surface, use the phase-2 volume fraction as a variable, get the isosurface with an Iso-Value value of 0.5, and name it "volume-fraction-0.5"; Change the data output format of Ansys Fluent to "legacy" in reference; Read in transient data in the "dat.h5" format and export it to CGNS format data that can be read by post-processing software. Select only the surfaces "expression-volume0.01" and "volume-fraction-0.5", and only select "volumefraction (phase-2)" as the variable.
[0011] Furthermore, in step S5, when all "CGNS" format files are obtained, batch processing is performed on all transient data in the "dat.h5" format.
[0012] Furthermore, the batch processing of all transient data in the "dat.h5" format comprises the following steps: Record step S5 as a journal script, and modify the recorded script file; Read the modified script into Ansys Fluent and convert all transient data in "dat.h5" format into "CGNS" format files.
[0013] Furthermore, step S6 includes the following steps: Import the 3D model in step S1 into Paraview as a background, and import all the "CGNS" format files obtained in step S5 into Paraview; In ParaView, a cloud map is drawn based on the secondary phase volume fraction. In the colormap, the same color is selected for all data points. The transparency of the data points with a secondary phase volume fraction of 0 is set to 0, and the transparency of the data points with a volume fraction of 1 is set to 1. The transparency of the remaining data points changes linearly according to the volume fraction from 0 to 1.
[0014] The beneficial effects of the present invention are as follows: through the above-mentioned three-dimensional giant plant flooding numerical calculation data extraction and post-processing method, first, a large plant is three-dimensionally modeled using a three-dimensional modeling software to obtain a three-dimensional model of the large plant, and the three-dimensional model is meshed using a meshing software; secondly, air is set as the main phase and water is set as the secondary phase, and transient data in the "dat.h5" format are obtained; then, each transient data in the "dat.h5" format is renamed using a python program; then, for each renamed transient data in the "dat.h5" format, the surface grid whose secondary phase volume fraction exceeds the first specified value in the calculation domain and the volume grid whose volume fraction is the second specified value are extracted, other data of the secondary phase in the calculation domain and the surface grid and volume grid whose primary phase volume fraction exceeds 99.9% are discarded, and the data export mode is changed to "legacy", and a "CGNS" format file is output 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 deduction.
[0015] Therefore, the present invention can significantly reduce the amount of output data, shrinking the original 1GB "dat.h5" file to a "CGNS" file of about 50MB, significantly shortening the data conversion time, reducing memory usage and improving post-processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a flow chart of a method for extracting and post-processing numerical calculation data of three-dimensional giant powerhouse flooding in Embodiment 1 of the present invention; Figure 2 Three-dimensional perspective view of the flow field of the underground powerhouse in the second embodiment of the present invention Figure 3 The grid diagram of the underground plant in the second embodiment of the present invention; Figure 4 The data graph output in the "CGNS" format in the second embodiment of the present invention; Figure 5 A post-processing diagram of flooding simulation performed in Paraview in the second embodiment of the present invention. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations. Example 1
[0018] This embodiment provides a method for extracting and post-processing numerical calculation data of a three-dimensional giant powerhouse flooding. Figure 1 , wherein the method comprises the following steps: S1. Perform three-dimensional modeling of a large factory building using three-dimensional modeling software to obtain a three-dimensional model of the large factory building, and perform meshing of the three-dimensional model using meshing software; S2. Set air as the primary phase and water as the secondary phase, and obtain transient data in the "dat.h5" format; S3. Use the python program to rename each transient data in the "dat.h5" format; S4. For each transient data in the renamed "dat.h5" format, extract the surface meshes whose volume fraction of the secondary phase in the calculation domain exceeds the first specified value, and the volume meshes whose volume fraction is the second specified value, discard other data of the secondary phase in the calculation domain and the surface meshes and volume meshes whose volume fraction of the primary phase exceeds 99.9%, and change the data export mode to "legacy" to output a "CGNS" format file; S5, repeat step S4 to obtain all "CGNS" format files; S6. Import the three-dimensional model into the post-processing software as a background, and import all "CGNS" format files into the post-processing software for image processing of flooding simulation.
[0019] In this embodiment, the output of all data of the entire model (including density, pressure, velocity, etc.) is the reason why the "dat.h5" format data file is too large. In the process of plant flooding simulation, generally only the location of water advancement in the model is concerned, that is, where there is water in the model. Therefore, in this embodiment, it is necessary to reduce the amount of data and reduce the pressure of data post-processing. Therefore, in this embodiment, only the result of the volume fraction of the secondary phase (water) is extracted, and other data (including density, pressure, velocity, etc.) are discarded. In addition, only the area with the secondary phase (water) in the model is output, and the area with only air is discarded, that is, the number of output grids is reduced. For this reason, in this embodiment, the surface grids with a secondary phase volume fraction exceeding 0.01 (i.e. 1%, indicating that there is "water" in the grid) are extracted, so that the surface grids flooded by water will be marked, and the volume grids with a volume fraction of 0.5 are extracted, so that the grids of the free liquid surface in the model will be output. In addition, when exporting to a "CGNS" data file, only the volume fraction information of "water" in the above grids is selected for output.
[0020] Therefore, this embodiment can significantly reduce the amount of output data, shrinking the original 1GB size of the 'dat.h5' file to a 'CGNS' file of about 50MB, shortening the data conversion time by 97%, significantly reducing memory usage and improving post-processing efficiency. Example 2
[0021] On the basis of Example 1, in step S1 of this embodiment, the 3D modeling software may be Ansys SCDM, UG, AutoCAD, Creo or Solidworks, and the meshing software may be Ansys fluent meshing; in step S6, the post-processing software may be Paraview.
[0022] To this end, this embodiment provides a three-dimensional giant powerhouse flooding numerical calculation data extraction and post-processing method, including the following steps: S1. See Figure 2-Figure 5 , use the 3D modeling software Ansys SCDM to carry out 3D modeling of the large factory building, obtain the 3D model of the large factory building, and use the meshing software Ansys fluent meshing to mesh the 3D model.
[0023] S2. Set air as the primary phase and water as the secondary phase, and obtain transient data in the "dat.h5" format; in this embodiment, there are 600 transient data, each of which is about 1 GB in size.
[0024] Wherein, step S2 comprises the following steps: S21. Select the ANSYS FLUENT solver in the meshing software; S22, importing the meshed 3D model into the ANSYS FLUENT solver; S23, select the VOF multiphase flow model, set air as the main phase and water as the secondary phase; S24, set the step size to 1 second, the total step size to 36000 seconds, and set it to automatically save a transient data in the "dat.h5" format every 60 seconds of physical time, perform multiphase flow transient simulation calculations, and output all transient data in the "dat.h5" format after the calculation is completed. Here, considering the calculation accuracy and calculation cost, and because the model scale is large, the complete flooding simulation will take more than 10 hours of physical time, so the total step size is set to 36000 seconds, and after the calculation is completed, fluent will output a large amount of transient data.
[0025] S3. Use Python program to rename each transient data in "dat.h5" format. Here, since the post-processing software Paraview cannot directly read the "dat.h5" file of Fluent, it is necessary to output the format into a more general "CGNS" format file. In order to facilitate the subsequent automated processing of data, the file name needs to be standardized. Therefore, here, step S3 refers to: Use rename.py in the Python program to batch rename each transient data in the "dat.h5" format to "physical time.dat.h5".
[0026] S4. For each transient data in the renamed "dat.h5" format, extract the surface mesh whose volume fraction of the secondary phase in the calculation domain exceeds the first specified value, and the volume mesh whose volume fraction is the second specified value, discard other data of the secondary phase in the calculation domain and the surface mesh and volume mesh whose volume fraction of the main phase exceeds 99.9%, and change the data export mode to "legacy" to output a "CGNS" format file; wherein, the first specified value is preferably 0.01, and the second specified value is preferably 0.5.
[0027] Here, the value 0.01 can be adjusted, preferably between 0.001 and 0.01 according to the numerical accuracy of the calculation, and the value 0.5 can also be adjusted. It is generally believed that when the water and air in the grid each account for 50%, it means that the grid is at the free liquid surface position, but considering that when the value is in the range of 0.1 to 0.9, the obtained volume grid position is very close to that when the value is 0.5, the value 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%.
[0028] 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: Use the "expression-volume..." method to create a surface, and the expression is: Volumefraction(phase='phase-2')>0.01, named "expression-volume0.01", that is, the surface mesh of the secondary phase (water) is extracted; then use the "Iso-surface" method to create a surface, using the phase-2 volume fraction as a variable, and obtain the isosurface with an Iso-Value value of 0.5, named "volume-fraction-0.5", that is, the volume mesh of the secondary phase (water) is extracted; Change the data output format of Ansys Fluent to "legacy" in reference; Read in transient data in the "dat.h5" format and export it to CGNS format data that can be read by post-processing software. Select only the surfaces "expression-volume0.01" and "volume-fraction-0.5", and only select "volumefraction (phase-2)" as the variable.
[0029] Here, step S4 may also add the submerged water depth operation during the deduction process: S401. Use the "point" method to establish a point "point-1" at the lowest point of the plant model. In Solution -XYPlot, select "xy-plot-1", the output parameter is "total pressure", and select "point-1" in Surfaces. S402. In Solution-XY Plot, save the pressure of “point-1” as a “.xy” format file; S403, start the journal script and record step S402; S404, add the script content in step S403 to the journal script file recorded in step S5, use the python code xy-Jou.py to copy and modify the script, generate a new journal script file "xy.jou", read this file in Fluent to automatically complete the reading, data extraction, conversion of all "dat.h5" files, and output the pressure file at the lowest point of the plant at each moment. In this embodiment, a total of 600 "physical time.cgns" format files and 600 "physical time.xy" format files are obtained; S405, using the python code “pressure.py” to write the pressure values in 600 “.xy” format files and the physical time values in the file names into a text file; S406, according to the water depth formula The submergence depth at each moment can be calculated, where P is the pressure value of "point-1", is the water density, is the acceleration due to gravity.
[0030] S5. Repeat step S4 to obtain all "CGNS" format files. Since the post-processing software Paraview cannot directly read the "dat.h5" file of Fluent, it is necessary to output the format into a more general "CGNS" format file.
[0031] In step S5, when all the "CGNS" format files are obtained, batch processing is performed on all the transient data in the "dat.h5" format; the batch processing of all the transient data in the "dat.h5" format may include the following steps: Record step S5 as a journal script, and modify the recorded script file; Read the modified script into Ansys Fluent and convert all transient data in "dat.h5" format into "CGNS" format files.
[0032] Therefore, a script file that can be automatically executed on all dat.h5 transient data files can be generated by combining Python code with Fluent script. Reading the script file in Fluent can automatically repeat the operations required by the user, greatly saving labor costs and improving data extraction efficiency.
[0033] S6, import the three-dimensional model into the post-processing software paraview as the background, and import all "CGNS" format files into the post-processing software paraview for image processing of flooding deduction; here, since only the grid information containing the secondary phase is output in steps S4~S5, the plant model obtained during post-processing is incomplete, so in step S7 of this embodiment, paraview has the function of using the geometric model as the background, which can make up for the problems in the above steps. The plant model established in S1 is imported into paraview as the data post-processing background, so that the full picture of the plant can be seen in the data image and video demonstration process.
[0034] Step S6 includes the following steps: Import the 3D model in step S1 into Paraview as a background, and import all the "CGNS" format files obtained in step S5 into Paraview; In ParaView, a cloud map is drawn based on the secondary phase volume fraction. In the colormap, the same color is selected for all data points. The transparency of the data points with a secondary phase volume fraction of 0 is set to 0, and the transparency of the data points with a volume fraction of 1 is set to 1. The transparency of the remaining data points changes linearly according to the volume fraction from 0 to 1.
[0035] Here, blue is preferred as the color of water, and transparency is used to represent the volume fraction, which can improve the recognition of water in the model.
[0036] Therefore, in this embodiment, when converting fluent data into the "CGNS" format, only the surface meshes with a secondary phase volume fraction exceeding 0.01 and the volume meshes with a volume fraction of 0.5 are output, and other surface meshes and volume meshes in the calculation domain are discarded, which greatly reduces the amount of output data, reduces the original 1GB "dat.h5" file to a "CGNS" file of about 50MB, shortens the data conversion time by 97%, and does not affect the effect of visualizing the flooding process. In Paraview, 600 transient data can be read in at the same time for processing, the memory usage is reduced by more than 93%, and the data cloud map output rate is increased by more than 5 times, which greatly reduces the resource usage and improves the post-processing efficiency.
[0037] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for extracting and post-processing numerical calculation data of three-dimensional giant powerhouse flooding, characterized in that: The steps include: S1. Perform three-dimensional modeling of a large factory building using three-dimensional modeling software to obtain a three-dimensional model of the large factory building, and perform meshing of the three-dimensional model using meshing software; S2. Set air as the primary phase and water as the secondary phase, and obtain transient data in the "dat.h5" format; S3. Use the python program to rename each transient data in the "dat.h5" format; S4. For each transient data in the renamed "dat.h5" format, extract the surface meshes whose volume fraction of the secondary phase in the calculation domain exceeds the first specified value, and the volume meshes whose volume fraction is the second specified value, discard other data of the secondary phase in the calculation domain and the surface meshes and volume meshes whose volume fraction of the primary phase exceeds 99.9%, and change the data export mode to "legacy" to output a "CGNS" format file; S5, repeat step S4 to obtain all "CGNS" format files; S6. Import the 3D model into the post-processing software as a background, and import all "CGNS" format files into the post-processing software for image processing of flooding simulation.
2. A three-dimensional giant powerhouse flooding numerical calculation data extraction and post-processing method according to claim 1, characterized in that: In step S1, the 3D modeling software is Ansys SCDM, UG, AutoCAD, Creo or Solidworks, and the meshing software is Ansys fluent meshing; In step S6, the post-processing software is Paraview.
3. A three-dimensional giant powerhouse flooding numerical calculation data extraction and post-processing method according to claim 1, characterized in that: Step S2 includes the following steps: S21. Select the ANSYS FLUENT solver in the meshing software; S22, importing the meshed 3D model into the ANSYS FLUENT solver; S23, select the VOF multiphase flow model, set 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 system to automatically save a transient data in the "dat.h5" format every 60 seconds of physical time to perform multiphase flow transient simulation calculations. After the calculation is completed, output all transient data in the "dat.h5" format.
4. A three-dimensional giant powerhouse flooding numerical calculation data extraction and post-processing method according to claim 1, characterized in that: Step S3 means: Use rename.py in the Python program to batch rename each transient data in the "dat.h5" format to "physical time.dat.h5".
5. The method for extracting and post-processing the numerical calculation data of three-dimensional giant powerhouse flooding according to claim 1 is characterized in that: In step S4, the first prescribed value is 0.01, and the second prescribed value is 0.
5.
6. A method for extracting and post-processing three-dimensional giant powerhouse flooding numerical calculation data according to claim 5, characterized in that: When the first specified value is 0.01 and the second specified value is 0.5, step S4 includes: Use the "expression-volume..." method to create a surface, the expression is: Volumefraction(phase='phase-2')>0.01, named "expression-volume0.01"; then use the "Iso-surface" method to create a surface, use the phase-2 volume fraction as a variable, get the isosurface with an Iso-Value value of 0.5, named "volume-fraction-0.5"; Change the data output format of Ansys Fluent to "legacy" in reference; Read in transient data in the "dat.h5" format, export it to CGNS format data that can be read by post-processing software, select only the surfaces "expression-volume0.01" and "volume-fraction-0.5", and select only "volume fraction (phase-2)" as the variable.
7. A method for extracting and post-processing three-dimensional giant powerhouse flooding numerical calculation data according to claim 6, characterized in that: In step S5, when all "CGNS" format files are obtained, batch processing is performed on all "dat.h5" format transient data.
8. A method for extracting and post-processing three-dimensional giant powerhouse flooding numerical calculation data according to claim 7, characterized in that: The batch processing of all transient data in the "dat.h5" format comprises the following steps: Record step S5 as a journal script, and modify the recorded script file; Read the modified script into Ansys Fluent and convert all transient data in "dat.h5" format into "CGNS" format files.
9. The method for extracting and post-processing the numerical calculation data of three-dimensional giant powerhouse flooding according to claim 2 is characterized in that: Step S6 includes the following steps: Import the 3D model in step S1 into Paraview as a background, and import all "CGNS" format files obtained in step S5 into Paraview; In ParaView, a cloud map is drawn based on the secondary phase volume fraction. In the colormap, the same color is selected for all data points. The transparency of the data points with a secondary phase volume fraction of 0 is set to 0, and the transparency of the data points with a volume fraction of 1 is set to 1. The transparency of the remaining data points changes linearly according to the volume fraction from 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