Wednesday, October 9, 2013

Learning basics of Computational Fluid Dynamics (CFD)


The link below hosts the source code and java executable program (under bin folder), which will run by double clicking if Java is installed on your computer to produce output as shown in the snapshot below:


The program is a graphical tutor for demonstrating the effects of CFD parameters (such as Courant number, advection and diffusion Partial differential Equation (PDE) constants, implicit, explicit schemes, backward, forward, central difference and upwind schemes and some other parameters) on the solution. It also displays the behavior of advection PDE and diffusion PDE, and what kind of schemes work / fail in producing a stable solution. The program can also demonstrate the advantages and disadvantages of explicit and implicit schemes (like Courant number restrictions, diffusion and dispersion errors etc.)
This program is more suited for demonstrations by CFD teachers made to the students who have just started learning CFD. As the students learn the techniques of CFD, he/she can get a better insight of the behavior of CFD solutions by running this program by changing various parameters and observing the changes in solution.

For example: A student can see that for an “Advection equation” with a positive value of “PDE constant” backward difference works, however with a negative constant forward difference works (that is what the upwinding scheme does). Also with the same settings for an explicit time discretization, with Courant number greater than 1.0 the solution blows-up. The student can try various other combinations and see the numerical diffusion / dispersion / blowing-up of the solution.

The user can play and pause the solution at any time step. However the changes in inputs are only taken into consideration when the reset button is pressed, before the next play. The implicit solver uses the conjugate gradient iterative matrix solver for fast results, and to exploit the sparsity of the matrix.
You may choose to run the program from a command line to see the messages at the console for additional information by using the following command:

java -jar StabilityTutor.jar

Type the above command after navigating to the directory where the file “StabilityTutor.jar” is placed.

You may contact me for any additional help or reporting bugs (with subject “Stability Tutor”) at:
heySourabh@gmail.com
I will be glad to hear from you to understand the way in which you are using the program and whether it is helpful or not or suggest some changes.

Below are few snapshots of the program: