Preprint
Article

This version is not peer-reviewed.

Physics-Informed Neural Networks for Excited Liquid Sloshing with Beating Response in a Rectangular Tank

A peer-reviewed version of this preprint was published in:
Symmetry 2026, 18(6), 917. https://doi.org/10.3390/sym18060917

Submitted:

23 March 2026

Posted:

24 March 2026

You are already at the latest version

Abstract
This paper applies physics-informed neural networks (PINNs) to laterally excited liquid sloshing in a two-dimensional rectangular tank, where near-resonant forcing (ωe/ω1 = 0.9) produces a multi frequency beating response with a period of approximately 10T1. Linearised potential flow theory governs the problem; the network learns the velocity potential φ(x,z,t) while the free-surface elevation η is injected analytically. Two training obstacles specific to forced sloshing are analysed. First, a zero solution trap arises because the trivial solution φ̂=0 satisfies all equations except the free-surface conditions, whose residuals are roughly 10−4 times smaller than the Laplace residual; characteristic scale normalisation combined with loss weighting (λD = λK = 100) breaks this trap. Second, spectral bias prevents standard MLPs from resolving the three co-existing frequencies (ω1, ωe, ∆ω); a Fourier time embedding that augments the input from 3 to 9 dimensions overcomes this limitation. Two additional techniques further reduce errors: a hard wall boundary condition enforced exactly via a cos(πx/B) spatial embedding, which eliminates wall collocation points; and a gradient-enhanced Laplace regulariser (∥∇(∇2φ̂)∥2) that constrains velocity smoothness through third-order automatic differentiation. An ablation study shows that these four techniques progressively reduce the horizontal velocity error from εu = 12.46% to 0.84%. Results are validated against a viscous finite-difference benchmark. Over one beating cycle the errors are εη = 0.15%, εu = 0.84%, and εw = 1.65%. Afrequency parameter study across ωe1 = 0.5–1.1 gives εη < 0.25% and εu < 2.3% for all near-resonance cases. For long-time simulation, a time-domain decomposition strategy with transfer learning partitions the domain into one-beat windows; extending to five beating cycles (50T1) yields εu = 3.43% and εη = 0.30% with no monotonic error accumulation across windows. The methodology is then extended to a three-dimensional rectangular tank (B × W × H) with bi-directional lateral excitation. The 3-D formulation introduces the y-dimension into the Laplace equation (∇2φ = φxx + φyy + φzz = 0), adds transverse wall boundary conditions (φ/∂y = 0) enforced exactly via a cos(πy/W) embedding, and extends the Fourier time embedding from 9 to 16 dimensions to accommodate six physical frequencies. The bi-directional excitation excites both (m,0) and (0,n) modal families, producing a genuinely three dimensional beating response. Results demonstrate that the proposed techniques transfer effectively to 3-D, with errors εη = 0.24%, εu = 1.31%, εv = 1.78%, and εw = 2.32% over one beating cycle (2,499 s training time).
Keywords: 
;  ;  ;  ;  ;  ;  ;  

1. Introduction

Liquid sloshing in partially filled containers arises in naval architecture, aerospace engineering, and civil engineering, where it affects the structural integrity of LNG carriers, spacecraft fuel tanks, and seismically loaded storage vessels [1,2]. Conventional computational approaches—finite-element methods [3], finite-difference methods [4], and boundary element methods—require mesh generation and time integration; for long transient simulations spanning tens of natural periods, these costs become considerable. Reduced-order models alleviate part of the burden but are typically restricted to a pre-selected set of modes.
Physics-informed neural networks (PINNs), introduced by Raissi et al. [5], embed the governing PDEs directly into the training loss, so the network is trained without labeled solution data. Reviews by Cai et al. [6] and Cuomo et al. [7] cover applications from Navier–Stokes flows to heat transfer; the open-source library DeepXDE [8] has further broadened accessibility.
Training PINNs for oscillatory problems is difficult in practice. Wang et al. [9] showed that imbalanced multi-component losses cause gradient pathologies in which the PDE residual dominates and suppresses boundary and initial condition learning; they proposed gradient-based adaptive weighting as a remedy. Jagtap et al. [10] addressed slow convergence through adaptive activation functions. A more fundamental obstacle is spectral bias—the preference of standard fully connected networks for low-frequency components of the target function, first analyzed by Rahaman et al. [11]. For oscillatory PDEs covering many cycles this can lead to severe temporal under-resolution. Tancik et al. [12] showed that mapping inputs through sinusoidal Fourier features enables networks to learn high-frequency functions; Wang et al. [13] extended the analysis to PINNs via Neural Tangent Kernel theory. Wang et al. [14] further proposed PirateNets with causal training to enforce temporal causality and prevent PINNs from using future information to predict past states, a common pathology in time-dependent problems.
For free surface and water wave problems, several strands of work have appeared in recent years. Sheikholeslami et al. [15] examined soft and hard boundary enforcement for linear Laplace-based waves, achieving velocity errors below 3% with a periodic hard boundary layer; their trial-function approach for the bottom boundary condition, however, restricted the solution space and increased errors by up to 15 times. Li et al. [16] treated fully nonlinear wave propagation using a quasi- σ coordinate transformation that maps the time-dependent free surface to a fixed domain, with a two-stage Adam/L-BFGS optimizer. Chen et al. [17] reconstructed rotational flow beneath periodic waves from sparse gauge data using WaveNets. More recently, Ehlers et al. [18] applied PINNs to the fully nonlinear potential flow equations for phase-resolved ocean wave assimilation and prediction, inferring the velocity potential throughout the fluid volume from surface elevation measurements alone.
Closer to the sloshing problem, Wessels et al. [19] proposed the Neural Particle Method, a Lagrangian PINN that tracks particle paths to handle the moving free surface; they simulated both small- and large-amplitude sloshing in a container and the dam-break problem, with good agreement with experimental data. Huang et al. [20] developed a boundary-and-initial-conditions-free PINN (bif-PINN) in Lagrangian coordinates that hardwires all boundary and initial conditions into the formulation via nonlinear residual connections; their approach solved the small- and large-amplitude sloshing cases accurately, whereas the original PINN failed entirely for all free-surface configurations. Shao et al. [21] combined PINNs with an improved neural particle method for violent sloshing simulation, validated against SPH results.
Despite this progress, all the above free-surface PINN studies address either periodic propagating waves over a few wavelengths or free sloshing (unforced) over a handful of cycles. The forced sloshing problem—where an external excitation near resonance produces a multi-frequency beating response spanning tens of natural periods—poses additional challenges that have not been addressed: the simulation must cover an order of magnitude more periods than a single natural cycle; the weak forcing creates free surface residuals orders of magnitude smaller than the Laplace residual, opening a zero-solution trap; and the multi-frequency temporal content exceeds the effective bandwidth of a standard MLP. The present work tackles these challenges for laterally forced sloshing at ω e = 0.9 ω 1 , where beating produces a response envelope over approximately 10 T 1 . Four configurations (C–F) progressively address the above difficulties, reducing ε u from 12.46% to 0.84%. The methodology is then extended to a three-dimensional rectangular tank with bi-directional excitation, demonstrating that the same techniques—Fourier embedding, hard wall boundary conditions, and gradient-enhanced regularisation—transfer effectively to the higher-dimensional setting.

2. Mathematical Formulation

2.1. Problem Setup

Consider a two-dimensional rectangular tank of length L and still-water depth h. The fluid is inviscid, incompressible, and irrotational, so the flow is described by a velocity potential φ ( x , z , t ) . The parameters are:
L = 2.0 m , h = 1.0 m , n = 1 ( first sloshing mode ) .
The wave number and natural frequency are:
k 1 = π L = 1.5708 rad / m ,
ω 1 = g k 1 tanh ( k 1 h ) = 3.7594 rad / s ,
with g = 9.81  m/s2. The natural period is T 1 = 2 π / ω 1 = 1.6713  s.
The tank is subjected to a lateral harmonic acceleration:
a ( t ) = a 0 sin ( ω e t ) , a 0 = 0.002 m / s 2 , ω e = 0.9 ω 1 = 3.3834 rad / s .
The excitation frequency is chosen near the first natural frequency to induce a beating response with period:
T beat = 2 π | ω 1 ω e | = 16.71 s 10 T 1 .
The simulation domain spans one full beating cycle: t [ 0 , T beat ] .

2.2. Governing Equation

In the non-inertial reference frame attached to the tank, the Euler equations for an inviscid, incompressible fluid read:
v t + ( v · ) v = 1 ρ p g z ^ a ( t ) x ^ ,
where v = ( u , w ) is the velocity vector, p is the pressure, ρ is the (constant) fluid density, g is gravitational acceleration, and a ( t ) x ^ is the pseudo-force due to the non-inertial frame. For irrotational flow ( × v = 0 ), a velocity potential φ exists such that v = φ . The incompressibility constraint · v = 0 then yields the Laplace equation:
2 φ = 2 φ x 2 + 2 φ z 2 = 0 , 0 < x < L , h < z < 0 .
Substituting v = φ into the Euler equation (6) and using the vector identity ( v · ) v = ( | v | 2 / 2 ) (valid for irrotational flow), one obtains the unsteady Bernoulli equation:
φ t + 1 2 | φ | 2 + p ρ + g z + a ( t ) x = C ( t ) ,
where C ( t ) is a spatially uniform function absorbed into φ by redefinition. This Bernoulli equation is the starting point for deriving the dynamic free surface boundary condition.
The velocity field is recovered from v = φ = ( u , w ) .

2.3. Boundary Conditions

KBBC (impermeable bottom):
φ z = 0 at z = h .
KWBC (impermeable walls):
φ x = 0 at x = 0 and x = L .
KFSBC (kinematic free surface):   The free surface is defined implicitly by F ( x , z , t ) = z η ( x , t ) = 0 . The kinematic condition requires that the free surface is a material surface, i.e., D F / D t = 0 :
D F D t = F t + u F x + w F z = η t φ x η x + φ z = 0 at z = η ( x , t ) ,
which yields the fully nonlinear KFSBC: η / t + ( φ / x ) ( η / x ) = φ / z at z = η . Under the small-amplitude assumption ( η / h = O ( ϵ ) , ϵ 1 ), we perform a Taylor expansion about the mean free surface z = 0 :
φ z | z = η = φ z | z = 0 + η 2 φ z 2 | z = 0 + O ( ϵ 2 ) .
Retaining only O ( ϵ ) terms and noting that ( φ / x ) ( η / x ) = O ( ϵ 2 ) , the linearized KFSBC becomes:
φ z = η t at z = 0 .
DFSBC (dynamic free surface):   Setting p = p atm (atmospheric pressure, taken as the reference) at z = η in the Bernoulli equation (8):
φ t | z = η + 1 2 φ x 2 + φ z 2 z = η + g η + a ( t ) x = 0 .
Again applying the Taylor expansion about z = 0 :
φ t | z = η = φ t | z = 0 + η 2 φ t z | z = 0 + O ( ϵ 2 ) ,
and noting that | φ | 2 = O ( ϵ 2 ) , the linearized DFSBC reads:
φ t + g η + a ( t ) x = 0 at z = 0 ,
where a ( t ) x is the pseudo-pressure term arising from the non-inertial reference frame.
Combined free surface condition.   Eliminating η from the linearized KFSBC (13) and DFSBC (16) by differentiating the DFSBC with respect to t and substituting η / t from the KFSBC yields:
2 φ t 2 + g φ z + a ˙ ( t ) x = 0 at z = 0 ,
where a ˙ ( t ) = a 0 ω e cos ( ω e t ) . This combined condition, while not used directly in the PINN loss, provides physical insight: the free surface acts as a dispersive wave guide with the forcing a ˙ ( t ) x injecting energy into the system.

2.4. Initial Condition

Since the tank starts from rest, φ ( x , z , 0 ) = 0 and φ / t ( x , z , 0 ) = 0 . No terminal condition is imposed because φ does not vanish at t = T beat ; the two initial conditions together serve as temporal anchors.

3. PINN Methodology

3.1. Network Architecture

The neural network approximation φ ^ θ ( x , z , t ) is a fully connected feed-forward network (multilayer perceptron) defined by the recursive composition:
h ( 0 ) = x input , h ( ) = tanh W ( ) h ( 1 ) + b ( ) , φ ^ = W ( L + 1 ) h ( L ) + b ( L + 1 ) ,
where W ( ) R n × n 1 and b ( ) R n are the weight matrix and bias vector for layer . The collection of all trainable parameters is θ = { W ( ) , b ( ) } = 1 L + 1 . The network uses L = 16 hidden layers with n = 64 neurons, Xavier normal initialization, and a single scalar output. Velocities follow from automatic differentiation:
u = φ ^ x , w = φ ^ z .
In the enhanced configuration (Config E), the input is augmented with Fourier time features, increasing the input dimension from 3 to 9 (see Section 3.6). The configuration is summarized in Table 1.

3.2. Loss Function and Automatic Differentiation

All required derivatives of the network output φ ^ = f θ ( γ ( x ) ) are computed via automatic differentiation (AD). By the chain rule through the Fourier embedding, the physical derivatives involve contributions from both the normalized coordinates and the sinusoidal features. For instance:
φ ^ t = f θ t ˜ · 1 T sim + i = 1 3 f θ s i ω i cos ω i t f θ c i ω i sin ω i t ,
where s i = sin ω i t , c i = cos ω i t , and ω i { ω 1 , ω e , Δ ω } . The spatial derivatives are simpler: φ ^ / x = ( f θ / x ˜ ) / L and φ ^ / z = ( f θ / z ˜ ) / h . The second-order derivatives needed for the Laplace residual are:
2 φ ^ x 2 = 1 L 2 2 f θ x ˜ 2 , 2 φ ^ z 2 = 1 h 2 2 f θ z ˜ 2 .
In PyTorch, these are obtained via nested calls to torch.autograd.grad with create_graph=True.
The analytically derived η ( x , t ) from Eq. (44) and its time derivative η / t are directly substituted into the KFSBC and DFSBC as known boundary data:
r KFSBC ( p ) : = φ ^ z | z = 0 η exact t , r DFSBC ( p ) : = φ ^ t | z = 0 + g η exact + a ( t ) x .
This converts the free surface conditions from coupled evolution equations into deterministic Neumann–Dirichlet boundary data for the Laplace equation. The remaining residual operators are:
r GE ( p ) : = 2 φ ^ x 2 + 2 φ ^ z 2 , r KBBC ( p ) : = φ ^ z | z = h .
The lateral wall boundary condition φ ^ / x = 0 at x { 0 , B } is enforced exactly by the network architecture rather than as a soft penalty. The spatial input is transformed as x n = cos ( π x / B ) , so that the network output φ ^ depends on x only through cos ( π x / B ) . By the chain rule:
φ ^ x = f θ x n · π B sin π x B ,
which vanishes identically at x = 0 and x = B . This hard boundary condition removes the need for wall collocation points and reduces the number of loss terms.
A gradient-enhanced Laplace regulariser is added to enforce velocity smoothness. Since 2 φ = 0 implies 2 u = 0 and 2 w = 0 for harmonic functions, we penalise the spatial gradients of the Laplace residual:
r GL ( p ) : = 2 φ ^ 2 = x 2 φ ^ 2 + z 2 φ ^ 2 .
This requires third-order automatic differentiation and is evaluated on a randomly subsampled subset of 4,096 interior points per step to limit GPU memory consumption.
The remaining residuals are:
r IC ( p ) : = φ ^ ( x , z , 0 ) , r IC v ( p ) : = φ ^ t ( x , z , 0 ) .
Each individual loss component is the mean squared residual over the corresponding point set S m :
J m = 1 | S m | p S m r m ( p ) 2 .
Residual normalization. The main difficulty in the forced sloshing problem is the disparity in residual magnitudes. The GE residual involves second-order spatial derivatives ( O ( 1 ) ), while the DFSBC contains φ ^ / t Φ ω 1 and the KFSBC contains φ ^ / z | z = 0 Φ k 1 , where Φ is the characteristic potential amplitude. To equalize their contributions, we define the characteristic scale:
Φ = max x , t | φ exact ( x , 0 , t ) | ,
and normalize the free surface residuals:
r ˜ DFSBC ( p ) = r DFSBC ( p ) Φ ω 1 , r ˜ KFSBC ( p ) = r KFSBC ( p ) Φ k 1 .
The normalized MSE losses are then:
J ˜ DFSBC = 1 | S FS | p S FS r ˜ DFSBC ( p ) 2 , J ˜ KFSBC = 1 | S FS | p S FS r ˜ KFSBC ( p ) 2 .
The total weighted loss is:
J total = J GE Laplace + λ GL J GL grad - enhanced + J KBBC bottom + λ D J ˜ DFSBC + λ K J ˜ KFSBC free surface ( weighted ) + λ I J IC + J IC v initial conditions ,
where λ D = λ K = 100 , λ GL = 0.1 , and λ I = 10 . The lateral wall condition is enforced exactly by the cos ( π x / B ) embedding and does not appear as a loss term.

3.3. Collocation Points

Points are sampled on a structured grid of N x × N z × N t interior points in ( x , z , t ) [ 0 , B ] × [ h , 0 ] × [ 0 , T beat ] , with the vertical coordinate clustered toward the free surface via z = h ( 1 ξ 0.6 ) where ξ [ 0 , 1 ] is uniform. An additional 20 dense temporal points near t = 0 resolve the initial transient. Boundary points are sampled on the bottom ( N x × N t ) and free surface ( N x × N t ). No wall collocation points are needed due to the hard wall embedding. The initial condition is enforced on N x × N z points at t = 0 . The default grid uses N x = 31 , N z = 31 , N t = 161 , yielding ∼173,000 interior points per window.

3.4. Training Strategy

Training proceeds in two stages with stochastic mini-batch sampling to manage GPU memory. At each Adam step, 15% of the interior, free-surface, and bottom points are randomly subsampled and transferred to GPU (all initial-condition points are retained). For the L-BFGS phase, a fixed 30% subsample is used to maintain the deterministic closure required by the quasi-Newton algorithm. This keeps peak GPU memory below 8 GB regardless of the total grid size.
1.
Adam (first-order): For the single-beat case, 8,000 epochs are used; for the three-beat case, 20,000 epochs with a 500-step linear warmup followed by cosine annealing:
α k = α min + 1 2 ( α max α min ) 1 + cos ( k k warm ) π K Adam k warm ,
where α max = 10 3 , α min = 10 5 , and k warm = 500 . Gradient clipping ( θ J 1 ) is applied throughout.
2.
L-BFGS (quasi-Newton): Up to 2,000 iterations (single-beat) or 3,000 iterations (three-beat) with strong Wolfe line search ( c 1 = 10 4 , c 2 = 0.9 ), gradient tolerance 10 12 , function change tolerance 10 14 , and history size m = 100 . For the three-beat mini-batch case, the batch is rotated every five outer L-BFGS steps to improve domain coverage while maintaining the deterministic closure required by the algorithm. The Hessian approximation follows the standard BFGS update:
H k B k 1 , B k + 1 = B k B k s k s k B k s k B k s k + y k y k y k s k ,
where s k = θ k + 1 θ k and y k = θ J k + 1 θ J k .

3.5. Error Metric

The accuracy is quantified by the normalized mean absolute error (NMAE):
ε q [ % ] = i = 1 | E | | q PINN ( p i ) q exact ( p i ) | | E | max p E | q exact ( p ) | × 100 ,
where q { u , w , η } is any field quantity, and E = { ( x i , z j , t k ) } is a separate evaluation grid ( N x E × N z E × N t E ) that does not coincide with the training collocation points. We also report the relative L 2 error for comparison:
ε q L 2 [ % ] = i = 1 | E | [ q PINN ( p i ) q exact ( p i ) ] 2 1 / 2 i = 1 | E | [ q exact ( p i ) ] 2 1 / 2 × 100 .

3.6. Fourier Time Embedding

Standard MLPs with tanh activations exhibit spectral bias [11]: the normalized input t / T sim [ 0 , 1 ] must encode oscillations at ω 1 T sim 63  rad, far beyond the effective bandwidth of a standard MLP. Following Tancik et al. [12] and Wang et al. [13], we augment the input with sinusoidal functions at the three physical frequencies of the problem:
γ ( x ) = x ˜ , z ˜ , t ˜ , sin ( ω t ) , cos ( ω t ) R 9 ,
where x ˜ = x / L , z ˜ = ( z + h ) / h , t ˜ = t / T sim are normalised coordinates and ω = ( ω 1 , ω e , Δ ω ) with Δ ω = ω 1 ω e . Explicitly:
x input = γ ( x ) = x L , z + h h , t T sim , sin ω 1 t , cos ω 1 t , sin ω e t , cos ω e t , sin Δ ω t , cos Δ ω t .
This can be written compactly as γ ( x ) = ( x ˜ , sin ( B t ) , cos ( B t ) ) where B = ( ω 1 , ω e , Δ ω ) .
Unlike the random Fourier features of [13], the frequencies here are known a priori from the problem physics. The embedding increases the input dimension from 3 to 9, adding only 6 × 64 = 384 parameters ( < 1 % of total).

3.7. PINN Training Algorithm

The complete training procedure is summarized in Algorithm 1.
Algorithm 1:PINN Training for Excited Sloshing with Fourier Embedding
Require: 
Tank parameters ( L , h , a 0 , ω e ), network config ( N L , N n ), grid ( N x , N z , N t )
Ensure: 
Trained network φ ^ θ ( x , z , t )
1:
Precompute: ω 1 , k n , A n ( t ) , η exact ( x , t ) , η / t
2:
Generate collocation points: interior, boundary, IC on structured grid
3:
Initialize: MLP with Xavier normal, θ 0
4:
Construct Fourier input: Augment ( x , z , t ) with sin ( ω 1 t ) , cos ( ω 1 t ) , R 9
5:
for epoch = 1 to 8000 (Adam) do
6:
   Forward pass: φ ^ = MLP θ ( x input )
7:
   Compute residuals via auto-diff: r GE , r KBBC , r KWBC , r KFSBC , r DFSBC , r IC , r IC v
8:
   Normalize: r ˜ DFSBC r DFSBC / ( Φ ω 1 ) ,     r ˜ KFSBC r KFSBC / ( Φ k 1 )
9:
   Compute weighted total loss: J = J GE + + λ D J ˜ DFSBC + λ K J ˜ KFSBC + λ I ( J IC + J IC v )
10:
   Clip gradients: θ J 1.0
11:
   Update θ with Adam (cosine LR: 10 3 10 5 )
12:
end for
13:
for iter = 1 to 2000 (L-BFGS) do
14:
   Compute J and θ J (full batch)
15:
   Update θ with L-BFGS (strong Wolfe, history=100)
16:
end for
17:
Evaluate: Compute u , w , η on separate evaluation grid
18:
Return: φ ^ θ , error metrics ε u , ε w , ε η

3.8. PINN Framework Overview

Figure 1 shows the overall architecture. Coordinates ( x , z , t ) are first mapped through the Fourier embedding into a 9-dimensional input; this feeds a 16-layer MLP with 64 neurons per layer and tanh activations. All PDE and boundary residuals are formed by automatic differentiation of the scalar output φ ^ , assembled into the weighted loss, and minimised by backpropagation.

4. Results and Discussion

4.1. Analytical Solution

PINN predictions are validated against the closed-form solution of the linearised problem. The wall and Laplace equations admit spatial eigenfunctions ψ n ( x , z ) = cos ( k n x ) cosh [ k n ( h + z ) ] / cosh ( k n h ) with k n = n π / L for odd n. Substituting the modal ansatz
φ = n odd A n ( t ) ψ n ( x , z )
into the combined free surface condition (17) and projecting onto each mode yields the forced harmonic oscillator ODE for the modal amplitude:
A n + ω n 2 A n = a ˙ ( t ) c n , a ˙ ( t ) = a 0 ω e cos ( ω e t ) ,
where the natural frequency, forcing coefficient, and dispersion relation are:
ω n = g k n tanh ( k n h ) , c n = 4 L ( n π ) 2 , k n = n π L .
With zero initial conditions A n ( 0 ) = 0 , A n ( 0 ) = 0 , the particular solution is obtained via the method of undetermined coefficients:
A n ( t ) = C n cos ( ω e t ) cos ( ω n t ) , C n = a 0 ω e c n ω n 2 ω e 2 .
The general solution of Eq. (39) is A n ( t ) = α n cos ( ω n t ) + β n sin ( ω n t ) + A n ( p ) ( t ) , where the particular solution A n ( p ) ( t ) = C n cos ( ω e t ) . Applying the initial conditions determines α n = C n , β n = 0 , recovering Eq. (41).
For the first mode ( n = 1 ), the beating structure is explicit via the product-to-sum identity:
cos ( ω e t ) cos ( ω 1 t ) = 2 sin ( ω 1 ω e ) t 2 sin ( ω 1 + ω e ) t 2 ,
exhibiting a slow envelope at the beat frequency Δ ω = ω 1 ω e and a fast carrier at the mean frequency ω ¯ = ( ω 1 + ω e ) / 2 .
The complete velocity potential and free surface elevation are:
φ ( x , z , t ) = φ 0 ( t ) + n odd A n ( t ) cos ( k n x ) cosh [ k n ( h + z ) ] cosh ( k n h ) ,
η ( x , t ) = 1 g n odd A n ( t ) cos ( k n x ) + a ( t ) x L 2 ,
where φ 0 ( t ) = a 0 L / ( 2 ω e ) [ cos ( ω e t ) 1 ] ensures volume conservation ( 0 L η d x = 0 ), and the first five odd modes ( n = 1 , 3 , 5 , 7 , 9 ) are retained.
The analytical velocity components are obtained by differentiating Eq. (43):
u ( x , z , t ) = φ x = n odd k n A n ( t ) sin ( k n x ) cosh [ k n ( h + z ) ] cosh ( k n h ) ,
w ( x , z , t ) = φ z = n odd k n A n ( t ) cos ( k n x ) sinh [ k n ( h + z ) ] cosh ( k n h ) .
The time derivative of the modal amplitude, needed for η , is:
A n ( t ) = C n ω e sin ( ω e t ) + ω n sin ( ω n t ) .
The wave elevation is recovered from the DFSBC:
η PINN = 1 g φ ^ t | z = 0 + a ( t ) x .

4.2. Loss Landscape Analysis

This subsection explains why standard PINN training fails for forced sloshing and how the proposed remedies work.
The zero-solution trap. The trivial solution φ ^ = 0 satisfies the Laplace equation, all wall/bottom boundary conditions, and both initial conditions exactly. The only nonzero residuals are on the free surface:
r DFSBC | φ ^ = 0 = g η exact + a ( t ) x = φ exact t | z = 0 ,
r KFSBC | φ ^ = 0 = η exact t .
Since the first mode dominates ( | C 3 / C 1 | < 1 % ), the DFSBC loss at φ ^ = 0 can be evaluated analytically retaining only n = 1 :
J DFSBC | φ ^ = 0 C 1 2 ( ω e 2 + ω 1 2 ) 4 + a 0 2 L 2 8 = 2.87 × 10 5 ,
using sin 2 ω t 1 / 2 and cos 2 k 1 x = 1 / 2 (verified against numerical quadrature to 0.2% accuracy). A randomly initialized network produces J GE ( init ) O ( 10 1 ) , yielding the ratio
J DFSBC | φ ^ = 0 J GE ( init ) 10 4 ,
so the DFSBC penalty for the zero solution is negligible—the optimizer has no incentive to deviate from φ ^ = 0 .
Breaking the trap. Two mechanisms are combined to escape the zero-solution trap. First, the DFSBC and KFSBC residuals are divided by their characteristic scales Φ ω 1 and Φ k 1 , which amplifies the normalized zero-solution loss from 2.87 × 10 5 to J ˜ DFSBC | φ ^ = 0 = 0.121 . Second, applying a weight λ D = 100 further elevates this to λ D J ˜ DFSBC | φ ^ = 0 = 12.1 , which exceeds J GE ( init ) by two orders of magnitude and reshapes the loss landscape so that φ ^ = 0 is no longer a local minimum.

4.3. External Validation Against Chen & Nokes (2005)

The PINN was re-run with the parameters of Chen & Nokes [4] ( B = 0.9 m, d 0 = 0.6 m, X 0 / d 0 = 0.00186 , ω e / ω 1 = 0.9 , Fig. 5c therein). As shown in Figure 2, the PINN agrees with the linear analytical solution to within ε η = 0.15 % over the full beating cycle ( T beat = 10 T 1 ). The slightly lower peak amplitude in Chen’s viscous nonlinear FDM is attributable to viscous dissipation and nonlinear effects absent from the present inviscid linearised formulation.
Ablation of remaining techniques.Table 2 isolates the effect of temporal resolution and Fourier embedding, starting from the configuration where the zero-solution trap has already been broken (normalized + weighted, λ D = λ K = 100 ).
Config C ( N t = 51 5 pts/ T 1 ) gives ε η = 0.30 % but ε w = 21.36 % due to temporal under-resolution. Increasing to N t = 201 ( 20 pts/ T 1 , Config D) reduces ε w to 15.40%. The Fourier embedding (Config E) alleviates spectral bias: ε η drops to 0.18% and ε w to 4.68%. Config F adds the hard wall boundary condition (removing wall collocation points) and the gradient-enhanced Laplace regulariser, yielding ε u = 0.84 % and ε w = 1.65 % —a further 4.5 × improvement in velocity accuracy. Config F is used for all subsequent simulations.

4.4. Velocity Fields

Figure 3 compares the analytical and PINN velocity fields at t = T beat / 4 (within Window 0 of the 3-beat decomposition), together with the pointwise error. The horizontal velocity u in Window 0 has ε u = 0.83 % ; the PINN reproduces the sinusoidal spatial variation and the cosh-dependent depth profile. The largest u-errors appear near the tank bottom ( z / h < 0.6 ), where velocity magnitudes are small and relative errors are amplified.
The vertical velocity w in Window 0 has ε w = 1.50 % , with errors concentrated near the bottom corners where the sinh depth profile attenuates the signal to near-zero values. In the free surface region ( z / h > 0.3 ), both velocity components have errors below 2%. The overall 3-beat errors ( ε u = 3.26 % , ε w = 3.87 % ) are higher because of the later windows (see Table 4).

5. Simulation Results

The single-beat case ( T sim = T beat = 10 T 1 ) is examined first through wave elevation, velocity potential, and flow fields; the method is then extended to a three-beat simulation ( 3 T beat = 30 T 1 ) to test long-time accuracy.

5.1. Wave Elevation

Figure 4 shows the wave elevation at the left wall ( x = 0 ) and right wall ( x = L ) over three beating cycles ( 3 T beat = 30 T 1 ). Both walls are antinodes of the first sloshing mode, with peak amplitudes of ± 1.65 mm. The PINN predictions track the analytical solution throughout all three beats ( ε η = 0.30 % ), reproducing the growth, peak, and decay phases of each beating envelope without visible drift.

5.2. Velocity Potential at Free Surface

Figure 5 shows the velocity potential φ at the free surface ( z = 0 ) as a function of x / B and t / T 1 over three beating cycles. The analytical field exhibits alternating positive and negative bands whose amplitude follows the beating envelope. The PINN output is visually identical; the maximum absolute error is 9.5 × 10 4 m2/s against a potential amplitude of 2.5 × 10 2 m2/s. Errors are largest in Window 2, consistent with the per-window velocity errors in Table 4. No discontinuities appear at the window boundaries (dashed lines).

5.3. Frequency Parameter Study

To test how the method performs across different excitation conditions, five frequency ratios are selected: ω e / ω 1 = 0.5 (far from resonance), 0.8 (moderately close), 0.9 (baseline), 0.95 (near-resonance), and 1.1 (above resonance). All simulations use the Chen & Nokes [4] tank geometry ( B = 0.9 m, d 0 = 0.6 m, X 0 / d 0 = 0.00186 ) and the same network architecture (16 layers × 64 neurons with Fourier embedding).
Figure 6 shows the left-wall wave elevation for all five cases. The beating period T beat = 2 π / | ω 1 ω e | ranges from 2.0 T 1 ( ω e / ω 1 = 0.5 ) to 20.0 T 1 ( ω e / ω 1 = 0.95 ), and the peak amplitude grows sharply as ω e / ω 1 1 . In each case the PINN reproduces both the carrier oscillations and the slowly varying envelope.
Table 3 lists the error metrics for all frequency ratios. The wave elevation error ε η stays below 0.25 % in every case. For excitation frequencies near the natural frequency ( ω e / ω 1 = 0.8 1.1 ), velocity errors are low ( ε u < 2.3 % , ε w < 2.9 % ). The far-from-resonance case ( ω e / ω 1 = 0.5 ) shows large relative velocity errors because the response amplitude is an order of magnitude smaller, so the normalisation denominator shrinks; absolute velocity errors are comparable. Training time is about 1900 s per beating cycle at all frequency ratios.
Figure 7 and Figure 8 compare the PINN velocity fields at t = T beat / 4 for ω e / ω 1 = 0.90 (baseline) and 0.95 (near-resonance). Each figure shows the analytical solution (top), PINN prediction (middle), and pointwise error (bottom) for both u and w. Errors concentrate near the bottom corners where velocity gradients are steepest. At ω e / ω 1 = 0.95 the response amplitude is the largest among all cases, yet ε u = 1.05 % —the Fourier embedding handles the beating dynamics at all tested frequency ratios.

5.4. Long-Time Multi-Beat Simulation via Time-Domain Decomposition

A single PINN trained over a long time window runs into a capacity bottleneck: ε η stays low, but velocity errors grow with the temporal domain (e.g. ε u = 15.79 % for 3 T beat with one network, versus 0.84 % for 1 T beat ). We therefore partition the simulation into one-beat windows.
Method. The simulation domain [ 0 , N w T beat ] is partitioned into N w windows, each covering one beating period. For window k:
  • The temporal domain is t [ k T beat , ( k + 1 ) T beat ] with local normalisation t ^ = ( t k T beat ) / T beat .
  • The initial condition at t = k T beat is prescribed from the analytical solution: φ = φ exact , φ / t = ( φ / t ) exact .
  • Transfer learning: window k is initialised with the trained weights from window k 1 , providing a warm start that reduces training time by approximately 30 % compared to training from scratch.
Each window is trained independently (8,000 Adam + 2,000 L-BFGS steps) with the same collocation density as the single-beat case, so the per-window difficulty is the same as the already validated single-beat problem.
Figure 9 shows the wave elevation over five consecutive beating cycles ( 5 T beat = 50 T 1 ). The predictions from all five windows are stitched together and compared with the analytical solution; no visible degradation appears at the window boundaries.
Table 4 compares the per-window and overall errors for the 3-beat and 5-beat simulations. For the 3-beat case, the decomposition gives ε u = 3.26 % and ε w = 3.87 % overall, whereas the single-network approach yields ε u = 15.79 % for the same domain—a reduction by nearly a factor of five.
Extending to 5 beats ( 50 T 1 ), the overall errors are ε u = 3.43 % , ε w = 4.07 % , and ε η = 0.30 % . The per-window errors do not accumulate monotonically: Window 3 ( ε u = 2.60 % ) is more accurate than Window 2 ( 6.44 % ), indicating that accuracy fluctuates between windows rather than systematically degrading. The total training time for 5 windows is 9,760 s ( 2.7 h), scaling linearly with the number of windows.
Figure 10 shows the PINN velocity field at t = 3.5 T beat (middle of the fourth window in the 5-beat simulation). The spatial patterns match the single-beat results, with no sign of progressive degradation as more windows are added.

6. Extension to Three Dimensions

The preceding sections demonstrated that PINNs with Fourier embedding and hard wall boundary conditions can accurately capture multi-frequency beating in a 2-D tank. A natural question is whether these techniques extend to a three-dimensional configuration, where the additional spatial dimension introduces transverse modes and substantially increases the computational domain. This section presents the 3-D formulation, the required modifications to the network architecture, and preliminary results.

6.1. 3-D Problem Setup

Consider a three-dimensional rectangular tank of length B, width W, and still-water depth d 0 . The physical parameters are taken from the 2-D Chen & Nokes configuration with an added transverse dimension:
B = 0.9 m , W = 0.6 m , d 0 = 0.6 m .
The first-mode wave numbers and natural frequencies in each horizontal direction are: `small
k 1 x = π B , ω 1 x = g k 1 x tanh ( k 1 x d 0 ) = 5.764 rad / s ,
k 1 y = π W , ω 1 y = g k 1 y tanh ( k 1 y d 0 ) = 7.154 rad / s .
The tank undergoes bi-directional lateral excitation:
a x ( t ) = a 0 x sin ( ω e x t ) , a y ( t ) = a 0 y sin ( ω e y t ) ,
where ω e x = 0.9 ω 1 x and ω e y = 0.9 ω 1 y , with a 0 x = X 0 ω e x 2 ( X 0 / d 0 = 0.00186 ) and a 0 y = Y 0 ω e y 2 ( Y 0 / d 0 = 0.00120 ). This produces two independent beating responses with periods T beat , x = 2 π / | ω 1 x ω e x | 10 T 1 x and T beat , y = 2 π / | ω 1 y ω e y | 10 T 1 y .

6.2. 3-D Governing Equations

The velocity potential φ ( x , y , z , t ) satisfies the three-dimensional Laplace equation:
2 φ x 2 + 2 φ y 2 + 2 φ z 2 = 0 , 0 < x < B , 0 < y < W , d 0 < z < 0 .
The boundary conditions are extended as follows:
  • KBBC ( z = d 0 ): φ / z = 0 .
  • KWBC (x-walls): φ / x = 0 at x = 0 and x = B .
  • KWBC (y-walls): φ / y = 0 at y = 0 and y = W .
  • KFSBC ( z = 0 ): φ / z = η / t .
  • DFSBC ( z = 0 ): φ / t + g η + a x ( t ) x + a y ( t ) y = 0 .
  • IC ( t = 0 ): φ = 0 , φ / t = 0 .
The DFSBC now includes a y-direction forcing term a y ( t ) y , and the new KWBC on the y-walls is the only structurally new equation compared to the 2-D case.

6.3. 3-D Analytical Solution

Under linearised potential flow, the x- and y-excitations decouple into independent modal families. The x-excitation drives ( m , 0 ) modes (odd m) and the y-excitation drives ( 0 , n ) modes (odd n):
φ = φ 0 x ( t ) + m odd A m ( t ) cos ( k m x x ) cosh [ k m x ( d 0 + z ) ] cosh ( k m x d 0 ) + φ 0 y ( t ) + n odd B n ( t ) cos ( k n y y ) cosh [ k n y ( d 0 + z ) ] cosh ( k n y d 0 ) ,
where A m ( t ) = C m x [ cos ( ω e x t ) cos ( ω m t ) ] and B n ( t ) = C n y [ cos ( ω e y t ) cos ( ω n t ) ] follow the same forced-oscillator structure as the 2-D case. The free-surface elevation is:
η ( x , y , t ) = 1 g m odd A m ( t ) cos ( k m x x ) + a x ( t ) x B 2 + n odd B n ( t ) cos ( k n y y ) + a y ( t ) y W 2 .
The velocity components are u = φ / x , v = φ / y , w = φ / z . Numerical verification confirms that this solution satisfies all governing equations and boundary conditions to within finite-difference truncation error ( 10 5 ). Importantly, the y-modes contribute approximately 42% of the velocity potential at the tank corners, confirming that the 3-D problem is not a trivial extrusion of the 2-D case.

6.4. 3-D Network Architecture

The 3-D network retains the same MLP structure (16 hidden layers, 64 neurons, tanh) with the following modifications:
Hard wall BC in both directions. The spatial inputs are embedded as x n = cos ( π x / B ) and y n = cos ( π y / W ) . By the chain rule:
φ ^ x = f θ x n · π B sin π x B , φ ^ y = f θ y n · π W sin π y W ,
which vanish identically at x { 0 , B } and y { 0 , W } respectively. This eliminates all wall collocation points in both horizontal directions.
Extended Fourier embedding. The input is augmented from 9 to 16 dimensions to accommodate six physical frequencies:
γ 3 D ( x ) = cos π x B , cos π y W , z + d 0 d 0 , t T w , sin ω 1 x t , cos ω 1 x t , sin ω e x t , cos ω e x t , sin Δ ω x t , cos Δ ω x t , sin ω 1 y t , cos ω 1 y t , sin ω e y t , cos ω e y t , sin Δ ω y t , cos Δ ω y t ,
where Δ ω x = ω 1 x ω e x and Δ ω y = ω 1 y ω e y . The additional 7 input features add only ( 16 9 ) × 64 = 448 parameters ( < 1 % of total). Table 5 compares the 2-D and 3-D architectures.

6.5. 3-D Loss Function

The loss function retains the same structure and weights as the 2-D case, with the following modifications:
  • 3-D Laplace: r GE = φ ^ x x + φ ^ y y + φ ^ z z .
  • 3-D gradient-enhanced Laplace: r GL = ( x 2 φ ^ ) 2 + ( y 2 φ ^ ) 2 + ( z 2 φ ^ ) 2 .
  • DFSBC: r DFSBC = t φ ^ + g η + a x ( t ) x + a y ( t ) y at z = 0 .
The loss weights ( λ D = λ K = 100 , λ GL = 0.1 , λ I = 10 ) and training strategy (8,000 Adam + 2,000 L-BFGS) are unchanged from the 2-D case.

6.6. 3-D Collocation Grid

A structured grid of N x × N y × N z × N t interior points is used, with the same vertical clustering ( z = d 0 ( 1 ξ 0.6 ) ) and early-time densification as the 2-D case. The default 3-D grid uses N x = 21 , N y = 11 , N z = 21 , N t = 101 , yielding approximately 490,000 interior points per window. The 15% mini-batch strategy keeps per-step GPU memory comparable to the 2-D case.

6.7. 3-D Results

The 3-D PINN was trained on a single NVIDIA RTX 5090 GPU. Training for one beating cycle took 2,499 s ( 42 min), comparable to the 2-D training time of ∼1,920 s on an A100.

6.7.1. Wave Elevation

Figure 11 shows the wave elevation time history at two tank corners: ( x , y ) = ( 0 , 0 ) and ( x , y ) = ( B , 0 ) , where both x- and y-modal families contribute. The PINN tracks the analytical solution over one beating cycle with ε η = 0.24 % .

6.7.2. Free-Surface Pattern

Figure 12 shows the three-dimensional free-surface elevation η ( x , y ) at four time instants spanning one beating cycle ( t / T beat = 0.10 , 0.25 , 0.40 , 0.50 ). The analytical solution is rendered as a coloured wireframe mesh, while the PINN predictions are plotted as scatter points at the same grid nodes. The points sit precisely on the mesh surface at all four instants, confirming sub-percent accuracy. The bi-directional excitation produces a genuinely two-dimensional wave pattern: the free surface tilts in both x and y simultaneously, with peak amplitudes of 12 mm at the corners growing from 5 mm at t = 0.10 T beat to the maximum at t = 0.25 T beat , then decreasing as the beating envelope passes through zero.

6.7.3. Velocity Fields

Figure 13 compares the velocity fields at the y = W / 2 mid-plane at t = T beat / 4 . All three velocity components (u, v, w) are shown. The transverse velocity v = φ / y is a purely 3-D quantity with no 2-D counterpart; at y = W / 2 the transverse modes have sin ( n π y / W ) = ± 1 (odd n), so v reaches its maximum magnitude at this plane, providing a stringent test of the network’s ability to learn the y-modal contributions.

6.7.4. Error Metrics

Table 6 summarises the 3-D PINN accuracy over one beating cycle. The errors are computed over the full 3-D volume, not on a single slice.
Comparing with the 2-D results ( ε η = 0.15 % , ε u = 0.84 % , ε w = 1.65 % ), the 3-D errors are expected to be moderately higher due to the increased input dimensionality and the additional PDE terms. The transverse velocity error ε v is reported for the first time and reflects the network’s ability to learn the y-modal family.

7. Conclusions

This paper has applied PINNs to near-resonant excited sloshing with a beating response in both two-dimensional and three-dimensional rectangular tanks. For the 2-D case, two training obstacles specific to forced sloshing are identified and addressed. Residual normalization and loss weighting ( λ D = λ K = 100 ) eliminate the zero-solution trap; Fourier time embedding at the three physical frequencies ( ω 1 , ω e , Δ ω ) resolves spectral bias. A hard wall boundary condition via the cos ( π x / B ) embedding enforces the lateral wall condition exactly, and a gradient-enhanced Laplace regulariser ( ( 2 φ ) = 0 ) improves velocity accuracy. Together, these techniques yield ε η = 0.15 % , ε u = 0.84 % , and ε w = 1.65 % over one beating cycle, validated against the viscous finite-difference results of Chen & Nokes [4].
A frequency parameter study covers ω e / ω 1 = 0.5 1.1 , including the near-resonance regime. A time-domain decomposition strategy with transfer learning partitions the domain into one-beat windows. For the 3-beat case ( 30 T 1 ), decomposition reduces velocity errors from ε u = 15.79 % (single network) to 3.26 % . Extending to 5 beats ( 50 T 1 ), overall accuracy is maintained at ε u = 3.43 % and ε η = 0.30 % with no monotonic error accumulation.
The extension to three dimensions demonstrates that the same techniques—Fourier embedding, hard wall boundary conditions, and gradient-enhanced regularisation—transfer effectively to higher-dimensional sloshing. The 3-D formulation introduces bi-directional excitation that excites both ( m , 0 ) and ( 0 , n ) modal families, producing a genuinely three-dimensional free-surface response with y-modes contributing approximately 42% of the velocity potential at the tank corners. The 16-dimensional Fourier embedding accommodating six physical frequencies, combined with hard wall enforcement in both x and y directions, enables the network to capture the additional modal family with errors of ε η = 0.24 % , ε u = 1.31 % , ε v = 1.78 % , and ε w = 2.32 % over one beating cycle.
Future work will address nonlinear large-amplitude sloshing, complex tank geometries, broadband excitation spectra, and the coupling of time-domain decomposition with the 3-D formulation for long-time multi-beat simulations.

Author Contributions

Conceptualization, Z.L.; methodology, Z.L.; software, Z.L.; validation, Z.L.; formal analysis, Z.L.; investigation, Z.L.; writing—original draft preparation, Z.L.; writing—review and editing, Z.L.; visualization, Z.L. The author has read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The data that support the findings of this study are available from the corresponding author upon reasonable request.

Acknowledgments

The implementation uses PyTorch with automatic differentiation. The 2-D simulations were executed on an NVIDIA A100 GPU provided by Alibaba Cloud; the 3-D extension was trained on an NVIDIA GeForce RTX 5090.

Conflicts of Interest

The author declares no conflicts of interest.

References

  1. Faltinsen, O.M.; Timokha, A.N. Sloshing; Cambridge University Press: Cambridge, UK, 2009. [Google Scholar]
  2. Ibrahim, R.A. Liquid Sloshing Dynamics: Theory and Applications; Cambridge University Press: Cambridge, UK, 2005. [Google Scholar]
  3. Wu, G.X.; Ma, Q.W.; Eatock Taylor, R. Numerical simulation of sloshing waves in a 3D tank based on a finite element method. Appl. Ocean Res. 1998, 20, 337–355. [Google Scholar] [CrossRef]
  4. Chen, B.-F.; Nokes, R. Time-independent finite difference analysis of fully non-linear and viscous fluid sloshing in a rectangular tank. J. Comput. Phys. 2005, 209, 47–81. [Google Scholar] [CrossRef]
  5. Raissi, M.; Perdikaris, P.; Karniadakis, G.E. Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. J. Comput. Phys. 2019, 378, 686–707. [Google Scholar] [CrossRef]
  6. Cai, S.; Mao, Z.; Wang, Z.; Yin, M.; Karniadakis, G.E. Physics-informed neural networks (PINNs) for fluid mechanics: A review. Acta Mech. Sinica 2021, 37, 1727–1738. [Google Scholar] [CrossRef]
  7. Cuomo, S.; Schiano Di Cola, V.; Giampaolo, F.; Rozza, G.; Raissi, M.; Piccialli, F. Scientific machine learning through physics-informed neural networks: Where we are and what’s next. J. Sci. Comput. 2022, 92, 88. [Google Scholar] [CrossRef]
  8. Lu, L.; Meng, X.; Mao, Z.; Karniadakis, G.E. DeepXDE: A deep learning library for solving differential equations. SIAM Rev. 2021, 63, 208–228. [Google Scholar] [CrossRef]
  9. Wang, S.; Teng, Y.; Perdikaris, P. Understanding and mitigating gradient flow pathologies in physics-informed neural networks. SIAM J. Sci. Comput. 2021, 43, A3055–A3081. [Google Scholar] [CrossRef]
  10. Jagtap, A.D.; Kawaguchi, K.; Karniadakis, G.E. Adaptive activation functions accelerate convergence in deep and physics-informed neural networks. J. Comput. Phys. 2020, 404, 109136. [Google Scholar] [CrossRef]
  11. Rahaman, N.; Baratin, A.; Arpit, D.; Draxler, F.; Lin, M.; Hamprecht, F.; Bengio, Y.; Courville, A. On the spectral bias of neural networks. Proc. ICML 2019, 2019; PMLR: Long Beach, CA, USA; pp. 5301–5310. [Google Scholar]
  12. Tancik, M.; Srinivasan, P.P.; Mildenhall, B.; Fridovich-Keil, S.; Ramamoorthi, R.; Barron, J.T.; Ng, R. Fourier features let networks learn high frequency functions in low dimensional domains. Proc. NeurIPS 2020, Vol. 33, 7537–7547. [Google Scholar]
  13. Wang, S.; Wang, H.; Perdikaris, P. On the eigenvector bias of Fourier feature networks: From regression to solving multi-scale PDEs with physics-informed neural networks. Comput. Methods Appl. Mech. Eng. 2021, 384, 113938. [Google Scholar] [CrossRef]
  14. Wang, S.; Sankaran, S.; Wang, H.; Perdikaris, P. An expert’s guide to training physics-informed neural networks. J. Mach. Learn. Res. 2024, 25, 1–51. [Google Scholar]
  15. Sheikholeslami, M.; Salehi, S.; Mao, W.; Eslamdoost, A.; Nilsson, H. Physics-informed neural networks with hard and soft boundary conditions for linear free surface waves. Phys. Fluids 2025, 37, 087158. [Google Scholar] [CrossRef]
  16. Lu, H.; Wang, Q.; Tang, W.; Liu, H. Physics-informed neural networks for fully non-linear free surface wave propagation. Phys. Fluids 2024, 36, 062106. [Google Scholar] [CrossRef]
  17. Chen, L.; Li, B.; Luo, C.; et al. WaveNets: Physics-informed neural networks for full-field recovery of rotational flow beneath large-amplitude periodic water waves. Eng. Comput. 2024, 40, 2819–2839. [Google Scholar] [CrossRef]
  18. Ehlers, S.; Hoffmann, N.; Tang, T.; Callaghan, A.H.; Cao, R.; Padilla, E.M.; Fang, Y.; Stender, M. Physics-informed neural networks for phase-resolved data assimilation and prediction of nonlinear ocean waves. Phys. Rev. Fluids 2025, 10, 094901. [Google Scholar] [CrossRef]
  19. Wessels, H.; Weißenfels, C.; Wriggers, P. The neural particle method—An updated Lagrangian physics informed neural network for computational fluid dynamics. Comput. Methods Appl. Mech. Eng. 2020, 368, 113127. [Google Scholar] [CrossRef]
  20. Huang, C.; Liu, C.; Dettmer, W. Solving free-surface problems for non-shallow water using boundary and initial conditions-free physics-informed neural network (bif-PINN). J. Comput. Phys. 2023, 479, 112003. [Google Scholar] [CrossRef]
  21. Shao, K.; Wu, Y.; Jia, S. An improved neural particle method for complex free surface flow simulation using physics-informed neural networks. Mathematics 2023, 11, 1805. [Google Scholar] [CrossRef]
Figure 1. PINN architecture with Fourier time embedding ( s i = sin ω i t , c i = cos ω i t ; ω i { ω 1 , ω e , Δ ω } ). Residuals are assembled into the weighted total loss and minimised via backpropagation.
Figure 1. PINN architecture with Fourier time embedding ( s i = sin ω i t , c i = cos ω i t ; ω i { ω 1 , ω e , Δ ω } ). Residuals are assembled into the weighted total loss and minimised via backpropagation.
Preprints 204614 g001
Figure 2. External validation against Chen & Nokes [4] Fig. 5(c). Dimensionless wave elevation ( h d 0 ) / X 0 at the left wall ( x = 0 ) for ω e / ω 1 = 0.9 , B = 0.9 m, d 0 = 0.6 m, X 0 / d 0 = 0.00186 . The PINN (blue dashed) and linear analytical solution (red solid) agree to within ε η = 0.15 % over the full beating cycle.
Figure 2. External validation against Chen & Nokes [4] Fig. 5(c). Dimensionless wave elevation ( h d 0 ) / X 0 at the left wall ( x = 0 ) for ω e / ω 1 = 0.9 , B = 0.9 m, d 0 = 0.6 m, X 0 / d 0 = 0.00186 . The PINN (blue dashed) and linear analytical solution (red solid) agree to within ε η = 0.15 % over the full beating cycle.
Preprints 204614 g002
Figure 3. Velocity field comparison at t = T beat / 4 for the 3-beat decomposition. Top: analytical. Middle: PINN (Window 0). Bottom: pointwise error. Left: u. Right: w. Overall 3-beat errors: ε u = 3.26 % , ε w = 3.87 % ; Window 0 alone: ε u = 0.83 % , ε w = 1.50 % .
Figure 3. Velocity field comparison at t = T beat / 4 for the 3-beat decomposition. Top: analytical. Middle: PINN (Window 0). Bottom: pointwise error. Left: u. Right: w. Overall 3-beat errors: ε u = 3.26 % , ε w = 3.87 % ; Window 0 alone: ε u = 0.83 % , ε w = 1.50 % .
Preprints 204614 g003
Figure 4. Wave elevation over three beating cycles ( 3 T beat = 30 T 1 ) at the left wall ( x = 0 , red) and right wall ( x = L , blue). Lines: analytical. Markers: PINN. ε η = 0.30 % .
Figure 4. Wave elevation over three beating cycles ( 3 T beat = 30 T 1 ) at the left wall ( x = 0 , red) and right wall ( x = L , blue). Lines: analytical. Markers: PINN. ε η = 0.30 % .
Preprints 204614 g004
Figure 5. Velocity potential φ at z = 0 over 3 beating cycles. Left: analytical. Center: PINN. Right: error. Dashed lines mark window boundaries.
Figure 5. Velocity potential φ at z = 0 over 3 beating cycles. Left: analytical. Center: PINN. Right: error. Dashed lines mark window boundaries.
Preprints 204614 g005
Figure 6. Frequency parameter study: wave elevation ( h d 0 ) / X 0 at the left wall for five excitation frequency ratios. Lines: analytical. Markers: PINN.
Figure 6. Frequency parameter study: wave elevation ( h d 0 ) / X 0 at the left wall for five excitation frequency ratios. Lines: analytical. Markers: PINN.
Preprints 204614 g006
Figure 7. Velocity field at t = T beat / 4 for ω e / ω 1 = 0.90 ( ε u = 0.84 % , ε w = 1.65 % ). Best accuracy among all tested frequencies.
Figure 7. Velocity field at t = T beat / 4 for ω e / ω 1 = 0.90 ( ε u = 0.84 % , ε w = 1.65 % ). Best accuracy among all tested frequencies.
Preprints 204614 g007
Figure 8. Velocity field at t = T beat / 4 for the near-resonance case ω e / ω 1 = 0.95 ( ε u = 1.05 % , ε w = 1.74 % ). Despite the largest response amplitude, velocity errors remain low.
Figure 8. Velocity field at t = T beat / 4 for the near-resonance case ω e / ω 1 = 0.95 ( ε u = 1.05 % , ε w = 1.74 % ). Despite the largest response amplitude, velocity errors remain low.
Preprints 204614 g008
Figure 9. Long-time simulation: wave elevation at the left wall over five beating cycles ( 50 T 1 ) using time-domain decomposition. Lines: analytical. Markers: PINN. Vertical dashed lines mark window boundaries.
Figure 9. Long-time simulation: wave elevation at the left wall over five beating cycles ( 50 T 1 ) using time-domain decomposition. Lines: analytical. Markers: PINN. Vertical dashed lines mark window boundaries.
Preprints 204614 g009
Figure 10. PINN velocity field at t = 3.5 T beat (5-beat simulation, Window 3). Top: analytical. Middle: PINN. Bottom: pointwise error. Window 3 errors: ε u = 2.60 % , ε w = 3.45 % ; 5-beat overall: ε u = 3.43 % , ε w = 4.07 % .
Figure 10. PINN velocity field at t = 3.5 T beat (5-beat simulation, Window 3). Top: analytical. Middle: PINN. Bottom: pointwise error. Window 3 errors: ε u = 2.60 % , ε w = 3.45 % ; 5-beat overall: ε u = 3.43 % , ε w = 4.07 % .
Preprints 204614 g010
Figure 11. 3-D sloshing: wave elevation at the tank corner ( x = 0 , y = 0 ) and ( x = B , y = 0 ) over one beating cycle. Lines: analytical. Markers: PINN.
Figure 11. 3-D sloshing: wave elevation at the tank corner ( x = 0 , y = 0 ) and ( x = B , y = 0 ) over one beating cycle. Lines: analytical. Markers: PINN.
Preprints 204614 g011
Figure 12. 3-D free-surface elevation η ( x , y ) at four time instants. Wireframe mesh: analytical solution. Coloured dots: PINN prediction at the same grid nodes. The PINN points lie on the analytical surface at all times ( ε η = 0.24 % ).
Figure 12. 3-D free-surface elevation η ( x , y ) at four time instants. Wireframe mesh: analytical solution. Coloured dots: PINN prediction at the same grid nodes. The PINN points lie on the analytical surface at all times ( ε η = 0.24 % ).
Preprints 204614 g012
Figure 13. 3-D velocity field at y = W / 2 , t = T beat / 4 . Top row: analytical. Middle row: PINN. Bottom row: pointwise error. Left to right: u, v, w.
Figure 13. 3-D velocity field at y = W / 2 , t = T beat / 4 . Top row: analytical. Middle row: PINN. Bottom row: pointwise error. Left to right: u, v, w.
Preprints 204614 g013
Table 1. Neural network architecture.
Table 1. Neural network architecture.
Parameter Value
Input 3 ( x , z , t ) or 9 (with Fourier features)
Output 1 ( φ ^ )
Hidden layers 16
Neurons/layer 64
Activation tanh
Initialization Xavier normal
Parameters ∼62,700 (3-input) / ∼63,100 (9-input)
Table 2. Ablation study starting from the weighted-normalized baseline (Config C). Each row adds one technique. The zero-solution DFSBC loss is λ D J ˜ D ( 0 ) = 12.1 for all configurations (unchanged by temporal grid or Fourier features).
Table 2. Ablation study starting from the weighted-normalized baseline (Config C). Each row adds one technique. The zero-solution DFSBC loss is λ D J ˜ D ( 0 ) = 12.1 for all configurations (unchanged by temporal grid or Fourier features).
Error [%]
Config Description N t ε η ε u ε w
C Normalization + weighting ( λ = 100 ) 51 0.30 12.46 21.36
D C + dense temporal grid 201 0.27 10.53 15.40
E D + Fourier time embedding 201 0.18 3.78 4.68
F E + hard wall BC + gradient-enhanced Laplace 181 0.15 0.84 1.65
Table 3. Error metrics for different excitation frequency ratios. All cases use one beating cycle with the same network architecture.
Table 3. Error metrics for different excitation frequency ratios. All cases use one beating cycle with the same network architecture.
ω e / ω 1 T beat / T 1 ε η [%] ε u [%] ε w [%] Training [s]
0.50 2.0 0.15 50.78 21.72 1957
0.80 5.0 0.14 2.27 2.88 1924
0.90 10.0 0.15 0.84 1.65 1917
0.95 20.0 0.21 1.05 1.74 1893
1.10 10.0 0.24 1.49 2.77 1927
Large relative error due to very small velocity amplitude far from resonance; absolute errors remain small.
Table 4. Per-window and overall errors for multi-beat simulations using time-domain decomposition. Single-network result for 3 beats is shown for comparison.
Table 4. Per-window and overall errors for multi-beat simulations using time-domain decomposition. Single-network result for 3 beats is shown for comparison.
Method Window ε η [%] ε u [%] ε w [%]
Single network (3 beats) Overall 0.12 15.79 18.77
Decomposition (3 beats) Window 0 0.16 0.83 1.50
Window 1 0.25 2.64 3.26
Window 2 0.50 6.44 6.94
Overall 0.30 3.26 3.87
Decomposition (5 beats) Window 0 0.16 0.83 1.50
Window 1 0.25 2.64 3.26
Window 2 0.50 6.44 6.94
Window 3 0.23 2.60 3.45
Window 4 0.34 4.92 5.37
Overall 0.30 3.43 4.07
Table 5. Network architecture comparison: 2-D vs. 3-D.
Table 5. Network architecture comparison: 2-D vs. 3-D.
Parameter 2-D 3-D
Input dimension 9 16
Output 1 ( φ ^ ) 1 ( φ ^ )
Hidden layers 16 16
Neurons/layer 64 64
Physical frequencies 3 ( ω 1 , ω e , Δ ω ) 6 ( ω 1 x , ω e x , Δ ω x , ω 1 y , ω e y , Δ ω y )
Hard wall dims x only x and y
Parameters 63 , 100 63 , 550
Velocity outputs u , w u , v , w
Table 6. 3-D PINN error metrics over one beating cycle (full-volume NMAE).
Table 6. 3-D PINN error metrics over one beating cycle (full-volume NMAE).
ε η [%] ε u [%] ε v [%] ε w [%]
3-D (1 beat) 0.24 1.31 1.78 2.32
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

Disclaimer

Terms of Use

Privacy Policy

Privacy Settings

© 2026 MDPI (Basel, Switzerland) unless otherwise stated