# Study on SPH Viscosity Term Formulations
## 5 Results II--Model Application in Practical Viscous Flows
### Lid-Driven Flow  
A lid-driven flow within a 2D square cavity of height \(H\) and width \(L\) is considered in the present section. The two side walls and the bottom wall of the cavity are stationary, while the top wall experiences a constant forced motion. The velocity of the top wall in the \(x\)-direction is given by \(U_{0}\). In the numerical study, the following parameters are used: \(H=L=1.0\) m, kinematic viscosity \(\
u=0.001\) m\({}^{2}\)/s, and \(\text{Re}=U_{0}L/\
u\), where \(U_{0}=1.0\) m/s is adopted.  
Figure 6: Convergence analysis of CPU time for different viscosity force models under the non-uniform particle distribution.  
Figure 7 gives the vector plots of lid-driven flow forced by the uniform motion of the top lid for the Reynolds number \(Re=1000\), with two different particle numbers of \(N=1600\) and 10,000, respectively. The computational time step \(\Delta t=0.001\) s is used. The simulation was carried out until \(t=40\) s when the velocity distribution reached the stable state. To validate the numerical results, Figure 8 gives the comparisons on the velocity amplitude distribution computed by the OpenFOAM (i.e., Open source Field Operation and Manipulation, [42]) and ISPH (VISC-04), in which a similar velocity field has been found from the two model results.  
OpenFOAM is a C++ toolbox for the development of customized numerical solvers, and pre-/post-processing utilities for the solution of continuum mechanics including CFD problems. OpenFOAM uses the finite volume method (FVM) and is a typically mesh-based numerical model. The FVM uses a co-located methodology on an unstructured grid with arbitrary grid element. A variety of available interpolation, discretization and matrix solution schemes can be selected at runtime and both the implicit and explicit solution techniques are accessible to the end-users.  
In order to quantify the accuracy of different viscosity calculation methods, Figure 9 gives the comparisons of velocity component distributions \(ux\) at \(x=0.5\) m and \(uy\) at \(y=0.5\) m with the experimental data of [PERSON] et al. [43] and OpenFOAM. In this case, the following computational parameters are used: particle size \(dx=0.005\) m, simulation time \(t=40\) s and Reynolds number \(Re=1000\). It is shown from Figure 9 that the results obtained by the four viscosity calculation methods are generally quite similar to each other. By examining the enlarged chart where the velocity experiences a larger gradient, however, it can be found that the results obtained by VISC-04 can get the best agreement with the experimental data.  
Furthermore, for the purpose of model convergence analysis, Figure 10 gives the errors in minimum \(ux\) value between the experimental data and various ISPH results for the different particle resolutions. The computational results of OpenFOAM are also shown for a comparison. The numerical error is defined by \(Err\)=\(|ux_{\min,n}-ux_{\min,e}|\), where \(ux_{\min,n}\) is the numerical minimum and \(ux_{\min,e}\) is the experimental one. According to the results in Figure 10, all errors obtained by the ISPH viscosity force models unanimously show a decreasing trend with a decrease in the particle size, i.e., an increase in the particle number. Meanwhile, VISC-04 can achieve the smallest errors among all viscosity force models under the same particle scale.  
Figure 10: Convergence and error analysis of four viscosity force models for the different particle resolutions of a lid-driven flow.  
Figure 9: Comparisons of four viscosity force models for the lid-driven flow: (**a**) \(ux\) velocity distribution; and (**b**) \(uy\) velocity distribution. OpenFOAM, Open source Field Operation and Manipulation; Exp, Experimental data of [PERSON] et al.