Development of an Unstructured Two Dimensional Compressible Flow Solver
Weiyang Lin, W. Kyle Anderson
The goal of this project is to implement a fully unstructured solver for compressible fluid problems. The unstructured property saves the strength needed for grid generation and adaptation.
A nodal scheme is used. The control volumes are constructed at the medians of the triangles:
Since the resulting connectivity leads to a sparse matrix, a compressed row storage (CRS) is implemented. The use of CRS may be illustrated using the following example:
/* Sparse matrix-vector multiplication */
Loop i = 1,nrows
v(i) = 0.0
Loop j = IA(i),IA(i+1)-1
icolumn = JA(j)
v(i) = v(i) + A(j)*x(icolumn)
end Loop
end Loop
A backward-Euler time discretization is used. The spatial finite volume discretization requires an appropriate flux formulation at the control surfaces, where the van Leer flux is chosen [1].
An explicit solver can be implemented without the flux Jacobian, but it may suffer from stability issues. An implicit scheme is implemented by linearize the nodal residuals. The linearization can be accomplished by either finite-difference, complex Taylor series expansion, hand differentiation, or automatic differentation. After the flux Jacobian is constructed, the flow solver can be solved using a linear-matrix solver. For simplicity, a point-iterative solver such as Gauss-Seidel scheme is used.
Some of the simulation results can be seen below:
To achieve higher order spatial accuracy, the gradient information is needed. The gradient may be calculated using least squares or a Green-Gauss formula. The latter one is implemented in this project. The higher order spatial accuracy is obtained by
QL = Q(i) + gradient(i)*(rL - ri)
QR = Q(j) + gradient(j)*(rR - ri)
where QL and QR represent the left and right states at control surfaces. However, since the linearization for the higher-order terms takes efforts but will give a bad-conditioned matrix, the flux Jacobian based on 1st-order scheme is used. Finally, note that the CFL numbers can be ramped to facilitate the convergence, and the convergence of the linear-matrix system also affects the convergence, some numerical experiments are conducted
1. Before the stability limit is reached, higher CFL usually leads to higher convergence rates
2. The number of sub-iterations also affects the convergence
3. The increase of sub-iterations does not help the case with 2nd-order scheme very much
In addition to traditional comparisons with experimental data such as lift, drag, and pressure coefficients, the code may be further validated by a manufactured solution, where the solution may be seen as
1. First order scheme and the accuracy
2. Second order scheme and the accuracy
Here is a video showing the effect of numerical viscosity using the current flow solver:
Reference
Anderson, W. Kyle, James Lee Thomas, and Bram Van Leer. "Comparison of finite volume flux vector splittings for the Euler equations." AIAA journal 24, no. 9 (1986): 1453-1460.