1. Introduction
Global climate change influences regional climate patterns, leading to increased occurrences of intense rainfall and river flooding. Strong climatic contrasts across Europe contribute to this situation. These include northern and southern air currents spanning over 2000 km, high temperatures in the Mediterranean region, and polar air masses over the North Sea, which collectively lead to significant moisture transport to eastern Central Europe and intense precipitation accumulation in the Carpathian Vault and the Northern Alps.
The situation was exacerbated by climate change, which caused the Mediterranean Sea to warm up and the atmosphere to absorb more moisture, leading to more prolonged precipitation. In 2024, Mediterranean surface temperatures were at record levels, reaching between 25 °C and nearly 30 °C in the northern Mediterranean region in mid-September. This meant that the temperature values were, in some cases, more than 4 °C above the long-term average. As a result, flooding in Central and Eastern Europe began on Friday 13 September 2024, triggered by Cyclone “Boris”, which caused severe cold and precipitation across most European countries.
According to the meteorological agency of Spain, in just a few hours, in a number of places in the country, the amount of precipitation equivalent to an annual indicator fell at the end of October 2024. In Chiva, west of Valencia, the agency recorded at least 491 L of rainfall per square meter. This deluge, associated with the meteorological phenomenon known as “cold fall” (which is an isolated depression in altitude), forced several rivers out of their channels and caused the sudden formation of massive mudflows.
Therefore, investigating hydrological processes in rivers through mathematical modeling is crucial for creating digital twins of river systems. For the developers of digital twins, the ability to perform real-time calculations is particularly important. Recent studies have addressed this topic and demonstrated the potential of digital twin systems to enhance the modeling of hydrological processes under climate change.
For example, the University of Trento developed a digital twin of Italy’s Adige River Basin in order to account for anthropogenic changes in reservoir dynamics [
1], while the Digital Twin Earth (DTE) model incorporated high-resolution Earth observation data to simulate soil moisture, precipitation, and river discharge for improved flood forecasting [
2]. A national-scale model for Denmark was also introduced to function as a real-time digital twin for flood risk prediction and agricultural planning under climate extremes. The so-called GEUS Denmark system incorporated approximately 5 terabytes of data into the portal using advanced calibration strategies and mixed machine learning approaches [
3]. One article by researchers from the UK Center for Ecology and Hydrology in Lancaster, UK, explores the importance of data science in the development of digital twins for the natural environment. It pays special attention to how emerging data models can complement the well-established process models in this field. The authors aim to clarify the intricate bidirectional relationship between data and the understanding of environmental processes [
4].
Mathematically, the study of flood phenomena can be approached by addressing both forward and inverse problems related to hydrological processes by employing the equations derived from the Shallow Water Theory [
5]. Physics-Informed Neural Networks (PINNs) serve as an essential element in digital twins by providing real-time computational capabilities; they have been the subject of significant recent advancements [
6,
7,
8]. In these models, the residual terms of the partial differential equations (PDEs) are embedded directly into the loss formulation of the neural network. This methodology has shown a strong performance in addressing a broad spectrum of forward and inverse PDE tasks [
9,
10,
11]. The modern theory of solving inverse problems for hyperbolic equations is covered in other studies [
12,
13]. Some early studies in the field of numerical solutions relating to inverse problems in the field of hydrology are known [
14,
15]; they use various mathematical methods to solve the Saint-Venant equations [
13,
16,
17].
Earlier research was also carried out to investigate the possibilities of using PINNs for solving hydrological problems, in particular for the approximation of the 1D equation of the Shallow Water Theory. As a rule, model problems were considered. Several studies by scientific groups from the USA [
18,
19] have demonstrated that PINNs successfully assimilated various types of observation and directly solved the 1D Saint-Venant equations. Different scientific research groups have run flow simulations across a floodplain and through an open channel. The performance of the PINNs was studied by comparing analytical solutions and numerical models.
The numerical solution of a 1D differential equation was used to predict water surface profiles in a river, as well as to estimate the so-called roughness parameter [
20]. PINN models were implemented in the TensorFlow framework using two neural networks. Different numbers of layers and neurons per hidden layer were tested, as well as different activation functions.
A two-dimensional model of the dam-break problem was analyzed in a PhD thesis [
21]. The purpose of this work was to investigate the possibility of using PINNs to approximate the Shallow Water Equations (SWEs), which are a PDE system, that simulated free-surface flow problems.
Another important direction is the study of filtration in porous media, including the Darcy and Richards equations. The PINN method was presented to solve the coupled Darcy equation and the advection–dispersion equation (ADE) and was tested in a range of Pe numbers. The authors of [
22] employed numerical solutions based on the finite-volume method as a benchmark for assessing PINN-based estimates of steady-state hydraulic head and concentration in a coupled Darcy flow ADE system characterized by spatially variable conductivity and velocity fields.
The PINN approach enables the generation of real-time numerical results that can subsequently inform simulations of riverbed silting. Forecasting key indicators plays a critical role in mitigating river pollution caused by sedimentation.
In [
23], researchers conducted a comparative analysis of the PINN approach versus traditional numerical simulations in order to evaluate parameters such as flow velocity, pressure, and density in aquatic systems. The PINN-based neural architecture was applied to solve the partial differential equation governing soil–water infiltration, enabling a numerical analysis of the infiltration process. The findings demonstrated that the PINN-based approach yielded more accurate numerical results and lower error levels compared to conventional numerical methods in modeling vertical soil–water infiltration. Among the soil types examined, water infiltrated most rapidly in light soil, followed by heavy soil, with medium soil showing the slowest infiltration rate [
24].
There are a few important soil-focused parameters for recreating water actions in soils using the Richardson–Richards equation (RRE)—Water Retention Curves (WRCs) and Hydraulic Conductivity Functions (HCFs). Famous approaches to obtain WRCs and HCFs are frequently useless for such a modeling purpose. In [
25,
26], the PINN method was observed to remove this problem and to determine an inverse solution of the RRE, implementing the estimation of WRC and HCF using volumetric water content measurements without initial or boundary conditions.
In [
27], Physics-Informed Neural Networks (PINNs) were applied to inverse problems in unsaturated groundwater flow by embedding observed volumetric water content measurements directly into the network’s loss function. Specifically, the Richards equation was coupled with the van Genuchten constitutive model, and PINNs were trained to reconstruct both the spatially distributed Richards equation solutions and the unknown parameters of the van Genuchten model from sparse measurement data. Berardi et al. [
28] extended this approach to an adaptive inverse PINN framework for a variety of porous media transport models, including diffusion, advection–diffusion–reaction, and mobile–immobile formulations. In their method, transport parameters such as diffusion coefficients were treated as trainable variables, and the loss function components—data mismatch, initial and boundary conditions, and PDE residual—were adaptively weighted during training to ensure reliable convergence. Yu et al. [
29] further enhanced the PINN methodology by introducing gradient-enhanced PINNs (gPINNs), which incorporate not only the residual of the governing PDE but also its gradient information into the loss function. Numerical experiments demonstrated that gPINNs achieve higher accuracy and faster convergence than standard PINNs, requiring fewer collocation points for both forward and inverse problems. Finally, Difonzo et al. [
30] applied PINNs to learn the horizon parameter in peridynamic models of linear microelasticity. They investigated several kernel functions—including tent-shaped, distributed, and V-type kernels—and conducted numerical experiments in both one- and two-dimensional spatial settings. By treating the horizon size as an additional trainable parameter, they showed that PINNs could accurately infer the correct nonlocal interaction scale directly from simulated data.
A particular approach was suggested in [
31] for solving SWEs on the sphere using PINNs. Trained PINNs were found to be effective in dealing with differential equations, in contrast to common numerical methods such as finite-difference, finite-volume, or spectral methods.
Modern approaches in the field of PINN application and hybrid neural network architectures for studying the hydrological processes of rivers are presented in [
32,
33,
34,
35,
36,
37]. Recent studies have explored the use of PINNs and other ML-based methods for modeling climate-driven processes in PDEs, combining physical constraints with data-driven learning [
6,
7,
8,
38,
39]. A modern and recent advancement in the development of PINN architectures in fluid dynamics focuses on the use of evolutionary deep neural networks [
40,
41,
42,
43]. An overview of modern approaches in the field of PINNs for studying problems in fluid dynamics is given in [
44,
45,
46,
47,
48,
49]. In [
50], the authors provide an overview of the use of PINNs and PIKANs in physics-informed machine learning. The authors of [
51] discuss the possibility of using an energy transformer approach to reconstruct three different flow fields from sparse measurements.
Currently, there are other approaches to building PINN architectures based on Deep Operator Neural Networks (DeepOnets) [
52] and Fourier Neural Operators (FNOs) [
53]. However, these architectures are more complex to implement in software.
The process of training neural networks requires datasets that cannot always be obtained from an experiment or laboratory. Synthetic data obtained from physical modeling can be used for this purpose. These are artificially generated datasets that are created when real hydrological data are either not available at all or are very rare or expensive to obtain. Many fully physics-solving and reduced physics hydrodynamic models are available in numerical codes (Delft3D [
54], ParFlow [
55], LISFLOOD-FP [
56], WRF-Hydro [
57], and HEC-RAS [
58]). Synthetic data for training neural networks can be obtained using one of these open source codes.
There are different numerical methods to solve the Saint-Venant equation in 1D/2D formulations. Among them are the finite-difference method [
59,
60] and Galerkin finite element method with the fourth-order, explicit Runge–Kutta scheme [
61,
62]. The Delft3D modeling code is widely used by hydrologists due to its open source availability, pre/post processors, and broad library of physical models; it has been applied, for example, to simulate temperature stratification and ice formation in deep lakes such as Lake Teletskoye [
63]. In [
64], a new bank erosion model was developed and successfully implemented in Delft3D code. The model performance was assessed by comparison with a previously reported experiment in an open-channel bend flume with a mobile bed. In [
65], the performance of two widely used hydrodynamic models was compared to predict the total water level (TWL) in Delaware Bay, USA. The authors simulated two hurricanes that affected the Bay and caused considerable damage and economic losses.
In [
66], the Delft3D modeling code was employed to identify the most suitable shoreline protection design for the intricate inlet–bay configuration of Carancahua Bay, Texas, using field measurements from a network of hydrodynamic and geotechnical sensors and historical shoreline imagery. Subsequent work [
67] applied a process-oriented modeling strategy to evaluate the impacts of climate change and engineering interventions on hydrodynamics and sediment transport, simulating sediment budgets, suspended sediment concentration distributions, and turbidity with a two-dimensional Delft3D Flexible Mesh model. The authors of [
68] developed Sandy-related storyline scenarios to assess how complex coastal flooding—driven by storms and sea-level rise—could affect New York City’s infrastructure under internal variability in storm intensity and trajectory. In research relating to Mekong Delta [
69], the authors used a coupled one- and two-dimensional unstructured mesh model in Delft3D Flexible Mesh to show that high dams alter runoff proportions and seasonal distribution across river branches. Finally, a comparative analysis of three Delft3D-based approaches (structural mesh encryption, suspension mesh, and unstructured mesh) for a bridge engineering project revealed that while the Flexible Mesh configuration struggled to capture wake flow oscillations behind bridge piers, the optimized method proved effective in practical applications [
70]. Thus, it can be concluded that the Delft3D code is used to study a wide range of hydrological processes in rivers and reservoirs. This calculation code can be used to generate synthetic data over a wide range of changes in initial and boundary conditions. Using Delft3D code, it is possible to study areas with spatial scales of the order of hundreds of kilometers on modern computers. That is, it is possible to calculate 2D/3D hydrological processes for rivers, reservoirs, and sea areas.
The purpose of this work is to develop an effective PINN model for solving 2D forward and inverse problems relating to hydrological processes in a model channel with given geometric parameters using synthetic data obtained from Delft3D open source hydrological code. PINNs will be used to approximate the 2D Saint-Venant equations and to predict the inverse problem of finding the roughness coefficient.
The paper is organized as follows.
Section 1 contains an Introduction that provides a brief overview of the research area.
Section 2 covers the Materials and Methods. These include the general mathematical model for hydrological problems (
Section 2.1), the formulation of the Inverse Coefficient Problem (
Section 2.2), and the finite difference discretization of Saint-Venant equations (
Section 2.3).
Section 3 covers neural network architecture and a description of the loss Function in machine learning.
Section 4 covers the regularization methods and the optimization problem.
Section 5 covers the definition of the problem. These are definitions for 1D problems (
Section 6.1) and for 2D forward problems (
Section 6.2).
Section 6 covers the used approach.
Section 7 covers the main results. The results of numerical computations for all types of described models and their combinations are analyzed.
Section 8 covers the discussion, where both the results obtained and the hardware implementation are discussed. Finally,
Section 9 provides the conclusions and outlines future research plans.
3. Neural Network Architecture
In the framework of this paper, the architecture of a Fully Connected Neural Network (FCNN) is considered to construct a Physics-Informed Neural Network for modeling simple flow cases. For the neural network, the following concepts are introduced: an input layer with neurons with features specified at the input in the form of point coordinates and discrete time values, several hidden layers with neurons, and an output layer with neurons. The network also incorporates initial and boundary conditions, a point cloud representing the computational domain, and a loss function based on the continuity and momentum equations.
As a rule, PINNs consist of three main blocks. The first block computes the value of studied functions. The inputs for the FCNN are converted into corresponding outputs.
The second block takes the output function fields and calculates their derivatives using the initial equations for motion and continuity for fluid mechanics problems. The boundary and initial conditions, as well as the observational data from the experiment, are also evaluated. The last step is the backpropagation mechanism, which minimizes the loss function using a given optimizer (for example, Adam or L-BFGS-B) according to some learning rate in order to obtain the optimal parameters for the neural network.
3.1. Mathematical Model for Neural Networks
We consider an FCNN of
L layers and
neurons in the
kth layer. The weight matrix and bias vector in the
kth layer (1 <
k <
L) are denoted by
and
. The input vector is indicated by
and the output vector in the
kth layer is indicated by
and
. Following [
75], we introduce scalable parameters
that control the slope of the activation function
in each hidden layer, which has been shown to increase training speed.
The
hidden layer of the FCNN is defined as follows:
In general, the parameterized conservation law is given as follows:
We solve forward and inverse problems. In the forward setting, the solutions to partial differential equations are computed for known model parameters ; however, in the inverse case, the parameters are estimated based on observed or artificial datasets.
The mathematical model is reformulated as a surrogate problem, where solving the original PDE becomes equivalent to minimizing a loss function constructed from initial and boundary conditions along with the PDE residual. The global minimum of this function corresponds to the PDE solution.
The main hyperparameters for PINN include the following:
The number of layers and neurons is shown in
Table 2;
The function of activation: tanh;
The optimizers are Adam and L-BFGS on different stages to improve convergence;
The final number of points are num domain = 500, num boundary = 200;
The number of random method points = 10,000;
The kernel initializer for the weights in a neural network: Glorot uniform;
Taking into account the characteristic scales, the weighting coefficients were set equal to 1.
The final number of collocation points was chosen based on the predicted water surface level and the available VRAM on the Nvidia GPU card.
Increasing the number of points resulted in a significant increase in training time without a noticeable improvement in accuracy and a decrease in the stability of calculations. Reducing the number of points resulted in a significant difference compared to synthetic data. The simplest example of an FCNN for a PINN is shown in
Figure 1.
3.2. The Loss Function Value
The loss function value is formed by the summation of three components of errors for the residuals of the equations, as wekk as the boundary and initial conditions. The MSE metric is used to calculate the error.
The loss function for the 1D model is as follows:
Here, is the loss function for the equations; is the loss function for the boundary conditions; is the loss function for the initial conditions; is the dimensionless residual of the i-th equation at the n-th point; is the number of points inside the computational domain; , , and are the number of points at the inlet, at the outlet, and for the initial conditions; , , and , are the specified values of the discharge and the area of water section in the boundary and initial conditions; and and are the weights also used for non-dimensionalization.
The loss function for the 2D model is as follows:
Here,
is the loss function for the equations;
is the loss function for the boundary conditions;
is the dimensionless residual of the
i-th equation at the
n-th point;
is the number of points inside the computational domain;
and
are the number of points at the inlet and outlet;
,
, and
are specified values of velocities and depth in boundary conditions;
and
are the weights also used for non-dimensionalization.
Similarly, MSE values are calculated for the values of the magnitude functions at the boundaries of the computational domain and at the initial moment of time.
The neural network was also used to solve the inverse problem—finding the roughness coefficient n. It turned out to be most effective to use the new value as the desired variable and to restore the roughness coefficient n after the solution.
Since a variant of Newton’s method is used in the solution process, it is intuitively clear that calculating the derivative of a linear function is preferable. Moreover,
enters the equations linearly. The main approaches and parameters of the results presented in the solutions to problems using PINN methods are given in
Table 3.
The authors of [
76] present an overview of the approximation theory, along with an error analysis for PINNs. It includes a theorem demonstrating that feed-forward neural networks (FNNs), when equipped with a sufficiently large number of neurons, are capable of simultaneously and uniformly approximating any function, as well as their partial derivatives.
8. Discussion
8.1. Selecting Optimal Hyperparameters for PINNa
When PINNs are used, the number of points in a domain varied from 500 to 50,000 during training. The calculations showed that increasing the number of points when using the PINN led to a significant and disproportionate increase in training time, which is also due to the necessity to reduce the learning rate, lr.
Currently, classical numerical methods (finite-difference, finite-volume, and finite element methods) even for nonlinear equations use at least semi-implicit schemes, which are almost linear with respect to the variables at the next time step or the next iteration. In this case, the inversion of the arising well-conditioned matrices is carried out by extremely efficient methods.
When using PINNs, one of the variants of the optimization method (Adam or L-BFGS-B) is used to calculate the desired variables at the next iteration. The Saint-Venant equations are essentially nonlinear. In general, the stability of the iterative process is not guaranteed in this case. Currently, when the number of points in the domain is too large, combined with a poor initial approximation and the use of automatic differentiation, the likelihood of iteration divergence becomes higher compared to classical numerical methods. At the same time, experimentally, we determined that 500 points are enough for a stable learning process (
Table 6).
When performing calculations with the trained model using a large number of points, it is possible to achieve both a small error and a very fast modeling process. When using the trained model, it is possible to set, for example, 10,000 points for the given problems.
The task of selecting optimal hyperparameters for a neural network is an independent scientific problem. The solution of this problem requires the use of special scientific libraries such as Ray Tune, Optuna, HyperOpt, and Scikit-Optimise, as well as additional computational resources.
8.2. Water Level Value
Analyzing
Figure 9 for the water level value, one can notice the presence of oscillations for the results obtained with PINNs. The water level numerical solution is not too high in absolute value in the case of a 2D problem. In absolute terms, the values varied slightly. There are only 4 cm of change per 100 m.
When solving nonlinear problems using an iterative method, some empirical coefficients are commonly used. For example, weight coefficients and the learning rate of the neural network are commonly used. We have chosen these empirical coefficients in such a way as to achieve convergence. The analysis of a recent publication in the field of inverse problem solving using PINNs demonstrates the similarity of approaches to selecting these coefficients [
28]. The learning rate decreases during training.
The characteristic depth is m, and the characteristic velocity is m/s. . Since all characteristic orders are close to 1, the weighting coefficients were also taken to be equal to 1.
Several studies by scientific groups from the USA [
18,
19] demonstrated that PINNs successfully assimilated various types of observations and directly solved the 1D Saint-Venant equations. As a result, several model problems with small dimensions in the computational domain were solved.
The purpose of [
20] was to predict river water surface profiles and to evaluate the roughness parameter. The numerical solution of a 1D differential equation was employed for this task.
The real mountain river morphology was then studied, but only in a 1D formulation. We solved the direct and inverse 2D problems for a channel with a length of 1000 m using a PINN.
To study the processes of water level changes in mountain rivers, it is necessary to take into account the complex terrain, precipitation, and sediment transport. Several studies have been conducted in this area to study the hydrological processes of mountain rivers [
78,
79,
80,
81].
8.3. Convergence Behavior
In [
30], numerical trials were conducted using PINNs to identify the horizon parameter in both one- and two-dimensional peridynamic cases. The findings demonstrated the capability of PINNs to handle the inverse problem effectively, even under intricate kernel configurations. Furthermore, it was shown that stochastic gradient descent is a one-sided convergence behavior toward a global minimum of the loss formulation, indicating that the actual horizon parameter acts as an unstable equilibrium in the gradient flow mechanics of the network. In our work, we did not use any specific kernel function. Convergence behavior was always achieved using optimization methods (Adam and L-BFGS-B).
Figure 16 shows graphs of the behavior of the loss functions. It can be seen that the process converges to a constant value.
8.4. Hardware and Software Resources
The learning (training) process for the PINN was conducted on a Dell EMC PowerEdge XE8545 server with two Intel Xeon CPUs, running OS Linux Ubuntu, with 4 Nvidia A100 GPUs, where each GPU had 40 GB VRAM. The software stack was based on Python (Version 3.10.12), DeepXDE library (Version 1.12.1), TensorFlow framework (Version 2.17.0), Numpy (Version 1.26.4), Matplotlib (Version 3.9.2).
The DeepXDE library allows users to conduct their own development of thematic PINN models [
76]. In our case, the peculiarities of software implementation in Python were related to writing special functions to read synthetic data obtained from Delft3D code. We also needed to write a special function for solving the Saint-Venant equations.
The authors of [
32] aimed to assess the applicability of PINNs as a solution method for free surface flow problems over a non-flat bottom. The results of PINNs for augmented SWEs (PINN-augmSWE) are presented. For all 1D cases, a training process was performed with an NVIDIA A100 GPU device. The average training time was between 7 and 8 min for tests with a “base” configuration.
Our studies have shown that during the training process with the selected parameters, it was necessary to use about 18–20 GB of memory on a single Nvidia GPU A100 40 GB. A typical training process for a 2D case took from 2.5 to 3.5 h. On average, the prediction process took 5 to 10 s. In comparison, the calculation in the Delft3D code took about 2 min.
8.5. Comparison with Other Approaches
An analysis of publications addressing ill-posed inverse problems in two-dimensional formulations reveals a relatively limited number of works. Among these, significant contributions come from the research group led by Professor G.E. Karniadakis, which has extensively studied various model ill-posed inverse problems in aerohydrodynamics using Physics-Informed Neural Networks (PINNs).
For instance, Raissi et al. [
6] investigated the inverse problem of identifying two coefficients in the Navier–Stokes equations for incompressible flow around a cylinder at Reynolds number 100. This study utilized a fully connected neural network (FCNN) architecture and synthetic data generated by the Nektar++ spectral-element CFD code. Jagtap et al. [
75] expanded on this direction by applying PINNs and their extended variant, XPINNs, to compressible flows involving complex phenomena such as two-dimensional expansion waves, as well as oblique and bow shock waves. Their approach leveraged domain decomposition, deploying powerful neural networks locally within each subdomain to enhance representational capacity for intricate flow structures. In a related development, Lou et al. [
82] proposed a specialized PINN-BGK framework—consisting of three subnetworks for the equilibrium distribution function, approximating the non-equilibrium distribution function, and for encoding the Boltzmann-BGK equation—and demonstrated its applicability to simulating micro Couette and micro cavity flows with Knudsen numbers up to 5. Further extending the methodology to thermal processes, Shukla et al. [
83] employed conservative PINNs (cPINNs) and XPINNs to determine coefficients in thermal conductivity equations, while Ameya et al. [
84] used cPINNs to estimate boundary conditions for the two-dimensional Burgers equation. It is important to note that these studies primarily examine models and test cases, and it remains unclear how directly these methods translate to practical applications such as digital twin model development. In our work, we considered hydrological channels of lengths 100 and 1000 m. Solving both direct and inverse problems in such settings promises utility in analyzing straight river sections, irrigation channels, and soil field grooves. Another direction is presented in [
85], which shifts the emphasis towards inverse problems linked to numerical simulation modeling, covering diffusion, flow, and phase transition processes through PINNs. For solving inverse problems, it is important to choose optimizer solvers for the loss function wisely in order to find the optimal parameters of the neural network. Berardi et al. [
28] provide a comprehensive overview of optimizers such as GradNorm, PCGrad, Multi-Objective Optimization, and Self-Adaptive methods applied to a one-dimensional inverse transport problem in porous media.
In our research, we used a PINN based on an FCNN architecture, combined with ADAM and L-BFGS-B optimizers, demonstrating that this approach is both practically feasible and programmatically implementable.
The authors of the article are not aware of other works in the field of solving inverse problems in hydrology with a 2D formulation using PINN.