Species Class


Species Class

A real gas mixture can be thought of as a collection of individual gas species. The RealGas class declares as one of its fields an array of Species objects. The Species class declares three fields ”the species name , the species molecular weight in kg/mole, and an array of coefficients used to compute the species enthalpy and entropy.

The specific heat of a real gas species is not constant but is a function of temperature. (It is also to a lesser extent a function or pressure, but we will ignore that here.) There are several ways to obtain the real gas specific heat. One way is to use statistical mechanics to partition the specific heat according to different energy modes. There have also been a number of curve fit relations developed over the years to approximate specific heat over a certain temperature range. For the Species class, we will use the Lewis curve fits, 1 developed at NASA, that are valid for temperatures ranging from 200 K to 20,000 K. There are three sets of nine coefficients for each gas species. We will refer to each set of nine coefficients as a through a 8 . The specific heat for arbitrary gas species can be computed using the expression in Eq. (18.8).

Equation 18.8

graphics/18equ08.gif


The species enthalpy and entropy are found using the expressions in Eq. (18.9) and Eq. (18.10).

Equation 18.9

graphics/18equ09.gif


Equation 18.10

graphics/18equ10.gif


The values computed by Eq. (18.8) through Eq. (18.10) are normalized by the Universal Gas Constant, R . The quantity p is the reference pressure for the entropy computation and x j is the species mole fraction. In addition to methods that return the species name and molar mass, the Species class defines methods to compute and return the species enthalpy and entropy according to Eq. (18.9) and Eq. (18.10). The Species class source code is ”

 package TechJava.Gas; public class Species {   //  The a[][] array contains Lewis curve fit   //  coefficients used to compute species enthalpy   //  and entropy.   private String name;   private double molarMass;   private double a[][];   //  The Species class has one constructor   public Species(String name, double molarMass,                  double a[][]) {     this.name = name;     this.molarMass = molarMass;     this.a = a;   }   //  These methods return the current value of the   //  name and molarMass variables.   public String getName() {     return name;   }   public double getMolarMass() {     return molarMass;   }   //  Compute species enthalpy in units of J/mole using   //  Lewis curve fits. The Lewis curve fit coefficients   //  come in three temperature bands, T<1000 K, 1000<T   //  <6000 K, and T>6000 K and have the heat of   //  formation already built into them. They are based   //  on a reference temperature of 298 K.   public double getEnthalpy(double T) {     double enthalpy;     int i = 2;     if (T <= 6000.0) i=1;     if (T <= 1000.0) i=0;     enthalpy = -a[0][i]/T +                 a[1][i]*Math.log(T) +                 a[2][i]*T +                 a[3][i]*Math.pow(T,2.0)/2.0 +                 a[4][i]*Math.pow(T,3.0)/3.0 +                 a[5][i]*Math.pow(T,4.0)/4.0 +                 a[6][i]*Math.pow(T,5.0)/5.0 +                 a[7][i];     return enthalpy*AbstractGas.R;   }   //  Compute entropy in units of J/mole-K using   //  Lewis curve fits   public double getEntropy(double T, double p,                            double moleFr) {     double entropy;     double eps = 1.234e-10;     int i = 2;     if (T <= 6000.0) i=1;     if (T <= 1000.0) i=0;     entropy = -a[0][i]/(Math.pow(T,2.0)*2.0) -                a[1][i]/T +                a[2][i]*Math.log(T) +                a[3][i]*T +                a[4][i]*Math.pow(T,2.0)/2.0 +                a[5][i]*Math.pow(T,3.0)/3.0 +                a[6][i]*Math.pow(T,4.0)/4.0 +                a[8][i] - Math.log(p/100000.0) -                Math.log(moleFr+eps);     return entropy*AbstractGas.R;   } } 


Technical Java. Applications for Science and Engineering
Technical Java: Applications for Science and Engineering
ISBN: 0131018159
EAN: 2147483647
Year: 2003
Pages: 281
Authors: Grant Palmer

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net