# Vectorized Numerical Algorithms to Solve Internal Problems of Computational Fluid Dynamics
## 9 Numerical Scheme
### Shock Tube  
In a shock tube (Sod problem), two regions are occupied by a gas (a diaphragm is located at \(x=0\)). When diaphragm is broken, two gases interact with each other. The problem has exact solution. It consists of a shock or rarefaction wave travelling to the left region, a shock or rarefaction wave travelling to the right region, and contact discontinuity. A wave front of rarefaction wave represents a fan of flow characteristics.  
The initial conditions correspond to two different solutions. Flow is subsonic in case 1, and flow is supersonic in case 2. Working substance is air; it is treated as ideal gas (\(\gamma=1.4\)).  
Figure 10: Dependence of numerical error on number of nodes. Symbols \(\bullet\), \(\blacksquare\), \(\blacktriangle\) correspond to upwind scheme and TVD schemes of 2 nd and 3 rd orders.  
Figure 9: Solution of wave equation at times 45 (**a,b**), 90 (**c,d**), 135 (**e,f**) with upwind scheme (**left**) and TVD scheme of 2 nd order (**right**). Symbols \(\blacksquare\) correspond to the exact solution.  
In case 1, \(\rho(x,0)=p(x,0)=2\) if \(x\leqslant 0\), and \(\rho(x,0)=p(x,0)=1\) if \(x>0\), \(u(x,0)=0\). The mesh contains 100 cells (mesh step size is \(\Delta x=1.0\)). To reach a steady state, 100 time steps are applied (time step is \(\Delta t=0.00058\)). The Courant number is fixed at 0.59.  
In case 2, \(\rho(x,0)=p(x,0)=20\) if \(x\leqslant 0\), and \(\rho(x,0)=p(x,0)=1\) if \(x>0\), \(u(x,0)=0\). The mesh contains 1000 cells (mesh step size is \(\Delta x=0.1\)). To reach a steady state, 100 time steps are applied (time step is \(\Delta t=0.00012\)). The Courant number is fixed at 0.54.  
The distributions of flow quantities are shown in Figure 11. The graphs presented show numerical solutions in a short period of time when initial discontinuity starts to break and the largest disturbance from the exact Riemann solver is observed. Solid line corresponds to the exact solution of Riemann problem, dotted line corresponds to calculation with Godunov scheme, symbols \(\bullet\) correspond to calculation with third-order numerical scheme, and circles correspond to calculation with the scheme using a piece-parabolic approximation of flow quantities in a control volume. In this case, Godunov scheme requires approximately 3.8 times more computational time than schemes with approximate solution of Riemann problem.  
The solution of shock tube problem [28] has a monotonic density profile. Solution of Lax problem [29] provides verification of properties of numerical schemes. Various numerical schemes correctly predict horizontal parts of density distributions. The distributions computed with second-order scheme have a slight increase in density in 1-2 mesh  
Figure 11: Distributions of pressure (**a,b**), density (**c,d**) and velocity (**e,f**) in Sod problem in case 1 (**left**) and case 2 (**right**). Solid lines show exact solutions, dotted lines show numerical solutions with Godunov scheme, and symbols \(\bullet\) correspond to calculations with numerical scheme of 3 rd order.  
cells to the right of contact discontinuity. The contact discontinuity is less smoothed in the numerical solutions computed with high-order accuracy schemes.