2.1. DAGA-GNN Model Architecture
The DAGA-GNN model adopts an encoder–processor–decoder architecture to predict indoor pollutant dispersion patterns. Based on the input graph structure and concentration data, the model forecasts the flow field state at the subsequent time step. By iteratively repeating this process, the temporal evolution of indoor pollutant leakage and dispersion over a given period can be predicted. The overall framework of the proposed model is illustrated in
Figure 1. This design aims to overcome the limited receptive field in capturing the coupled relationships between airflow and concentration fields and the difficulty of single-layer message passing in modeling long-range dependencies, thereby improving predictive accuracy and enabling rapid prediction of toxic gas concentration fields as an alternative to conventional CFD solvers.
The proposed model is implemented within a message-passing graph neural network framework. The CFD computational mesh is converted into a graph structure, where each mesh cell is represented as a node and adjacency relationships between neighboring cells are represented as graph edges. Physical variables associated with each cell, including velocity, pressure, concentration, and node type, are used as node features, while physical differences and geometric distances between neighboring cells are encoded as edge features. During message passing, information is exchanged along graph edges, enabling each node to aggregate local and neighboring flow information and learn the spatial interactions governing indoor airflow and pollutant transport.
2.1.1. Encoder and Decoder Modules
In graph neural networks, the encoder can be regarded as a feature extraction module that transforms raw physical variables into latent feature representations suitable for graph learning, whereas the decoder performs the inverse transformation by mapping the updated latent features back to physically meaningful quantities, including the flow and pollutant concentration fields at the next time step. In this study, the proposed model denotes the graph structure as , where represents cell elements and denotes edge attributes between adjacent cells.
The encoding stage is responsible for transforming the cell-centered graph into a higher-level feature representation to facilitate subsequent message passing and prediction. The encoder consists of a node attribute encoder
and an edge attribute encoder
. The node encoder
takes as input the node features
at the current time step on the cell-centered graph, which include physical information at the cell centers, such as node type, velocity, pressure, and concentration. It outputs a 128-dimensional hidden representation
. The edge encoder
takes as input the physical differences between adjacent cells and their coordinate offsets, which can be expressed as in Equation (1), and outputs a 128-dimensional edge feature
. Both encoders are implemented using two linear layers with ReLU activation, followed by LayerNorm for output normalization.
The decoder module adopts a multilayer perceptron architecture similar to that of the encoder and is responsible for mapping the updated node and edge features obtained after message passing to outputs of the target dimensionality . The output features can be interpreted as higher-order derivatives of . By concatenating multiple output features and applying forward Euler integration with a fixed time step , the dynamic state at the next time step is computed, thereby generating the mesh at the subsequent time instant. Each iteration of the encoder–processor–decoder framework can be regarded as producing one temporal frame in the numerical solution process, and repeated iterations yield the full spatiotemporal evolution of the domain.
2.1.2. Dual-Layer Aggregation Mechanism
In the indoor pollutant dispersion prediction task, the processor consists of multiple message-passing layers, each comprising a cell block and an edge block, which together form the core components of the graph network. The cell block aggregates features from adjacent edges to their shared vertices, and information from multiple vertices belonging to the same cell is further fused at the cell center to update cell features. The edge block concatenates cell features with neighboring edge features and updates the edge representations accordingly. This process is illustrated in
Figure 2.
During message aggregation, the model performs a dual-layer aggregation operation. First, the first-layer aggregation is conducted using Equation (3), in which features from adjacent edges are aggregated to their shared vertices, achieving an initial integration of vertex features. Subsequently, the function
aggregates vertex features within the same cell to the cell center, enabling vertex feature fusion while establishing the basis for subsequent edge-block concatenation. Afterward, neighboring cell features are fused with edge features and updated through
. The overall process is formulated as follows:
From the overall workflow described above, the encoder first maps physical parameters such as pollutant concentration and ventilation conditions into an initial graph representation . The graph is then input into the cell block of the message-passing layer, where features of all edges sharing the same vertex are summed to produce aggregated node features . In the second aggregation stage, the cell block propagates all node features within the same cell to the cell center and concatenates them with the existing hidden cell features , which are subsequently updated through . Finally, neighboring cell features are concatenated with edge features and passed through to update the edge representations .The hierarchical nature of this mechanism is reflected in the fact that each node first aggregates local features from its adjacent edges, after which the cell center integrates global information from its associated nodes. In this process, plays a role analogous to convolutional kernels in convolutional neural networks, as the two-stage aggregation over the cell-centered graph substantially expands the receptive field. This enables the model to capture longer-range feature dependencies and more effectively represent the complex physical processes governing pollutant dispersion in indoor environments.
2.2. Dataset Generation
The dataset constructed in this study consists of indoor airflow velocity and pollutant concentration distributions obtained from CFD simulations of pollutant dispersion. Taking the typical indoor space model illustrated in
Figure 3 as an example, the computational domain of this room is defined as a complex three-dimensional rectangle measuring 15.1 m(x)
7.8 m(y)
3.6 m(z) along its axes. The air inlets and outlets are represented by windows within the room: a rectangular opening on the right wall measuring 0.97 m(y)
2.07 m(z) serves as the airflow inlet, while a rectangular opening on the left wall measuring 3.42 m(y)
2.2 m(z) functions as the outlet. Inside the model, a 0.4 m(x)
0.4 m(y)
3.6 m(z) cubic region represents the pollutant release source within the building.
To construct a diverse dataset of indoor pollutant dispersion patterns, the random obstacle generation algorithm [
28] was used to place obstacles and pollutant release sources at random locations within the indoor models. Inflow boundary conditions were generated using a Gaussian random number generator: inflow velocities were randomly selected within the range of 2–10
, inflow angles within 45–135°, and the wind speed at the toxic gas release source was randomly selected within 2–5
. These three parameters were combined to form a variety of inflow condition scenes. Based on 15 real room models, this approach was used to generate 280 distinct building models and initial condition setups. CFD simulations were conducted using the OpenFOAM platform v2212 to generate high-fidelity datasets for indoor pollutant dispersion prediction.
It should be noted that the CFD simulations in this study were conducted on a two-dimensional indoor computational domain. Most available experimental datasets for indoor airflow and pollutant dispersion are based on fully three-dimensional wind-tunnel or chamber configurations. Directly using such three-dimensional experimental data to validate the present two-dimensional simulations may introduce additional inconsistencies associated with vertical transport, wall boundary-layer effects, and three-dimensional turbulent mixing. Therefore, the CFD-generated fields in this study are not claimed to be experimentally validated measurements. Instead, they are used as numerically generated reference data for training and evaluating the proposed graph neural network-based surrogate model. To improve the reliability of the CFD-generated reference data, a series of numerical verification analyses were conducted, including mesh-sensitivity analysis, concentration contour map comparison, monitoring point concentration comparison, Courant number monitoring, solver residual assessment, and late-stage concentration variation analysis. Although these numerical verification results support the stability and mesh-resolution adequacy of the CFD simulations, the absence of direct experimental validation is acknowledged as a limitation of the present study. Future work will include tracer-gas experiments or validation against suitable two-dimensional or quasi-two-dimensional benchmark data to further assess the physical accuracy of the CFD-generated pollutant dispersion fields.
The following is a simulated implementation process. The mesh generation process was performed using the snappyHexMesh and extrudeMesh utilities in OpenFOAM v2212. The indoor geometries were initially meshed in three dimensions using snappyHexMesh to accurately capture room boundaries and internal structures. The resulting meshes were then transformed into two-dimensional computational domains through extrudeMesh by compressing the geometry along the vertical direction. This strategy significantly reduces computational complexity while retaining the dominant airflow and pollutant dispersion characteristics in the horizontal plane. The transient airflow and pollutant transport processes were simulated using the pimpleDriftFluxFoam solver under the incompressible flow assumption. This solver is based on the PIMPLE algorithm and includes the transport equation for the pollutant concentration field. Turbulence effects were modeled using the standard Reynolds-Averaged Navier–Stokes
-
turbulence model. Velocity inlet boundary conditions were imposed at the ventilation openings, and no-slip conditions were applied at solid walls. For the concentration field, the pollutant concentration was defined as a normalized scalar variable. The initial concentration in the indoor domain was set to
, representing clean indoor air before pollutant release. A fixed-value concentration boundary condition of
was imposed at the pollutant source region to represent continuous normalized pollutant release. The concentration at the ventilation inlet was set to
, indicating clean incoming air. Zero-gradient boundary conditions were employed at the outlet and solid wall boundaries for the concentration field. In the drift-flux formulation, the scalar transport equation can be expressed as:
where
is the normalized pollutant concentration,
is time,
denotes the spatial coordinate in the i-th direction,
is the airflow velocity component,
is the drift velocity component, and
is the effective scalar diffusivity. The second term on the left-hand side represents pollutant transport by both airflow advection and drift flux, while the term on the right-hand side represents diffusion driven by the concentration gradient.
The effective scalar diffusivity was defined as:
where
is the molecular diffusion coefficient of the pollutant,
is the turbulent kinematic viscosity obtained from the
-
turbulence model, and
is the turbulent Schmidt number. The scalar transport parameters were specified in the transportProperties file. In the present simulations, the air density was set to
, the kinematic viscosity of air was
, the molecular diffusion coefficient was
and the turbulent Schmidt number was
. The pollutant was modeled as a gas-phase passive scalar by setting the particle diameter to
, so that particle inertia, gravitational settling and drift effects were negligible. Therefore, under the present setting, pollutant dispersion was mainly governed by airflow advection and turbulence-induced diffusion. An adaptive time-stepping strategy was adopted in the transient simulations. The initial time step was set to 0.001 s, while the maximum allowable time step was limited to 0.01 s. The time step was automatically adjusted according to the Courant-number constraint, with the maximum Courant number set to 1. To examine the temporal stability of the numerical setup, a representative indoor scene was selected for verification. During the simulation, the monitored Courant number remained within the prescribed limit, with a mean value of approximately 0.0498 and a maximum value of approximately 0.9487. This indicates that the numerical stability requirement was satisfied under the present mesh resolution and flow conditions.
To further verify the adequacy of the selected simulation duration, pollutant concentrations at five representative monitoring points in the representative scene were compared between 25 s and 30 s. As shown in
Table 1, the average relative concentration change was only 0.41%, and the maximum change was 0.97%, indicating that the concentration field had approached a quasi-steady state and that the main pollutant dispersion process had been sufficiently captured in the examined case.
In addition, to further examine the numerical stability and convergence behavior of the transient CFD simulation, solver residuals and Courant numbers were monitored in a representative indoor scene. During the initial start-up stage, the time step was automatically adjusted by the solver. After this initial adjustment, the Courant number remained stable, with the maximum Courant number at representative time instants remaining below 1. As shown in
Table 2, the final residuals of the velocity components, pressure, turbulence quantities, and pollutant concentration equation remained at low levels during the transient simulation. At the later stage of the simulation, the final residuals of U, p, k, ε, and C were generally on the order of 10
−6–10
−8, except for ε, which remained around 10
−5. The continuity errors also remained small, indicating that the transient calculation was numerically stable and that no divergence occurred.
As shown in
Figure 4, under the influence of room layout and initial airflow conditions, the concentration fields of toxic gas released from the source exhibit diverse distribution patterns after a period of dispersion. By varying model topologies, release source locations, initial wind speeds, and other parameters, a large and diverse set of indoor pollutant concentration data samples was generated, providing a robust dataset for subsequent model training. Selected results of pollutant dispersion simulations in the dataset are shown in
Figure 4.
2.2.1. Mesh Sensitivity Analysis
To ensure that the CFD-generated pollutant concentration dataset is numerically reliable and not excessively influenced by mesh resolution, mesh sensitivity analysis was conducted using a representative indoor scene.
Three meshes with different resolutions were generated using the same meshing strategy, containing 2481, 6762, and 13,787 cells, respectively, as shown in
Figure 5. Since the present simulations were performed on a two-dimensional indoor computational domain, the representative grid refinement ratio was estimated based on the square root of the cell-number ratio. The refinement ratios from the low-resolution mesh to the intermediate-resolution mesh and from the intermediate-resolution mesh to the high-resolution mesh were approximately 1.65 and 1.43, respectively, indicating a clear increase in mesh resolution among the three cases. The intermediate-resolution mesh was employed for dataset generation, while the low-resolution and high-resolution meshes were used to evaluate the sensitivity of pollutant dispersion predictions to mesh refinement.
Figure 5 illustrates the corresponding pollutant concentration distributions obtained using the three mesh resolutions. The low-resolution mesh exhibits noticeable discrepancies in regions characterized by strong concentration gradients, particularly near the pollutant source and along the primary transport pathway. In contrast, the concentration fields predicted by the intermediate-resolution and high-resolution meshes display highly similar spatial distributions throughout the computational domain, with only minor differences observed in localized regions. These results indicate that the intermediate-resolution mesh is capable of capturing the dominant pollutant transport characteristics with satisfactory accuracy.
To further quantify the effect of mesh refinement, pollutant concentrations at five representative monitoring points were compared among the three mesh resolutions, as shown in
Table 3. The comparison shows that the change from the low-resolution mesh to the intermediate-resolution mesh was more pronounced than that from the intermediate-resolution mesh to the high-resolution mesh. This decreasing sensitivity with mesh refinement suggests that the numerical solution was approaching a mesh-independent trend. Although local differences still existed at individual monitoring points due to strong concentration gradients and recirculation effects, the overall pollutant dispersion pattern and the monitored concentration values became stable after the intermediate mesh resolution. Taking the high-resolution mesh as the reference, the relative differences between the intermediate-resolution and high-resolution meshes at the five monitoring points were 3.24%, 2.13%, 0.58%, 2.60%, and 0.82%, respectively. The average relative difference was approximately 1.87%, and the maximum relative difference was 3.24%. These results indicate that further refinement from 6762 to 13,787 cells had only a limited influence on the monitored pollutant concentrations and the dominant concentration distribution.
Considering the balance between numerical accuracy and computational efficiency, the intermediate-resolution mesh was selected for CFD dataset generation in this study. The results demonstrate that the adopted mesh resolution provides sufficient accuracy for predicting indoor pollutant dispersion while avoiding the significantly increased computational cost associated with further mesh refinement.
2.2.2. Graph Augmentation
In deep learning-driven fluid dynamics modeling, the training process requires large-scale datasets to capture the inherent patterns and features of the data. Small datasets can easily lead to model overfitting, while generating high-precision CFD simulation data is computationally expensive. To address this, the present study employs a graph-based data augmentation framework to jointly enhance the mesh structure, concentration fields, and airflow fields, thereby enriching the pollutant concentration dataset [
29].
In the task of predicting indoor pollutant dispersion patterns, the input data consist of three key physical fields: the computational domain’s mesh structure
, the velocity vector field
, and the pollutant concentration scalar field
. In this study, a multi-field collaborative augmentation algorithm is developed based on the rotation group SO(2) to ensure covariance of all physical fields under rotation. The rotation matrix
is parameterized by a single angle
, with the mesh structure, velocity field, and concentration field transformed to
,
u, and
, respectively.
Through this module, the input graph-structured data are randomly rotated by different angles before being fed into the model. These rotation-transformed data serve as entirely new and diverse inputs for the neural network, enabling it to learn richer and more generalizable feature representations. It should be noted that the proposed SO(2)-based augmentation does not generate new physical flow states. Instead, it leverages the rotational covariance of the governing equations to provide alternative geometric representations of existing solutions. The method assumes incompressible indoor airflow and passive scalar transport without buoyancy, thermal stratification, or other direction-dependent body forces. Under these assumptions, rotating the entire computational domain together with the associated velocity field, pollutant source location, and boundary-condition configuration yields a physically equivalent problem. Therefore, the augmented samples remain physically consistent while increasing the directional diversity of the training data. By employing this graph-based data augmentation strategy, the model can learn pollutant transport patterns from multiple spatial orientations and improve its robustness under different dispersion pathways.
2.2.3. Data Preprocessing
The network model is highly sensitive to its input data; directly feeding raw time-series data into the model can adversely affect its ability to learn the physical features of the flow field under fluid-solid coupling. Therefore, it is necessary to preprocess the input time-series airflow velocity and pollutant concentration distributions before feeding them into the model, making them more suitable for capturing the distribution characteristics of the input vectors by the GNN.
For preprocessing the pollutant concentration field, a thresholding operation is first applied to constrain the data within the [0, 1] range, eliminating extreme or anomalous values. This is followed by a linear scaling step, in which a proportional coefficient adjusts the data magnitude. Finally, a logarithmic transformation, as expressed in Equation (11), is applied, forming a combined preprocessing strategy. This composite transformation effectively smooths the data distribution while reducing variance, achieving the intended preprocessing objectives.
For the velocity field data and the preprocessed concentration field data, Z-score normalization is applied to standardize the airflow data. This normalization method subtracts the mean of the dataset from each data point and then divides by the standard deviation, resulting in data that follow a standard normal distribution. By mapping data of different scales and distributions into the same numerical space, this approach unifies the magnitude of disparate datasets, which helps improve model convergence speed and prediction accuracy. The procedure can be expressed mathematically as follows:
where
denotes the input data,
is the mean of the dataset,
is the standard deviation of the dataset, and
represents the normalized data after Z-score standardization.
2.3. Experimental Design
The DAGA-GNN model performs four rounds of message passing, and its MLP modules consist of three fully connected layers with ReLU activation functions between layers, followed by LayerNorm for final output normalization. During network training, 80% of the dataset is randomly selected as the training set, while 20% is reserved as the test set, ensuring that test data do not appear in the training set. Model weights are updated using the Adam optimizer [
30], with an initial learning rate of 1 × 10
−4 exponentially decaying to 1 × 10
−6. Random noise is added to the input data to improve the model’s robustness to perturbations. The training loss function is the L2 loss, which is computed as the sum of squared differences between the predicted values
and the ground truth values
. Mathematically, the L2 loss is defined as follows:
To evaluate the predictive performance of the network and facilitate comparison with CFD methods, this study employs Normalized Mean Square Error (NMSE) and the correlation coefficient
as the model accuracy metrics. The formulas for these two evaluation indicators are as follows:
where
and
denote the predicted and true values at each node, respectively, while
and
represent the mean of all true values and predicted values. The correlation coefficient
ranges from 0 to 1, with a value of 1.0 indicating perfect agreement between predictions and ground truth. The NMSE metric ranges from 0 to infinity, with smaller NMSE values indicating better predictive performance of the model.
The final loss function is defined as the sum of the individual loss terms computed separately for the velocity field and the concentration field. The specific formulation is as follows:
where
and
denote the loss functions for the velocity field and the concentration field, respectively, while
and
are the weighting coefficients for the airflow and concentration losses. During the initial training phase,
is set to 1 and
to 0.3, emphasizing the model’s ability to learn the airflow field. This strategy is based on the physical dependency of pollutant dispersion on the velocity field, as accurate airflow prediction is a prerequisite for reliable concentration forecasting. Once the velocity field prediction accuracy exceeds 0.5, both
and
are set to 1 to achieve balanced optimization between airflow and toxic gas concentration fields. During training, if convergence of a particular physical quantity lags, its corresponding weight can be increased to strengthen the learning of that aspect.
To quantitatively compare the predictions of the network model with CFD simulation results, several measurement points were placed within the experimental scene to monitor pollutant concentrations. The spatial distribution of these measurement points is illustrated in
Figure 6.