Defining the State and Behavior of a Gas Mixture


Before we begin to create our class hierarchy we must think about the state and behavior of what we are modeling ”in this case, a gas mixture. We need to consider what things are common to all gas mixtures and what things are specific to certain types of gas mixtures. The common elements will be placed higher in the class hierarchy so the specific subclasses can share them.

Every gas mixture will have certain state variables associated with it, including pressure, density, molar mass, and temperature. These quantities are related according to an equation of state. For thermally perfect gases, the equation of state is shown in Eq. (18.1).

Equation 18.1

graphics/18equ01.gif


In Eq. (18.1), p is the pressure, r is the density, M is the molar mass, and T is the temperature. We will use MKS units for the gas mixture example presented in this chapter. The quantity R is the Universal Gas Constant and has a value of 8.31441 J /( mole K ).

There are other state variables associated with a gas mixture to consider as well ”transport coefficients of viscosity and thermal conductivity and thermodynamic properties of enthalpy, internal energy, and entropy. These quantities are functions of pressure, density, and/or temperature. We need to consider whether to include them as separate fields or simply provide methods to compute and return their value.

We also must decide on which methods we need in our gas classes to model the gas mixture's behavior. At the very least, we will want to include methods that change or return the value of our state variables. More complicated gas classes may implement methods to do things like determine the equilibrium composition of the gas. We also must decide where to implement the methods. Methods that will be shared by more than one class should be placed higher in the hierarchy. Subclasses may override methods that are declared in a superclass.

Gas mixtures can be divided into two main categories. A perfect gas is one that is nonreacting and can be considered to be composed of a single gas species with a constant specific heat. A real gas is one that can undergo chemical reactions . Its composition can change with changes in temperature and pressure. The thermodynamic properties of a real gas are not constant but instead vary with temperature and, to a lesser extent, pressure. We may want to have different branches in our class hierarchy, one for perfect gases and one for real gases.



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