<<

AIAA-96-0681 Computation of Thermally Perfect Compressible Flow Properties David W. Witte NASA Langley Research Center, Hampton, VA Kenneth E. Tatum Lockheed Martin Engineering & Sciences, Hampton, VA and S. Blake Williams Computer Science Corp., Hampton, VA

34th Aerospace Sciences Meeting & Exhibit January 15-18, 1996 / Reno, NV

For permission to copy or republish, contact the American Institute of Aeronautics and Astronautics 370 L'Enfant Promenade, S.W., Washington, D.C. 20024 Computation of Thermally Perfect Compressible Flow Properties

David W. Witte* NASA Langley Research Center Hampton, Virginia,

Kenneth E. Tatum† Lockheed Martin Engineering & Sciences Hampton, Virginia, and S. Blake Williams‡ Computer Sciences Corporation Hampton, Virginia

Abstract Introduction A set of compressible flow relations for a The traditional computation of the one- thermally perfect, calorically imperfect are dimensional (1-D) compressible flow gas derived for a value of cp (specific heat at constant properties is performed with one-dimensional pressure) expressed as a polynomial function of calorically perfect gas equations such as those of and developed into a computer NACA Report 11351. If the gas of interest is air, program, referred to as the Thermally Perfect then the tables of compressible flow values Gas (TPG) code. The code is available free from provided in NACA Report 1135 can be used. the NASA Langley Software Server at URL These tables were generated using the calorically http://www.larc.nasa.gov/LSS. The code perfect gas equations with a value of 1.40 for the produces tables of compressible flow properties ratio of specific heats, γ. The application of these similar to those found in NACA Report 1135. equations and tables is limited to that range of Unlike the NACA Report 1135 tables which are temperature for which the calorically perfect gas valid only in the calorically perfect temperature assumption is valid. However, a significant regime the TPG code results are also valid in the number of aeronautical engineering calculations thermally perfect, calorically imperfect extend beyond the temperature limits of the temperature regime, giving the TPG code a calorically perfect gas assumption, and the considerably larger range of temperature application of the tables of NACA Report 1135 application. Accuracy of the TPG code in the can result in significant errors. The temperature calorically perfect and in the thermally perfect, range limitation is greatly minimized by the calorically imperfect temperature regimes are assumption of a thermally perfect, calorically verified by comparisons with the methods of imperfect gas in the development of the NACA Report 1135. The advantages of the TPG compressible flow relations. (For the sake of code compared to the thermally perfect, terminology simplicity, throughout this paper the calorically imperfect method of NACA Report term “thermally perfect” will be used to denote a 1135 are its applicability to any type of gas thermally perfect, calorically imperfect gas.) The (monatomic, diatomic, triatomic, or polyatomic) purpose of this paper is to present a computer or any specified mixture of , ease-of-use, code which implements one-dimensional and tabulated results. compressible flow relations derived for a thermally perfect gas. A calorically perfect gas is by definition a gas for which the values of specific heat at constant * Aerospace Engineer, Hypersonic Airbreathing pressure, cp, and specific heat at constant Propulsion Branch, Member AIAA volume, cv, are constants. Therefore, in the † Staff Engineer, Senior Member AIAA derivation of the compressible flow relations for a ‡ Member of the Technical Staff calorically perfect gas, the value of cp was

Copyright  1996 by the American Institute of Aeronautics and Astronautics, Inc. No copyright is asserted in the United States under Title 17, U.S. Code. The U. S. Government has a royalty-free license to exercise all rights under the copyright claimed herein for Governmental purposes. All other rights are reserved by the copyright owner. American Institute of Aeronautics and Astronautics assumed constant. The resulting calorically Planck’s constant, ν is the characteristic perfect gas equations are derived in many frequency of molecular vibration, k is the compressible flow textbooks and are summarized Boltzmann constant, and T is the static in NACA Report 1135. The accuracy of these temperature. The complete set of thermally equations is only as good as the assumption of a perfect compressible flow relations based upon γ constant cp (and therefore a constant ). For any the cp variation given in equation (1) are listed in diatomic or polyatomic gas, the value of cp NACA Report 1135 in the section entitled actually varies with temperature and can only be “Imperfect-Gas Effects”. Tables of these approximated as a constant over some relatively thermally perfect gas properties are not provided small temperature range. At some point, as the because each value of total temperature, Tt, temperature increases, the cp value starts would yield a unique table of gas properties. increasing appreciably due to the excitation of NACA Report 1135 does provide charts of the the vibrational energy of the molecules. This thermally perfect air properties normalized by phenomena occurs around 450 to 500 K for air. the calorically perfect air values plotted versus Thus, above 500 K use of γ = 1.40 for air in the Mach number for select values of total calorically perfect gas equations will yield temperature. This approach is limited in noticeably incorrect results. The variation of cp application to only diatomic gases (e.g., N2, O2, with temperature (and with only temperature) and H2) because of the functional form used to continues for air up to roughly 1500 K. In this describe the variation of with temperature range, where the value of cp is only temperature. a function of temperature, air is considered a Because equation (1) is applicable to only thermally perfect gas. The derivation of the diatomic gases, a different method for computing compressible flow relations for a thermally the one-dimensional compressible flow values of perfect gas therefore must account for a variable a thermally perfect gas was developed and is heat capacity. Above 1500 K for air, and at some described in this paper. This method utilizes a relatively high temperature for all diatomic and polynomial curve fit of c versus temperature to polyatomic gases, dissociation of the molecules p describe the variation of heat capacity for a gas. starts to occur. When dissociation commences, The data required to generate this curve fit for a the value of c becomes a function of both p given gas can be found in tabulated form in temperature and pressure and the gas is no several published sources such as the NBS longer considered thermally perfect. The reason Tables of Thermal Properties of Gases3 and the for specifically citing the calorically perfect and JANAF Tables4. Actual coefficients for specific thermally perfect temperature limits for air is to types of polynomial curve fits are also available illustrate the much larger temperature range of from sources such as NASP TM 11075, NASA SP- application available from a thermally perfect 30016, and NASA TP 32877. Use of these curve compressible flow analysis. fits based upon tables of standard properties of NACA Report 1135 presents one method for gases enables the application of this method to computing the one-dimensional compressible any type of gas; monatomic, diatomic, and flow properties of a thermally perfect gas. In this polyatomic (e.g., H2O, CO2, and CF4) gases or approach the variation of heat capacity due to the mixtures thereof, provided a data set of cp versus contribution from the vibrational energy mode of temperature exists for the individual gas(es) of the molecule is determined from quantum interest. mechanical considerations through the A set of thermally perfect gas equations is assumption of a simple harmonic vibrator model derived for the specific heat as a polynomial of a diatomic molecule. With this assumption the function of temperature and is presented in the vibrational contribution to the heat capacity of a derivation section of this paper. This set of diatomic gas takes the form of 2 equations was coded into a computer program Θ ---- referred to as the thermally perfect gas (TPG) T c  Θ  2 e  ----- p  = ------(1) code, which represents the end product of this   Θ 2 R vib T ----  research effort. The code is available free from T  e – 1  the NASA Langley Software Server (LSS) at URL http://www.larc.nasa.gov/LSS. The output Θ ν/ where R is the specific gas constant, = h k, h is tables of the TPG program are structured to

2 American Institute of Aeronautics and Astronautics resemble the tables of one-dimensional Θ molecular vibrational energy compressible flow properties that appear in constant NACA Report 1135. The difference (and ν characteristic frequency of advantage) of the output tables from the TPG molecular vibration code is their validity in the thermally perfect temperature regime as well as in the calorically ρ static mass density (RHO) perfect temperature regime. This code serves Subscripts the function of the tables of NACA Report 1135 for any gas species or mixture of gas species 1 upstream flow reference point; (such as air), and significantly increases the e.g., upstream of shock wave range of valid temperature application due to its 2 downstream flow reference point; thermally perfect analysis. e.g., downstream of shock wave t total (stagnation) conditions NOMENCLATURE * critical (sonic) conditions Symbols i ith component gas species of the a speed of sound mixture A cross-sectional area of stream j jth coefficient of the polynomial tube or channel curve fit for cp Aj coefficients of the polynomial jmax the maximum j value curvefit for cp/R mix gas mixture 2 Beta M – 1 n total number of gas species that cp specific heat at constant pressure comprise gas mixture cv specific heat at constant volume perf quantity evaluated for gas that is e per unit mass both thermally and calorically perfect. h per unit mass, e + pv; Planck’s constant therm perf quantity evaluated for a gas that is thermally perfect but k Boltzmann constant calorically imperfect M Mach number, V/a vib vibrational contribution p static pressure Abbreviations q dynamic pressure, ρV2/2; heat 1-D one-dimensional added per unit mass CPG calorically perfect gas R specific gas constant JANAF Joint Army-Navy-Air Force T static temperature NACA National Advisory Committee for u velocity component parallel to Aeronautics the free-stream flow direction NASP National Aero-Space Plane v specific volume, 1/ρ NBS National Bureau of Standards V speed of the flow NTIS National Technical Information W molecular weight Service Y mass fraction TPG thermally perfect gas ∆ increment indicator GUI graphical user interface γ ratio of specific heats, cp/cv LSS Langley Software Server

3 American Institute of Aeronautics and Astronautics Derivation of Thermally Perfect Equations th where Yi is the mass fraction of the i gas species. Polynomial Curve Fit for cp The value of cpi is determined from equation (2) for each component species. To illustrate how this The selection of a suitable curve fit function equation is actually implemented in the code, for cp is the starting point for the development of consider the example of standard air consisting of thermally perfect compressible flow relations. the four major component species N2, O2, Ar, and The form chosen for use in the TPG code was the CO . eight-term, fifth-order polynomial expression 2 given below, where the value of c has been cp = YN cp +YO cp +YArcp + YCO cp p air 2 N 2 O Ar 2 CO (4) nondimensionalized by the specific gas constant. 2 2 2 8 c 1 1  2  3  4  5  j – 3 -----p = A ------ +A ---- +A +A ()T +A T  +A T  +AWritingT  + AthisT  equation= ∑ A T in its full form using R 12  2T  3 4 5 6 7 8 j T equation (2) gives j = 1 8   3  4  5  j – 3 1  1  5  A T  A T  A T  A T c = YN RN A ------+ Y...N +RYN AR A----  +T = + + + + +6 +7 + 8 = ∑ j (2) pair 2 2 1N 2  2 N2 2 2NN2 T8N 2 T 2 2 j = 1 1  ... 1  5 + YO RO A ------+YO +RYOOAROA----8  +T A1 through A8 are the coefficients of the curve fit 2 2 1O 2  2 2 2 2O 2 T O 2 T 2 2 for a given temperature range. This is the 1 1  5 5 + Y R A ------ +Y +RY AR A---- +T functional form for cp used in NASP TM 1107 Ar Ar 1 2  ...Ar ArAr 2 Ar8  Ar T Ar T Ar which provides values of A1 through A8 for 15 individual gas species. NASA SP 30016 provides 1  ... 1  5 (5) + YCO RCO A1 ------+YCO+ YRCO RA2 A----  +T 2 2 CO 2  2 CO22 COCO2 T8CO similar cp/R curve fit coefficient data (A3 through 2 T 2 2 A ) for over 200 individual gas species for a five- 7 By combining like terms in equation (5), a resultant term, fourth-order polynomial fit equation. 7 cp curve for the gas mixture (air) is generated. NASA TP 3287 also provides similar cp curve fit coefficient data for 50 reference elements for both 1  1  2 3 4 5 c = A ------+A ----  +A +A TA +T +A T +A T + A T pair 1air2  2air T 3air 4air 5air 6air 7air 8air a five-term (A3-A7) and a seven-term (A1-A7) T fourth-order polynomial fit equation. 2 3 4 5 = + + +TA +T +A T +A T + A T (6a) Equation (2) is valid with this coefficient data 5air 6air 7air 8air also, provided that the coefficients not used are where set equal to zero. If the pertinent cp/R versus temperature data has been fit into some other A = Y R A +Y R A + Y R A + jair N2 N2 jN O2 O2 jO Ar Ar jAr algebraic expression different from above, that 2 2 expression could easily be exchanged for = + + + Y R A , for j=1,8 (6b) r CO2 CO2 jCO equation (2) in the TPG code. The only 2 requirements are that closed-form solutions to In generalized terminology equations (6a) and (6b) c dT ()c ⁄ T dT both∫ p and ∫ p must be known. The are expressed as reason for these requirements will become jmax j – 3 apparent as the compressible flow relations are c = ∑ A T (7a) pmix jmix derived for a thermally perfect gas. j = 1 Mixture Properties and n The TPG code can be used to compute the A = ∑ Y R A , for j=1, jmax (7b) jmix i i ji thermally perfect gas properties for not only i = 1 individual gas species but also for mixtures of individual gas species (e.g., air). This capability With a known curve fit expression for cp of the γ is achieved in the code by calculating the gas mixture, the value of for a given temperature variation of the heat capacity for the specified gas can be computed directly from its definition. Mixture properties of gas constant and molecular mixture. The cp of a mixture of gases is computed from weight are also computed. n c = ∑ Y c (3) Isentropic Relations pmix i pi i = 1 If the flow is assumed to be adiabatic, then the 1-D energy equation written for two separate points

4 American Institute of Aeronautics and Astronautics T in the flowfield is t cp A11 1  1 1  Tt A52 2  A63 3  2 2 -----dT = – ------------– ------ – A ------– ------+A ln------+A ()T – T +------T – T  + ------T – T  u u ∫ 2 2 2  3 4 t 1 t 1 t 1 1 2 T 2   Tt T1 T 2 3 h + ------= h + ------(8) T Tt T1 1 2 2 2 1 A   A   where h is the enthalpy and u is the velocity. t () 5 2 2 6 3 3 = +------+A4 Tt – T1 +------Tt – T1  + ------Tt – T1  Using the definition of enthalpy h referenced to T 2 3 0 K gives A74 4  A85 5  +------T – T  + ------ T – T  (13) 4 t 1 5 t 1 T T 1 2 2 2 (9) u1 u2 Equations (12) and (13) are used in the TPG code ∫ c dT + ------= ∫ c dT + ------p 2 p 2 to compute the value of p /p for each value of T . 0 0 1 t 1 Detailed derivations of thermally perfect If point 2 is selected to represent the stagnation relations for the remaining isentropic properties condition, then u =0 and T =T . Then ρ ρ 2 2 t of q1/pt (dynamic to total pressure ratio), 1/ t equation (9) reduces to (static to total density ratio), and A1/A* (local to 8 2 T T T sonic area ratio) are given in NASA TP 3447 . u t 1 t -----1- =∫ c dT – ∫ c dT = ∫ c dT (10) 2 p p p Normal Shock Relations 0 0 T1 The continuity and momentum equations for where for the selected fifth-order curve fit for cp (equations 7a and 7b with jmax = 8) 1-D flow across a normal shock wave in a shock- fixed coordinate system are given in equations Tt 1 1  Tt A42 (14)2  andA5 (15),3 respectively.3  A64 4  c dT = – A ------– ------+A ln------+A (T – T ) +------T – T  +------T – T  + ------T – T  ∫ p 1T T  2 T 3 t 1 2 t 1 3 t 1 4 t 1 t 1 1 ρ u = ρ u (14) T1 1 1 2 2 2 2 p + ρ u = p + ρ u (15) A42 2  A53 3  A64 4  1 1 1 2 2 2 = + +) +------T – T  +------T – T  + ------T – T  2 t 1 3 t 1 4 t 1 Dividing the momentum equation by the continuity equation gives A75 5  A86 6  + ------Tt – T1  + ------ Tt – T1 p p 5 6 (11) 1 u 2 u ρ------+ 1 = ρ------+ 2 (16) 1u1 2u2 For a specified total temperature, the value of The relation for the speed of sound can be written equation (11) can be computed for a range of using the as static . Each value of static tem- 2 γp perature, T1 (T1 less than Tt), represents a a = ------(17) unique point in the expansion of the gas from its ρ stagnation conditions. With knowledge of γ, and Solving equation (17) for p and substituting into 2 γ equation (16) yields the speed of sound (a = RT), along with u1 from 2 2 equation (10), the Mach number is obtained. a a (18) 1 u 2 u γ------+ 1 = γ------+ 2 An expression for the static to total pressure 1u1 2u2 ratio p1/pt is obtained through the use of the first Equation (18) provides the needed relationship law of thermodynamics, the definitions of across the shock. For a given value of T the left- enthalpy and entropy, the equation of state, and 1 8 hand side of equation (18) is known from the assumption of isentropic flow . previous computations. The right-hand side of p1 1 equation (18) appears to have three unknowns γ , ------= ------(12) 2 T  pt t u2, and a2, but in reality these three variables are 1 cp  exp---- ∫ -----dT  all functions of only T2. (Actually u2 depends on R T  T1 both T2 and Tt2, but because a shock wave is considered adiabatic, ht2=ht1. This translates to For the selected fifth-order curve fit for cp, the Tt2=Tt1 for a thermally perfect gas because cp is closed form solution to the integral in a function of temperature only.) Therefore, the equation (12) is right-hand side of equation (18) can be expressed as one elementary, nonlinear function of T2. An iterative technique has been implemented in the TPG code to solve equation (18) for T2. With the

5 American Institute of Aeronautics and Astronautics γ known value of T2, the values of 2, u2, a2, and M2 gases vary with both total temperature Tt and γ are computed in the same manner as , u1, a1, local static temperature T rather than with only and M1 were determined for T1. The desired the ratio of T/Tt. Thus, the utility of the code is shock relations, T2/T1 and u2/u1, can then be its capability to generate tables of compressible computed. The expressions for the static flow properties for any total conditions over any pressure and density ratios across the shock, range of static temperatures (T

6 American Institute of Aeronautics and Astronautics Table 1. TPG code: Version 2.4 files and format, or may be output separately, in a second subroutines table cross-referenced to the isentropic properties by the Mach number and static Files: Contents: temperature. The table of normal shock properties begins with sonic conditions and TPG.f Main Program includes all supersonic entries. The tables are Version.h Include Code Version written to an output file by default since they can Identifier be rather extensive; however, they may be params.h Include Parameters written to standard output. The TPG code also provides options for additional output files for dimens.h Include Common Blocks plotting/postprocessing purposes. trangej.f Subroutine trangej A program loop over the temperature or Mach cpsubs.f Subroutines cpeval, range between the desired limits computes the cpNtgra, and cptNtgr basic isentropic properties. A second loop over all supersonic Mach numbers calculates the normal ntgrat.f Subroutines intCp and shock properties. After this loop is completed, intCpT the data are written to the tables and to a basic titer.f Subroutines t1iter and t2iter postprocessor file. Finally, normalization of the Cratio.f Subroutine Cratio thermally perfect data with that of a calorically perfect gas is performed, and the normalized initd.f Subroutine initd and Block results may be output to a second postprocessor Data file. Warning summaries of the number of times the valid polynomial curve fit temperature ranges have been exceeded during the questions are omitted, and defaults are assumed. calculations comprise the final output. These A particular database file may be specified next, warnings, if any, are related to the database describing the necessary thermochemical data information. for the gases of interest. The contents of such a database file are described in later paragraphs. Include (or Header) Files The code contains a default database necessary The Version.h file contains a character to define a four species mixture of air. The gas variable specifying the current version number of mixture definition is completed by specification of the computer code which is output at the the number of individual species and the beginning of each interactive execution, and in corresponding mass fractions, in the order of the the table header. Two files, params.h and species within the database. Defaults correspond dimens.h, contain information which determine to the standard composition of air. Error the size of the computer memory required to checking is incorporated within the code to execute the TPG code, and, thus, the size of the ensure that the sum of the mass fractions equals case which may be specified. The dimensions of unity, and that the database contains sufficient the primary arrays within the code are included information for the requested case. in a FORTRAN parameter statement in The next inputs define the composition and params.h and have the following values as format of the table(s). The total temperature released in Version 2.4: specifies the upper temperature limit output (for mtrm (=8) : number of polynomial terms which the Mach number is zero). Following that which define the is an input that specifies whether the tables are relationship for c /R, to be in terms of static temperature or Mach p number increments. The default entries in the mspc (=25) : maximum number of gas table(s) are given for incremental Mach numbers species allowed, over a particular range. Isentropic properties are mcvf (=3) : maximum number of always included in the table, and normal shock temperature ranges per properties may be included as an option. The species allowed and normal shock properties may be output in the corresponding sets of same table as the isentropic properties in a wide polynomial coefficients,

7 American Institute of Aeronautics and Astronautics mtncr (=10000) : maximum number of thus requiring the parameter mtrm to be at least computed static 5. Any mtrm of 5 or greater may be set in temperatures. params.h with no changes required in the All values assigned to the preceding FORTRAN code. However, for mtrm < 5, or for a parameters, except mtrm, may be changed to suit different expression defining cp/R, these three particular user requirements. A change in mtrm subroutines must be modified. Increasing mtrm may require coding changes in the subroutines beyond the code’s release value of 8 would include which perform specific calculations using the higher order powers of T (>5) in the polynomials. cp(T)/R relationships. The dimens.h file Temperature Iteration Subroutines specifies common blocks containing all of the major arrays that are dependent on the An expression for Mach number as a function parameters described above. of static temperature results from combining the relationship for the speed of sound within a Temperature Rangefinder Subroutine thermally perfect gas with equation (10) for A single function accurately describing the velocity. Subroutine t1iter solves the inverse of relationship between heat capacity and static this expression, that is, for temperature as a temperature over a wide temperature range for function of Mach number. The nonlinear typical gases is extremely difficult to define. equation is solved by means of a Newton Multiple polynomial functions over limited iteration. Subroutine t2iter implements a second temperature ranges are defined much more Newton iteration to solve equation (18) for the easily, even while maintaining continuity and static temperature T2 behind a normal shock. smoothness at the interfaces between individual Calorically Perfect Comparison ranges. References 5-7 provide such polynomial curve fits of the specific heat, specific enthalpy Subroutine Cratio may be called after all gas per temperature, and specific entropy for a properties have been computed using the number of gases over multiple temperature thermally perfect relationships. Given a user- γ ranges. The trangej subroutine determines the input value of , the routine uses the appropriate appropriate temperature range in which the equations from NACA Report 1135 to compute expression for specific heat is to be evaluated. corresponding gas properties for a calorically Given a particular temperature, the routine perfect gas. Each property computed by the selects the correct temperature range from the thermally perfect equations is normalized by the set of valid ranges for the gas mixture. In the calorically perfect value to allow analysis of the case of a temperature beyond the limits of any magnitude of the thermal dependency. range, the closest range is specified for Database File Format extrapolation, and a warning message is output for that particular temperature. A single The thermochemical data required by the extrapolation warning message is written at the TPG code for a given mixture of gases is defined end of the tabular file stating the temperature in a database file to be read at execution time. A below, or above, which extrapolations were database for the standard composition of air is performed. This warning message appears when contained within the code and may be accessed as any of the component species of a gas mixture the default. However, for mixtures of other require extrapolation. gases, or more complete models of air, a separate database file may be provided. The format is Polynomial Summation and Integration simple, grouped by species with a two-line Subroutines header, and additional databases are easily The equations defined in the derivation constructed. A sample two-species database is section require evaluation of c , the integral of c , shown in Table 2, with line numbers added (in p p italics) for reference. and the integral of cp/T. These evaluations are performed numerically in three subroutines: Line 1 is a descriptor of the data to follow on cpeval, cpNtgra, and cptNtgr. These routines line 2, and, as such, is merely a comment line. assume a polynomial expression of the form Line 2 gives the number of species for which the given in equation (7a). The smallest power of T file includes thermochemical data, and the is -2. The largest power of T must be at least +2, number of temperature ranges over which

8 American Institute of Aeronautics and Astronautics Table 2. Sample thermochemical database file

(1) # of species #of Temperature ranges : NASP TM 1107 + Mods. (2) 2 2 (3) Name: Molecular Wt. (4) N2 28.0160 (5) tmin tmax (6) 20. 1000. (7) Cp/R Coefficients: c1(-2) --> c1(5) (8) -1.33984200E+01 1.34280300E+00 3.45742000e+00 5.74727600E-04 (9) -3.21711900E-06 7.50775400E-09 -5.90150500E-12 1.50979900E-15 (10) tmin tmax (11) 1000. 6000. (12) Cp/R Coefficients: c2(-2) --> c2(5) (13) 5.87702841E+05 -2.23921563E+03 6.06686971E+00 -6.13957913E-04 (14) 1.49178026E-07 -1.92307130E-11 1.06193594E-15 0.00000000E+00 (15) Name: Molecular Wt. (16) O2 32.0000 (17) tmin tmax (18) 30. 1000. (19) Cp/R Coefficients: c1(-2) --> c1(5) (20) 3.88517500E+01 -2.70630800E+00 3.56119600E+00 -3.32782400E-04 (21) -1.18148000E-06 1.10853500E-08 -1.49299400E-11 5.99553800E-15 (22) tmin tmax (23) 1000. 6000. (24) Cp/R Coefficients: c2(-2) --> c2(5) (25) -1.05642070E+06 2.41123849E+03 1.73474238E+00 1.31512292E-03 (26) -2.29995151E-07 2.13144378E-01 -7.87498771E-16 0.00000000E+00 separate polynomials define cp/R as a function of number of species defined is less than expected. T. These integer values are read in free format. The thermochemical data for the first gas Version 2.4 of the code requires that, for each begins with line 3 which again is a descriptor for species within a particular file, each of the the next line of data. Line 4 contains the name polynomials must have the same limiting and molecular weight of the gas. Each temperatures for each range, except the absolute temperature range polynomial definition follows, minimum and maximum temperatures of the beginning with the lowest. Line 6 gives the overall definition. That is, if the polynomials for minimum and maximum temperatures for the one gas are valid from 200 K to 1000 K, and from first polynomial. Following another descriptor 1000 K to 5000 K, then each gas within that line, the coefficients A to A (or A if mtrm is database file must also be defined by one 1 8 mtrm not equal to 8) for the polynomial are given in free polynomial up to 1000 K, and a second one above format on lines 8-9. The minimum and 1000 K. The absolute extrema of 200 K and maximum temperatures for the second 5000 K are not required to be identical since the polynomial are given on line 11, and a second set code simply extrapolates the polynomials beyond of coefficients follows on lines 13-14. The pattern these limits. Extrapolation warnings are given is repeated for all the temperature ranges as based upon the worst case, that is, based upon specified in the database header. The data for a the extrema limits of the most conservatively second gas follows directly (lines 15-26), in the defined gas. same format as the first, and so on until all gases Lines 3-14 are repeated for each gaseous have been defined. species in the file. Error handling has been The TPG code uses the gas definitions in the incorporated within the code to recognize End-of- order specified within the database file, and mass File on most computers, without terminating fraction inputs must be in that same order. execution, for the case in which the actual However, mass fractions of zero are acceptable

9 American Institute of Aeronautics and Astronautics inputs, if it is desired to omit one or more of the tables to a file. Finally, through the use of the file leading species within a given file. Also, the browser a user can be sure that the desired polynomial coefficients for a particular gas do not database file does exist, and the associated all have to be nonzero. In particular, a species are displayed along with their mass or calorically perfect gas may be defined by a mole fraction. User-error is minimized since database in which all of the coefficients are zero, error checking is performed prior to calling the except A3 which equals the caloric constant for isentropic and normal shock algorithmic loops. c /R. p The GUI is written in the C programming Database files provided with the code as language and calls a FORTRAN subroutine when currently released on the NASA Langley the “Compute” button is clicked, if all the inputs Software Server contain curve fit definitions for meet error-checking criteria. The main the following gas species: N2, O2, Ar, CO2, H2O, FORTRAN subroutine basically consists of the NO, H2, OH, H, O, CF4, SF6, CH4, and calorically Main program from the FORTRAN version of perfect air. Multiple curve fit definitions, having TPG, with the interactive input removed. When different temperature ranges and varying “Compute” is selected, the GUI writes a polynomial orders, are provided for some of these temporary file with all data needed for the gas species. FORTRAN code. The remainder of the FORTRAN code is identical to that of the Graphical User Interface version interactive version, except that control returns to A second version of the TPG code utilizes a the GUI after the “Compute” operation is Motif-based X-window graphical user interface complete; thus repeated calculations are allowed for specification of the user inputs, thus replacing within a single session. the interactive question-and-answer portion of the program with a point&click window. Comparison to NACA Report 1135 Currently, this version of TPG only runs on a Sun Calorically Perfect Temperature Regime Microsystems workstation under the Unix operating system. Built using standard Motif The TPG code was compared to NACA Report widgets and the matrix widgets from the Bellcore 1135 to verify the code’s accuracy in the Application Environment library, the primary calorically perfect temperature regime using air window has pull-down “File” and “Help” menus, as the test gas. In this temperature regime the and five subwindow regions (see Fig. 1). Along specific heat of air is nearly constant and the TPG the top are text regions to accept the case ID and code results should be nearly identical to the a database file name; the latter may be specified tables of NACA Report 1135. For this test case by typing or through a file browser. A handy the default data file for standard four-species air “Compute” button activates the algorithmic loops was used along with the default values for the when proper inputs are provided. mass fraction composition of air. A stagnation temperature of 400 K was selected. This case The majority of the GUI window consists of was run using the Mach number increment four subregions which allow specification of: 1) option (as opposed to temperature increment) the gas species mixture, 2) the total temperature with a Mach number increment of 0.1, a and the tabular limits in terms of temperature or minimum Mach number of 0.0 (the default Mach number, 3) optional normal shock output, value), and a maximum Mach number of 3.0. A table formats, and postprocessor files, and 4) the portion of the TPG.out file for this test case is destinations of the tabular outputs. As in the given in Table 3. A comparison of this output FORTRAN version, defaults are provided for all with Tables I and II from NACA Report 1135 for inputs; however, unlike the interactive any matching Mach number shows the desired FORTRAN version, no user-action is required to agreement and validates the TPG code in this accept these defaults. In addition, the GUI has calorically perfect temperature regime. The several capabilities not found in the FORTRAN small differences that are observed between the code. Specific output file names may be specified corresponding values of Table 3 and the NACA in place of the defaults, and the species mixtures Report 1135 tables are in either the third or may be specified in terms of either mass or mole fourth digit. To better examine these small fraction. The output may be previewed in a differences the TPG code was used to generate separate on-screen window prior to writing the

10 American Institute of Aeronautics and Astronautics the ratio of the gas properties calculated with the utilization of multiple-range polynomial curve thermally perfect relations (Table 3) to those fits of theoretical data3-7 to model the variation of calculated from the calorically perfect relations heat capacity, which for this particular (NACA Report 1135 tables). These results have application of the code consisted of two fifth- been plotted versus Mach number in figures 2 order, eight-term polynomial curve fits. Note and 3. From these figures the maximum that, although figure 4 gives thermally perfect difference between the values listed in Table 3 results for air up to 3000 K, in reality dissociation and the NACA Report 1135 tables appears to be of O2 begins at approximately 1500 K, thus roughly 0.5 percent. Note that these small making air thermally imperfect due to a differences actually represent the small amount changing composition which is a function of both of error associated with the tabulated values of pressure and temperature. NACA Report 1135 resulting from the calorically The remaining gas properties computed by perfect gas assumption. Close inspection of the TPG code in the thermally perfect Table 3 reveals that a slight variation with temperature regime were verified for test cases temperature actually exists in the specific heat at total temperatures of 556 K (1000° R), 1111 K ratio which leads to the noted differences when (2000° R), 1667 K (3000° R), and 2778 K compared with the calorically perfect gas (5000° R), all with air (using the standard four- properties. species composition) as the test gas. These four Thermally Perfect Temperature Regime specific test cases were selected so that a comparison could be made with the caloric The first step in verifying the TPG code in the imperfection charts of NACA Report 1135 which thermally perfect temperature regime was to give the compressible flow gas properties for air compare the γ variation for air computed by the computed from the thermally perfect relations TPG code with both the γ variation calculated based upon equation (1) of this paper. Each of the from NACA Report 1135 (equation (180)1) and twelve charts from NACA Report 1135 gives the the theoretical thermally perfect γ variation from variation of one gas property, normalized by its the JANAF Thermochemical Tables4 (obtained calorically perfect value, versus Mach number for from the theoretical c data for N , O , Ar, and p 2 2 the above mentioned four total temperatures. CO ). The variation of γ as a function of 2 The TPG code results for these four test cases temperature is presented in figure 4. Below were also normalized by their calorically perfect 300 K, the NACA Report 1135 predicted γ values values and then plotted together with the results have attained their asymptotic value of 1.400 from the caloric imperfection charts of NACA while the γ values predicted by the TPG code Report 1135. (The results of NACA Report 1135 have reached a slightly greater asymptotic value have been regenerated here for plotting purposes of 1.401 which is in agreement with the from equations (180-194)1.) Only two of these theoretical data4. Above 300 K, both the TPG twelve charts are presented here due to length code and the NACA Report 1135 exponential considerations, but these two charts (Figures 5 expression for γ produce a nearly identical γ and 6) are typical of the agreement present for all variation that is in excellent agreement with the twelve flow properties. Examination of figures 5 theoretical γ values up to approximately 1600 K, and 6 (which correspond to charts 12 and 17 of at which point the γ curve of NACA Report 1135 NACA Report 1135) show that good overall begins a gradual divergence away from the TPG agreement exists (maximum difference less than code γ curve and the theoretical results. This one percent) for the compressible flow properties divergence is due to the inability of the NACA computed from the two different thermally Report 1135 exponential expression for γ to perfect methods. The small differences that are accurately model the true thermally perfect observed in these figures can be attributed in behavior of the gas at the higher temperatures. most cases to one of the two sources of γ Equation (180)1 only accounts for the harmonic inaccuracies noted previously. One difference contribution to the vibrational energy mode. At noted in figures 5 and 6 is between the curves of these higher temperatures (>1600 K) other the TPG code and NACA Report 1135 for the test contributions to the vibrational energy mode, case at a total temperature of 2778 K (5000° R). such as anharmonicity and vibrational- This difference is discernible from the start of the rotational interactions, must also be included. expansion and results from the difference in the The TPG code avoids this limitation by

11 American Institute of Aeronautics and Astronautics predicted γ values between the two methods for mixture.) User-specified tabulated results are temperatures above approximately 1600 K. (See available from the TPG code as opposed to caloric figure 4.) The other discernible difference imperfection charts found in NACA Report 1135 between the curves of the TPG code and NACA which require graphical interpolation among Report 1135 occurs at all four total four discrete total temperature values. These temperatures. At some given value of Mach charts also are only available for air. For other number the curves of the TPG code diverge diatomic gases the user of NACA Report 1135 slightly from the asymptotic plateau value of must resort to the set of lengthy exponential NACA Report 1135. Examination of the tabular equations some of which are implicit. Lastly, the data for these test cases (not included in this TPG code is easily accessible with the code being report) revealed that the divergence onset Mach available free via the LSS on Internet. These numbers for the above stated four test cases all assessments are presented in the form of a correspond to a static temperature value of comparative matrix in table 5. approximately 200 K. The divergence between the TPG code and NACA Report 1135 curves Conclusions which becomes discernible in the plotted data A set of compressible flow relations for a around 200 K is actually a consequence of the thermally perfect gas has been derived for a difference in the predicted γ values as shown in value of cp expressed as a polynomial function of the low-temperature range of figure 4. This temperature and developed into a computer comparison verifies the TPG code accuracy and program, referred to as the TPG code, which is the derived thermally perfect gas relations based available free from the NASA Langley Software upon polynomial expressions for cp. Although Server. The code produces tables of compressible these test cases were all for air, a primarily flow properties similar to those found in NACA diatomic gas, the validation of the TPG code also Report 11351. Unlike the NACA Report 1135 stands for polyatomic gases. The utilization of a tables, which are valid only in the calorically polynomial curve fit for cp makes the TPG code perfect temperature regime, the TPG code independent of the molecular structure of the 8 results are also valid in the thermally perfect gas . temperature regime, giving the TPG code a Comparative Assessment considerably larger range of temperature application. Accuracy of the TPG code in the The TPG code represents a significant calorically perfect temperature regime was advancement over NACA Report 1135 in the verified by comparisons with the NACA Report compressible flow analysis of both calorically 1135 tables. In the thermally perfect perfect and thermally perfect gases. It is temperature regime the TPG code was verified by applicable to any type of gas or mixture of gases, comparisons with results obtained using the unlike NACA Report 1135 whose thermally NACA Report 1135 method for calculating the perfect analysis is only applicable to diatomic thermally perfect compressible flow properties. gases. The code also has the capability to The TPG code essentially serves the function of γ compute the of any arbitrary gas mixture, a the compressible flow tables of NACA Report feature not provided by NACA Report 1135. 1135 while providing thermally perfect results. Table 4 presents a sample case of hydrogen and It is applicable to any type of gas, not restricted air combustion products to illustrate the to only diatomic gases as is the method of NACA potential applicability of the TPG code. In both Report 1135. In addition, the TPG code is capable the calorically and thermally perfect of handling any specified mixture of individual temperature regimes the TPG code has been gas species (for which the necessary polynomial shown to produce more accurate results than curve fit information for cp is known for each of NACA Report 1135. The TPG code user need not the component gas species) since the calculation be concerned with exceeding the temperature of the pertinent thermochemical mixture limits of the calorically perfect gas assumption properties is performed within the code. for a given gas and therefore is not confronted with a decision of which analysis method to use as is the user of NACA Report 1135. (The user must still be aware of the limits of the thermally perfect gas assumption for each gas within the

12 American Institute of Aeronautics and Astronautics References 1. Ames Research Staff: Equations, Tables, and Charts for Compressible Flow. NACA Report 1135, 1953. (Supersedes NACA TN 1428.) 2. Donaldson, Coleman duP.: Note on the Importance of Imperfect-Gas Effects and Variation of Heat Capacities on the Isentropic Flow of Gases. NACA RM L8J14, 1948. 3. Hilsenrath, J.; Beckett, C. W.; Benedict, W. S.; Fano, L.; Hoge, H. J.; Masi, J. F.; Nuttall, R. L.; Touloukian, Y. S.; and Woolley, H. W.: “Tables of Thermal Properties of Gases,” National Bureau of Standards Circular 564, U.S. Dep. Commerce, November 1, 1955. 4. JANAF Thermochemical Tables, Second ed., U.S. Standard Reference Data System NSRDS-NBS 37, U.S. Dep. Commerce, June 1971. 5. Rate Constant Committee, NASP High-Speed Propulsion Technology Team: Hypersonic Combustion Kinetics. NASP TM 1107, NASP JPO, Wright-Patterson AFB, May 1990. 6. McBride, Bonnie J.; Heimel Sheldon; Ehlers, Janet G.; and Gordon, Sanford: Thermodynamic Properties to 6000 K for 210 Substances Involving the First 18 Elements. NASA SP-3001, 1963. 7. McBride, Bonnie J.; Gordon, Sanford; and Reno, Martin A.: Thermodynamic Data for Fifty Reference Elements. NASA TP-3287, January 1993. 8. Witte, David W.; and Tatum, Kenneth E.: Computer Code for Determination of Thermally Perfect Gas Properties. NASA TP- 3447, September 1994.

13 American Institute of Aeronautics and Astronautics Table 3: Test case for the calorically perfect temperature regime

Table 4: Sample case representing a gas mixture of hydrogen and air combustion products

14 American Institute of Aeronautics and Astronautics Table 5: TPG Code Versus NACA Report 1135 Comparative Matrix

Thermally Perfect Gas code NACA Report 1135

Calorically Perfect Gas (CPG): a) Applicability any gas or mixture of gases, γ is only for gas or gas mixture for which computed constant γ is known b) Accuracy - accounts for slight caloric - ignores small caloric imperfections imperfections of “realistic” gases - adjustable Mach number - fixed Mach number increment increment & range (∆M=0.01) - no interpolation required - interpolation required for improved precision c) Temperature range not restricted to CPG limits restricted to CPG limits d) Tabulated results yes, for any gas yes, only for γ=1.4 e) Ease-of-use simple responses to interactive table look-up for γ=1.4, evaluation of program CPG equations for γ ≠ 1.4 f) Cost free via Internet nominal from NTIS http://www.larc.nasa.gov/LSS Thermally Perfect Gas (TPG): a) Applicability any gas or mixture of gases: diatomic gases only monatomic, diatomic, triatomic, or polyatomic b) Accuracy user-definable, multi-segment, high single-parameter, exponential curve order polynomial curve fit fit for diatomic gases only c) Temperature range restricted to thermally perfect gas restricted to thermally perfect gas limits limits d) Tabulated results yes, for any gas no, caloric imperfection charts available for air at 4 discrete total temperatures e) Ease-of-use simple responses to interactive reading of charts for air, or program evaluation of set of implicit, lengthy exponential equations for other diatomic gases f) Cost free via Internet: nominal from NTIS http://www.larc.nasa.gov/LSS

15 American Institute of Aeronautics and Astronautics THERMALLY PERFECT GAS PROGRAM

_File Help_

Gas Mixture ID Database File Compute Combustion Products te/TPG_datafiles/CombProd.data . . .

Species Mole Fraction Total Temperature: 1500.0 O2 0.006 Compute Temperature Range (K) Ar 0.008 Compute Mach Number Range NO 0.004 3.0 Upper Limit: H2 0.02

Static Increment: 0.2 Total 1.000000 Enter as Mass Fractions Low Limit: 0.2 Enter as Mole Fractions

Options Output

Normal-Shock Properties Append to Table Screen

TECPLOT TPGpost.dat File TPG.out

Calorically-Perfect Gamma 1.4

TPGratio.dat

Figure 1. TPG Graphical User Interface

1.004 ) 5 3

1 1.002 1

) t e r d o T/Tt

o A/A p * c e

R G

P A T C (

A t

c 1.000 N ( e ρ ρ

/ f t t r c e e P f

r p/p

y t e l l P a

y l m l r a e

c V/a h i 0.998 * r T o l a C

q/pt 0.996 0.0 0.5 1.0 1.5 2.0 2.5 3.0 Mach Number, M

Figure 2. Caloric imperfections of isentropic properties for air (Tt = 400 K)

16 American Institute of Aeronautics and Astronautics 1.004 ) 5 3 1 1

1.002 t ) r e o d

p ρ ρ o 2/ 1 p2/p1 e c

R

G A P M2 C T T /T

( 2 1 A

t N c ( 1.000

e t f p /p

r t2 t1 c e e f P r

e y l l P

a p /p

y 1 t2 l l m r a e c i h r 0.998 T o l a C

0.996 1.0 1.5 2.0 2.5 3.0 Mach Number, M

Figure 3. Caloric imperfections of normal shock properties for air (Tt = 400 K)

1.45 TPG Code NACA 1135 (eq. 180) JANAF Thermochemical Tables

1.40 γ

, s t a e H

c i f i c 1.35 e p S

f o

o i t a R 1.30

1.25 0 500 1000 1500 2000 2500 3000 Temperature (K)

Figure 4. Variation of γ with temperature for thermally perfect air

17 American Institute of Aeronautics and Astronautics 1.10

° Total temperature, Tt = 556 K (1000 R) 1.00

° Tt = 1111 K (2000 R) f r

e 0.90 p

m f r r e e h p t

° ) ) T = 1667 K (3000 R) t t t p p / / p p ( ( 0.80

TPG Code 0.70 NACA 1135 ° Tt = 2778 K (5000 R)

0.60 0 1 2 3 4 5 6 7 8 9 10 Mach Number, M

Figure 5. Caloric imperfections of static to total pressure ratio for air

1.06 TPG Code NACA 1135

1.04 ° Total Temperature, Tt = 2778 K (5000 R) ° Tt = 1667 K (3000 R) f r

e 1.02 p °

m T = 1111 K (2000 R) r f t r e e h t p

) ) ° 2

2 T = 556 K (1000 R) t t t p p / / 1 1 p p (

( 1.00

0.98

0.96 1 2 3 4 5 6 7 8 9 10 Mach Number, M Figure 6. Caloric imperfections of pitot-static pressure ratio for air

18 American Institute of Aeronautics and Astronautics