Fourier Physics-Informed Neural Networks (FPINNs) for Fluid Dynamics (pt.II)
Helmholtz decomposition - recap
In the last post I showed the results of a simple Physics-Informed Neural Network (PINN) to perform the Helmholtz decomposition in Fluid Dynamics, that is to decompose the velocity into two components, $\mathbf{u}_s$ and $\mathbf{u}_c$, which represent the vortical and compressive motions, respectively.
The results of this experiment were encouraging but not exactly mind-blowing: the PINN, based on a multi-layer perceptron architecture, was able to solve the scalar Poisson equation in three dimensions and reconstruct the two velocity components up to 10% rms error (see previous post). This sounds a bit much, even though I chose a particularly simple and boring velocity field, and tripling the number of collocation points over which to solve the Poisson equation from 500 to 1500 only lowered the error slightly (from 10% to 7%).
Fourier-PINNs
One strategy that has been used (e.g. here https://arxiv.org/pdf/2508.04600) to increase the accuracy of the PINN is to integrate Fourier features in the neural network. In this way, we expose directly to the NN a new basis, made of sines and cosines (or complex exponentials), that complements the information in real space (that is, the coordinates x,y,z). Since the Laplacian operator appearing in the Poisson equation has a very simple expression in Fourier space, this approach seems very reasonable.
In practice, the implementation is as follows:
- the general architecture of the NN (multi-layer perceptron) is unchanged, BUT
- the 3 dimensional input (x,y,z) is now augmented by a vector of size N which is made of complex exponentials of the type e^{ik_n x}, where $k_n$ is a wave-vector that can be chosen at setup.
I implemented this Fourier-PINN as a subclass of the Equinox.Module class in Jax, using N=48 low-frequency Fourier modes. The number of weights in the PINN is unchanged from the basic model, which consists of 4 layers of width=32. I used an Adam optimizer and an exponentially decreasing learning rate.
Comparison with basic PINN
Now I perform again the same test as before, keeping everything the same (velocity field, random number generator, etc.), As you can see from the figure below, there is a drastic improvement in the accuracy of the PINN, going from 10% rms error to 0.5% for both the compressive and vortical components!
Test with more complicated velocity high-frequency
This is very encouraging. So let’s push the Fourier-PINN a bit further and try with a different initial velocity field, which has higher frequencies and is more complex. We keep everything else the same, except for the number of collocation, which we set at 1500 for better sampling. The result after 20k epochs is shown below, where we see that the Fourier-PINN is able to recover the compressive and vortical components within a 3% rms error, which is pretty good. If I use instead the basic PINN architecture the accuracy degrades to about 40% rms error, showing again the power of the new Fourier PINN.