N Class


N Class

The second gas species class we will use in this chapter is the N class that represents atomic nitrogen. Here is its source code.

 package TechJava.Gas; public class N extends Species {   //  Fill the Lewis curve fit coefficient   //  array with data for N   private static double a[][] = {     {0.0           , 8.876501380e+04, 5.475181050e+08},     {0.0           ,-1.071231500e+02,-3.107574980e+05},     {2.5           , 2.362188287e+00, 6.916782740e+01},     {0.0           , 2.916720081e-04,-6.847988130e-03},     {0.0           ,-1.729515100e-07, 3.827572400e-07},     {0.0           , 4.012657880e-11,-1.098367709e-11},     {0.0           ,-2.677227571e-15, 1.277986024e-16},     {5.61046378e+04, 5.697351330e+04, 2.550585618e+06},    {4.19390932e+00, 4.865235790e+00,-5.848769710e+02} };   //  The N constructor calls the Species class   //  constructor with data for atomic nitrogen   public N() {     super("N", 0.0140067, a);   } } 

It is always good to check our work, so we will write a driver program that will create an N object and access its fields. The class is called SpeciesDriver and its source code is ”

 import TechJava.Gas.*; public class SpeciesDriver {   public static void main(String args[]) {     N spc = new N();     System.out.println("species name = " +                         spc.getName());     System.out.println("molar mass = " +                       spc.getMolarMass() + " kg/mole");     System.out.println("\ntemperature = 600.0");     System.out.println("enthalpy = " +                    spc.getEnthalpy(600.0) + " J/mole");     System.out.println("entropy = " +       spc.getEntropy(600.0,100000.0,1.0) + " J/mole-K");   } } 

Output ”

 species name = N molar mass = 0.0140067 kg/mole temperature = 600.0 enthalpy = 478948.576570698 J/mole entropy = 167.83662132483943 J/mole-K 


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