  Physics-informed neural networks (PINNs) have shown remarkable prospects in
the solving the forward and inverse problems involving partial differential
equations (PDEs). The method embeds PDEs into the neural network by calculating
PDE loss at a series of collocation points, providing advantages such as
meshfree and more convenient adaptive sampling. However, when solving PDEs
using nonuniform collocation points, PINNs still face challenge regarding
inefficient convergence of PDE residuals or even failure. In this work, we
first analyze the ill-conditioning of the PDE loss in PINNs under nonuniform
collocation points. To address the issue, we define volume-weighted residual
and propose volume-weighted physics-informed neural networks (VW-PINNs).
Through weighting the PDE residuals by the volume that the collocation points
occupy within the computational domain, we embed explicitly the spatial
distribution characteristics of collocation points in the residual evaluation.
The fast and sufficient convergence of the PDE residuals for the problems
involving nonuniform collocation points is guaranteed. Considering the meshfree
characteristics of VW-PINNs, we also develop a volume approximation algorithm
based on kernel density estimation to calculate the volume of the collocation
points. We verify the universality of VW-PINNs by solving the forward problems
involving flow over a circular cylinder and flow over the NACA0012 airfoil
under different inflow conditions, where conventional PINNs fail; By solving
the Burgers' equation, we verify that VW-PINNs can enhance the efficiency of
existing the adaptive sampling method in solving the forward problem by 3
times, and can reduce the relative error of conventional PINNs in solving the
inverse problem by more than one order of magnitude.
