Figure 1.
Finite difference grid for one-dimensional problems.
Figure 1.
Finite difference grid for one-dimensional problems.
Figure 2.
Comparison of exact solution and numerical solution computed using FTCS numerical scheme. The numerical solution is computed using and .
Figure 2.
Comparison of exact solution and numerical solution computed using FTCS numerical scheme. The numerical solution is computed using and .
Figure 3.
Comparison of exact solution and numerical solution computed using third-order Runge-Kutta numerical scheme. The numerical solution is computed using and .
Figure 3.
Comparison of exact solution and numerical solution computed using third-order Runge-Kutta numerical scheme. The numerical solution is computed using and .
Figure 4.
Comparison of exact solution and numerical solution computed using Crank-Nicolson numerical scheme. The numerical solution is computed using and .
Figure 4.
Comparison of exact solution and numerical solution computed using Crank-Nicolson numerical scheme. The numerical solution is computed using and .
Figure 5.
Comparison of exact solution and numerical solution computed using implicit compact Pade numerical scheme. The numerical solution is computed using and .
Figure 5.
Comparison of exact solution and numerical solution computed using implicit compact Pade numerical scheme. The numerical solution is computed using and .
Figure 6.
Evolution of shock with time for the initial condition using FTCS scheme.
Figure 6.
Evolution of shock with time for the initial condition using FTCS scheme.
Figure 7.
Finite difference grid for one-dimensional problems where the the solution is stored at the interface of the cells. The first and last points lie on the left and right boundary of the domain. The stencil required for reconstruction of left and right side state is highlighted with blue rectangle. Ghost points are shown by red color.
Figure 7.
Finite difference grid for one-dimensional problems where the the solution is stored at the interface of the cells. The first and last points lie on the left and right boundary of the domain. The stencil required for reconstruction of left and right side state is highlighted with blue rectangle. Ghost points are shown by red color.
Figure 8.
Evolution of shock with time for the initial condition using WENO-5 scheme.
Figure 8.
Evolution of shock with time for the initial condition using WENO-5 scheme.
Figure 9.
Evolution of shock with time for the initial condition using CRWENO scheme.
Figure 9.
Evolution of shock with time for the initial condition using CRWENO scheme.
Figure 10.
Finite difference grid for one-dimensional problems where the the solution is stored at the center of the cells. The flux is also computed at left and right boundary. The stencil required for reconstruction of left and right side flux is highlighted with blue rectangle. Ghost points are shown by red color.
Figure 10.
Finite difference grid for one-dimensional problems where the the solution is stored at the center of the cells. The flux is also computed at left and right boundary. The stencil required for reconstruction of left and right side flux is highlighted with blue rectangle. Ghost points are shown by red color.
Figure 11.
Evolution of shock from sine wave () computed using conservative form of inviscid Burgers equation. The reconstruction of the field is done using WENO-5 scheme, and flux splitting and Riemann solver approach is used to compute the nonlinear term.
Figure 11.
Evolution of shock from sine wave () computed using conservative form of inviscid Burgers equation. The reconstruction of the field is done using WENO-5 scheme, and flux splitting and Riemann solver approach is used to compute the nonlinear term.
Figure 12.
Evolution of density, velocity, energy, and pressure at for the shock tube problem computed using Riemann solver based on Roe averaging. The true solution is calculated with grid resolution with and the low-resolution results are for grid resolution with .
Figure 12.
Evolution of density, velocity, energy, and pressure at for the shock tube problem computed using Riemann solver based on Roe averaging. The true solution is calculated with grid resolution with and the low-resolution results are for grid resolution with .
Figure 13.
Evolution of density, velocity, energy, and pressure at for the shock tube problem computed using Riemann solver based on Harten-Lax-van Leer Contact (HLLC) scheme. The true solution is calculated with grid resolution with and the low-resolution results are for grid resolution with .
Figure 13.
Evolution of density, velocity, energy, and pressure at for the shock tube problem computed using Riemann solver based on Harten-Lax-van Leer Contact (HLLC) scheme. The true solution is calculated with grid resolution with and the low-resolution results are for grid resolution with .
Figure 14.
Evolution of density, velocity, energy, and pressure at for the shock tube problem computed using Riemann solver based on Rusanov scheme. The true solution is calculated with grid resolution with and the low-resolution results are for grid resolution with .
Figure 14.
Evolution of density, velocity, energy, and pressure at for the shock tube problem computed using Riemann solver based on Rusanov scheme. The true solution is calculated with grid resolution with and the low-resolution results are for grid resolution with .
Figure 15.
Finite difference grid for two-dimensional problems. The calculation is done only for points shown by blue color. The solution at black points is extended from left and bottom boundary for periodic boundary condition. The solution is already available at all four boundaries for Dirichlet boundary condition.
Figure 15.
Finite difference grid for two-dimensional problems. The calculation is done only for points shown by blue color. The solution at black points is extended from left and bottom boundary for periodic boundary condition. The solution is already available at all four boundaries for Dirichlet boundary condition.
Figure 16.
Comparison of exact solution and numerical solution computed using fast Fourier transform method for the Poisson equation with periodic boundary condition.
Figure 16.
Comparison of exact solution and numerical solution computed using fast Fourier transform method for the Poisson equation with periodic boundary condition.
Figure 17.
Comparison of error for spectral method (Top) and second-order CDS (bottom) for three different grid resolutions. The error is defined as .
Figure 17.
Comparison of error for spectral method (Top) and second-order CDS (bottom) for three different grid resolutions. The error is defined as .
Figure 18.
Order of accuracy for spectral method and second-order CDS. We calculate discretization error at five grid resolutions and change the grid size by a factor of 2 in both x and y direction. The CDS Poisson solver give second-order accuracy. Spectral method give exact solution and error is of the same order as machine zero.
Figure 18.
Order of accuracy for spectral method and second-order CDS. We calculate discretization error at five grid resolutions and change the grid size by a factor of 2 in both x and y direction. The CDS Poisson solver give second-order accuracy. Spectral method give exact solution and error is of the same order as machine zero.
Figure 19.
Comparison of exact solution and numerical solution computed using fast sine transform method for the Poisson equation with Dirichlet boundary condition.
Figure 19.
Comparison of exact solution and numerical solution computed using fast sine transform method for the Poisson equation with Dirichlet boundary condition.
Figure 20.
Comparison of exact solution and numerical solution computed using Gauss-Seidel iterative method for the Poisson equation.
Figure 20.
Comparison of exact solution and numerical solution computed using Gauss-Seidel iterative method for the Poisson equation.
Figure 21.
Comparison of exact solution and numerical solution computed using conjugate gradient algorithm for the Poisson equation.
Figure 21.
Comparison of exact solution and numerical solution computed using conjugate gradient algorithm for the Poisson equation.
Figure 22.
Illustration of multigrid V-cycle framework with three levels between fine and coarse grid. For full multigrid cycle, the coarsest mesh has grid resolution and is solved directly.
Figure 22.
Illustration of multigrid V-cycle framework with three levels between fine and coarse grid. For full multigrid cycle, the coarsest mesh has grid resolution and is solved directly.
Figure 23.
Comparison of exact solution and numerical solution computed using multigrid framework for the Poisson equation.
Figure 23.
Comparison of exact solution and numerical solution computed using multigrid framework for the Poisson equation.
Figure 24.
Residual history comparison for different iterative methods for Poisson equation with Dirichlet boundary condition. The stopping criteria for all iterative methods is that the residual should reduce below . The grid resolution for all cases is and .
Figure 24.
Residual history comparison for different iterative methods for Poisson equation with Dirichlet boundary condition. The stopping criteria for all iterative methods is that the residual should reduce below . The grid resolution for all cases is and .
Figure 25.
Vorticity field and streamfunction field for the lid-driven cavity benchmark problem.
Figure 25.
Vorticity field and streamfunction field for the lid-driven cavity benchmark problem.
Figure 26.
Evolution of the vorticity field at three time steps during the co-rotating vortex interaction. The solution is computed using second-order explicit solver.
Figure 26.
Evolution of the vorticity field at three time steps during the co-rotating vortex interaction. The solution is computed using second-order explicit solver.
Figure 27.
Evolution of the vorticity field at three time steps during the co-rotating vortex interaction. The solution is computed using hybrid Arakawa-spectral solver.
Figure 27.
Evolution of the vorticity field at three time steps during the co-rotating vortex interaction. The solution is computed using hybrid Arakawa-spectral solver.
Table 1.
Summary of different problems included in the CFD Julia module and the description of topics covered in these selected problems. Source codes are accessible to everyone at
https://github.com/surajp92/CFD_Julia.
Table 1.
Summary of different problems included in the CFD Julia module and the description of topics covered in these selected problems. Source codes are accessible to everyone at
https://github.com/surajp92/CFD_Julia.
Github Index | Description |
---|
01 | 1D heat equation: Forward time central space (FTCS) scheme |
02 | 1D heat equation: Third-order Runge-Kutta (RK3) scheme |
03 | 1D heat equation: Crank-Nicolson (CN) scheme |
04 | 1D heat equation: Implicit compact Pade (ICP) scheme |
05 | 1D inviscid Burgers equation: WENO-5 with Dirichlet and periodic boundary condition |
06 | 1D inviscid Burgers equation: CRWENO-5 with Dirichlet and periodic boundary conditions |
07 | 1D inviscid Burgers equation: Flux-splitting approach with WENO-5 |
08 | 1D inviscid Burgers equation: Riemann solver approach with WENO-5 using Rusanov solver |
09 | 1D Euler equations: Roe solver, WENO-5, RK3 for time integration |
10 | 1D Euler equations: HLLC solver, WENO-5, RK3 for time integration |
11 | 1D Euler equations: Rusanov solver, WENO-5, RK3 for time integration |
12 | 2D Poisson equation: Finite difference fast Fourier transform (FFT) based direct solver |
13 | 2D Poisson equation: Spectral fast Fourier transform (FFT) based direct solver |
14 | 2D Poisson equation: Fast sine transform (FST) based direct solver for Dirichlet boundary |
15 | 2D Poisson equation: Gauss-Seidel iterative method |
16 | 2D Poisson equation: Conjugate gradient iterative method |
17 | 2D Poisson equation: V-cycle multigrid iterative method |
18 | 2D incompressible Navier-Stokes equations (cavity flow): Arakawa, FST, RK3 schemes |
19 * | 2D incompressible Navier-Stokes equations (vortex merging): Arakawa, FFT, RK3 schemes |
20 | 2D incompressible Navier-Stokes equations (vortex merging): Hybrid RK3/CN approach |
21 * | 2D incompressible Navier-Stokes equations (vortex merging): Hybrid pseudo-spectral 3/2 padding approach |
22 | 2D incompressible Navier-Stokes equations (vortex merging): Hybrid pseudo-spectral 2/3 padding approach |
Table 2.
Comparison of different iterative methods in terms of iteration count, residual and CPU time for solving the Poisson equation on a resolution of and .
Table 2.
Comparison of different iterative methods in terms of iteration count, residual and CPU time for solving the Poisson equation on a resolution of and .
Iterative Solver | Iteration Count | Residual | CPU Time (s) |
---|
Gauss-Seidel | 416,946 | | 1662.08 |
Conjugate-Gradient | 1687 | | 4.30 |
V-cycle Multigrid | 9 | | 0.55 |
Table 3.
Comparison of CPU time for Julia and Python version of Navier-Stokes solver for grid resolution and . We note that the codes are written mostly for the pedagogical purpose and the CPU time may not be the optimal time that can be achieved for each of the programming languages.
Table 3.
Comparison of CPU time for Julia and Python version of Navier-Stokes solver for grid resolution and . We note that the codes are written mostly for the pedagogical purpose and the CPU time may not be the optimal time that can be achieved for each of the programming languages.
Programming Language | CPU Time (s) |
---|
Julia | 5.97 |
Python (nonvectorized) | 1271.55 |
Python (vectorized) | 18.46 |
Table 4.
Comparison of CPU time for Julia and Python version of pseudo-spectral solver at two grid resolutions. We highlight that the codes are not written for optimization purpose and the CPU time may not be the optimal time that can be achieved for each of the programming languages.
Table 4.
Comparison of CPU time for Julia and Python version of pseudo-spectral solver at two grid resolutions. We highlight that the codes are not written for optimization purpose and the CPU time may not be the optimal time that can be achieved for each of the programming languages.
Programming Language | CPU Time (s) |
---|
| | |
---|
Julia | 31.25 | 163.63 |
Python (Numpy) | 37.05 | 181.07 |
Python (pyFFTW) | 21.76 | 105.81 |