Reconstructing Rayleigh-Benard flows out of temperature-only
  measurements using Physics-Informed Neural Networks
We investigate the capabilities of Physics-Informed Neural Networks (PINNs)
to reconstruct turbulent Rayleigh-Benard flows using only temperature
information. We perform a quantitative analysis of the quality of the
reconstructions at various amounts of low-passed-filtered information and
turbulent intensities. We compare our results with those obtained via nudging,
a classical equation-informed data assimilation technique. At low Rayleigh
numbers, PINNs are able to reconstruct with high precision, comparable to the
one achieved with nudging. At high Rayleigh numbers, PINNs outperform nudging
and are able to achieve satisfactory reconstruction of the velocity fields only
when data for temperature is provided with high spatial and temporal density.
When data becomes sparse, the PINNs performance worsens, not only in a
point-to-point error sense but also, and contrary to nudging, in a statistical
sense, as can be seen in the probability density functions and energy spectra.
Patricio Clark Di Leoni, Lokahith Agasthya, Michele Buzzicotti, Luca Biferale
Reconstructing Rayleigh-Benard flows out of temperature-only measurements using Physics-Informed Neural Networks

###### Abstract

We investigate the capabilities of Physics-Informed Neural Networks (PINNs) to reconstruct turbulent Rayleigh-Benard flows using only temperature information. We perform a quantitative analysis of the quality of the reconstructions at various amounts of low-passed-filtered information and turbulent intensities. We compare our results with those obtained via nudging, a classical equation-informed data assimilation technique. At low Rayleigh numbers, PINNs are able to reconstruct with high precision, comparable to the one achieved with nudging. At high Rayleigh numbers, PINNs outperform nudging and are able to achieve satisfactory reconstruction of the velocity fields only when data for temperature is provided with high spatial and temporal density. When data becomes sparse, the PINNs performance worsens, not only in a point-to-point error sense but also, and contrary to nudging, in a statistical sense, as can be seen in the probability density functions and energy spectra.

keywords: keyword1, Keyword2, Keyword3, Keyword4

## 1 Introduction

Understanding the type and quantity of information needed to reconstruct the state of a physical system carries important implications for both its fundamental study and its real-world applications. In this work we analyze this question for the case of thermally driven flows. Thermally driven flows are at the core of several geophysical and industrial systems such as, atmospheric convection, [1; 2], oceanic convection [3], mantle convection [4] and pure-metal melting [5]. These flows can exhibit a wide variety of behaviors and structures, ranging from plume formation to fully developed turbulence [6]. It was first conjectured by Charney [7] that temperature measurements alone are enough to reconstruct the whole state of the atmosphere. This conjecture has been studied both theoretically and numerically in simple convective systems [8; 9], 3D Planetary Geostrophic models [10], and Rayleigh-Benard flows in non-turbulent regimes [11; 12], in the infinite Prandtl number limit [13], and at moderate and high Rayleigh
lows_

These studies showed the importance of setting a correct velocity prior to get a good reconstruction [11], and the fragility to get a time-independent full synchronization at high Rayleigh numbers [12; 14]. A deeper understanding of the Charney conjecture is then important not only to elucidate the interplay between velocity and temperature but also to improve current forecasts and Data Assimilation [15; 16] schemes. The aim of this paper is to continue the work presented in [14] in 2D turbulent Rayleigh-Benard flows. Whilst the original work used Nudging [17; 18; 19], a synchronization equations-based DA tool, to reconstruct the flows, we now use Physics-Informed Neural Networks (PINNs). PINNs are neural networks designed to approximate the solution of systems of partial differential equations [20]. They have been used in inverse problems with partial information [21; 22], to reconstruct turbulent flows out of measurements [23; 24; 25; 26], and to assimilate statistical data into synthetically generated fields [27]. For detailed reviews on PINNs, see [28; 29]. Using a flow coming from a Direct Numerical Simulation of the 2D Rayleigh-Benard system at two different Rayleigh numbers, one moderate and one high, we use PINNs to perform reconstructions using varying amounts of data, characterized by the separation distance between measuring probes. We show that PINNs are successful at the task, even at high Rayleigh numbers, where the correlations between the temperature field (for which we provide information) and the velocity fields (for which we do not) diminish.

The paper is organized as follows, in Sec. 2.1 we introduce the Rayleigh-Benard equations and describe the data generation procedures while in Sec. 2.3 we describe the PINN technique and how it is applied in this context. Results are presented in Sec. 3 and conclusions in Sec. 4.

## 2 Methods

### Rayleigh-Benard flows and data generation

Rayleigh-Benard convection consists of a planar horizontal layer of fluid that is heated from below with respect to gravity. If density fluctuations are small, the Boussinesq approximation may be employed and the fluid can be described in terms of an incompressible velocity field plus a temperature field. Taking \(\mathbf{u}=(u,v)\) to be the horizontal and vertical components of the velocity field, respectively, \(T\) the temperature and \(p\) the pressure, in a 2D geometry and with the average temperature set to zero and the density to unity the equations take the form

\[\partial_{t}\mathbf{u}+(\mathbf{u}\cdot\nabla)\mathbf{u}=-\nabla p+\nu\nabla^ {2}\mathbf{u}-\beta Tg\hat{z}, \tag{1}\] \[\frac{\partial T}{\partial t}+\mathbf{u}\cdot\nabla T=\kappa\nabla^ {2}T, \tag{2}\]

where \(\beta\) is the thermal expansion coefficient of the fluid, \(\nu\) is its kinematic viscosity, \(\kappa\) its thermal conductivity and \(g\hat{z}\) the acceleration due to gravity. The domain is \(L_{x}\) wide and \(L_{z}\) tall and has periodic boundary conditions in the horizontal direction \(\hat{x}\). At the top and bottom boundaries, the boundary conditions are

\[\begin{split} T(z=0)=T_{d},\qquad T(z=L_{z})=-T_{d},\\ \mathbf{u}(z=0)=\mathbf{u}(z=L_{z})=0.\end{split} \tag{3}\]

where \(T_{d}>0\). The characteristic velocity scale is given by \(u_{0}=\sqrt{gL_{z}\beta 2T_{d}}\) and the turnover time by \(\tau_{0}=2L_{z}/u_{0}\). Several dimensionless numbers can be used to describe Rayleigh-Benard flows. The Rayleigh number gives a measure of the ratio between buoyant and viscous forces and is given by

\[\text{Ra}=\text{g}\beta\frac{2\text{T}_{\text{d}}\text{L}_{\text{z}}^{3}}{ \nu\kappa}. \tag{4}\]

The Prandtl number is the ratio between momentum diffusivity and thermal diffusivity, namely

\[\text{Pr}=\frac{\nu}{\kappa}. \tag{5}\]

The Nusselt number measures the ratio of heat transfer due to convection versus that due to

Figure 1: Diagram of the PINN used.
conduction and is given by

\[\mathrm{Nu}=\frac{\langle\mathrm{vT}-\kappa\partial_{x}\mathrm{T}\rangle}{\kappa 2\mathrm{T}_{\mathrm{d}}/\mathrm{L}_{x}}, \tag{6}\]

where \(\langle.\rangle\) indicate the ensemble average over the whole domain. Finally, as an estimate of the size of the smallest scales of the system we define the Kolmogorov length scale \(\eta_{\kappa}=(\nu^{3}/\epsilon)^{1/4}\), where \(\epsilon=(\nu\kappa^{2}/L_{z}^{4})(\mathrm{Nu}-1)\mathrm{Ra}\) is the average rate of energy dissipation [30].

The reference, or ground-truth, flow of our numerical experiments was produced by evolving Eqs. (1)-(2) using a Lattice-Boltzmann method at two different Rayleigh numbers, \(\mathrm{Ra}_{1}=7.2\times 10^{7}\) and \(\mathrm{Ra}_{2}=36.3\times 10^{7}\). The reference flows are denoted by variables \(u^{r}\), \(v^{r}\), \(p^{r}\), and \(T^{r}\). Details on the numerical method can be found in [14]. In the first case \(L_{x}=864\delta\), \(L_{z}=432\delta\), \(T_{d}=2.5T_{0}\), and \(u_{0}=1.31U_{0}\), while in the second case \(L_{x}=1200\delta\), \(L_{z}=600\delta\), \(T_{d}=1.5T_{0}\), and \(u_{0}=2.12U_{0}\). In both cases \(\nu=6.67\times 10^{-4}\), \(\mathrm{Pr}=1\), \(\delta=1\), \(T_{0}=1/100\), \(U_{0}=1/100\), and \(\eta_{\kappa}\approx 2\delta\). In the first case \(\mathrm{Nu}\approx 25\), while in the second case \(\mathrm{Nu}\approx 39\). The flows were first allowed to reach a statistically stationary state and then data was extracted on a equally spaced rectangular grid of separation distance \(\ell\in[1:31]\delta\) at specific time intervals. In the first case, data was extracted over 8 separate time windows 11 snapshots long at a sampling rate of \(164/\tau_{0}\). In the second case, data was extracted over 10 separated time windows also 11 snapshots long but at a sampling rate of \(1130/\tau_{0}\), as this flow contains faster scales than the other one. Data was extracted over the whole spatial domain, except for the case with \(\ell=1\) at \(\mathrm{Ra}_{2}\), where the domain was split into four quadrants, thus necessitating four PINNs for the reconstruction of the whole domain. Each dataset \(\Omega_{d}\) is then identified by the Rayleigh number of the flow, the grid spacing \(\ell\), and the temporal window. The sets of collocation points \(\Omega_{p}\) where the physics part of the loss function is evaluated (see below) consist of all points where data part are evaluated, i.e. \(\Omega_{d}\), plus randomly selected points not necessarily lying on the \(\ell\)-spaced sampling grid. Note that as no data are used when evaluating the physics part of the loss function, we are not increasing the density of data used. The number of extra collocation points was 0, 0, 1, 2, 3, and 4 for every spatial position in \(\Omega_{d}\) for \(\ell/\delta=1,7,10,14,22\), and 31, respectively. To evaluate the PINNs' performances testing datasets \(\Omega_{t}\) consisting of the full fields, i.e., not subsampled in space, were used.

### Flow reconstruction using PINNs

Figure 1 shows a diagram of the PINN used in our experiments. The PINN takes coordinates \((x,z,t)\) as input and outputs fields \((u,v,p,T)\) at the specified coordinate. All PINNs presented here are five layers deep, have 100 hidden units in each layer and use ELU as activation functions. The loss function used to train them has the form

\[L=L_{d}+\lambda L_{p},\]

with the contribution given by the measured data is given by

\[L_{d}=\frac{1}{N(\Omega_{d})T_{0}^{2}}\sum_{j\in\Omega_{d}}|T(x_{j},z_{j},t_{ j})-T_{j}^{r}|^{2},\]

and the one given by the imposition of the correct equations of motion by:

\[L_{p}=\frac{\delta^{2}}{N(\Omega_{p})}\sum_{j\in\Omega_{p}} \left(\lambda_{u}U_{0}^{-4}f_{u}+\lambda_{T}T_{0}^{-2}U_{0}^{-2}f_{T}+\right.\] \[\left.\lambda_{i}U_{0}^{-2}f_{i}\right),\]

with

\[f_{u}=|\partial_{t}\mathbf{u}+(\mathbf{u}\cdot\nabla)\mathbf{u}+\nabla p-\nu\nabla^{2}\bm {u}+\beta Tg\hat{z}|^{2},\]

\[f_{T}=|\partial_{t}T+\mathbf{u}\cdot\nabla T-\kappa\nabla^{2}T|^{2},\]

and

\[f_{i}=|\nabla\cdot\mathbf{u}|^{2},\]

and where \(\lambda\), \(\lambda_{u}\), \(\lambda_{T}\) and \(\lambda_{i}\) are extra hyperparameters set fixed to \(10^{5}\), \(1\), \(10^{-1}\) and \(10^{3}\), respectively, throughout. The subsets of points \(\Omega_{d}\) and \(\Omega_{p}\) where the summations are evaluated are explained in the section above, \(N(\Omega_{d})\) and \(N(\Omega_{p})\) denote the number of point in the respective datasets. The PINNs were trained using the Adam algorithm with a learning rate of \(10^{-4}\) for \(60000\) epochs.
### Flow reconstruction using Nudging

Nudging is an equation-informed data assimilation tool, using the evolution of the Navier-Stokes equations (1) supplemented by a Newton relaxation term proportional to \(\alpha(T_{(}x_{j},z_{j},t_{j})^{r}-T)\) in the temperature evolution. The resulting equations take the form

\[\partial_{t}\mathbf{u}+(\mathbf{u}\cdot\nabla)\mathbf{u}=-\nabla p+\nu\nabla^{2 }\mathbf{u}-\beta Tg\hat{z}, \tag{7}\] \[\frac{\partial T}{\partial t}+\mathbf{u}\cdot\nabla T=\kappa\nabla^{ 2}T-\alpha\mathcal{I}(T^{r}-T),\]

where \(\alpha\) is the amplitude of the nudging term and has units of frequency and \(\mathcal{I}\) is a filtering operator equal to 1 where the data is available, i.e. the measuring probes, and zero otherwise. The idea in nudging is to force the equation of motion to "follow" the available information where it is available and leave the equations of motion to refill the gaps in the whole space-time domain. For further details about the optimal selection for the nudging parameter \(\alpha\) and how to interpolate in time and space the supplied data see [14]. In contrast with PINNs, Nudging naturally enforces all physical constraints everywhere, at the cost of evolving the partial differential equations on the entire domain.

### Error assessment

In order to assess the reconstructions obtained, we define the point-to-point error field for temperature and velocity as:

\[T_{\Delta}(\mathbf{r},t)=T^{r}(\mathbf{r},t)-T(\mathbf{r},t);\] \[v_{\Delta}(\mathbf{r},t)=v^{r}(\mathbf{r},t)-v(\mathbf{r},t). \tag{8}\]

Global normalized errors are then given by

\[\Delta_{T}=\frac{\langle T_{\Delta}^{2}(\mathbf{r},t)\rangle}{\langle T^{2}(\mathbf{r },t)\rangle};\hskip 28.452756pt\Delta_{v}=\frac{\langle v_{\Delta}^{2}(\mathbf{r},t )\rangle}{\langle v^{2}(\mathbf{r},t)\rangle}, \tag{9}\]

where \(\langle\cdot\rangle\) indicates the average over the entire domain. It is important to stress that no information on the temperature at the boundary was provided (similarly to what implemented for nudging).

The scale-by-scale analysis is performed by analyzing the energy spectra:

\[E_{f}(k)=\langle|\hat{f}(k,z_{0},t)|^{2}\rangle_{t}, \tag{10}\]

where \(f\) is the field studied (either \(v\), \(v_{\Delta}\), \(T\), or \(T_{\Delta}\)), \(\hat{f}(k,z_{0},t)\) are the Fourier coefficients of \(f\) calculated along the horizontal direction at position \(z_{0}=L_{z}/2\) and time \(t\), and \(\langle,\rangle_{t}\) denotes the time average.

Figure 2: Visualizations of temperature (top) and vertical velocity (bottom) for the flow with \(\text{Ra}_{2}\). The left column shows the reference data, the other three columns show the reconstructions obtained with \(\ell/\delta=1\), 14 and 31. The locations of the measuring probes (corresponding to the case with \(\ell=14\delta\)) are marked with white dots on top of \(T^{r}\). All visualizations share the same colorbar.
## 3 Results

Figure 2 shows visualizations of the reference temperature \(T^{r}\) and vertical velocity \(v^{r}\) of the flow with \(\mathrm{Ra}_{2}\) at a given time and their PINN-reconstructed counterparts, \(T\) and \(v\), for three reconstructions, one performed with \(\ell/\delta=1\), one with \(\ell/\delta=14\) and one with \(\ell/\delta=31\). The location of the temperature measuring probes (corresponding to the \(\ell/\delta=14\) case) are marked with white dots. These visualizations not only show the characteristics of the flow, but also give a qualitative glimpse into the overall results: PINNs are able to reconstruct/infer the velocity field using only temperature information, even at high Rayleigh number, but with clear difficulties to capture small-scales fluctuations, as shown by the blurred velocity configurations (middle and right bottom panels). To further stress this point, we show the horizontal profile at \(z_{0}=300\delta\) in Fig. 3 with three different \(\ell/\delta=1,14,31\) for temperature (top), and velocity (bottom). As seen, the temperature reconstruction almost overlaps with the reference data for all cases, except the one with \(\ell/\delta=31\). The reconstructed velocity field, on the other hand, is able to correctly match the large scale structure of the reference flow, but is missing smaller scale features. Furthermore, the effects of not enforcing periodic boundary conditions along the horizontal direction can be clearly seen in the \(\ell/\delta=31\) case.

To put matters into quantitative terms, in Fig. 4 we show \(\Delta_{T}\) and \(\Delta_{v}\) obtained for the different \(\ell/\delta\) and the two Rayleigh numbers. The figures also show the results obtained via Nudging presented in [14]. As shown on the top panel of Fig. 4 for the case of the temperature field, PINNs and Nudging perform similarly. On the other hand, concerning the most interesting -and difficult- question of reconstructing the velocity field, in the bottom panel we show that PINNs outperform Nudging when the supplied temperature is dense enough in space \(\delta/\ell\sim 1\), while it is comparable with Nudging for sparse data, \(\delta/\ell<8\times 10^{-2}\).

In Fig. 5 (top) we show the temperature spectra at \(y_{0}=300\delta\) of the reference flow and of the reconstructions obtained with \(\ell=1\delta\), \(14\delta\), and \(31\delta\) for the high Rayleigh number case, while in the bottom panel we show the the spectra of the reference field superimposed with the spectra of the error \(T_{\Delta}\). A Hanning window was applied to the reconstructed fields to cure any effects of non-periodicity. The vertical dash-dotted red line marks where \(k\delta=14\) and the veritcal dotted green line where \(k\delta=31\). As expected from the previous analysis, the overall errors are small and mostly concentrated in the small scales, although in the \(\ell=14\delta\) and \(31\delta\) cases, these are still bigger than the scale set by \(\ell\). Figure 6 shows the corresponding spectra of the vertical velocity, with the addition of the result obtained via nudging [14] for \(\ell/\delta=14\). Here, only in the case with \(\ell/\delta=1\) the PINN produces a physically meaningful energy spectrum, while the spectra obtained via nudging is very similar to the reference one. In accordance with Figs. 2 and 3, the cases with higher \(\ell/\delta\) can only properly reconstruct the position and shape of the largest structures of the flow, but fail to produce the small-scale structures observed at these Rayleigh numbers. The energy spectra of the reconstruction thus decay very rapidly.

Finally, in Fig. 7(a) and (b) we show the probability density functions (excluding the regions close to the walls) of temperature and vertical velocity, respectively for the case with \(\mathrm{Ra}_{2}\). As expected, temperature statistics are well reproduced for all \(\ell\) presented, while velocity statistics are only close to accurate when \(\ell=1\), otherwise the probability density function start resembling a Gaussian.

## 4 Conclusions

Machine and deep learning techniques are becoming well-established tools in the Data Assimilation world. We show that it is possible to reconstruct Rayleigh-Benard velocity fields having access only to time-resolved point-wise temperature measurements using PINNs. We investigate two different Rayleigh numbers at \(7.2\times 10^{7}\) and \(3.6\times 10^{8}\). In order to assess the accuracy of PINNs we compare the results against a baseline given by Nudging [14]. PINNs achieve an accuracy comparable to Nudging for the smallest Rayleigh number and a better accuracy for highest Rayleigh case when the temperature data are supplied at high spatial frequencies. On the other hand, when temperature is too sparse, PINNs fail to produce meaningful results, while Nudging still produces physically valid solutions. We interpret this as a lack to enforce the correct physical constraints when data
are not dense enough. As seen in other works [26; 29], PINNs can struggle with high-frequency components, a major problem in multi-scale turbulent data where information is key also at small-scales and high-frequencies. It is important to remark that while the results presented can be considered promising, we do not claim they are optimal under any criteria, better results may be obtained with a different choice of hyperparameters, a slight modifications to the architecture [25], by enforcing periodicity in the horizontal direction via Fourier features [31], or by splitting the domain into smaller subsections [32]. It is out of the scope of this work to perform an exhaustive and meaningful hyperparameter scan. This work can be considered another exploratory attempt to systematic assess ML tools for reconstructing multi-scale turbulent fields, imposing physics constraints. Our intention here is to stress the importance to compare with other baselines (here Nudging is used), the need -in future works- to explore a wider range of Rayleigh (here limited to \([10^{7}:10^{8}]\)) and to jump to full \(3d+1\) space-time domains, the need to distinguish point-based reconstructions (here assessed in term of \(L_{2}\) norm, and spectral errors) from statistical reconstruction (here assessed with spectral and probability density functions). As far as this study shows, when data are sparse, PINNs performance worsens. Contrary to Nudging, the obtained reconstructed fields not only have a high point-to-point error but also have incorrect energy spectra and statistics.

## Declarations

The datasets generated during and/or analysed during the current study are available from the corresponding author on reasonable request.

Figure 4: Global temperature errors \(\Delta_{T}\) (top) and global velocity errors \(\Delta_{v}\) (bottom) as a function of \(\delta/\ell\). Full markers denote the results for the case with \(\text{Ra}_{1}\), while empty markers denote the case with \(\text{Ra}_{2}\). The orange circular markers are the results obtained with PINNs, while the blue square markers are for the results obtained via nudging (extracted from [14]). Both figures share the same legend.

Figure 3: Temperature (top) and velocity (bottom) profiles for the case with \(\text{Ra}_{2}\). The reconstructions shown were obtained using \(\ell/\delta=1\), \(14\), and \(31\). Both figures share the same legend.
L.A. and P.C. conceived and carried out the numerical experiments, and analyzed the results. All authors worked on developing the main idea, discussed the results and contributed to the final manuscript.

This project has received partial funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme (Grant Agreement No. 882340)).
