Last Updated: 1/19/2010
Computational Fluid Dynamics
& Heat Transfer I
Spring 2010
You may program in whatever
language you wish, but whatever language you choose, I strongly urge you to
develop good, well-structured, readable, documented code.
In the past few years the majority of students
have found Excel and its macro language Visual Basic for Applications (VBA) an
excellent choice, and I will provide code snippets in VBA and a few in Fortran.
The spreadsheet is used for input and its charting features are used for the
graphical presentation of results, while the heavy-duty number-crunching is
done in a highly-structured Visual Basic for Applications program. A write-up
covering everything I know about VBA may be downloaded here
and a little spreadsheet that demonstrates many features may be downloaded here. Other
excellent references on VBA are Walkenbach's Excel 2007 Power Programming
with VBA and Power Programming with VBA/Excel by Steven C.
Chapra. The former is for the serious
programmer, but the latter is aimed at beginning programmers.
You can get a free “Express” edition
of Visual Basic, Visual C# and Visual C++ at this Microsoft site.
If you use Fortran, the traditional scientific programming language, Fortran 90 or 95 is preferred, Fortran 77 will be tolerated, but Fortran 66 will be forbidden. You may also want to obtain your own Fortran 90 compiler; several brands, e.g., Intel (what used to be Microsoft and then was Digital and then Compaq; this is what is installed in the MAE Computer Lab), NAG, Absoft and Lahey are available. The latter has a stripped-down version (ELF90) available at a student discount.
The program ref90.f
demonstrates more than you need to know about Fortran 90, and a paper
describing all the features used in that program may be downloaded here. This program is written such that it would run
successfully without any changes under both the xlf90 compiler on the RS/6000's
we used to have and with the NAG compiler in both fixed and free format. You
may also want to special order one of the several reference books on Fortran 90
cited at the top of that program. Since Fortran 90 is a superset of Fortran 77,
you needn't worry if you have had no previous exposure to Fortran 90. The
initial programs will be identical to Fortran 77 (although compiled under
Fortran 90), unless you decide to use the ELF90, compiler, which unlike the
others, is not backwardly compatible with Fortran 77. Later in the course when
we move on to multi-dimensional problems, we will discuss many of the new
features of Fortran 90.
You are also welcome to use other commercial
products; e.g., MATLAB,
Mathematica, and
Maple, but you must
recognize that you will have the job of translating any of the bits and pieces
of Fortran or VBA code that I will give you into that package. Off-grounds students can special order these
packages at student discount rates through Cavalier Computers. You must have a valid UVa e-mail address to
shop there.
NOTE:
Links to Web Sites external to the