Dynamic mode decomposition of numerical data in natural circulation

Dynamic mode decomposition (DMD) has been used for experimental and numerical data analysis in fluid dynamics. Despite of its advantages, the application of the DMD methodology to investigate the natural circulation in nuclear reactors is very scarce in literature. In this paper it is applied the traditional DMD and its variation, the sparsity-promoting dynamic mode decomposition (SPDMD), for analysis of temperature and velocity fields. These datasets are generated by computational simulation of an experimental setup in reduced scale, similar to a heat removal system by natural circulation of a pool-type research reactor. Firstly the numerical data is partitioned, using a space-time correlation approach, in order to identify fundamental sequences to compute the dynamic modes. Next, the DMD and SPDMD methodologies are applied over each subsequence to obtain the dynamic modes of the temperature and velocity fields. Finally the flow fields are reconstructed and compared with the original numerical data. The conclusion is that the SPDMD performs better than DMD to represent both the temperature and velocity data.


INTRODUCTION
The natural circulation is a very important matter with great interest in the nuclear reactor thermal-hydraulics. Many studies concerning the heat removal of a nuclear reactor by natural circulation have been carried out in the last two decades, to more clearly understand the physical phenomena and to develop methods for simulating the thermal hydraulic behavior in a passive reactor cooling mode [1][2][3][4]. Theoretical models for prediction of single-phase and two-phase natural circulation flow parameters have been developed. Although these models have the ability to predict important flow parameters such as the pressure gradient, average phase velocities and void fractions, they are not capable to predict the flow structure itself. Moreover, the flow structure evolution may differ from that of forced convection flows [5], [6]. When a nuclear reactor is submitted to natural circulation conditions, a movement of the working fluid occurs from the hottest regions to the colder ones, resulting in a heat removal from the hottest regions. When this phenomenon is established, it has a heat exchange cycle that does not depend on any external mechanisms, for example, a pump. From this moment, the velocity fields control depends only on the phenomenon and any variation in the velocities should be attributed to buoyancy forces, which can be related with temperature variations in the system. In a particular case of a pool type research reactor after a shutdown, the heat is transferred by natural circulation from the core to a pool water upward through the core [7].
More recently the occurrence of the natural circulation in nuclear research reactors has been described in the literature by studies focusing mainly: the prevention of a severe accident [8], the effect of an unprotected reactivity insertion on the dynamic response of Materials Testing Reactor -MTR research reactors under natural circulation regime [9], the investigation of flow reversal from downward forced to upward natural circulation [10], the stability of the natural circulation and its suppression due to the presence of oscillations [11], [12].
Since its proposal in [13], the dynamic mode decomposition (DMD) has been used for numerical and experimental data analysis in fluid mechanics to identify low-order dynamics. The DMD formulates the flow time series as a Krylov sequence [14] by assuming a linear mapping that connects the flow field at a time step to the subsequent flow field at time + ∆ . Then, given a sequence of flow snapshots, the DMD technique performs the singular value decomposition (SVD) of the data matrix composed by the first − 1 flow snapshots and applies preprocessing step using the SVD result to get a robust computation of the proper modes of the data sequence. The DMD approach and its variant, named sparsity-promoting DMD (SPDMD) [15], have been successfully applied for numerical data generated through Navier-Stokes codes and experimental data measurements.
In the standard DMD as well as in the SPDMD the reasoning to set is that, adding further flow fields v to the data sequence will not improve the vector space spanned by 1  (or may not) contains the other one as a subspace. This issue is particularly interesting to be investigated in natural circulation flows due to the possibility to assess itself the flow structure to study instabilities (oscillations), in single-phase and two-phase flows, as they can cause damages to the system due excessive pressure, temperature or vibration variation.
In this paper, as case study, we apply the DMD and SPDMD methodologies on numerical data, composed by time-varying temperature and velocity, generated by computational simulation of an experimental setup working under single-phase natural circulation flow. So, we apply the methodology proposed in [19] in order to set the best value for . Next, we take each flow field and compare DMD and SPDMD regarding to flow patterns preservation and dimension of dynamic mode representation (compact representation). In the case of temperature we notice that both SPDMD and DMD reconstructed data preserve the flow fields but the former allows a more sparse (compact) representation. The same was verified for the velocity field. Consequently, we conclude that SPDMD outperforms traditional DMD in the performed tests. In the text remaining, we firstly summarize the DMD and SPDMD in section 2. Then, section 3 describes the methodology proposed in [19]. The computational setup is discussed in section 4. The results are presented in section 5. Finally, we show conclusions and future works (section 6).

Ramos et al. Author et al. • Braz. J. Rad. Sci. • 2020
The key idea behind SPDMD is to change the objective function in expression (2) in order to introduce sparsity in the dynamic mode representation but keeping the quality of the reconstruction. This is implemented by solving the optimization problem: , where ̂= (̂1,̂2, ⋯̂), Φ and are the same matrices of expression (2), and ∈ ℝ controls the sparsity of the solution. Once problem (4) is solved, the second step of SPDMD technique adjusts the values of the non-zero entries of ̂ in order to optimally approximate the entire data sequence. That means, we solve the problem (4) with = 0, but subject to ̂= 0 where ∈ ℝ × encodes information about the sparsity structure of the vector ̂ (see [15] for details).

METHODOLOGY
A critical value in the DMD techniques of previous section is the sub-sequence size N. So, in order to compute N, we apply the method presented in [19] and firstly perform a coarse temporal data segmentation using a simple similarity measure, the cross-correlation defined by [16]: where and .
The lower/higher values of the cross-correlation (5) indicate the evolution in time of different flow configurations, given a guess about fundamental sub-sequences. To smooth the correlation signal, we apply the total variation filter [20], generating a smooth signal ( ) , +1 . This iterative technique depends on two parameters: smoothing parameter λ and number of iterations , which we set by trial and error.
The obtained function is the input for a discrete differentiation filter, combined with a simple thresholding operation, that highlights the points of transition in the numerical frame sequence. Let us suppose that such transitions happen for ∈ { 1 , 2 , ⋯ , }, with 1 < 2 < ⋯ < . From this result, we generate M segments given by the subsequences [1,1 ], [1,2 ], ⋯ , [1, ]. We take into account the rank of each segment obtained in order to compute the DMD and SPDMD dynamic modes for each interval [1, k], denoted by , and ̂, , respectively. Then, each segment is analyzed considering the norm of the residuals of DMD, computed by the frame-to-frame error ( ) and the root mean square error( ) given, respectively, by: where is the dimension of the data vectors, ∈ { 1 , 2 , ⋯ , }, and ∈ { 1 , 2 , ⋯ , , } .
When ≠ we call the result a local reconstruction error, otherwise ( = )we say that we calculate global reconstruction errors. The idea is to choose an interval with low global and low local reconstruction errors. We can choose the best [1, ] interval to compute the DMD dynamic modes by solving the optimization problem [19]: where: since, the first term ( , ) is the global reconstruction error obtained when computing DMD using the interval [1, k] and the second term ( , ) is the local reconstruction error in the same interval.
However, to compute ( , ) we need to calculate DMD technique using the interval [1, k] but reconstruct (N − 1) >k frames using the obtained dynamic modes. To perform this task, we must solve the optimization problem (2) but, in this case, Φ is related to the SVD decomposition of 1 −1 instead of 1 −1 . We solve this generalized version of problem (2) by noticing that (see [19]): Hence, if we define Ψ ( ) ≡ [ 1 1 2 2 ⋯ ] , we can follow [19] and compute the solution of this generalized version of problem (2) through: where Considering that the SPDMD tries to optimize the data representation in the dynamic mode subspace, we take the solution of (8) to compute the SPDMD technique. We follow the SPDMD methodology available in [18] and seek for a near-optimum value for parameter γ by considering a with the vector and matrix B yielded using the SPDMD dynamic modes with ̂ ≠ 0. In this case, we want to obtain a desirable tradeoff between the quality of approximation and the number of modes that are used to approximate the time series. Therefore, we set with a value that gives low global reconstruction error as well as high sparsity.
Next, we take each data sequence and compare DMD and SPDMD regarding to the flow pattern preservation and compact representation. Both techniques are computed using the best interval

EXPERIMENTAL AND COMPUTATIONAL SETUPS
The experimental setup is shown in Figure 1.

RESULTS
In this section we present results by comparing reconstructions of numerical data that are obtained by DMD and SPDMD methodologies. Firstly, we consider the traditional DMD and apply the methodology of section 3 to find the number of snapshots used to compute the dynamic modes. Next, we apply the SPDMD using the obtained N to complete the analysis. The implementation is performed using Matlab resources.
The whole frame sequence has 16,077 numerical snapshots holding the velocity and temperature fields represented using a computational grid with 900,438 elements. Despite of the large number of numerical frames, we take only the last 41 ones for the analysis because they are more representative of the prototype operating temperature. In each time step, the temperature is represented as an array with 900,438 elements while the velocity field is reshaped in a vector with 3×900,438 = 2,701,314 entries. We start with the velocity dataset. Following the steps of section 3, we compute the cross-correlation through expression (5), shown in Figure 2.(a). Then, the total variation technique [20] is used to process that result, to obtain a smoother signal shown in Figure   2.(b). Following, the differentiation operator is applied, given the result pictured in Figure 2. Next, we compute the traditional DMD for each interval, and perform local as well as global reconstructions using each DMD basis. In this case, the singular values of the matrices 1 −1 , ( 1 = 6, 2 = 35, 3 = 40) are non-null. So, we consider full rank matrices ( = − 1) compute the DMD for each interval as well as the local reconstruction errors, given by expression (7) with   to each other and that SPDMD uses a sparse alpha vector (2 non-null entries among 39 ones) we can say that SPDMD outperforms DMD in the velocity field analysis.
If we apply the same methodology used above to analyze the temperature field, that falls in the range [360.20,528.10] (in Kelvin), we get the intervals [1,3] and [1,40] calculated using the crosscorrelation, followed by thresholding of the differentiation. The best segment is [1,40], computed by solving expression (8). Then, we seek the optimum gamma to compute SPDMD dynamic modes using a list of 20 values logarithmically spaced from 10 to 600. The analysis of the global reconstruction error and number of non-zero alphas versus gamma gives = 164.675 as the best choice that generates an alpha vector with seven non-null elements. Figure 6 shows the real (Figure However, once SPDMD uses a sparse alpha vector (7 non-null entries among 39 ones) and gets a global reconstruction error lower than DMD, we can say that the former outperforms the latter for the temperature data analysis.

CONCLUSION
In this work, we compare the DMD and SPDMD to analyze numerical data in natural circulation. We apply a methodology proposed in [19] to set the number of snapshots used to compute the dynamic modes. Finally, we compare DMD and SPDMD results regarding to flow preservation and compact representation. Although both SPDMD and DMD perform almost equal in terms of reconstruction quality, we notice that SPDMD outperforms DMD because it gives a more compact representation in the tests. Further works are undertaken to exploit low-rank tensor decompositions within the DMD methodology to analyze the velocity field.