34th aerospace sciences meeting & exhibitmln/ltrs-pdfs/nasa-aiaa-96-0681.pdfaiaa-96-0681...

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

Upload: others

Post on 14-Mar-2020

13 views

Category:

Documents


0 download

TRANSCRIPT

AIAA-96-0681

Computation of Thermally Perfect Compressible Flow Properties

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

David W. Witte NASA Langley Research Center, Hampton, VA

S. Blake Williams Computer Science Corp., Hampton, VA

Kenneth E. Tatum Lockheed Martin Engineering & Sciences, Hampton, VAand

American Institute of Aeronautics and Astronautics

Computation of Thermally Perfect Compressible Flow Properties

David W. Witte*

NASA Langley Research CenterHampton, Virginia,

Kenneth E. Tatum†

Lockheed Martin Engineering & SciencesHampton, Virginia,

and

S. Blake Williams‡

Computer Sciences CorporationHampton, Virginia

* Aerospace Engineer, Hypersonic Airbreathing Propulsion Branch, Member AIAA† Staff Engineer, Senior Member AIAA‡ Member of the Technical Staff

Abstract

A set of compressible flow relations for athermally perfect, calorically imperfect gas arederived for a value of cp (specific heat at constantpressure) expressed as a polynomial function oftemperature and developed into a computerprogram, referred to as the Thermally PerfectGas (TPG) code. The code is available free fromthe NASA Langley Software Server at URLhttp://www.larc.nasa.gov/LSS. The codeproduces tables of compressible flow propertiessimilar to those found in NACA Report 1135.Unlike the NACA Report 1135 tables which arevalid only in the calorically perfect temperatureregime the TPG code results are also valid in thethermally perfect, calorically imperfecttemperature regime, giving the TPG code aconsiderably larger range of temperatureapplication. Accuracy of the TPG code in thecalorically perfect and in the thermally perfect,calorically imperfect temperature regimes areverified by comparisons with the methods ofNACA Report 1135. The advantages of the TPGcode compared to the thermally perfect,calorically imperfect method of NACA Report1135 are its applicability to any type of gas(monatomic, diatomic, triatomic, or polyatomic)or any specified mixture of gases, ease-of-use,and tabulated results.

Introduction

The traditional computation of the one-dimensional (1-D) compressible flow gasproperties is performed with one-dimensionalcalorically perfect gas equations such as those ofNACA Report 11351. If the gas of interest is air,then the tables of compressible flow valuesprovided in NACA Report 1135 can be used.These tables were generated using the caloricallyperfect gas equations with a value of 1.40 for theratio of specific heats, γ. The application of theseequations and tables is limited to that range oftemperature for which the calorically perfect gasassumption is valid. However, a significantnumber of aeronautical engineering calculationsextend beyond the temperature limits of thecalorically perfect gas assumption, and theapplication of the tables of NACA Report 1135can result in significant errors. The temperaturerange limitation is greatly minimized by theassumption of a thermally perfect, caloricallyimperfect gas in the development of thecompressible flow relations. (For the sake ofterminology simplicity, throughout this paper theterm “thermally perfect” will be used to denote athermally perfect, calorically imperfect gas.) Thepurpose of this paper is to present a computercode which implements one-dimensionalcompressible flow relations derived for athermally perfect gas.

A calorically perfect gas is by definition a gasfor which the values of specific heat at constantpressure, cp, and specific heat at constantvolume, cv, are constants. Therefore, in thederivation of the compressible flow relations for acalorically 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 Title17, U.S. Code. The U. S. Government has a royalty-free license to exercise all rights under the copyright claimed herein for Governmentalpurposes. All other rights are reserved by the copyright owner.

2American Institute of Aeronautics and Astronautics

assumed constant. The resulting caloricallyperfect gas equations are derived in manycompressible flow textbooks and are summarizedin NACA Report 1135. The accuracy of theseequations is only as good as the assumption of aconstant cp (and therefore a constant γ). For anydiatomic or polyatomic gas, the value of cpactually varies with temperature and can only beapproximated as a constant over some relativelysmall temperature range. At some point, as thetemperature increases, the cp value startsincreasing appreciably due to the excitation ofthe vibrational energy of the molecules. Thisphenomena occurs around 450 to 500 K for air.Thus, above 500 K use of γ = 1.40 for air in thecalorically perfect gas equations will yieldnoticeably incorrect results. The variation of cpwith temperature (and with only temperature)continues for air up to roughly 1500 K. In thistemperature range, where the value of cp is onlya function of temperature, air is considered athermally perfect gas. The derivation of thecompressible flow relations for a thermallyperfect gas therefore must account for a variableheat capacity. Above 1500 K for air, and at somerelatively high temperature for all diatomic andpolyatomic gases, dissociation of the moleculesstarts to occur. When dissociation commences,the value of cp becomes a function of bothtemperature and pressure and the gas is nolonger considered thermally perfect. The reasonfor specifically citing the calorically perfect andthermally perfect temperature limits for air is toillustrate the much larger temperature range ofapplication available from a thermally perfectcompressible flow analysis.

NACA Report 1135 presents one method forcomputing the one-dimensional compressibleflow properties of a thermally perfect gas. In thisapproach the variation of heat capacity due to thecontribution from the vibrational energy mode ofthe molecule is determined from quantummechanical considerations through theassumption of a simple harmonic vibrator modelof a diatomic molecule. With this assumption thevibrational contribution to the heat capacity of adiatomic gas takes the form of 2

(1)

where R is the specific gas constant, Θ = hν/k, h is

cpR-----

vib

ΘT----

2 e

ΘT----

e

ΘT----

1– 2-------------------------=

Planck’s constant, ν is the characteristicfrequency of molecular vibration, k is theBoltzmann constant, and T is the statictemperature. The complete set of thermallyperfect compressible flow relations based uponthe cp variation given in equation (1) are listed inNACA Report 1135 in the section entitled“Imperfect-Gas Effects”. Tables of thesethermally perfect gas properties are not providedbecause each value of total temperature, Tt,would yield a unique table of gas properties.NACA Report 1135 does provide charts of thethermally perfect air properties normalized bythe calorically perfect air values plotted versusMach number for select values of totaltemperature. This approach is limited inapplication to only diatomic gases (e.g., N2, O2,and H2) because of the functional form used todescribe the variation of heat capacity withtemperature.

Because equation (1) is applicable to onlydiatomic gases, a different method for computingthe one-dimensional compressible flow values ofa thermally perfect gas was developed and isdescribed in this paper. This method utilizes apolynomial curve fit of cp versus temperature todescribe the variation of heat capacity for a gas.The data required to generate this curve fit for agiven gas can be found in tabulated form inseveral published sources such as the NBSTables of Thermal Properties of Gases3 and theJANAF Tables4. Actual coefficients for specifictypes of polynomial curve fits are also availablefrom sources such as NASP TM 11075, NASA SP-30016, and NASA TP 32877. Use of these curvefits based upon tables of standard properties ofgases enables the application of this method toany type of gas; monatomic, diatomic, andpolyatomic (e.g., H2O, CO2, and CF4) gases ormixtures thereof, provided a data set of cp versustemperature exists for the individual gas(es) ofinterest.

A set of thermally perfect gas equations isderived for the specific heat as a polynomialfunction of temperature and is presented in thederivation section of this paper. This set ofequations was coded into a computer programreferred to as the thermally perfect gas (TPG)code, which represents the end product of thisresearch effort. The code is available free fromthe NASA Langley Software Server (LSS) at URLhttp://www.larc.nasa.gov/LSS. The outputtables of the TPG program are structured to

3American Institute of Aeronautics and Astronautics

resemble the tables of one-dimensionalcompressible flow properties that appear inNACA Report 1135. The difference (andadvantage) of the output tables from the TPGcode is their validity in the thermally perfecttemperature regime as well as in the caloricallyperfect temperature regime. This code servesthe function of the tables of NACA Report 1135for any gas species or mixture of gas species(such as air), and significantly increases therange of valid temperature application due to itsthermally perfect analysis.

NOMENCLATURE

Symbols

a speed of sound

A cross-sectional area of streamtube or channel

Aj coefficients of the polynomialcurvefit for cp/R

Beta

cp specific heat at constant pressure

cv specific heat at constant volume

e internal energy per unit mass

h enthalpy per unit mass, e + pv;Planck’s constant

k Boltzmann constant

M Mach number, V/a

p static pressure

q dynamic pressure, ρV2/2; heatadded per unit mass

R specific gas constant

T static temperature

u velocity component parallel tothe free-stream flow direction

v specific volume, 1/ρ

V speed of the flow

W molecular weight

Y mass fraction

∆ increment indicator

γ ratio of specific heats, cp/cv

M2

1–

Θ molecular vibrational energyconstant

ν characteristic frequency ofmolecular vibration

ρ static mass density (RHO)

Subscripts

1 upstream flow reference point;e.g., upstream of shock wave

2 downstream flow reference point;e.g., downstream of shock wave

t total (stagnation) conditions

* critical (sonic) conditions

i ith component gas species of themixture

j jth coefficient of the polynomialcurve fit for cp

jmax the maximum j value

mix gas mixture

n total number of gas species thatcomprise gas mixture

perf quantity evaluated for gas that isboth thermally and caloricallyperfect.

therm perf quantity evaluated for a gas thatis thermally perfect butcalorically imperfect

vib vibrational contribution

Abbreviations

1-D one-dimensional

CPG calorically perfect gas

JANAF Joint Army-Navy-Air Force

NACA National Advisory Committee forAeronautics

NASP National Aero-Space Plane

NBS National Bureau of Standards

NTIS National Technical InformationService

TPG thermally perfect gas

GUI graphical user interface

LSS Langley Software Server

4American Institute of Aeronautics and Astronautics

Derivation of Thermally Perfect Equations

Polynomial Curve Fit for cp

The selection of a suitable curve fit functionfor cp is the starting point for the development ofthermally perfect compressible flow relations.The form chosen for use in the TPG code was theeight-term, fifth-order polynomial expressiongiven below, where the value of cp has beennondimensionalized by the specific gas constant.

(2)

A1 through A8 are the coefficients of the curve fitfor a given temperature range. This is thefunctional form for cp used in NASP TM 11075

which provides values of A1 through A8 for 15individual gas species. NASA SP 30016 providessimilar cp/R curve fit coefficient data (A3 throughA7) for over 200 individual gas species for a five-term, fourth-order polynomial fit equation.NASA TP 32877 also provides similar cp curve fitcoefficient data for 50 reference elements for botha five-term (A3-A7) and a seven-term (A1-A7)fourth-order polynomial fit equation.Equation (2) is valid with this coefficient dataalso, provided that the coefficients not used areset equal to zero. If the pertinent cp/R versustemperature data has been fit into some otheralgebraic expression different from above, thatexpression could easily be exchanged forequation (2) in the TPG code. The onlyrequirements are that closed-form solutions toboth and must be known. Thereason for these requirements will becomeapparent as the compressible flow relations arederived for a thermally perfect gas.

Mixture Properties

The TPG code can be used to compute thethermally perfect gas properties for not onlyindividual gas species but also for mixtures ofindividual gas species (e.g., air). This capabilityis achieved in the code by calculating thevariation of the heat capacity for the specified gasmixture. The cp of a mixture of gases is computedfrom

(3)

cpR----- A1

1

T2

------ A2

1T----

A3 A4 T( ) A5 T2

A6 T3

A7 T4

A8 T5

+ + + + + + + AjTj 3–

j 1=

8

∑= =

A6 T3

A7 T4

A8 T5

+ + + + + + + AjTj 3–

j 1=

8

∑= =

cpdT∫ cp T⁄( ) dT∫

cpmixYicpi

i 1=

n

∑=

where Yi is the mass fraction of the ith gas species.The value of cpi is determined from equation (2) foreach component species. To illustrate how thisequation is actually implemented in the code,consider the example of standard air consisting ofthe four major component species N2, O2, Ar, andCO2.

(4)

Writing this equation in its full form usingequation (2) gives

...

...

...

... (5)

By combining like terms in equation (5), a resultantcp curve for the gas mixture (air) is generated.

(6a)

where

, for j=1,8 (6b)

In generalized terminology equations (6a) and (6b)are expressed as

(7a)

and

, for j=1, jmax (7b)

With a known curve fit expression for cp of thegas mixture, the value of γ for a given temperaturecan be computed directly from its definition.Mixture properties of gas constant and molecularweight are also computed.

Isentropic Relations

If the flow is assumed to be adiabatic, then the1-D energy equation written for two separate points

cpairYN2

cpN2

YO2cpO2

YArcpArYCO2

cpCO2

+ + +=

cpairYN2

RN2A1N2

1

T2

------ YN2

RN2A2N2

1T----

+ += YN2RN2

A8N2

T5

+

YO2RO2

A1O2

1

T2

------ YO2

RO2A2O2

1T----

+ ++ YO2RO2

A8O2

T5

+

YArRArA1Ar

1

T2

------ YArRArA2Ar

1T----

+ ++ YArRArA8ArT

5+

YCO2RCO2

A1CO2

1

T2

------ YCO2

RCO2A2CO2

1T----

+ ++ YCO2RCO2

A8CO2

T5

+

cpairA1air

1

T2

------ A2air

1T----

A3airA4air

T A5airT

2A6air

T3

A7airT

4A8air

T5

+ + + + + + +=

T A5airT

2A6air

T3

A7airT

4A8air

T5

+ + + + + + +=

AjairYN2

RN2AjN2

YO2RO2

AjO2

YArRArAjAr+ + +=

rYCO2

RCO2AjCO2

+ + +=

cpmixAjmix

Tj 3–

j 1=

jmax

∑=

AjmixYiRiAji

i 1=

n

∑=

5American Institute of Aeronautics and Astronautics

in the flowfield is

(8)

where h is the enthalpy and u is the velocity.Using the definition of enthalpy h referenced to0 K gives

(9)

If point 2 is selected to represent the stagnationcondition, then u2=0 and T2=Tt. Thenequation (9) reduces to

(10)

where for the selected fifth-order curve fit for cp(equations 7a and 7b with jmax = 8)

(11)

For a specified total temperature, the value ofequation (11) can be computed for a range ofstatic temperatures. Each value of static tem-perature, T1 (T1 less than Tt), represents aunique point in the expansion of the gas from itsstagnation conditions. With knowledge of γ, andthe speed of sound (a2=γRT), along with u1 fromequation (10), the Mach number is obtained.

An expression for the static to total pressureratio p1/pt is obtained through the use of the firstlaw of thermodynamics, the definitions ofenthalpy and entropy, the equation of state, andthe assumption of isentropic flow8.

(12)

For the selected fifth-order curve fit for cp, theclosed form solution to the integral inequation (12) is

h1

u12

2------+ h2

u22

2------+=

cpdT0

T1

∫u1

2

2------+ cpdT

0

T2

∫u2

2

2------+=

u12

2------ cpdT

0

Tt

∫ cpdT0

T1

∫– cpdTT1

Tt

∫= =

cpdTT1

Tt

∫ A11Tt------ 1

T1------–

– A2lnTtT1------ A3 Tt T1–( )

A4

2------ Tt

2T1

2–

A5

3------ Tt

3T1

3–

A6

4------ Tt

4T1

4–

+ + + + +=

)A4

2------ Tt

2T1

2–

A5

3------ Tt

3T1

3–

A6

4------ Tt

4T1

4–

+ + + + +=

A7

5------ Tt

5T1

5–

A8

6------ Tt

6T1

6–

++

p1

pt------ 1

exp 1R----

cpT-----dT

T1

Tt

------------------------------------------=

(13)

Equations (12) and (13) are used in the TPG codeto compute the value of p1/pt for each value of T1.Detailed derivations of thermally perfectrelations for the remaining isentropic propertiesof q1/pt (dynamic to total pressure ratio), ρ1/ρt(static to total density ratio), and A1/A* (local tosonic area ratio) are given in NASA TP 34478.

Normal Shock Relations

The continuity and momentum equations for1-D flow across a normal shock wave in a shock-fixed coordinate system are given in equations(14) and (15), respectively.

(14)

(15)

Dividing the momentum equation by thecontinuity equation gives

(16)

The relation for the speed of sound can be writtenusing the equation of state as

(17)

Solving equation (17) for p and substituting intoequation (16) yields

(18)

Equation (18) provides the needed relationshipacross the shock. For a given value of T1 the left-hand side of equation (18) is known fromprevious computations. The right-hand side ofequation (18) appears to have three unknowns γ2,u2, and a2, but in reality these three variables areall functions of only T2. (Actually u2 depends onboth T2 and Tt2, but because a shock wave isconsidered adiabatic, ht2=ht1. This translates toTt2=Tt1 for a thermally perfect gas because cp isa function of temperature only.) Therefore, theright-hand side of equation (18) can be expressedas one elementary, nonlinear function of T2. Aniterative technique has been implemented in theTPG code to solve equation (18) for T2. With the

cpT-----dT

T1

Tt

∫A1

2------ 1

Tt2

------ 1

T12

------–

– A21Tt------ 1

T1------–

– A3lnTtT------ A4 Tt T1–( )

A5

2------ Tt

2T1

2–

A6

3------ Tt

3T1

3–

+ + + +=

tT------ A4 Tt T1–( )

A5

2------ Tt

2T1

2–

A6

3------ Tt

3T1

3–

+ + + +=

A7

4------ Tt

4T1

4–

A8

5------ Tt

5T1

5–

+ +

ρ1u1 ρ2u2=

p1 ρ1u12

+ p2 ρ2u22

+=

p1

ρ1u1------------ u1+

p2

ρ2u2------------ u2+=

a2 γp

ρ------=

a12

γ1u1----------- u1+

a22

γ2u2----------- u2+=

6American Institute of Aeronautics and Astronautics

known value of T2, the values of γ2, u2, a2, and M2are computed in the same manner as γ, u1, a1,and M1 were determined for T1. The desiredshock relations, T2/T1 and u2/u1, can then becomputed. The expressions for the staticpressure and density ratios across the shock,obtained using equations (14), (15), and (17), arepresented in equations (19) and (20),respectively8.

(19)

(20)

Combinations of previously determined staticand total pressure ratios yield expressions for thetotal pressure ratio across the shock and thepitot-static pressure ratio.

(21)

(22)

TPG Code Description

An interactive FORTRAN computer code,herein referred to as the TPG code, has beenwritten based on the equations describedpreviously. The code delivers complete tables ofresults within seconds when run on a computerworkstation or personal computer. The purposeand primary output of the code is the creation oftables of compressible flow properties for athermally perfect gas or mixture of gases, styledafter the tables found in NACA Report 1135.Both the isentropic and normal shock propertiesmay be computed, with tabular entries basedupon constant decrements of static temperatureor constant increments of Mach number. Suchentries in terms of static temperaturedecrements reveal a fundamental differencebetween the data of the TPG code and NACAReport 1135. This fundamental difference ishighlighted when the TPG code output tables arecompared with the calorically perfect gas table ofNACA Report 1135, a single table of compressibleflow properties for air as a function of Machnumber. The properties of thermally perfect

p2

p1------ 1 γ+ 1M1

21

u2

u1------–

=

ρ2

ρ1-----

u1

u2------=

pt2

pt1

-------

pt2

p2-------

pt1

p1-------

--------------

p2

p1------

=

p1

pt2

-------pt1

pt2

------- p1

pt1

-------

=

gases vary with both total temperature Tt andlocal static temperature T rather than with onlythe ratio of T/Tt. Thus, the utility of the code isits capability to generate tables of compressibleflow properties for any total conditions over anyrange of static temperatures (T<Tt, of course) orMach numbers. In this section the majorsegments of the TPG code, Version 2.4, alongwith the various types of output are described. Acomplete description of the TPG FORTRAN code(Version 2.2) is given in NASA TP 34478.

A graphical-user-interface (GUI) version ofthe TPG code has also been developed for a SunMicrosystems workstation, requiring the sameinputs and generating the same outputs. Themathematical algorithms are identical to theFORTRAN version. This GUI version isdescribed briefly at the end of this section.

The FORTRAN code consists of a Mainprogram, three “include” files, severalsubroutines, and a Block Data initializationroutine. The subroutines are grouped accordingto purpose within several files, and are called asneeded from various locations within the Mainprogram, as well as other subroutines. Table 1summarizes the files and subroutines whichcomprise the TPG code. A Unix Makefile hasbeen developed for compilation of the code andcreation of an executable file. Defaults areprovided for all inputs and a complete executionrequires, at a minimum, answering eachinteractive prompt with a comma, followed by a“carriage return”. Such a minimal executiongenerates a single output file containing a tableof the basic isentropic properties for thestandard composition of air. More extensivetables, tables for other gas mixtures, or files forpost-processing require specific inputs.

The FORTRAN source code, the GUIexecutable for Sun Microsystems workstations,and several thermodynamic database files areavailable in a Unix tar file from the LSS.

The Main Program

The first part of the Main program containsthe interactive inquiries and responses whichspecify the gas components, the desired totaltemperature, and the desired outputs and outputformats. The first response required is anidentifier character string (an ID), or symbolname, for inclusion within output files. A defaultID may be specified, in which case the next three

7American Institute of Aeronautics and Astronautics

questions are omitted, and defaults are assumed.A particular database file may be specified next,describing the necessary thermochemical datafor the gases of interest. The contents of such adatabase file are described in later paragraphs.The code contains a default database necessaryto define a four species mixture of air. The gasmixture definition is completed by specification ofthe number of individual species and thecorresponding mass fractions, in the order of thespecies within the database. Defaults correspondto the standard composition of air. Errorchecking is incorporated within the code toensure that the sum of the mass fractions equalsunity, and that the database contains sufficientinformation for the requested case.

The next inputs define the composition andformat of the table(s). The total temperaturespecifies the upper temperature limit output (forwhich the Mach number is zero). Following thatis an input that specifies whether the tables areto be in terms of static temperature or Machnumber increments. The default entries in thetable(s) are given for incremental Mach numbersover a particular range. Isentropic properties arealways included in the table, and normal shockproperties may be included as an option. Thenormal shock properties may be output in thesame table as the isentropic properties in a wide

Table 1. TPG code: Version 2.4 files andsubroutines

Files: Contents:

TPG.f Main Program

Version.h Include Code VersionIdentifier

params.h Include Parameters

dimens.h Include Common Blocks

trangej.f Subroutine trangej

cpsubs.f Subroutines cpeval,cpNtgra, and cptNtgr

ntgrat.f Subroutines intCp andintCpT

titer.f Subroutines t1iter and t2iter

Cratio.f Subroutine Cratio

initd.f Subroutine initd and BlockData

format, or may be output separately, in a secondtable cross-referenced to the isentropicproperties by the Mach number and statictemperature. The table of normal shockproperties begins with sonic conditions andincludes all supersonic entries. The tables arewritten to an output file by default since they canbe rather extensive; however, they may bewritten to standard output. The TPG code alsoprovides options for additional output files forplotting/postprocessing purposes.

A program loop over the temperature or Machrange between the desired limits computes thebasic isentropic properties. A second loop over allsupersonic Mach numbers calculates the normalshock properties. After this loop is completed,the data are written to the tables and to a basicpostprocessor file. Finally, normalization of thethermally perfect data with that of a caloricallyperfect gas is performed, and the normalizedresults may be output to a second postprocessorfile. Warning summaries of the number of timesthe valid polynomial curve fit temperatureranges have been exceeded during thecalculations comprise the final output. Thesewarnings, if any, are related to the databaseinformation.

Include (or Header) Files

The Version.h file contains a charactervariable specifying the current version number ofthe computer code which is output at thebeginning of each interactive execution, and inthe table header. Two files, params.h anddimens.h, contain information which determinethe size of the computer memory required toexecute the TPG code, and, thus, the size of thecase which may be specified. The dimensions ofthe primary arrays within the code are includedin a FORTRAN parameter statement inparams.h and have the following values asreleased in Version 2.4:

mtrm (=8) : number of polynomial termswhich define therelationship for cp/R,

mspc (=25) : maximum number of gasspecies allowed,

mcvf (=3) : maximum number oftemperature ranges perspecies allowed andcorresponding sets ofpolynomial coefficients,

8American Institute of Aeronautics and Astronautics

mtncr (=10000) : maximum number ofcomputed statictemperatures.

All values assigned to the precedingparameters, except mtrm, may be changed to suitparticular user requirements. A change in mtrmmay require coding changes in the subroutineswhich perform specific calculations using thecp(T)/R relationships. The dimens.h filespecifies common blocks containing all of themajor arrays that are dependent on theparameters described above.

Temperature Rangefinder Subroutine

A single function accurately describing therelationship between heat capacity and statictemperature over a wide temperature range fortypical gases is extremely difficult to define.Multiple polynomial functions over limitedtemperature ranges are defined much moreeasily, even while maintaining continuity andsmoothness at the interfaces between individualranges. References 5-7 provide such polynomialcurve fits of the specific heat, specific enthalpyper temperature, and specific entropy for anumber of gases over multiple temperatureranges. The trangej subroutine determines theappropriate temperature range in which theexpression for specific heat is to be evaluated.Given a particular temperature, the routineselects the correct temperature range from theset of valid ranges for the gas mixture. In thecase of a temperature beyond the limits of anyrange, the closest range is specified forextrapolation, and a warning message is outputfor that particular temperature. A singleextrapolation warning message is written at theend of the tabular file stating the temperaturebelow, or above, which extrapolations wereperformed. This warning message appears whenany of the component species of a gas mixturerequire extrapolation.

Polynomial Summation and IntegrationSubroutines

The equations defined in the derivationsection require evaluation of cp, the integral of cp,and the integral of cp/T. These evaluations areperformed numerically in three subroutines:cpeval, cpNtgra, and cptNtgr. These routinesassume a polynomial expression of the formgiven in equation (7a). The smallest power of Tis -2. The largest power of T must be at least +2,

thus requiring the parameter mtrm to be at least5. Any mtrm of 5 or greater may be set inparams.h with no changes required in theFORTRAN code. However, for mtrm < 5, or for adifferent expression defining cp/R, these threesubroutines must be modified. Increasing mtrmbeyond the code’s release value of 8 would includehigher order powers of T (>5) in the polynomials.

Temperature Iteration Subroutines

An expression for Mach number as a functionof static temperature results from combining therelationship for the speed of sound within athermally perfect gas with equation (10) forvelocity. Subroutine t1iter solves the inverse ofthis expression, that is, for temperature as afunction of Mach number. The nonlinearequation is solved by means of a Newtoniteration. Subroutine t2iter implements a secondNewton iteration to solve equation (18) for thestatic temperature T2 behind a normal shock.

Calorically Perfect Comparison

Subroutine Cratio may be called after all gasproperties have been computed using thethermally perfect relationships. Given a user-input value of γ, the routine uses the appropriateequations from NACA Report 1135 to computecorresponding gas properties for a caloricallyperfect gas. Each property computed by thethermally perfect equations is normalized by thecalorically perfect value to allow analysis of themagnitude of the thermal dependency.

Database File Format

The thermochemical data required by theTPG code for a given mixture of gases is definedin a database file to be read at execution time. Adatabase for the standard composition of air iscontained within the code and may be accessed asthe default. However, for mixtures of othergases, or more complete models of air, a separatedatabase file may be provided. The format issimple, grouped by species with a two-lineheader, and additional databases are easilyconstructed. A sample two-species database isshown in Table 2, with line numbers added (initalics) for reference.

Line 1 is a descriptor of the data to follow online 2, and, as such, is merely a comment line.Line 2 gives the number of species for which thefile includes thermochemical data, and thenumber of temperature ranges over which

9American Institute of Aeronautics and Astronautics

separate polynomials define cp/R as a function ofT. These integer values are read in free format.Version 2.4 of the code requires that, for eachspecies within a particular file, each of thepolynomials must have the same limitingtemperatures for each range, except the absoluteminimum and maximum temperatures of theoverall definition. That is, if the polynomials forone gas are valid from 200 K to 1000 K, and from1000 K to 5000 K, then each gas within thatdatabase file must also be defined by onepolynomial up to 1000 K, and a second one above1000 K. The absolute extrema of 200 K and5000 K are not required to be identical since thecode simply extrapolates the polynomials beyondthese limits. Extrapolation warnings are givenbased upon the worst case, that is, based uponthe extrema limits of the most conservativelydefined gas.

Lines 3-14 are repeated for each gaseousspecies in the file. Error handling has beenincorporated within the code to recognize End-of-File on most computers, without terminatingexecution, for the case in which the actual

number of species defined is less than expected.

The thermochemical data for the first gasbegins with line 3 which again is a descriptor forthe next line of data. Line 4 contains the nameand molecular weight of the gas. Eachtemperature range polynomial definition follows,beginning with the lowest. Line 6 gives theminimum and maximum temperatures for thefirst polynomial. Following another descriptorline, the coefficients A1 to A8 (or Amtrm if mtrm isnot equal to 8) for the polynomial are given in freeformat on lines 8-9. The minimum andmaximum temperatures for the secondpolynomial are given on line 11, and a second setof coefficients follows on lines 13-14. The patternis repeated for all the temperature ranges asspecified in the database header. The data for asecond gas follows directly (lines 15-26), in thesame format as the first, and so on until all gaseshave been defined.

The TPG code uses the gas definitions in theorder specified within the database file, and massfraction inputs must be in that same order.However, mass fractions of zero are acceptable

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

10American Institute of Aeronautics and Astronautics

inputs, if it is desired to omit one or more of theleading species within a given file. Also, thepolynomial coefficients for a particular gas do notall have to be nonzero. In particular, acalorically perfect gas may be defined by adatabase in which all of the coefficients are zero,except A3 which equals the caloric constant forcp/R.

Database files provided with the code ascurrently released on the NASA LangleySoftware Server contain curve fit definitions forthe following gas species: N2, O2, Ar, CO2, H2O,NO, H2, OH, H, O, CF4, SF6, CH4, and caloricallyperfect air. Multiple curve fit definitions, havingdifferent temperature ranges and varyingpolynomial orders, are provided for some of thesegas species.

Graphical User Interface version

A second version of the TPG code utilizes aMotif-based X-window graphical user interfacefor specification of the user inputs, thus replacingthe interactive question-and-answer portion ofthe program with a point&click window.Currently, this version of TPG only runs on a SunMicrosystems workstation under the Unixoperating system. Built using standard Motifwidgets and the matrix widgets from the BellcoreApplication Environment library, the primarywindow has pull-down “File” and “Help” menus,and five subwindow regions (see Fig. 1). Alongthe top are text regions to accept the case ID anda database file name; the latter may be specifiedby typing or through a file browser. A handy“Compute” button activates the algorithmic loopswhen proper inputs are provided.

The majority of the GUI window consists offour subregions which allow specification of: 1)the gas species mixture, 2) the total temperatureand the tabular limits in terms of temperature orMach number, 3) optional normal shock output,table formats, and postprocessor files, and 4) thedestinations of the tabular outputs. As in theFORTRAN version, defaults are provided for allinputs; however, unlike the interactiveFORTRAN version, no user-action is required toaccept these defaults. In addition, the GUI hasseveral capabilities not found in the FORTRANcode. Specific output file names may be specifiedin place of the defaults, and the species mixturesmay be specified in terms of either mass or molefraction. The output may be previewed in aseparate on-screen window prior to writing the

tables to a file. Finally, through the use of the filebrowser a user can be sure that the desireddatabase file does exist, and the associatedspecies are displayed along with their mass ormole fraction. User-error is minimized sinceerror checking is performed prior to calling theisentropic and normal shock algorithmic loops.

The GUI is written in the C programminglanguage and calls a FORTRAN subroutine whenthe “Compute” button is clicked, if all the inputsmeet error-checking criteria. The mainFORTRAN subroutine basically consists of theMain program from the FORTRAN version ofTPG, with the interactive input removed. When“Compute” is selected, the GUI writes atemporary file with all data needed for theFORTRAN code. The remainder of theFORTRAN code is identical to that of theinteractive version, except that control returns tothe GUI after the “Compute” operation iscomplete; thus repeated calculations are allowedwithin a single session.

Comparison to NACA Report 1135

Calorically Perfect Temperature Regime

The TPG code was compared to NACA Report1135 to verify the code’s accuracy in thecalorically perfect temperature regime using airas the test gas. In this temperature regime thespecific heat of air is nearly constant and the TPGcode results should be nearly identical to thetables of NACA Report 1135. For this test casethe default data file for standard four-species airwas used along with the default values for themass fraction composition of air. A stagnationtemperature of 400 K was selected. This casewas run using the Mach number incrementoption (as opposed to temperature increment)with a Mach number increment of 0.1, aminimum Mach number of 0.0 (the defaultvalue), and a maximum Mach number of 3.0. Aportion of the TPG.out file for this test case isgiven in Table 3. A comparison of this outputwith Tables I and II from NACA Report 1135 forany matching Mach number shows the desiredagreement and validates the TPG code in thiscalorically perfect temperature regime. Thesmall differences that are observed between thecorresponding values of Table 3 and the NACAReport 1135 tables are in either the third orfourth digit. To better examine these smalldifferences the TPG code was used to generate

11American Institute of Aeronautics and Astronautics

the ratio of the gas properties calculated with thethermally perfect relations (Table 3) to thosecalculated from the calorically perfect relations(NACA Report 1135 tables). These results havebeen plotted versus Mach number in figures 2and 3. From these figures the maximumdifference between the values listed in Table 3and the NACA Report 1135 tables appears to beroughly 0.5 percent. Note that these smalldifferences actually represent the small amountof error associated with the tabulated values ofNACA Report 1135 resulting from the caloricallyperfect gas assumption. Close inspection ofTable 3 reveals that a slight variation withtemperature actually exists in the specific heatratio which leads to the noted differences whencompared with the calorically perfect gasproperties.

Thermally Perfect Temperature Regime

The first step in verifying the TPG code in thethermally perfect temperature regime was tocompare the γ variation for air computed by theTPG code with both the γ variation calculatedfrom NACA Report 1135 (equation (180)1) andthe theoretical thermally perfect γ variation fromthe JANAF Thermochemical Tables4 (obtainedfrom the theoretical cp data for N2, O2, Ar, andCO2). The variation of γ as a function oftemperature is presented in figure 4. Below300 K, the NACA Report 1135 predicted γ valueshave attained their asymptotic value of 1.400while the γ values predicted by the TPG codehave reached a slightly greater asymptotic valueof 1.401 which is in agreement with thetheoretical data4. Above 300 K, both the TPGcode and the NACA Report 1135 exponentialexpression for γ produce a nearly identical γvariation that is in excellent agreement with thetheoretical γ values up to approximately 1600 K,at which point the γ curve of NACA Report 1135begins a gradual divergence away from the TPGcode γ curve and the theoretical results. Thisdivergence is due to the inability of the NACAReport 1135 exponential expression for γ toaccurately model the true thermally perfectbehavior of the gas at the higher temperatures.Equation (180)1 only accounts for the harmoniccontribution to the vibrational energy mode. Atthese higher temperatures (>1600 K) othercontributions to the vibrational energy mode,such as anharmonicity and vibrational-rotational interactions, must also be included.The TPG code avoids this limitation by

utilization of multiple-range polynomial curvefits of theoretical data3-7 to model the variation ofheat capacity, which for this particularapplication of the code consisted of two fifth-order, eight-term polynomial curve fits. Notethat, although figure 4 gives thermally perfectresults for air up to 3000 K, in reality dissociationof O2 begins at approximately 1500 K, thusmaking air thermally imperfect due to achanging composition which is a function of bothpressure and temperature.

The remaining gas properties computed bythe TPG code in the thermally perfecttemperature regime were verified for test casesat total temperatures of 556 K (1000 R), 1111 K(2000 R), 1667 K (3000 R), and 2778 K(5000 R), all with air (using the standard four-species composition) as the test gas. These fourspecific test cases were selected so that acomparison could be made with the caloricimperfection charts of NACA Report 1135 whichgive the compressible flow gas properties for aircomputed from the thermally perfect relationsbased upon equation (1) of this paper. Each of thetwelve charts from NACA Report 1135 gives thevariation of one gas property, normalized by itscalorically perfect value, versus Mach number forthe above mentioned four total temperatures.The TPG code results for these four test caseswere also normalized by their calorically perfectvalues and then plotted together with the resultsfrom the caloric imperfection charts of NACAReport 1135. (The results of NACA Report 1135have been regenerated here for plotting purposesfrom equations (180-194)1.) Only two of thesetwelve charts are presented here due to lengthconsiderations, but these two charts (Figures 5and 6) are typical of the agreement present for alltwelve flow properties. Examination of figures 5and 6 (which correspond to charts 12 and 17 ofNACA Report 1135) show that good overallagreement exists (maximum difference less thanone percent) for the compressible flow propertiescomputed from the two different thermallyperfect methods. The small differences that areobserved in these figures can be attributed inmost cases to one of the two sources of γinaccuracies noted previously. One differencenoted in figures 5 and 6 is between the curves ofthe TPG code and NACA Report 1135 for the testcase at a total temperature of 2778 K (5000 R).This difference is discernible from the start of theexpansion and results from the difference in the

°° °°

°

12American Institute of Aeronautics and Astronautics

predicted γ values between the two methods fortemperatures above approximately 1600 K. (Seefigure 4.) The other discernible differencebetween the curves of the TPG code and NACAReport 1135 occurs at all four totaltemperatures. At some given value of Machnumber the curves of the TPG code divergeslightly from the asymptotic plateau value ofNACA Report 1135. Examination of the tabulardata for these test cases (not included in thisreport) revealed that the divergence onset Machnumbers for the above stated four test cases allcorrespond to a static temperature value ofapproximately 200 K. The divergence betweenthe TPG code and NACA Report 1135 curveswhich becomes discernible in the plotted dataaround 200 K is actually a consequence of thedifference in the predicted γ values as shown inthe low-temperature range of figure 4. Thiscomparison verifies the TPG code accuracy andthe derived thermally perfect gas relations basedupon polynomial expressions for cp. Althoughthese test cases were all for air, a primarilydiatomic gas, the validation of the TPG code alsostands for polyatomic gases. The utilization of apolynomial curve fit for cp makes the TPG codeindependent of the molecular structure of thegas8.

Comparative Assessment

The TPG code represents a significantadvancement over NACA Report 1135 in thecompressible flow analysis of both caloricallyperfect and thermally perfect gases. It isapplicable to any type of gas or mixture of gases,unlike NACA Report 1135 whose thermallyperfect analysis is only applicable to diatomicgases. The code also has the capability tocompute the γ of any arbitrary gas mixture, afeature not provided by NACA Report 1135.Table 4 presents a sample case of hydrogen andair combustion products to illustrate thepotential applicability of the TPG code. In boththe calorically and thermally perfecttemperature regimes the TPG code has beenshown to produce more accurate results thanNACA Report 1135. The TPG code user need notbe concerned with exceeding the temperaturelimits of the calorically perfect gas assumptionfor a given gas and therefore is not confrontedwith a decision of which analysis method to useas is the user of NACA Report 1135. (The usermust still be aware of the limits of the thermallyperfect gas assumption for each gas within the

mixture.) User-specified tabulated results areavailable from the TPG code as opposed to caloricimperfection charts found in NACA Report 1135which require graphical interpolation amongfour discrete total temperature values. Thesecharts also are only available for air. For otherdiatomic gases the user of NACA Report 1135must resort to the set of lengthy exponentialequations some of which are implicit. Lastly, theTPG code is easily accessible with the code beingavailable free via the LSS on Internet. Theseassessments are presented in the form of acomparative matrix in table 5.

Conclusions

A set of compressible flow relations for athermally perfect gas has been derived for avalue of cp expressed as a polynomial function oftemperature and developed into a computerprogram, referred to as the TPG code, which isavailable free from the NASA Langley SoftwareServer. The code produces tables of compressibleflow properties similar to those found in NACAReport 11351. Unlike the NACA Report 1135tables, which are valid only in the caloricallyperfect temperature regime, the TPG coderesults are also valid in the thermally perfecttemperature regime, giving the TPG code aconsiderably larger range of temperatureapplication. Accuracy of the TPG code in thecalorically perfect temperature regime wasverified by comparisons with the NACA Report1135 tables. In the thermally perfecttemperature regime the TPG code was verified bycomparisons with results obtained using theNACA Report 1135 method for calculating thethermally perfect compressible flow properties.The TPG code essentially serves the function ofthe compressible flow tables of NACA Report1135 while providing thermally perfect results.It is applicable to any type of gas, not restrictedto only diatomic gases as is the method of NACAReport 1135. In addition, the TPG code is capableof handling any specified mixture of individualgas species (for which the necessary polynomialcurve fit information for cp is known for each ofthe component gas species) since the calculationof the pertinent thermochemical mixtureproperties is performed within the code.

13American Institute of Aeronautics and Astronautics

References

1. Ames Research Staff: Equations, Tables, andCharts for Compressible Flow. NACA Report1135, 1953. (Supersedes NACA TN 1428.)

2. Donaldson, Coleman duP.: Note on theImportance of Imperfect-Gas Effects andVariation of Heat Capacities on the IsentropicFlow 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 SystemNSRDS-NBS 37, U.S. Dep. Commerce, June1971.

5. Rate Constant Committee, NASP High-SpeedPropulsion Technology Team: HypersonicCombustion Kinetics. NASP TM 1107, NASPJPO, Wright-Patterson AFB, May 1990.

6. McBride, Bonnie J.; Heimel Sheldon; Ehlers,Janet G.; and Gordon, Sanford:Thermodynamic Properties to 6000 K for 210Substances Involving the First 18 Elements.NASA SP-3001, 1963.

7. McBride, Bonnie J.; Gordon, Sanford; andReno, Martin A.: Thermodynamic Data forFifty Reference Elements. NASA TP-3287,January 1993.

8. Witte, David W.; and Tatum, Kenneth E.:Computer Code for Determination ofThermally Perfect Gas Properties. NASA TP-3447, September 1994.

14American 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

15American Institute of Aeronautics and Astronautics

Table 5: TPG Code Versus NACA Report 1135 Comparative Matrix

Thermally Perfect Gas code NACA Report 1135

Calorically PerfectGas (CPG):

a) Applicability any gas or mixture of gases, γ iscomputed

only for gas or gas mixture for whichconstant γ is known

b) Accuracy - accounts for slight caloricimperfections

- adjustable Mach numberincrement & range

- no interpolation required

- ignores small caloric imperfectionsof “realistic” gases

- fixed Mach number increment(∆M=0.01)

- interpolation required for improvedprecision

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 interactiveprogram

table look-up for γ=1.4, evaluation ofCPG equations for γ ≠ 1.4

f) Cost free via Internethttp://www.larc.nasa.gov/LSS

nominal from NTIS

Thermally Perfect Gas(TPG):

a) Applicability any gas or mixture of gases:monatomic, diatomic, triatomic, orpolyatomic

diatomic gases only

b) Accuracy user-definable, multi-segment, highorder polynomial curve fit

single-parameter, exponential curvefit for diatomic gases only

c) Temperature range restricted to thermally perfect gaslimits

restricted to thermally perfect gaslimits

d) Tabulated results yes, for any gas no, caloric imperfection chartsavailable for air at 4 discrete totaltemperatures

e) Ease-of-use simple responses to interactiveprogram

reading of charts for air, orevaluation of set of implicit, lengthyexponential equations for otherdiatomic gases

f) Cost free via Internet:http://www.larc.nasa.gov/LSS

nominal from NTIS

16American Institute of Aeronautics and Astronautics

Figure 1. TPG Graphical User Interface

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

THERMALLY PERFECT GAS PROGRAM

te/TPG_datafiles/CombProd.dataCombustion Products

Database FileGas Mixture ID

File_ Help_

Compute. . .

1500.0

3.0

0.2

0.2

TPGpost.dat

1.4

TPGratio.dat

Append to Table

Total Temperature:

Upper Limit:

Static Increment:

Low Limit:

Compute Temperature Range (K)

Compute Mach Number Range

Enter as Mass Fractions

Enter as Mole Fractions

Normal-Shock Properties

TECPLOT

Calorically-Perfect Gamma

0.02

0.004

0.008

0.006

H2

NO

Ar

O2

Screen

File TPG.out

Options Output

Mole FractionSpecies

1.000000Total

0.0 0.5 1.0 1.5 2.0 2.5 3.00.996

0.998

1.000

1.002

1.004

The

rmal

ly P

erfe

ct (

TP

G c

ode)

A/A*

ρ/ρt

V/a*

q/pt

T/Tt

p/pt

Mach Number, M

Cal

oric

ally

Per

fect

(N

AC

A R

epor

t 113

5)

17American Institute of Aeronautics and Astronautics

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

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

1.0 1.5 2.0 2.5 3.00.996

0.998

1.000

1.002

1.004

Mach Number, M

Cal

oric

ally

Per

fect

(N

AC

A R

epor

t 113

5)

The

rmal

ly P

erfe

ct (

TP

G c

ode)

ρ2/ρ1 p2/p1

M2 T2/T1

pt2/pt1

p1/pt2

0 500 1000 1500 2000 2500 30001.25

1.30

1.35

1.40

1.45

Rat

io o

f Spe

cific

Hea

ts, γ

TPG Code

JANAF Thermochemical Tables

NACA 1135 (eq. 180)

Temperature (K)

18American Institute of Aeronautics and Astronautics

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

Figure 6. Caloric imperfections of pitot-static pressure ratio for air

0 1 2 3 4 5 6 7 8 9 100.60

0.70

0.80

0.90

1.00

1.10

(p/p

t) th

erm pe

rf

TPG CodeNACA 1135

Mach Number, M

Tt = 1111 K (2000°R)

Tt = 1667 K (3000°R)

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

Tt = 2778 K (5000°R)

(p/p

t) pe

rf

1 2 3 4 5 6 7 8 9 100.96

0.98

1.00

1.02

1.04

1.06

(p1/

p t2)

perf

(p1/

p t2)

ther

m pe

rf

Mach Number, M

Tt = 1667 K (3000°R)

Tt = 1111 K (2000°R)

Tt = 556 K (1000°R)

Total Temperature, Tt = 2778 K (5000°R)

TPG CodeNACA 1135