scieee AI-readable full text Open interactive document viewer

Accelerating urban scale simulations leveraging local spatial 3D structure

Iserte, Sergio; Macias, Aina; Martínez-Cuenca, Raúl; chiva, sergio; Paredes, Roberto; Quintana-Orti, Enrique S.

Abstract

This paper presents a hybrid methodology for accelerating Computational Fluid Dynamics (CFD) simulations intertwining inferences from deep neural networks (DNN). The strategy leverages the local spatial data of the velocity field to leverage three-dimensional convolutional kernels within DNN. The hybrid workflow is composed of two-step cycles where CFD solvers calculations are utilized to feed predictive models, whose inferences, in turn, accelerate the simulation of the fluid evolution compared with traditional CFD. This approach has proved to reduce 30% time-to-solution in an urban scale study case, which leads to generating massive datasets at a fraction of the cost.

Full text

Journal of Computational Science 62 (2022) 101741 Available online 15 June 2022 1877-7503/© 2022 The Author(s). Published by Elsevier B.V. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/). Contents lists available at ScienceDirect Journal of Computational Science journal homepage: www.elsevier.com/locate/jocs Accelerating urban scale simulations leveraging local spatial 3D structure Sergio Iserte a,∗,Aina Macías a,Raúl Martínez-Cuenca a,Sergio Chiva a,Roberto Paredes b, Enrique S. Quintana-Ortí c aUniversitat Jaume I (UJI), Dpt. of Mechanical and Engineering Construction (DEMC), Spain bUniversitat Politècnica de València (UPV), Dpto. de Sistemas Informáticos y Computación (DSIC), Spain cUniversitat Politècnica de València (UPV), Dpto. de Informática de Sistemas y Computadores (DISCA), Spain ARTICLE INFO Keywords: Computational fluid dynamics Structured mesh Convolutional neural network High performance computing Data-driven simulations ABSTRACT This paper presents a hybrid methodology for accelerating Computational Fluid Dynamics (CFD) simulations intertwining inferences from deep neural networks (DNN). The strategy leverages the local spatial data of the velocity field to leverage three-dimensional convolutional kernels within DNN. The hybrid workflow is composed of two-step cycles where CFD solvers calculations are utilized to feed predictive models, whose inferences, in turn, accelerate the simulation of the fluid evolution compared with traditional CFD. This approach has proved to reduce 30% time-to-solution in an urban scale study case, which leads to generating massive datasets at a fraction of the cost. 1. Introduction Traditional Computational Fluid Dynamics (CFD) simulations are able to compute and analyze the fluid flow behavior from a set of Partial Differential Equations (PDE) [1]. This permits the optimization of the performance of a wide variety of industrial devices and facilities in fields such as aerodynamics [2,3], industrial mixing [4,5], nuclear reactor safety [6] and wastewater treatment [7,8]. The ability of these codes to forecast future states of the fluid flow makes them also a valuable tool for environmental studies [9,10]. Here, the focus lies on the dispersion of contaminants depending on emissions and local climatology to prevent risks to the population. The huge computational cost of the CFD modeling (both in terms of memory and time) strongly limits their practical implementation. Recent studies try to speed up CFD simulations by using Artificial Intelligence (AI) techniques following two main approaches: (1) learning from simulations and predicting results using neural networks [11]; and (2) including predictive models in the CFD solvers to work over a specific problem [12]. The combination of both approaches has provided such promising results that it has given birth to the new area of knowledge Data-driven CFD [13]. It is interesting to note that AI methods have been also leveraged in other tasks of CFD such as, for instance, automating the spatial discretization of the fluid flow domain by estimating optimal meshes based on large sets of examples [14]. This paper contributes with a novel methodology that combines stages of CFD resolution and predictions to accelerate the calculation of transient flows in a specific 3D domain leveraging its local spatial ∗Corresponding author. E-mail address: [email protected] (S. Iserte). structure. First, the domain for the simulations is established. Then, a conventional transient CFD solver is used to train a Deep Neural Network (DNN) consisting of convolutional layers that rely on 3D kernels to detect patterns and extract the physical characteristics of the simulated flow. Finally, the resulting DNN provides spatial–temporal predictions of the flow evolution within the chosen domain in a small fraction of the time needed by the transient CFD solver. The proposed methodology calculates the flow evolution by alternating stages of transient CFD simulations and predictions of the DNN. In this way, the hybrid approach profits from both the reliability of CFD resolutions to mitigate error accumulation and propagation and the inference speed of predictive models. The reduction of the time-to-result while achieving a low error rate can be crucial when simulating computationally expensive CFD models, particularly, in the case of generating datasets for training neural networks with the aim of making fluid dynamic predictions. For this purpose, datasets are expected to be composed of many similar simulations, where boundary conditions can be slightly altered [15,16]. This operation provides a dataset with a large variety of scenarios to train the DNN, which can then learn and generalize solutions. The rest of the paper is structured as follows: Section 2summarizes the related work. Section 3presents the study case and how it has been modeled. Section 4introduces the hybrid solver based on CFD and DNN and the interfaces developed to integrate both subsystems. Section 5describes the training and evaluation of the devised deep learning model and details the results provided by the hybrid model. Finally, Section 6concludes this work and states open research lines. https://doi.org/10.1016/j.jocs.2022.101741 Received 10 February 2022; Received in revised form 20 May 2022; Accepted 1 June 2022 Journal of Computational Science 62 (2022) 101741 2 S. Iserte et al. 2. Related work The incursion of AI methods in CFD simulations to reduce the time-to-solution while providing an acceptable accuracy is a current hot research topic [17]. Several strategies are being followed to provide predictive models capable of accelerating simulations, as well as improving turbulence closure modeling or enhancing Reduced-Order Models (ROM). Deep learning is used in CFD to infer the physic behavior that allows predicting the evolution of a fluid flow. In principle, it may seem that the ultimate aim here is to deploy a neural network that completely substitutes the numerical solvers of CFD, in other words, use a predictive model to simulate flows virtually in real-time. However, the current state of the art is still far from accomplishing that mission [18]. In the following paragraphs, we refer to some of the most relevant efforts, related to this work. In [19], authors complement their CFD with deep learning surrogate models of specific subdomains of the case. Especially those that are highly computational demanding. For this purpose, the authors leverage recurrent neural networks (RNN) to predict the unsteady aerodynamic loads of free pitching and plunging airfoil in a transonic flow field. The work in [20] presents a real-time iterative model that learns from previous data and predicts subsequent temperatures in a voxel. This project trains the model with the available data (calculated + predicted) at each step to make new predictions, which means that the error may be propagated in case of a bad prediction. Tompson et al. [21] used a predictive model to compute just one of the CFD solver tasks. Specifically, CFD solvers for incompressible flows need to ensure that the computed velocity fields are divergence-free. In practice, this involves a high time-consuming resolution of a Poisson equation that was accelerated thanks to the training of a ConvNet model. In [22], the authors include the actual equations of the physics models to data-driven approaches in which neural networks are trained to fit the physical laws (i.e.: mass or momentum conservation). They designed data-driven algorithms for inferring solutions to nonlinear PDEs and construct physics-informed surrogate models. Similarly, in [23] physics laws were embedded within the convolutional layers of their network to improve temporal predictions of three-dimensional unsteady vortex dynamics, which are expected to accumulate and propagate the errors when the model is fed with only predicted data. More related to wind urban environments, there have been several AI applications reviewed in [24] including field regressors, Bayesian deep learning, dynamic node decomposition, cyber–physical systems, autonomous morphing, or digital twins. Particularly, in [25] authors devised a Non-Intrusive Reduced Order Model (NIROM) combining Proper Orthogonal Decomposition (POD) and machine learning techniques. Their results show that the model is capable of predicting the evolution of a turbulent flow in a quasi-steady state. The methodology based on reducing the temporal characteristics before learning is also used in [15], where the authors propose a method based on a convolutional autoencoder that computes a latent space and a Long Short Term Memory (LSTM) network for temporal evolution learning. A more general approach can be found in [16], where authors present CFDNet, a deep learning framework coupled with a physical simulator for RANS models. These solutions are based on reducing the data dimensionality, which in turn removes the local spatial information of the data. There are also data-driven solutions for Lagrangian mechanics. For instance, the authors in [26] present a general-purpose framework for learning from data of particle-based representation of physics. Nevertheless, it is important to note that the approach taken in this manuscript leverages Eulerian mechanics for calculating fluid motion. At the end of the day, scientists aim to reduce the extremely large computation time of some simulations using AI (machine or deep learning) techniques. In this paper, a novel hybrid methodology for Fig. 1. Representation of the case simple city blocks of AIJ. 𝑋-axis is aligned with the wind direction and the 𝑍-axis with the vertical plane. inferring flow evolution that combines traditional CFD simulation and DNN predictions is presented. The strategy leverages the accuracy of CFD solvers to feed a deep 3D convolutional neural network producing predictions which are then used to accelerate the simulation of the fluid evolution. These two-stage cycles will accelerate simulations thanks to the interleaved predictions, which can be translated in non-negligible time, energy, and cost savings when generating large datasets. To the best of our knowledge, no CFD-DNN hybrid solver like the one proposed in this work has previously incorporated a fully convolutional approach to accelerate CFD simulations. 3. Case description The present study considers a flow scenario comprising several city blocks in an urban area. This configuration has been extensively characterized in wind tunnel tests by the Architectural Institute of Japan (AIJ) and serves for the validation of CFD simulations aiming at the prediction of pedestrian wind environment around buildings [27, 28]. Particularly, the experimental test case C (simple city blocks) of AIJ [29] has been targeted. Fig. 1 represents the case and the wind direction. Notice that the figure illustrates that the 𝑋-axis is aligned with the wind direction and the 𝑍-axis with the vertical plane. The computational domain limits for the case are established following the COST guideline [30]. Fig. 2 depicts a vertical 2(a) and an horizontal 2(b) section of the domain under study. The resultant domain is configured being 𝐻= 0.4m the height of the highest-rise building, and 𝑏= 0.2m the height of the low-rise buildings. The case is discretized into a mesh harnessing the blockMesh1utility provided by OpenFOAM [31] software, to create a three-dimensional structured grid composed of hexahedral cells, with physical values, such as velocity, pressure, etc., centered in each cell. The methodology presented in this work is spatial dependent because it is based on convolutional kernels, and therefore unstructured meshes cannot be used directly. However, if the unstructured mesh values are interpolated into a structured grid, data could be used in the hybrid methodology. A standard grid is established to ensure computational accuracy for CFD simulations. Fig. 3 shows the vertical cross-section of the computational grid distribution around the buildings in the middle of the 𝑌domain (Fig. 3(a)) and at the bottom of 𝑍(Fig. 3(b)). As a result, the generated mesh is conformed to 374,400 grid points. Flow equations are modeled using the Unsteady Reynolds-averaged Navier–Stokes (URANS) equations. Particularly, the pimpleFOAM solver was used for their numerical resolution, providing an accurate (though highly time-consuming) description of the flow evolution. To grant 1https://www.openfoam.com/documentation/user-guide/4-mesh- generation-and-conversion/4.3-mesh-generation-with-the-blockmesh-utility Journal of Computational Science 62 (2022) 101741 3 S. Iserte et al. Fig. 2. Computational domain for 𝐻for AIJ case C following the COST guidelines. a smooth initialization of the transient solver, the initial conditions are computed from a steady-state resolution using the simpleFOAM solver. It is beyond the scope of this paper to conduct a more detailed evaluation of these specific CFD solvers, but a detailed description can be found in the OpenFOAM documentation.2 4. CFD-DNN hybrid solver This section details the methodology implemented by the hybrid solver. Furthermore, the dataset generated to train and evaluate the predictive model is described in detail. The solution proposed in this work provides an accelerated alternative to the traditional CFD simulations. As introduced in Section 2, the high accuracy of CFD is achieved by solving complex PDEs which usually require large computational times. The DNN offers a technique that provides highly-reduced time-to-solution at the expense of small errors. Alternatively, the predictive model could be applied to subdomains of the case under study [19], or certain periods of the temporal evolution [25]. 2https://www.openfoam.com/documentation/user-guide/a-reference/a.1- standard-solvers The hybrid solver combines both approaches, CFD and DNN, to rapidly return a solution while preventing error accumulation and propagation. Fig. 4 depicts how the different subsystems interact. Every cycle (the 𝑖th cycle is represented) starts with the CFD computation of 𝑁𝐶𝐹 𝐷 solved timesteps. These results are kept in memory, and just a small subset of 𝑁𝑤,𝐶𝐹 𝐷 timesteps (green squares) are stored on disk at a given write interval. Then, the last three written timesteps (also known as snapshots) serve as input for the DNN after a proper transformation (T) of the CFD results into a format that the DNN solver can process. Next, the DNN computes 𝑁𝐷𝑁𝑁 predicted timesteps as output (orange squares). The cycle ends with the parsing (P) from the three-dimensional DNN format to the CFD flat-array domain so that the next cycle starts. These cycles can be repeated as many times as needed to provide the flow evolution. In this work, the cycle is composed of 𝑁𝑤,𝐶𝐹 𝐷 = 10 written timesteps followed by 𝑁𝐷𝑁𝑁 = 10 predicted timesteps. The election of three time steps for DNN input intents to capture the acceleration that theoretically corresponds to the second derivative of the displacement. The 10-timestep output is chosen as a tradeoff between performance and accuracy, which for this specific study returned appropriate results. The presented hybrid solver employs OpenFOAM and Keras/ Tensorflow. In this regard, OpenFOAM velocity files for every written timestep are transformed into NumPy [32] arrays (T). The NumPy Journal of Computational Science 62 (2022) 101741 4 S. Iserte et al. Fig. 3. Computational mesh of the discretized domain depicted in Fig. 2. Range of X-axis: [-2.44:5.98]. Range of Y-axis: [-2.48:2.48]. Range of Z-axis: [0:2.4]. Fig. 4. Hybrid CFD-DNN model scheme. arrays returned by the DNN are parsed to the OpenFOAM expected file format (P). Through these format conversions, the hybrid solver intertwines both subsystems. The OpenFOAM format represented in a cartesian system in Fig. 3 has to be transformed to an equidistant space handled by NumPy. Each point in the OpenFOAM domain matches a cell in the NumPy tensor of shape 117 ×86 ×38, corresponding respectively to axes X, Y, and Z of the domain (see Fig. 5). For this purpose, the primarily structured mesh of 382,356 cells is shrunk to 374,400 by setting to zero the cells that correspond to the interior of the buildings (these nodes are removed from the CFD mesh). This conversion can be easily done thanks to the multiblock-structured nature of the mesh with matching cell faces. Figs. 5(a) and 5(c) represent the same planes, once the domain is converted, of Figs. 3(a) and 3(b), respectively. As an example of the transformed domain representation, Figs. 5(b) and 5(d) show how the velocity field within the domain would be after 4s of time evolution (400 written timesteps). 4.1. Dataset generation The CFD simulations have been performed with OpenFOAM v2006 and executed in Tirant III supercomputer at Universitat de València Journal of Computational Science 62 (2022) 101741 5 S. Iserte et al. Fig. 5. NumPy representation of the domain with the shape (117, 86, 38) corresponding to dimensions X, Y, and Z, respectively. Range of X-axis: [0:116]. Range of Y-axis: [0:85] in (c) and (d). Range of Z-axis[0:37] in (a) and (b). (UV). The servers in this platform are equipped of two Intel Xeon SandyBridge E5-2670 sockets, and 32 GB of main memory. The dataset used for training and evaluating the neural network is composed of 31 transient CFD simulations. Details about these simulations and how they have been preprocessed to conform the dataset are described next. 4.1.1. CFD simulations The inflow conditions proposed by [33,34] were used to ensure a homogeneous Atmospheric Boundary Layer (ABL). They are implemented in OpenFOAM as the following utilities: •atmBoundaryLayerInletVelocity defines the average wind velocity profile represented by the logarithmic law: 𝑈(𝑧) = 𝑢∗ 𝜅ln (𝑧+𝑧0 𝑧0),(1) where 𝜅is the von Karman constant (𝜅= 0.4), 𝑧0[m] is the aerodynamic roughness length, and 𝑢∗[m/s] is the friction velocity, given by 𝑢∗=𝜅𝑢𝑟𝑒𝑓 ln (𝑧𝑟𝑒𝑓 +𝑧0 𝑧0),(2) where 𝑢𝑟𝑒𝑓 [m/s] is the user-defined reference velocity at a reference height 𝑧𝑟𝑒𝑓 [m]. •atmBoundaryLayerInletK defines the default generalized log-law for the turbulent kinetic energy. •atmBoundaryLayerInletOmega defines the default inlet profile for the specific dissipation of the eddies. Notice that slip (free-slip) conditions are used for the lateral and top boundaries of the domain; while zero gradient condition is applied to the outflow boundary. The transient CFD simulations were initialized from a common steady-state CFD simulation to ensure an adequate smooth initialization of the transient solver. The steady-state simulation used a constant inlet profile with 𝑢𝑟𝑒𝑓 = 1 m∕s,𝑧𝑟𝑒𝑓 = 0.15 m and 𝑧𝑜= 0.001 m and was run up to convergence, defined at a root mean square error (RMSE) lower than 10−4. In these experiments, the transient simulations are run to simulate flow evolution to 𝑡= 6.51 s with a solving timestep of 0.001 s and a writing interval of 10. At second 6.51 the residual thresholds of the solver convergence criteria are lower than an RMSE of 10−5for all variables. In this regard, solutions are written to disk every 0.01 s of flow time. Consequently, DNN predicted timesteps comprise 0.01 s. During the first 0.5 s of evolution, 𝑢𝑟𝑒𝑓 is linearly increased from its initial value (1 m∕s) up to a value 𝑢𝑟𝑒𝑓 ,𝑒𝑛𝑑 , keeping this value for the rest of the execution. A total of 31 simulations were launched with 𝑢𝑟𝑒𝑓,𝑒𝑛𝑑 ranging between 3 m∕s (minimum velocity profile) and 6 m∕s (maximum velocity profile) in steps of 0.1 m∕s.Fig. 6 represents the minimum and maximum wind profiles. These profiles show, for each height (Y-axis), the expected velocity (X-axis). Notice that all the profiles configurations of 𝑢𝑟𝑒𝑓,𝑒𝑛𝑑 lie within these bounds. 4.1.2. Data preprocessing The dataset generation stage involves the methods of filtering, remapping, reshaping, standardizing, and splitting the data in order to produce a dataset that feeds the deep convolutional neural network. In this work, only the velocity field (in its three dimensions) within the physical domain is taken into account. For this reason, pressure or turbulence-related metrics are filtered out from raw data. Furthermore, the DNN training was focused on just the first two seconds of time evolution, which involves 200 written timesteps of the transient simulations. Simulations up to 𝑡= 2 s contain enough information for fitting the predictive model. After completion of this process, the initial dataset is composed of 31 cases of 200 timesteps each, with 374,400 three-component vectors corresponding to the velocity in the mesh cell locations. Journal of Computational Science 62 (2022) 101741 6 S. Iserte et al. Fig. 6. Inflow profiles for the cases with maximum and minimum values for 𝑢𝑟𝑒𝑓,𝑒𝑛𝑑 . As described in Section 3, the domain studied in this work relies on a structured mesh. To leverage the spatial arrangement of data, the next step rearranges the velocity flat array of 374,400 elements into a 3D space adapted to the convolutional kernels. The resultant domain, with dimension 117 ×86 ×38 (X, Y, and Z, respectively), counts with a total of 382,356 cells. Furthermore, the domain contains 7956 additional cells than the OpenFOAM flat array. These extra cells are associated with the buildings, and they are necessary for computing 3D convolutions. At this point, the dataset shape is 31 ×200 ×117 × 86 ×38 ×3, respectively describing the number of cases, number of written timesteps per case, cells in domain dimension X, cells in domain dimension Y, cells in domain dimension Z, and velocity dimensions. Since the proposed predictive model handles the velocity in three different neural networks, one per velocity dimension, the shape of each dataset is 31 ×200 ×117 ×86 ×38, where the components respectively correspond to the number of cases, number of written timesteps per case, cells in domain dimension X, cells in domain dimension Y, cells in domain dimension Z. Velocity values are then transformed to have a distribution of mean zero and standard deviation of one. The resultant dataset has a size in memory of 26.49 GB. Values are stored in a 32-bit floating point datatype. Finally, the dataset is split into train and test subsets. In particular, the cases are shuffled and 80% of them (for a total of 24 cases) are assigned to the training dataset, while the remaining seven cases to the testing dataset. In addition 20% of the training cases are used for cross-validation. 4.2. CNN training and evaluation The DNNs have been trained in CTE-Power at Barcelona Supercomputing Center (BSC) with the following software: Python 3.7.4, NumPy 1.18.4, Scikit-learn 0.23.1, and Keras 2.4 over Tensorflow [35] 2.3. Each CTE-Power node is equipped with two IBM Power9 8335-GTH processors, 512 GB of main memory, and four GPU NVIDIA V100 with 16 GB HBM2. The predictive model devised in this work is designed to provide multi-step predictions of a 3D variable. For this purpose, three independent identical convolutional neural networks have been implemented, one for each velocity dimension. These networks are composed of three 3D convolutional layers plus a dense layer, as Fig. 7 depicts. In the figure, for each layer, the input and output data shape is showcased. These layers expect data to be formatted as (mini-batch size,height,width,depth,timesteps). The mini-batch size is determined by the GPU memory which, for the proposed model, cannot fit larger mini-batches, and the last dimension, corresponding to the channels of the layers, is used to convey the consecutive timesteps. Fig. 7. CNN architecture per velocity dimension. For each layer it is indicated its type (leftmost) and the data shape in the input and output (rightmost). Dimensions at layers’ input/output correspond to mini-batch size, width, height, depth, and channels, respectively. Table 1 Training epochs and time per neural network. Dimension Epochs Time X 34 9,644 s Y 29 8,169 s Z 47 13,378 s Table 2 Aggregated errors of evaluation cases per velocity dimension. Dim. MSE Min. Max. Mean Std. dev. X8.31 × 10−4 1.03 × 10−1 6.75 × 10−3 5.20 × 10−4 Y1.50 × 10−3 2.37 × 10−1 1.28 × 10−2 5.33 × 10−3 Z1.78 × 10−3 1.74 × 10−1 1.69 × 10−2 2.16 × 10−3 The convolutional layers are configured with a kernel size of 3 × 3×3 with a padding set to zero. Furthermore, the padding type is defined to ‘‘same’’ which configures a same convolution where the output matrix is of the same dimension as the input matrix. The number of filters defined for the three layers is 64, 128, and 64, respectively. Non-linearity in the convolutional layers is realized with the LeakyReLU activation function, a variation of the rectified linear unit (ReLU) which allows small positive gradients when the unit is not active [36]. The dense layer counts with the number of neurons corresponding to the number of steps that will be predicted. Particularly, this layer is configured with 10 neurons meaning that the prediction will return 10 written timesteps. This dense last layer is activated linearly since it is a regression problem It is important to note that the network expects three observation samples as input. For this purpose, instead of using recurrent neural networks, we have used the channels of the input layer (last parameter of the input tensor) to convey the values of three consecutive written timesteps of a dimension of the velocity. Mini-batches are composed of four elements, and the model is compiled with the Adam optimizer [37], with a learning rate of 0.0001, to update weights and biases within the network, which relies on the mean square error (MSE) loss function: 𝑀𝑆𝐸 =1 𝑛 𝑛 ∑ 𝑖=1 (𝑦𝑖−𝑦′ 𝑖)2.(3) Each independent neural network, one per velocity dimension, has been trained using a GPU of CTE-Power cluster. Table 1 compiles the number of epochs and time employed in each training. The model is evaluated with the test subset composed of seven cases. Journal of Computational Science 62 (2022) 101741 7 S. Iserte et al. Fig. 8. CFD and Hybrid results comparison for six velocity magnitude profiles in a vertical plane 𝑌= 0 for different three times. (a, c, e) Comparisons of the vertical profiles; (b, d, f) Comparisons of the percentage difference. Table 2 shows the absolute errors of the evaluation for this subdataset. In this regard, testing cases have been independently evaluated and their errors aggregated with minimum,maximum,mean and standard deviation per dimension. When predicting the dimension X of velocity, the model is able to provide lower errors than for the other dimensions. Since the wind blows from the 𝑋-axis, this dimension contains more data diversity and the model is likely to learn more patterns. In contrast, axes Y and Z present more homogeneity in their data, which undermines pattern detection. As a result, the model encounters more difficulties to learn and predictions are not so accurate. A priori, the evaluation errors are acceptable since all the values have been standardized. Although maximum errors are not ideal, the mean and the standard deviation show small errors with low variance. 5. Results This section compares the hybrid model execution with the CFD simulation, as well as their performance. 5.1. Hybrid model evaluation Next, we illustrate the accuracy of the hybrid solver by performing an in-depth analysis of one of the cases. Since the standard deviation of the errors calculated during the evaluation of the predictive model (see Table 2) shows little variations when predicting the different cases of the test subdataset, an arbitrary case from the test dataset was selected (𝑢𝑟𝑒𝑓,𝑒𝑛𝑑 = 3.5 m∕s). In this subsection, we present the results Journal of Computational Science 62 (2022) 101741 8 S. Iserte et al. Fig. 9. CFD and Hybrid results comparison for six velocity magnitude profiles in a horizontal plane 𝑧= 0.1m for different three times. (a, c, e) Comparisons of the horizontal profiles; (b, d, f) Comparisons of the percentage difference. obtained with the proposed hybrid solver in different temporal and spatial points. Fig. 8 compares the resulting velocities of the CFD and hybrid solvers in three different instants: 𝑡= 2 s, 𝑡= 4 s, and 𝑡= 6 s. Figs. 8(a), 8(c), and 8(e) compare the velocity profiles at six vertical lines in the ZX plane, specifically at locations: 𝑥∕𝑏= −11,−7.54,−3,−1,1, and 3. Notice that 𝑥∕𝑏in the 𝑋-axis and 𝑧∕𝑏in the 𝑌-axis represent the non-dimensional horizontal and vertical distance, respectively. From these results, it is patent that the hybrid solver can properly capture the spatial–temporal evolution of the flow for most locations at any time. Only a small deviation from the CFD is observed at line 𝑥∕𝑏= 1 for 𝑡= 4 s, where the velocity magnitude is slightly under-predicted by the hybrid model. Figs. 8(b),8(d), and 8(f) directly compare the velocities at the same locations of their peer Figs. 8(a),8(c), and 8(e), respectively. The plots showcase the strong correlation in the studied points between CFD and hybrid solvers. Some discrepancies appear for the lowest velocities due to the recirculation regions behind the blocks, particularly in the high-rise building. Overall, the deviations remain below 20%, especially for high-velocity values. Fig. 9 shows the results corresponding to a horizontal plane 𝑍= 0.1 m, close to the ground. Again, some discrepancies are observed in the space between blocks, particularly behind the high-rise building due to the complex eddies generated behind it. Hybrid results at the majority points are adequate, with an average velocity difference lower Journal of Computational Science 62 (2022) 101741 9 S. Iserte et al. Fig. 10. The velocity vectors and contours in a vertical plane at 𝑌= 0 for CFD simulation (top) and Hybrid (bottom) at 𝑡= 6.51 s. Fig. 11. The velocity vectors and contours in a horizontal plane at 𝑍= 0.05 m for CFD simulation (top) and Hybrid (bottom) at 𝑡= 6.51 s. than 20%. The differences in a few locations are higher than 30% characterized by under-predicting the CFD results as mentioned above. Finally, Figs. 10 and 11 present the mean velocity contours and vectors in vertical (plane 𝑌= 0) and horizontal (plane 𝑍= 0.05 m) cross-sections. These results demonstrate that the CFD-DNN model captures the main trends of the flow, especially for the separation region around the blocks and recirculation region behind blocks, despite the small deviations in velocity values. 5.2. Performance analysis Once the hybrid solver is validated, in this section, we study its performance in terms of time compared with the traditional CFD solver. The interleaved predictions provided by the DNN in the hybrid solver are expected to reduce the time-to-solution by accelerating the flow simulation. For this purpose, the execution of the simulation case described in the previous section, (𝑢𝑟𝑒𝑓,𝑒𝑛𝑑 = 3.5 m∕s), is analyzed. All the executions described in this section have been run on a single core of a Tirant III server in an effort to provide a fair comparison. For evaluation purposes, the flow evolution has been extended to second 6.51 of the simulation, calculating a total of 652 written timesteps. Table 3 compares the experiment execution times for Table 3 Execution time comparison of case 𝑢𝑟𝑒𝑓,𝑒𝑛𝑑 = 3.5 m∕s. Solvers #Simulated TS #Predicted TS Execution time CFD 652 0 15,891.16 s Hybrid 322 330 11,018.57 s Table 4 Stages of a hybrid simulation. Notice that times in the time evolution stage are the average of the 32 cycles values. Stage Operation #Written timesteps Time 1. Boot Initialization – 2.08 s Simulation 2 75.10 s 2. Inference Generate DS – 5.57 s Prediction 10 38.20 s Regenerate DS – 11.59 s 3. Time evolution (32 cycles) Simulation 10 284.81 s Inference stage 10 55.36 s both approaches. The CFD solver computes all timesteps in nearly 15,900 s. The hybrid solver combines CFD and DNN leverages Open- FOAM to calculate 322 written timesteps and the DNN to infer 330 predicted timesteps. The results reveal that the hybrid solver reduces the execution time by more than 30%. In more detail, Table 4 analyzes the stages of the hybrid solver workflow digging deeper into its operations. The workflow begins with an initialization of the necessary data structures and file systems. During this operation, the predictive model is also loaded in memory. The boot stage also involves a two-written timestep CFD simulation, starting from the steady-state initialization (𝑡= 0 s) to end at 𝑡= 0.02 s. The three resulting written timesteps are used for the first inference of 10 predicted timesteps. The inference stage comprehends the operations of generating the dataset (T) for feeding the predictive model, the prediction, and the conversion (P) of the predicted timesteps into the OpenFOAM format, to continue with the simulation (recall Fig. 4). Finally, in the time evolution stage, the hybrid solver performs 32 cycles that combine CFD simulation and DNN inference. Particularly, every cycle is composed of 10 written timesteps and 10 predicted timesteps. 6. Conclusions This paper presents a novel hybrid methodology that combines CFD calculations and DNN. Compared with the variety of approaches that are being taken to integrate AI with physics simulations, the hybrid