Urban region gaseous non-radioactive pollutant diffusion simulation method based on OpenFOAM
Through the OpenFOAM method, a three-dimensional urban model was established and grid division and parallel computing was carried out, and the problem of insufficient flexibility and freedom in simulated gaseous non-radioactive pollutants diffusion process in urban areas was solved in the existing technology, and the pollutants were realized Precise simulation of diffusion and provision of rapid governance programs.
Patent Information
- Application Number
- CN202411190247.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2025-01-10
AI Technical Summary
The prior art lacks flexibility and freedom in simulating the diffusion of gaseous non-radioactive pollutants in urban areas. It relies on dedicated commercial software to quickly judge the pollution status and formulate governance plans.
Using OpenFOAM-based method, a three-dimensional urban model is established through CAD software, pre-processing and meshing are performed, and pollutant diffusion is simulated by using the ScalarTransportFoam solver and SIMPLE algorithm to realize parallel computing and data analysis.
It realizes flexible and precise simulation of the diffusion process of gaseous non-radioactive pollutants, provides a scientific basis for quickly judging urban pollution status and formulating governance plans, and reduces dependence on special software.
Smart Images

Figure CN119294281A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of computational fluid dynamics simulation, and in particular relates to an OpenFOAM-based method for simulating the diffusion of gaseous non-radioactive pollutants in urban areas. Background Art
[0002] Urban areas are places where people are most concentrated, and their air quality is closely related to the health of residents. Therefore, studying the diffusion mechanisms of common gaseous non-radioactive pollutants in urban areas, such as NO2, SO2, PM10, and simulating and calculating their migration and diffusion processes in urban blocks, so as to propose targeted treatment plans, is of great significance for improving the health of urban residents and the air quality of block environments.
[0003] In recent years, with the widespread application of computational fluid dynamics (CFD) in the field of atmospheric science, great progress has been made in simulating the diffusion of atmospheric pollutants in urban areas using computational fluid dynamics software. Cheng Xueling et al. (2004) applied CFD methods to calculate and analyze a large number of examples and studied the two-dimensional diffusion of pollutants in urban block canyons, including comparing the diffusion concentration of pollutants under various conditions, examining the influence of factors such as incoming wind speed, block characteristic ratio and sunshine on diffusion, and analyzing the dynamic reasons for its diffusion by studying the flow field and turbulence intensity, providing a basis for improving engineering prediction models; Dong Wencheng et al. (2014) conducted numerical simulation research on the flow field and pollutant transmission and diffusion in the urban area based on the observation data of the pollution diffusion experiment in Yuzhong using CFD software Fluent, and compared the simulated values with the observed values of the field experiment. The results showed that Fluent can simulate the flow field in the urban area well, and the simulated value of the wind field can reflect the change trend of the actual wind field.
[0004] CFD is a method based on mathematical physics equations to study the laws of fluid motion through numerical discretization and computational solutions. It plays an important role in environmental pollution control. The CFD method uses basic physical laws such as the mass conservation equation, momentum equation, and diffusion equation to study the movement and diffusion of pollutants in fluids. By establishing mathematical models and calculation methods, the transmission path and concentration distribution of pollutants can be predicted, providing a scientific basis for early warning and control of gaseous non-radioactive pollutants in urban areas. Summary of the invention
[0005] In view of the defects in the prior art, the purpose of the present invention is to provide a method for simulating the diffusion of gaseous non-radioactive pollutants in urban areas based on OpenFOAM. This method can be used to more flexibly and freely accurately simulate the diffusion process of gaseous non-radioactive pollutants in cities.
[0006] To achieve the above purpose, the technical solution adopted by the present invention is as follows:
[0007] A method for simulating the diffusion of gaseous non-radioactive pollutants in urban areas based on OpenFOAM includes the following steps:
[0008] S1. Building a three-dimensional model of the urban area to be simulated based on CAD software and a custom script program;
[0009] S2. Based on the OpenFOAM open source platform, the generated three-dimensional city model is imported and pre-processed on the three-dimensional city model, wherein the pre-processing includes customizing the calculation domain and boundary conditions, meshing the calculation domain, and allocating the calculation domain;
[0010] S3, using ScalarTransportFoam solver to perform parallel calculation of pollutant diffusion;
[0011] S4. Check simulation results and collect and analyze data.
[0012] Furthermore, in the OpenFOAM-based urban area gaseous non-radioactive pollutant diffusion simulation method, in step S1, two-dimensional CAD data and building heights of the urban area to be simulated are obtained through field surveys or by using public data.
[0013] Furthermore, in the above-mentioned OpenFOAM-based method for simulating the diffusion of gaseous non-radioactive pollutants in urban areas, the script program algorithm in step S1 specifically includes:
[0014] S11, adding a height field thickness to the two-dimensional CAD data of the urban area to form three-dimensional CAD data;
[0015] S12, looping through the 3D CAD data, if the height field thickness is not zero, executing the extrude command to extrude the 2D buildings in the urban area to form a 3D CAD model, if the height field thickness is 0, skipping;
[0016] S13. Batch extrude and export the three-dimensional building models of urban areas in a specified format.
[0017] Furthermore, in the above-mentioned OpenFOAM-based method for simulating the diffusion of gaseous non-radioactive pollutants in urban areas, in step S2, BlockMesh and SnappyHexMesh commands are used to perform grid division of the computational domain, and a one-to-one mapping between the actual continuous space of the urban area and the simulated computational virtual discrete space is established.
[0018] Furthermore, in the above-mentioned OpenFOAM-based method for simulating the diffusion of gaseous non-radioactive pollutants in urban areas, the DecomposePar command is used in step S2 to distribute the computational domain to the multi-core solver to prepare for parallel computing.
[0019] Further, in the above-mentioned OpenFOAM-based method for simulating the diffusion of gaseous non-radioactive pollutants in urban areas, step S3 is specifically as follows:
[0020] The SIMPLE algorithm is used to deal with the steady-state incompressible pressure-velocity coupling. For each different gaseous non-radioactive pollutant, the scalar transport equation is used to solve it and simulate the diffusion process of different pollutants in the calculation domain.
[0021] Further, in the above-mentioned OpenFOAM-based method for simulating the diffusion of gaseous non-radioactive pollutants in urban areas, in step S3:
[0022] The specific calculation formula of the scalar transport equation is:
[0023]
[0024] In formula (1), is the pollutant scalar to be determined, Γ is the diffusion coefficient, S is the non-radioactive pollutant source term, U j is the speed, t is the time;
[0025] The continuity equation, momentum equation and component transport equation are discretely solved by the finite volume method. According to the coupling of pressure and velocity, the SIMPLE algorithm and the first-order upwind scheme are used, and the steady-state results are obtained by parallel computing iteration.
[0026] Compared with the prior art, the method for simulating the diffusion of gaseous non-radioactive pollutants in urban areas based on OpenFOAM provided by the present invention has the following beneficial effects:
[0027] The method provided by the present invention includes the establishment of a three-dimensional model of a pre-processed urban area, the import of a three-dimensional urban model based on the OpenFOAM open source platform, and the discretization of a continuous three-dimensional urban space into a three-dimensional space grid, and then the distribution of the calculation space to a multi-core solver for parallel computing. The SIMPLE algorithm is used to process the steady-state incompressible pressure-velocity coupling during calculation. For gaseous non-radioactive pollutants, the diffusion of pollutants in the atmosphere can be simulated by solving the scalar transport equation through a custom solver. The simulation method of the present invention does not need to rely on dedicated commercial software, and has a high degree of flexibility and freedom. When pollution diffusion occurs, the urban pollution status can be immediately judged through simulation, and the treatment plan can be further determined. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 A flow chart of a method for simulating the diffusion of gaseous non-radioactive pollutants in urban areas based on OpenFOAM provided in an embodiment of the present invention;
[0029] Figure 2 for Figure 1 Another flow chart of the method;
[0030] Figure 3 This is a three-dimensional model of the urban area in the embodiment;
[0031] Figure 4 This is the simulation result of the diffusion of gaseous non-radioactive pollutants in the urban area of the embodiment. DETAILED DESCRIPTION
[0032] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0033] Figure 1 and Figure 2 A flow chart of a method for simulating the diffusion of gaseous non-radioactive pollutants in urban areas based on OpenFOAM provided in an embodiment of the present invention is shown. The method comprises the following steps:
[0034] S1. Based on CAD software and custom script program, a three-dimensional model of the urban area to be simulated is established.
[0035] 3D modeling of urban areas is the first step in numerical simulation. For urban areas, the 2D CAD data and building heights of the area can be obtained through field surveys or by using some public data. After obtaining these data, 3D modeling is performed using CAD software and custom scripts to obtain a 3D city model. The specific script algorithm is as follows:
[0036] S11, adding a height field thickness to the two-dimensional CAD data of the urban area to form three-dimensional CAD data;
[0037] S12, looping through the 3D CAD data, if the height field thickness is not zero, executing the extrude command to extrude the 2D buildings in the urban area to form a 3D CAD model, if the height field thickness is 0, skipping;
[0038] S13. Batch extrude and export the three-dimensional building models of urban areas in a specified format.
[0039] S2. Based on the OpenFOAM open source platform, the generated three-dimensional city model is imported and pre-processed on the three-dimensional city model. The pre-processing includes customizing the calculation domain and boundary conditions, meshing the calculation domain, and allocating the calculation domain.
[0040] OpenFOAM is an open source computational fluid dynamics software toolkit that provides a range of functions and modules for simulating fluid flow and related phenomena. It can be used to study various fluid-related problems, including the diffusion of atmospheric pollutants.
[0041] Create a new case on the OpenFOAM platform and import the 3D city model generated in step S1. Before performing CFD numerical simulation, necessary pre-processing is required, including customizing the computational domain, boundary conditions, meshing, and computational domain allocation. Specifically, the meshing can be performed using the BlockMesh and SnappyHexMesh commands to mesh the computational domain and establish a one-to-one mapping between the real continuous space of the urban area and the virtual discrete space of the simulation calculation; finally, the DecomposePar command is used to allocate the computational domain to the multi-core solver for parallel computing.
[0042] S3. Use the ScalarTransportFoam solver to perform parallel calculations on pollutant diffusion.
[0043] The present invention uses SIMPLE algorithm to process steady-state incompressible pressure-velocity coupling. For each different gaseous non-radioactive pollutant, the scalar transport equation is used to solve it and simulate the diffusion process of different pollutants in the calculation domain. The specific calculation formula of the scalar transport equation is as follows:
[0044]
[0045] In formula (1), is the pollutant scalar to be determined, Γ is the diffusion coefficient, S is the non-radioactive pollutant source term, U j is the velocity, and t is the time. The continuity equation, momentum equation, and component transport equation are discretely solved by the finite volume method. According to the coupling of pressure and velocity, the SIMPLE algorithm and the first-order upwind scheme are used for parallel calculation, and the steady-state results are obtained iteratively.
[0046] S4. Check simulation results and collect and analyze data.
[0047] After obtaining the calculation results, you can use post-processing software to view the image, or you can directly extract data from the results for analysis.
[0048] Example
[0049] The above method is used to simulate the diffusion of gaseous non-radioactive pollutants in a certain urban area. The specific steps are as follows:
[0050] Step 1: Use CAD modeling to build a 3D model of the city based on the 2D data of the city. Figure 3 shown.
[0051] Step 2. Create a new Openfoam example, put the 3D model into the constant / geometry folder of the openfoam example, configure the decomposeParDict file, use the decomposePar command to divide the computational domain, configure the blockMeshDict file, use the blockMesh command to perform preliminary mesh division, then configure the snappyHexMeshDict file in the system folder, and execute the snappyHexMesh command to complete the final mesh division.
[0052] Step 3: Set boundary conditions, set it to steady-state calculation, iterate 1000 steps, set boundary conditions such as inlet wind and temperature profile; configure the scalar transport equation in the ScalarTransportFoam solver for parallel operation. The scalar transport equation is:
[0053] fvScalarMatrix CEqn (
[0055] fvm::div(phi,C)
[0056] -fvm::laplacian(DEff,C)
[0057] ==
[0058] fvOptions(C) );
[0060] Step 4: Get the simulation results and analyze them. Figure 4 shown.
[0061] The method for simulating the diffusion of gaseous non-radioactive pollutants in urban areas based on OpenFOAM provided by the present invention does not rely on dedicated commercial software, and can simulate the diffusion process of gaseous non-radioactive pollutants in cities with higher flexibility and freedom. When pollution diffusion occurs, the urban pollution status can be immediately judged through simulation, thereby providing a scientific basis for early warning and control of gaseous non-radioactive pollutants in urban areas.
[0062] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for simulating the diffusion of gaseous non-radioactive pollutants in urban areas based on OpenFOAM, comprising the following steps: S1. Building a three-dimensional model of the urban area to be simulated based on CAD software and a custom script program; S2. Based on the OpenFOAM open source platform, the generated three-dimensional city model is imported and pre-processed on the three-dimensional city model, wherein the pre-processing includes customizing the calculation domain and boundary conditions, meshing the calculation domain, and allocating the calculation domain; S3, using ScalarTransportFoam solver to perform parallel calculation of pollutant diffusion; S4. Check simulation results and collect and analyze data.
2. The method for simulating the diffusion of gaseous non-radioactive pollutants in urban areas based on OpenFOAM according to claim 1, characterized in that: In step S1, two-dimensional CAD data and building heights of the urban area to be simulated are obtained through field surveys or by using public data.
3. The method for simulating the diffusion of gaseous non-radioactive pollutants in urban areas based on OpenFOAM according to claim 2, characterized in that: The script algorithm in step S1 specifically includes: S11, adding a height field thickness to the two-dimensional CAD data of the urban area to form three-dimensional CAD data; S12, looping through the 3D CAD data, if the height field thickness is not zero, executing the extrude command to extrude the 2D buildings in the urban area to form a 3D CAD model, and skipping if the height field is 0; S13. Batch extrude and export the three-dimensional building models of urban areas in a specified format.
4. The method for simulating the diffusion of gaseous non-radioactive pollutants in urban areas based on OpenFOAM according to any one of claims 1 to 3, characterized in that: In step S2, BlockMesh and SnappyHexMesh commands are used to mesh the computational domain and establish a one-to-one mapping between the real continuous space of the urban area and the virtual discrete space of the simulation calculation.
5. The method for simulating the diffusion of gaseous radioactive pollutants in urban areas based on OpenFOAM according to claim 4, characterized in that: In step S2, the DecomposePar command is used to distribute the computational domain to the multi-core solver to prepare for parallel computing.
6. The method for simulating the diffusion of gaseous non-radioactive pollutants in urban areas based on OpenFOAM according to claim 5, characterized in that: Step S3 is specifically as follows: The SIMPLE algorithm is used to deal with the steady-state incompressible pressure-velocity coupling. For each different gaseous non-radioactive pollutant, the scalar transport equation is used to solve it and simulate the diffusion process of different pollutants in the calculation domain.
7. The method for simulating the diffusion of gaseous non-radioactive pollutants in urban areas based on OpenFOAM according to claim 6, characterized in that: In step S3: The specific calculation formula of the scalar transport equation is: In formula (1), is the pollutant scalar to be determined, Γ is the diffusion coefficient, S is the non-radioactive pollutant source term, U j is the speed, t is the time; The continuity equation, momentum equation and component transport equation are discretely solved by the finite volume method. According to the coupling of pressure and velocity, the SIMPLE algorithm and the first-order upwind scheme are used, and the steady-state results are obtained by parallel computing iteration.