# Quantitative assessment of PINN inference on experimental data for gravity currents flows

Mickaël Delcey, Yoann Cheny, Jean Schneider, Simon Becker, Sébastien

Kiesgen de Richter

► To cite this version:

Mickaël Delcey, Yoann Cheny, Jean Schneider, Simon Becker, Sébastien Kiesgen de Richter. Quantitative assessment of PINN inference on experimental data for gravity currents flows. Machine Learning: Science and Technology, 2025, 6 (1), pp.015032. 10.1088/2632-2153/adaca0. hal-05103923

HAL Id: hal-05103923

https://hal.science/hal-05103923v1

Submitted on 9 Jun 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
PAPER • OPEN ACCESS

# Quantitative assessment of PINN inference on experimental data for gravity currents flows

To cite this article: Mickaël Delcey et al 2025 Mach. Learn.: Sci. Technol. 6 015032

View the article online for updates and enhancements.

## You may also like

- Polynomial differentiation decreases the training time complexity of physics-informed neural networks and strengthens their approximation power

Juan-Esteban Suarez Cardona and Michael Hecht

- Accelerating physics-informed neural network based 1D arc simulation by meta learning

Linlin Zhong, Bingyu Wu and Yifan Wang

- Spectrally adapted physics-informed neural networks for solving unbounded domain problems

Mingtao Xia, Lucas Böttcher and Tom Chou
<figure><img src="image_2.png" /></figure>

CrossMark

OPEN ACCESS

RECEIVED

8 February 2024

REVISED

28 July 2024

ACCEPTED FOR PUBLICATION

21 January 2025

PUBLISHED

10 February 2025

Original Content from
this work may be used
under the terms of the
Creative Commons
Attribution 4.0 licence.

Any further distribution
of this work must
maintain attribution to
the author(s) and the title
of the work, journal
citation and DOI.

<figure><img src="image_3.png" /></figure>

PAPER

# Quantitative assessment of PINN inference on experimental data for gravity currents flows

Mickaël Delcey¹,*, Yoann Cheny¹, Jean Schneider¹, Simon Becker¹ and Sébastien Kiesgen De Richter¹,²

¹ LEMTA, Université de Lorraine, CNRS, 2, Avenue de la Forêt de Haye, B.P. 160, 54500 Vandœuvre-lés-Nancy, France

² Institut Universitaire de France (IUF), Paris, France

* Author to whom any correspondence should be addressed.

E-mail: mickael.delcey@loria.fr

**Keywords:** physics informed neural networks, gravity currents, experimental measures, fluid mechanics

## Abstract

In this paper, we apply physics informed neural networks (PINNs) to infer velocity and pressure field from light attenuation technique (LAT) measurements for gravity current induced by lock-exchange. In a PINN model, physical laws are embedded in the loss function of a neural network, such that the model fits the training data but is also constrained to reduce the residuals of the governing equations. PINNs are able to solve ill-posed inverse problems training on sparse and noisy data, and therefore can be applied to real engineering applications. The noise robustness of PINNs and the model parameters are investigated in a 2 dimensions toy case on a lock-exchange configuration, employing synthetic data. Then we train a PINN with experimental LAT measurements and quantitatively compare the velocity fields inferred to particle image velocimetry measurements performed simultaneously on the same experiment. The results state that accurate and useful quantities can be derived from a PINN model trained on real experimental data which is encouraging for a better description of gravity currents.

## Introduction

In recent years, advances in deep learning [1] and the universal approximation nature of neural networks offer new possibilities in fluid mechanics [2]. However, some physical systems remain beyond the reach of purely data-driven models due to their chaotic nature and limited data availability. To address this, Raissi et al [3] recently introduced the physics-informed neural network (PINNs) approach. PINNs can solve forward and inverse partial differential equation (PDE) problems by incorporating prior knowledge of physical laws, constraining the neural network to adhere to a set of PDEs. This approach has quickly demonstrated its effectiveness on various non-linear problems, both forward [4], and inverse [5] (see [6] for a complete review). PINNs are particularly suitable for dealing with noisy and incomplete data, as well as ill-posed problems, making them ideal for addressing complex reconstruction problems in fluid dynamics. In fluid mechanics, reconstruction problems aim to determine the complete flow field, denoted as **v**, from limited information, such as partial measurements or incomplete physics. One of the most challenging types of reconstruction problems is inferring the full velocity and pressure fields from partial measurements of a single component of **v**, such as concentration, temperature, or density fields, with the constraint that only one realization of the flow can be performed. This is particularly difficult when dealing with complex, non-linear governing equations like the Navier-Stokes equations. In this context, linear methods such as proper orthogonal decomposition [7], dynamic mode decomposition [8], and standard regression methods are inadequate due to the inherent nonlinearity of the problem and the lack of sufficient data on the quantities of interest. These methods fail to capture the complex interactions within the flow fields accurately. Additionally, data assimilation techniques [9], while powerful, are not suitable due to the ill-posed nature of the problem and their computational intensity. Given these challenges, PINNs emerge as one of the few viable methods that can effectively address this reconstruction problem. In [10], Raissi et al successfully reconstructed the velocity and pressure fields from synthetic measurements of passive scalar
concentration for the canonical flow past a cylinder. This method was also tested with Gaussian noise, demonstrating its robustness under noisy conditions. In [11] the authors reconstructed accurately the velocity and pressure fields from temperature field in a synthetic case of forced convection. While PINNs have been frequently used for reconstruction problems on synthetic data, there are few examples of their application to experimental data. One major contribution is [12], in which Kaniadakis et al used a PINNs model to infer the velocity and pressure fields from experimental measurements of temperature obtained via background oriented Schlieren (BOS) [13] for a flow over an espresso cup. However, the velocity fields inferred were only validated through a qualitative comparison with particle image velocimetry (PIV) [14] measurements in a companion experiment. Recently, PINNs have also been applied to BOS data to reconstruct high-speed flow fields [15], but no validation of the velocity field is available. In this paper, we aim to take a step further and demonstrate a quantitative comparison between the velocity fields predicted by PINNs and those measured by PIV. To achieve this, we consider gravity currents [16] the canonical flow of this physical phenomenon: the lock exchange [17], which we have previously studied in another work [18]. This flow is complex and governed by the Navier-Stokes equations coupled with the transport of density. Our experimental setup couples density measurements obtained by the light attenuation technique (LAT) [19] and velocity measurements by PIV in the same experiment. We will train a PINN model using the LAT density data and compare the velocity fields predicted by the model with those obtained from PIV measurements for a single realization of the flow. In all subsequent discussions, we will consider only the 2D governing equations. Conducting such a comparison requires making a strong assumption of a 2D model, which is commonly made in the study of gravity currents [20]. This assumption will be discussed at the end of the article. The governing equations of gravity currents flow and the principles of PINNs will be discussed in sections 1 and 2, respectively. In section 3 we calibrate the model hyperparameters on a digital twin of the experimental apparatus of the lock exchange configuration and study the noise robustness of PINNs on synthetic data. In section 4, we will focus on the application of PINNs to experimental data from the lock-exchange experiment. We will use the PINNs model to reconstruct the velocity and pressure fields from LAT experimental measurements and then compare these reconstructed velocity fields with PIV measurements obtained simultaneously during the same experiment. Finally, we will discuss the potential outcomes of the trained model for gravity currents.

# 1. Governing equations of lock-exchange gravity currents

In the lock exchange flow [17], fluids of different densities initially at rest are separated by a vertical membrane, in a tank. The fluids in the left and right hand compartments have the respective densities $\tilde{\rho}_1$ and $\tilde{\rho}_2$ with $\tilde{\rho}_1 > \tilde{\rho}_2$, the density gradient is caused for instance by salinity difference. Once the membrane is withdrawn, the density difference $\Delta\rho = \tilde{\rho}_1 - \tilde{\rho}_2$ between the two compartments induces the generation and propagation of a gravity current at the tank bottom. The intensity of turbulent structures and induced mixing in the current are controlled by the Reynolds number ($Re$), which is defined as $Re = \frac{UL}{\nu}$, where $U$ is the characteristic velocity, $L$ is the characteristic length, and $\nu$ is the kinematic viscosity of the fluid. Additionally, the mixing of scalar quantities is characterized by the Schmidt number ($Sc$), defined as $Sc = \frac{\nu}{D}$, where $D$ is the mass diffusivity. The flow is governed by Navier-Stokes, mass transport and incompressibility equations. Moreover, in this paper, we study gravity currents induced by small difference in density, so that Boussinesq approximation [21] is effective. A sketch of the tank setup can be seen in figure 1.

In order to render the equations dimensionless (see [22]), we use $\tilde{L}_y$ as the characteristic length scale and the characteristic velocity is the buoyancy velocity defined as :

$$ \tilde{u}_b = \sqrt{g \frac{\tilde{\rho}_1 - \tilde{\rho}_2}{\tilde{\rho}_a} \tilde{L}_y}, \quad \text{with} \quad \tilde{\rho}_a = \frac{\tilde{\rho}_1 + \tilde{\rho}_2}{2}. \qquad (1) $$

We consider small density difference $\tilde{\rho}_1 - \tilde{\rho}_2 \ll \tilde{\rho}_1$ for which the Boussinesq approximation can be adopted, thus the governing equations read in dimensionless form :

$$ \frac{\partial \mathbf{u}}{\partial t} + (\mathbf{u} \cdot \nabla) \mathbf{u} + \nabla p - \frac{1}{Re} \nabla^2 \mathbf{u} + \rho \mathbf{e}_y = 0, \qquad (2a) $$

$$ \frac{\partial \rho}{\partial t} + (\mathbf{u} \cdot \nabla) \rho - \frac{1}{ReSc} \nabla^2 \rho = 0, \qquad (2b) $$

$$ \nabla \cdot \mathbf{u} = 0, \qquad (2c) $$
<figure><img src="image_4.png" /><figcaption>Figure 1. Lock exchange tank: the lock-exchange configuration. At the initial moment, the wall is removed and the system evolves under the action of gravity only. The difference of density is achieved by a difference of salinity.</figcaption></figure>

where $\mathbf{u} = (u, v)^T$ denotes the dimensionless velocity vector. The non-dimensional pressure $p$ and density $\rho$ are given by:

$$p = \frac{\tilde{p}}{\tilde{\rho}_a \tilde{u}_b^2}, \quad \rho = \frac{\tilde{\rho} - \tilde{\rho}_2}{\tilde{\rho}_1 - \tilde{\rho}_2}. \qquad (3)$$

The Reynolds number $Re$ and the Schmidt number $Sc$ arising in the dimensionless equation (2) are defined by:

$$Re = \frac{\tilde{u}_b \tilde{L}_y}{\tilde{\nu}}, \quad Sc = \frac{\tilde{\nu}}{\tilde{\kappa}}, \qquad (4)$$

where $\tilde{\nu}$ is the kinematic viscosity and $\tilde{\kappa}$ denotes the molecular diffusivity of the chemical species producing the density difference.

## 2. PINNs

Artificial neural networks (ANNs) are known as universal approximators [23] so they can in theory learn any continuous function from observed data. A neural network consists of an input layer, one or more hidden layers, and an output layer. The layers are composed of nodes, also known as neurons, and each neuron is associated with a set of learnable parameters called weights and biases which are used to transform the input signals and compute the output of the model. An ANN of $N$ layers performs a series of computations, known as forward propagation, that transform the input vector $\mathbf{x}$ through each layer of the network until a final prediction $\mathbf{a}^{[N]}$ is obtained:

$$\mathbf{a}^{[1]} = \mathbf{x} \in \mathbb{R}^{n_1}, \qquad (5a)$$

$$\mathbf{a}^{[k]} = \sigma(W^{[k]} \mathbf{a}^{[k-1]} + \mathbf{b}^{[k]}), \quad 2 \le k < N, \qquad (5b)$$

$$\mathbf{a}^{[N]} = W^{[N]} \mathbf{a}^{[N-1]} + \mathbf{b}^{[N]}, \quad k = N. \qquad (5c)$$

Here $W^{[k]} \in \mathcal{M}_{n_k n_{k-1}}(\mathbb{R})$, $\mathbf{b}^{[k]} \in \mathbb{R}^{n_k}$ are the weights and biases of the $k$th-layers and $\sigma$ is a non linear transformation called activation function. $n_k$ is the number of neurons of the layer $k$.

The learnable parameters of the networks: $\theta = (W_k, b_k)_{k=2...N}$ are adjusted through the training process until they reach an optimal value $\theta^* = (W_k^*, b_k^*)_{k=2...N}$ that minimizes a loss function $\mathcal{L}$ which penalizes the mismatch between the network predictions and observed data:

$$\theta^* = \underset{\theta}{\operatorname{argmin}} \mathcal{L}(\theta), \qquad (6)$$

most of the time, for regression tasks, the loss function $\mathcal{L}$ is the Mean Squared Error between the observations $\{a_i\}_{i=1...N_{\text{data}}}$ and the corresponding predictions of the network $\{a^{[N]}(x_i)\}_{i=1...N_{\text{data}}}$ where $N_{\text{data}}$ is the size of the observed dataset.

The weights are updated at each training step, using the gradient descent:

$$\theta_{n+1} = \theta_n - \eta \nabla_{\theta} \mathcal{L}(\theta), \qquad (7)$$
where $\eta$ is called the learning rate.

The key point in the success of neural networks is backpropagation. Backpropagation [24] is an algorithm for computing the gradients of the loss function with respect to the learnable parameters in a neural network. Nowadays deep learning libraries such as Tensorflow/Keras [25] and Pytorch [26] include automatic differentiation (AD) tools [27] that allow an efficient computation of these gradients.

In the context of physics-informed neural networks (PINNs) [3], an ANN $v_N$ is used to approximate the solution $v$ of PDEs like:

$$ \partial_t v + \mathcal{D}_x [v] = 0, \quad x \in \Omega, \ t \in [0, T], \qquad (8a) $$

$$ v(x, 0) = h(x), \quad x \in \Omega, \qquad (8b) $$

$$ v(x, t) = g(x, t), \quad x \in \partial\Omega, t \in [0, T], \qquad (8c) $$

where $\mathcal{D}_x$ is a linear or non linear differential operator, $\Omega$, $\partial\Omega$, $[0, T]$ are respectively the spatial domain and his frontier, and the temporal domain. The terms $h|_{\Omega}, g|_{\partial\Omega, [0, T]}$ represent initial and boundary conditions, respectively. In this paper, we focus on two-dimensional problems, meaning that the position vector $x$ will be defined in terms of two coordinates, $x$ and $y$. Thus, $x = (x, y)$.

We define $f$ that represents the left-hand-side of (8a):

$$ f := \partial_t v + \mathcal{D}_x [v], \qquad (9) $$

$v_N$ takes as input $(x, t)$ and AD enables the computation of the derivatives of $v_N$ with respect to $x$ and $t$, thus we can get an explicit expression of $f(x, t)$, $\forall(x, t)$. This stage is the key instance of PINNs because AD does not introduce truncation errors due to numerical approximations as with conventional derivation methods. The objective function to minimize is expressed as:

$$ \mathcal{L} = \lambda_1 \mathcal{L}_f + \lambda_2 \mathcal{L}_b + \lambda_3 \mathcal{L}_0 + \lambda_4 \mathcal{L}_{\text{data}}, \qquad (10a) $$

$$ \mathcal{L}_f = \frac{1}{N_f} \sum_{i=1}^{N_f} \|f(\mathbf{x}_i^f, \mathbf{t}_i^f)\|^2, \qquad (10b) $$

$$ \mathcal{L}_b = \frac{1}{N_b} \sum_{i=1}^{N_b} \|v_N(\mathbf{x}_i^b, \mathbf{t}_i^b) - g(\mathbf{x}_i^b, \mathbf{t}_i^b)\|^2, \qquad (10c) $$

$$ \mathcal{L}_0 = \frac{1}{N_0} \sum_{i=1}^{N_0} \|v_N(\mathbf{x}_i^0, 0) - h(\mathbf{x}_i^0)\|^2, \qquad (10d) $$

$$ \mathcal{L}_{\text{data}} = \frac{1}{N_{\text{data}}} \sum_{i=1}^{N_{\text{data}}} \|v_N(\mathbf{x}_i^{\text{data}}, \mathbf{t}_i^{\text{data}}) - v(\mathbf{x}_i^{\text{data}}, \mathbf{t}_i^{\text{data}})\|^2. \qquad (10e) $$

Here, $\mathcal{L}_{\text{data}}$ is due to additional observations inside the domain, and $\mathcal{L}_f, \mathcal{L}_b, \mathcal{L}_0$ penalize the residual equations, the boundary, and the initial conditions.

The parameters $\lambda_1...4 \in \mathbb{R}_+$ are non trainable weights set manually to manage the ratio between all loss terms. Collocation points for data, residuals and boundary conditions: $\{\mathbf{x}_i^*, \mathbf{t}_i^*\}_{i=1...N_*}$ are often selected on a uniform Cartesian grid. In the machine learning community, ADAM [28], a first-order gradient-based optimization algorithm for stochastic objective functions, is usually selected to optimize the parameter $\theta$.

In the next section, we will apply PINNs to gravity currents generated by lock exchange, to infer the density, velocity and pressure field with synthetical data from 2D simulation. We can see a schematic representation of PINN for this problem figure 2.

### 3. Application of PINNs on synthetical data

In this section, we analyze the lock exchange configuration through a single 2D simulation provided by a CFD solver. This approach allows us to access the complete hydrodynamic fields, including density, velocity, and pressure, in both space and time, all derived from just one simulation. Our goal is to train a PINN model using density measurements, treating the simulated density data as if they were experimental LAT data. We reserve the velocity and pressure fields for validation purposes and aim to compare the velocity and pressure fields predicted by the PINN model with the actual fields obtained from the simulation. Evaluating the model in different noise configurations allowed us to find suitable hyperparameters, such as the network structure and activation function. These parameters provide a good compromise between computational time and accuracy and will not be discussed here.
<figure><img src="image_5.png" /><figcaption>**Figure 2.** Physic informed neural network structure for gravity currents governing equations: a fully connected neural network take as input $(\mathbf{x}, t) \in \mathbb{R}^3$ and predicts $v_N(\mathbf{x}, t) = (\rho_N, u_N, v_N, p_N)$. The residuals of the governing equations $e_1, \dots, e_4$ are computed by automatic differentiation and $e_0$ denotes the mismatch between the observational data $v$ and the predictions $v_N$, which are combined in the loss function $\mathcal{L}_0, \mathcal{L}_b$ and $\mathcal{L}_{\text{data}}$. Finally, the weights and biases of the network are updated iteratively with gradient descent. In the residuals, the material derivative expressed as $\frac{Df}{Dt}$ inherently includes the convective terms.</figcaption></figure>

<figure><img src="image_6.png" /><figcaption>**Figure 3.** Heatmap of the density field $\rho$ for different time steps during the flow.</figcaption></figure>

### 3.1. Synthetic data for the lock-exchange problem

An accurate representation of the interface between the miscible fluids is crucial in gravity currents simulations, which requires high-order numerical methods to compute steep gradients in the vicinity of the interface. To this end, the governing equation (2) are solved with the code Nek5000 [29] that has been for example successfully employed in numerical investigations by [30]. The discretization scheme in Nek5000 is based on the spectral element method proposed by [31] with exponential convergence in space and 3rd-order timestepping scheme.

We consider the dimensionless computational domain $\Omega = [0, 6.0] \times [0, 1.0]$ and $T = [0, 10]$ with $Re = 5500$. While for liquids such as salt water $Sc \approx 700$, we consider here $Sc = 1$. This assumption is commonly made to reduce computational costs and has low influence on the gravity current front as shown by [32]. A free-slip condition is applied at $y = 1.0$ and no slip-conditions are applied on the remaining domain boundaries. Grid independent results were obtained on a computational mesh of 90 × 45 elements where unknowns are represented by 7th-order Lagrange interpolating polynomials, and with a fixed timestep $\Delta t = 2.10^{-2}$ giving a Courant–Friedrichs–Lewy number less than 0.5. We show in figure 3 the time evolution of the density field obtained with Nek5000.
<figure><img src="image_7.png" /><figcaption>Figure 4. Density field at t = 10 for the different cases studied. In case number 4, 200 squares of size 10 by 10 are randomly selected in the mesh $\Omega_{obs}$.</figcaption></figure>

We build from this simulation a training dataset $\mathcal{D}$ where the collocation points are selected in the sub domain: $\Omega_{obs} \times T_{obs} = [0, 4.5] \times [0, 1.0] \times [4.0, 7.5] \subset \Omega \times T$, which is discretized into a uniform Cartesian grid of $N_x \times N_y \times N_t$ points, where $N_x = 750$, $N_y = 150$ and $N_t = 400$.

Finally, to mimic experimental measurements of LAT, we extract from this simulation the observed quantity of the density $\rho$ on each collocation points, and build our training dataset $\mathcal{D} = (\mathbf{x}_i, t_i, \rho_i)_{i=1...N_x N_y N_t}$ while the other fields $u, v, p$ are used for validation purpose, The dataset $\mathcal{D}$ contains $N = N_x N_y N_t = 45M$ points.

## 3.2. Noise robustness

In this section, noises of varying magnitudes were added to $\mathcal{D}$. We investigate 4 different cases that are represented in figure 4:

* Case 1: Original dataset $\mathcal{D}$.

* Case 2: We add a Gaussian noise to $\rho$ field with standard deviation $\sigma = 5\%$ (experimental precision of LAT).

* Case 3: same as Case 2 but with $\sigma = 25\%$.

* Case 4: Same as Case 3 but in addition, we remove a part of the information in all the snapshots. (we draw 200 squares of 10 × 10 pixels randomly from Case 3 dataset). This reduced dataset contains $N = 8M$ points.

For all cases, the PINN loss function is expressed as:

$$ \mathcal{L} = \lambda \mathcal{L}_{\text{data}} + \mathcal{L}_{f}, \qquad (11a) $$

$$ \mathcal{L}_{f} = \frac{1}{N_{f}} \sum_{i=1}^{N_{f}} \|f(\mathbf{x}_{i}^{f}, t_{i}^{f})\|^{2}, \qquad (11b) $$

$$ \mathcal{L}_{\text{data}} = \frac{1}{N_{\text{data}}} \sum_{i=1}^{N_{\text{data}}} \| \rho_{\mathcal{N}}(\mathbf{x}_{i}^{\text{data}}, t_{i}^{\text{data}}) - \rho(\mathbf{x}_{i}^{\text{data}}, t_{i}^{\text{data}}) \|^2. \qquad (11c) $$

The neural networks $\mathcal{N}$ take as input $(\mathbf{x}, t) = (x, y, t)$ and outputs the prediction $v_{\mathcal{N}}(\mathbf{x}, t) = (\rho_{\mathcal{N}}, u_{\mathcal{N}}, v_{\mathcal{N}}, p_{\mathcal{N}})$. The term $\mathcal{L}_f$ penalizes the governing equations (2) and $\mathcal{L}_{\text{data}}$ penalizes mismatch between network prediction for $\rho_{\mathcal{N}}$ and observed $\rho$. The parameter $\lambda$ is a weighting coefficient used to penalize (11c), in practice we set $\lambda = 500$.

## 3.3. Results on synthetic data

The neural network is composed of 8 layers of 250 neurons each. The stochastic Adam optimizer [28] is employed for solving (6): Glorot normal initializer [33] is employed to initialize the biases and the weights that are computed iteratively with a gradient update (7) on a subset $B \subset \mathcal{D}$ called a batch. One training
<figure><img src="image_8.png" /><figcaption>Figure 5. Horizontal profiles comparison. Profiles of (ρ, u, v) reconstructed by PINNs for Cases 1–4 along the x-direction at y = 0.24 and t = 7.5 against the reference solution (left). Corresponding location of the profile in Ωobs (right).</figcaption></figure>

round over $\mathcal{D}$ is called an epoch. Training is done for 100 epochs with a batch size of 4096. We use an exponential decay learning rate schedule. The learning rate starts at $1 \times 10^{-3}$ and ends at $1 \times 10^{-5}$. Swish activation function [34] is selected for all layers except the last one. Finally, training is done with two GPU A6000 in parallel.

For quantitative results, we define the following relative L2-norm:

$$ \epsilon_V = \frac{100}{\sup_{\mathbf{x} \in \Omega_{\text{obs}} \times T_{\text{obs}}} |V_{\mathbf{x}}|} \sqrt{\frac{\sum_{\mathbf{x} \in \mathbf{X}} |V_{\mathcal{N}}(\mathbf{x}) - V_{\mathbf{x}}|^2}{|\mathbf{X}|}} \quad (12) $$

where $V \in (\rho, u, v, p)$ and $\mathbf{X} \subseteq \Omega_{\text{obs}} \times T_{\text{obs}}$ defines the domain where the error is computed. We choose $\sup_{\mathbf{x} \in \Omega_{\text{obs}} \times T_{\text{obs}}} |V_{\mathbf{x}}|$ as reference value to avoid the division near to zero issue reported in [18].

In figure 5, the comparison of horizontal profiles shows that the models for Cases 1,2 and 3 are very efficient and can reconstruct all the variations in the current. Moreover, even with 25% of noise, model for Case 3 is able to filter out measurement noise and correctly reconstruct density and associated velocity fields. The model for Case 4 also performs great mostly everywhere, but we can see a big drop in performance near $x = 1.5$ which may be due to a lack of training data in this area. For all the cases, the results for u and v close to $x = 4.49$ are less accurate, but the steep variations near the front are well inferred.

Figure 6 shows the evolution in $T_{\text{obs}}$ of the error in $\Omega_{\text{obs}}$ for the fields $\rho, u, v$. We can see the L2-errors for the density and pressure field are almost constant in time except for density in Case 4. For all cases, the accuracy of the predictions u and v improves with time. Since gravity currents propagate from left to right, at the initial stages of the flow, a large portion of the area covered by the flow contains zero values that might not be useful for training the neural network, making it more challenging to effectively learn and approach the velocity. However, as the gravity current progresses and reaches the end of the flow, the entire current is present in $\Omega_{\text{obs}}$, and more useful values such as non zero variations of density can be utilized by the neural network, possibly leading to improved performance.

Table 1 illustrates the global error for Cases 1 to 4 between the density, velocity and pressure fields predicted by PINN, and the corresponding ground truth. The first three cases have highly accurate predictions with less than 3% error for all fields, indicating that the model is robust to noise. Despite the higher errors in the fourth case, the prediction errors are still below 8%, suggesting that the model can handle incomplete data with high noise level.
<figure><img src="image_9.png" /><figcaption>**Figure 6.** Evolution of the L2-relative error computed on $x \in \Omega$ for density, velocity and pressure fields for $t \in [4, 7.5]$.</figcaption></figure>

<table><caption>**Table 1.** Relative L₂-norm errors of the fields reconstructed by PINN computed on the spatio-temporal domain $\Omega_{\text{obs}} \times T_{\text{obs}}$.</caption><thead><tr><th>Case</th><th>ε<sub>ρ</sub></th><th>ε<sub>u</sub></th><th>ε<sub>v</sub></th><th>ε<sub>p</sub></th></tr></thead><tbody><tr><td>Case n<sup>0</sup>1</td><td>0.035%</td><td>1.17%</td><td>1.81%</td><td>1.03%</td></tr><tr><td>Case n<sup>0</sup>2</td><td>0.085%</td><td>1.29%</td><td>2.41%</td><td>1.07%</td></tr><tr><td>Case n<sup>0</sup>3</td><td>0.53%</td><td>2.65%</td><td>5.30%</td><td>2.48%</td></tr><tr><td>Case n<sup>0</sup>4</td><td>7.98%</td><td>4.93%</td><td>5.12%</td><td>4.48%</td></tr></tbody></table>

These results are very promising and the robustness of PINNs to noise in the 2D lock exchange configuration suggests the potential of this framework for real experimental data. In the following section, we apply the PINN model to experimental data obtained by LAT.

# 4. Application of PINNs to LAT experimental measurements

## 4.1. Experimental setup

The experimental apparatus is summarized in figure 7. Experiments are conducted in a 150 cm long, 10 cm wide and 35 cm high plexiglas tank. After the tank is filled with freshwater to an height 25 cm, a gate with insulating sides is inserted at 20 cm from the left end of the tank.

Salt is dissolved in the lock to reach a homogeneous density $\tilde{\rho}_1 = 1001.2 \text{ kg.m}^{-3}$ slightly larger than the freshwater density $\tilde{\rho}_2 = 999.8 \text{ kg.m}^{-3}$ which gives us $\Delta\rho = 1.4 \text{ kg.m}^{-3}$, Re = 14000 and Sc = 1000 according to the definitions in section (3).

Measurements are performed using two cameras and two light sources. The PIV and LAT cameras are respectively mounted with a 180 mm f2-8 and 25 mm lens. The cameras are mounted on tripods and placed at a distance of 250 cm from the tank. Images are recorded at a frame rate of 10 fps and the spatial resolution of the raw images is 8 Mpx for both cameras.

The PIV [35] camera is synchronized with a vertical LASER sheet that illuminates the central section of the tank, providing two-dimensional vertical velocity field measurements as commonly performed in stratified flows.

The LAT camera is synchronized with a white LED panel placed behind the tank. The latter technique allows to measure high resolution cross-averaged density fields by adding a known concentration of tracer in the dense compartment. In the present experiment, a red food dye is used as a tracer for salinity and hence density. The reader may refer to [19] for a detailed description of the LAT protocol.

The two cameras and light sources are computer-controlled, which permits to synchronize velocity and density measurements. As the LED panel interferes with the PIV measurements, it is required to trigger the PIV and LAT sources in a slightly phase-shifted manner. Measurements are latter recombined on an identical timestep during the PIV post-process. A common spatial origin is used to match the recorded velocity and density field.

As the studied flow evolves in 3D, using the canonical PINN model would imply forcing a neural network to impose the Navier-Stokes equations in 3D and having available measurements of the density field in the whole tank which is prohibitive in our case.

So in the following, we assume that the flow is homogeneous in the z-direction, this assumption is commonly made for the lock release configuration [20]. As a consequence, we reduce the problem size and consider only the 2D Navier-Stokes equations (2) and, under this assumption, the spanwise-averaged density $\bar{\rho}$ measured by LAT is assimilated to 2D density measurements $\rho$. In figure 8, we can see a sample of the fields measured by the combination of LAT and PIV.
<figure><img src="image_10.png" /><figcaption>**Figure 7.** (a) Sketch of the experimental setup, including the tank, barrier, light panel, fluids and cameras 1 (LAT) and 2 (PIV). Combination of LAT and PIV measurement devices with $\tilde{L}_y = 25$ cm, $\tilde{L}_x = 150$ cm and $l = 10$ cm. The cameras are located at a distance of $D = 250$ mm from the tank. (b) Time scale used to represent, in chronological order, the duration of PIV time with 8000 µs correlation time between two images and LAT time with 2500 µs exposure time.</figcaption></figure>

<figure><img src="image_11.png" /><figcaption>**Figure 8.** Measurements of density at $t = 20.45$ and two components of velocity at $t = 20.80$. $\rho$ is measured by LAT and $(u, v)$ are measured by PIV in the middle plane of the tank.</figcaption></figure>

## 4.2. Training data

The data are acquired on the spatial and temporal dimensionless domain $\Omega_{\text{exp}} \times T_{\text{exp}} = [3.0, 4.65] \times [0.05, 0.5] \times [19.5, 21.5]$. This domain is discretized into a uniform grid of $N_x \times N_y \times N_t$ points, where $N_x = 1050$, $N_y = 300$ and $N_t = 90$. The training dataset contains $N = N_x N_y N_t = 28350000$ points of density measurements.

We aim to infer the hydrodynamic field in the middle plane of the domain given LAT measurements of density. We keep the available PIV measurements for validation purposes and do not use the velocity data obtained from PIV to train the model. We apply the canonical PINN method with LAT experimental measurements as observation data in the domain $\Omega_{\text{exp}} \times T_{\text{exp}}$, considering the governing equations (2) and
<figure><img src="image_12.png" /><figcaption>Figure 9 Comparison between measured and predicted density and velocity for model $\mathcal{N}$ at $t = 20.8$. First line refers to $\rho$ obtained by LAT and $(u, v)$ measured by PIV considered as ground truth. Second line refers to corresponding fields inferred by PINN, and third line corresponds to horizontal profiles along the $x$-axis for $y = 0.11$ (red), $y = 0.28$ (blue) and $y = 0.48$ (green) for both inferred and measured fields.</figcaption></figure>

loss function (11). After training the model on LAT density data, we will compare the velocities predicted by the model to the PIV velocities, which will be considered as a test error.

### 4.3. Results on experimental data

The neural network is composed of 8 layers of 250 neurons each which, in our case is the structures which gives the best results. Training is done for 150 epochs with a batch size of 4096. We use Adam optimizer with a decreasing learning rate schedule. The learning rate follows an exponential decay starting from $5 \times 10^{-4}$ to $1 \times 10^{-5}$. Finally we use Swish activation function on each layers transition, except for the last layers where no activation function is selected.

In figure 9, we can see a comparison between predicted $\rho$, $u$ and $v$ fields and the corresponding measured fields by LAT/PIV. Since the model is trained on density, it is not surprising that the predicted density values are highly accurate, but we can notice that PINN has a smoothing effect on the density field. What is the most interesting here is the comparison on the velocity fields. Indeed, the NN has succeeded without prior information on $u$ and $v$ to reproduce the right amplitudes of values as well as the location of the current front. On the other hand, there is a bias in the values for $u$ and the small variations above the current (blue profile) are poorly captured. Moreover, for $v$, the values on the right of the front seem to be outliers.

After a thorough study of the problem parameters, we came to the conclusion that the residual related to the incompressibility equation (2c) in 2D degraded the results. So, to account for the spanwise variations of the flow, we propose a modification of the continuity equation (2c) :

$$ \frac{\partial u}{\partial x} + \frac{\partial v}{\partial y} + \xi = 0, \qquad (13) $$

where $\xi$ depends on $(x, y, t) \in \Omega_{\text{exp}} \times T_{\text{exp}}$ is a new output of the neural network. Thus, the new model $\mathcal{M}$ take as input $(\mathbf{x}, t) = (x, y, t)$ and outputs the prediction $\mathbf{v}_{\mathcal{M}}(\mathbf{x}, t) = (\rho_{\mathcal{M}}, u_{\mathcal{M}}, v_{\mathcal{M}}, p_{\mathcal{M}}, \xi_{\mathcal{M}})$. Since the 3D Navier-Stokes equations involve $\frac{\partial w}{\partial z}$ in the incompressibility equation, we expect $\xi_{\mathcal{M}}$ to converge during training to the restriction of $\frac{\partial w}{\partial z}$ to the PIV plane. In the following, we denote by $\mathcal{N}$ or $\mathcal{M}$ either if the model was trained with the equation (2c) or with (13).

The modification made to the equation has led to significant improvements in the accuracy of the predictions. The results figure 10 show the efficiency of this new formulation of the problem. For the $u$ component of velocity, although a small bias can still be observed on the values above the stream, the predicted quantities inside the stream and near the blue zone are suitable. The predicted profiles for the $v$
<figure><img src="image_13.png" /><figcaption>**Table 2.** Relative $L_2$-norm errors on the spatio-temporal domain $\Omega_{\text{exp}} \times T_{\text{exp}}$ between reconstructed and measured fields. model name is $\mathcal{N}$ or $\mathcal{M}$ either if training was done with standard incompressibility equation (2c) or variation (13).</figcaption></figure>

<table><thead><tr><th>Model</th><th>&epsilon;<sub>&rho;</sub></th><th>&epsilon;<sub>u</sub></th><th>&epsilon;<sub>v</sub></th></tr></thead><tbody><tr><td>&#x1d5049;</td><td>1.72%</td><td>20.90%</td><td>31.5%</td></tr><tr><td>&#x1d504A;</td><td>1.35%</td><td>14.6%</td><td>12.65%</td></tr></tbody></table>

component of velocity in the blue and green zones are now accurate, and the model is able to capture steep variations, such as the large peak at $x = 4.3$, with good accuracy.

The table 2 shows the overall improvement in predictions brought by the simple change in the incompressibility equation (13). The model achieve accurate results on the global space $\Omega_{\text{exp}} \times T_{\text{exp}}$.

### 4.4. Quantities derived from PINNs

Once trained on experimental density data for a fixed flow, model $\mathcal{M}$ acts as a surrogate model that allows us to calculate any quantity involving density, velocity, or pressure, as well as their derivatives. These values are obtained locally throughout the entire spatial and temporal domain. It would allow us to estimate the vorticity, and energy flux field $J = pu$ [36], which is crucial for understanding the energy budget and fluid circulation in density-varying fluids such as the ocean and the atmosphere. However, it is rarely possible to determine this quantity, which requires simultaneous measurements of the pressure and velocity perturbation fields $p$ and $u$, respectively. Using the PINN model, we present a method for obtaining the instantaneous $J$ from density measurements only, providing a capability that remains out of reach for known methods.

In figure 11, we represent the quantity $J = pu$ where $u = (u, v)^T$, and respectively the isovalues of the separated components $pv$, $pu$ given by $\mathcal{M}$ at three different times during the flow. These quantities provide information about the energy flux within the gravity current.

We clearly evidence a zone where the current transfers energy to the surrounding fluid, which are the zone where $pv$ reach its maximum values in the right of the current front. In the same way, one identifies a zone where the current captures energy from the ambient fluid which are the zone of circulation above the current where $pu$ reach its minimum values. We can notice a very sharp transition between these two zones (red dotted line) where $pv$ changes sign. This criterion is consistent through time and represents a quantitative criterium to divide the density field in two parts, the front and the head of the current. In the last raw of figure 11 vorticity isovalues inferred $\omega$ are plotted and superposed to the energy flux vector field.
<figure><img src="image_14.png" /><figcaption>**Figure 11.** Horizontal and vertical components of the energy flux field $\rho v$, and vorticity. Isovalues of $\rho$ (first line), $pu, pv$ (second and third line) and $\omega$ (fourth line) at times : $t = 20.7, 21.14$ and $21.6$ in addition in lines 2, 3, 4, the vector field $pu$ is added.</figcaption></figure>

We observe that the transition between the two previously identified zones is also associated with the
appearance of re-circulation rolls where the mixing becomes efficient.

**5. Conclusion**

In this work, we quantitatively demonstrate that PINNs are able to solve inverse problems from experimental data. We first investigated the robustness of this model to noisy and gappy data. This study was made from synthetic data obtained by the CFD solver Nek5000 for the lock-exchange configuration, and allowed us to study the parametric aspect of the model. Next, we trained a physics-informed model using experimental density measurements obtained by LAT in the lock-exchange configuration. The inferred velocity fields were then compared to PIV measurements taken simultaneously during the same experiment. Despite the assumption of homogeneity in the z-direction, the results are convincing, and the model succeeds in predicting the pressure field. In our previous paper [18], we highlighted an optimal experimental setup that would allow the reconstruction of the entire 3D field from multiple 2D measurements of PIV and LAT. In future work, when our experimental setup allows for such measurements, we will consider a case of 3D reconstruction for the lock exchange.

**Data availability statement**

The data cannot be made publicly available upon publication because no suitable repository exists for
hosting data in this field of study. The data that support the findings of this study are available upon
reasonable request from the authors.

**Acknowledgments**

A part of this study is conducted in the framework of the Agence Nationale de la Recherche (Project
'Pinn'terfaces' ANR-23-CE23-0020).

**ORCID iD**

Mickaël Delcey https://orcid.org/0000-0003-2225-8531
References

[1] Goodfellow I *et al* 2016 *Deep Learning* (MIT Press) (available at: http://www.deeplearningbook.org)

[2] Brunton S L *et al* 2020 Machine learning for fluid mechanics *Ann. Rev. Fluid Mech.* 52 477–508

[3] Raissi M, Yazdani A and Em Karniadakis G 2020 Hidden fluid mechanics: learning velocity and pressure fields from flow visualizations *Science* 367 1026–30

[4] Zhiping M 2020 Physics-informed neural networks for high-speed flows *Comput. Methods Appl. Mech. Eng.* 360 112789

[5] Jagtap A D, Mao Z, Adams N and Em Karniadakis G 2022 Physics-informed neural networks for inverse problems in supersonic flows *J. Comput. Phys.* 466 111402

[6] Cuomo S *et al* 2022 Scientific machine learning through physics-informed neural networks: where we are and what’s next *J. Sci. Comput.* 92 88

[7] Berkooz G, Holmes P and Lumley J L 1993 The proper orthogonal decomposition in the analysis of turbulent flows *Ann. Rev. Fluid Mech.* 25 539–75

[8] Schmid P J 2010 Dynamic mode decomposition of numerical and experimental data *J. Fluid Mech.* 656 5–28

[9] Matthew Rodell P R H *et al* 2004 The global land data assimilation system *Bull. Am. Meteorol. Soc.* 85 381–94

[10] Raissi M and Em Karniadakis G 2018 Hidden physics models: machine learning of nonlinear partial differential equations *J. Comput. Phys.* 357 125–41

[11] Cai S *et al* Physics-informed neural networks for heat transfer problems *J. Heat Transfer* 143 2021

[12] Cai S *et al* 2021 Flow over an espresso cup: inferring 3-D velocity and pressure fields from tomographic background oriented Schlieren via physics-informed neural networks *J. Fluid Mech.* 915

[13] Raffel M 2015 Background-oriented Schlieren (BOS) techniques *Exp. Fluids* 56 1–17

[14] Perez-Diaz B *et al* 2018 PIV-PLIF characterization of nonconfined saline density currents under different flow conditions *J. Hydraulic Eng.* 144 04018063

[15] Molnar J *et al* 2023 Estimating density, velocity and pressure fields in supersonic flows using physics-informed BOS *Exp. Fluids* 64 14

[16] Ungarish M 2009 *An Introduction to Gravity Currents and Intrusions* (CRC Press)

[17] Shin J O *et al* 2004 Gravity currents produced by lock exchange *J. Fluid Mech.* 521 1–34

[18] Delcey M *et al* 2023 Physics-informed neural networks for gravity currents reconstruction from limited data *Phys. Fluids* 35 027124

[19] Dossmann y *et al* 2016 Experiments with mixing in stratified flow over a topographic ridge *J. Geophys. Res. Oceans* 121 6961–77

[20] La Rocca M and Bateman A 2010 *Experimental and Theoretical Modelling of 3D Gravity Currents*

[21] Gray D D and Giorgini A 1976 The validity of the Boussinesq approximation for liquids and gases *Int. J. Heat Mass Transfer* 19 545–51

[22] Hartel C *et al* 2000 Analysis and direct numerical simulation of the flow at a gravity-current head. Part 1. Flow topology and front speed for slip and no-slip boundaries *J. Fluid Mech.* 418 189–212

[23] George C 1989 Approximation by superpositions of a sigmoidal function *Math. Control, Signals, Syst.* 2 303–14

[24] Higham C F *et al* 2019 Deep learning: an introduction for applied mathematicians *SIAM Rev.* 61 860–91

[25] Géron A 2019 *Hands-on Machine Learning With Scikit-Learn, Keras and Tensorflow: Concepts, Tools and Techniques to Build Intelligent Systems* (O’Reilly Media)

[26] Paszke A *et al* 2019 PyTorch: an imperative style, high-performance deep learning library *NeurIPS 2019* (arXiv:1912.017 03)

[27] Griewank A *et al* 1989 On automatic differentiation *Math. Programm. Recent Develop. Appl.* 6 83–107

[28] Kingma D P and Jimmy B 2014 Adam: a method for stochastic optimization (arXiv:1412.6980)

[29] Fischer P F *et al* 2008 nek5000 Web page (available at: http://nek5000.mcs.an l.gov)

[30] Ozgökmen T M *et al* 2004 Three-dimensional turbulent bottom density currents from a high-order nonhydrostatic spectral element model *J. Phys. Oceanogr.* 34 2006–26

[31] Patera A T 1984 A spectral element method for fluid dynamics: laminar flow in a channel expansion *J. Comput. Phys.* 54 468–88

[32] Marshall C R *et al* 2021 The effect of Schmidt number on gravity current flows: the formation of large-scale three-dimensional structures *Phys. Fluids* 33 106601

[33] Glorot X and Bengio Y 2010 Understanding the difficulty of training deep feed forward neural networks *Proc. 13th Int. Conf. on Artificial Intelligence and Statistics* (JMLR Workshop and Conf. Proc.) pp 249–56

[34] Ramachandran P *et al* 2017 Searching for activation functions. (arXiv:1710.05941)

[35] Raffel M, Willert C E, steven W and Kompenhans J 2007 *Particle Image Velocimetry: A Practical Guide. Experimental Fluid Mechanics* (Springer)

[36] Allshouse M R *et al* 2016 Internal wave pressure, velocity and energy flux from density perturbations *Phys. Rev. Fluids* 1 014301