Page 305 - Introduction to Computational Fluid Dynamics
P. 305
P1: ICD
CB908/Date
0 521 85326 5
0521853265appb
APPENDIX B May 11, 2005 15:43
1D Conduction Code
B.1 Structure of the Code
The 1D conduction code is divided into two parts:
1. a user part containing files COM1D.FOR and USER1D.FOR and
2. a library part containing file LIB1D.FOR.
The user part is problem dependent. Therefore, the two files in this part are
used to specify the problem to be solved. In contrast, the library part is problem
independent. Thus, the LIB1D.FOR file remains unaltered for all problems. In this
sense, the library part may be called the solver whereas the user part may be called
the pre- and postprocessor.
This structure is central to creation of a generalised code. To execute the code,
USER1D.FOR and LIB1D.FOR files are compiled separately and then linked before
execution. The COM1D.FOR is common to both parts and its contents are brought
into each subroutine or function via the “INCLUDE” statement in FORTRAN.
Variable names starting with I, J, K, L, M, and N are integers whereas all others are
real by default. The list of variable names with their meanings is given in Table B.1.
The listings of each file are given at the end of this appendix.
B.2 File COM1D.FOR
In this file, logical, real, and integer variables are included. The PARAMETER
statement is used to specify the maximum array dimension IT and values of π,
GREAT, and SMALL. The latter are frequently required for generalised coding. The
variable names are given in a labelled COMMON as in COMMON/BOUND/...,
where BOUND is the label. Here, variables of relevance to boundary conditions
are included. If required, the user may add more variable names or arrays for the
specific problem at hand as shown at the bottom of the file.
284