Book contents
- Frontmatter
- Contents
- Nomenclature
- Preface
- 1 Introduction
- 2 1D Heat Conduction
- 3 1D Conduction–Convection
- 4 2D Boundary Layers
- 5 2D Convection – Cartesian Grids
- 6 2D Convection – Complex Domains
- 7 Phase Change
- 8 Numerical Grid Generation
- 9 Convergence Enhancement
- Appendix A Derivation of Transport Equations
- Appendix B 1D Conduction Code
- Appendix C 2D Cartesian Code
- Bibliography
- Index
Appendix B - 1D Conduction Code
Published online by Cambridge University Press: 05 June 2012
- Frontmatter
- Contents
- Nomenclature
- Preface
- 1 Introduction
- 2 1D Heat Conduction
- 3 1D Conduction–Convection
- 4 2D Boundary Layers
- 5 2D Convection – Cartesian Grids
- 6 2D Convection – Complex Domains
- 7 Phase Change
- 8 Numerical Grid Generation
- 9 Convergence Enhancement
- Appendix A Derivation of Transport Equations
- Appendix B 1D Conduction Code
- Appendix C 2D Cartesian Code
- Bibliography
- Index
Summary
Structure of the Code
The 1D conduction code is divided into two parts:
a user part containing files COM1D.FOR and USER1D.FOR and
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.
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.
- Type
- Chapter
- Information
- Introduction to Computational Fluid Dynamics , pp. 284 - 305Publisher: Cambridge University PressPrint publication year: 2005