edu.davidson.chm.equilibria
Class Gas

java.lang.Object
  extended by edu.davidson.chm.equilibria.Phase
      extended by edu.davidson.chm.equilibria.Gas
All Implemented Interfaces:
PhysicalConstants

public class Gas
extends Phase

This project contains the files necessary to solve arbitrary equilibrium problems

Copyright (c) David N. Blauch

Version:
1.1
Author:
David N. Blauch

Field Summary
 
Fields inherited from class edu.davidson.chm.equilibria.Phase
autoChargeBalance, chemSystem, density, dielectricConstant, isProtic, label, physState, species, volume
 
Fields inherited from interface edu.davidson.chm.equilibria.PhysicalConstants
F, k, No, perm, qe, R, RJ
 
Constructor Summary
Gas()
           
Gas(java.lang.String _label, ChemSystem _chemSystem)
          The minimal requirements for defining a Gas phase are a descriptive label and the chemical system that contains the phase.
 
Method Summary
 Phase copyOf(ChemSystem _chemSystem)
          Creates a copy of this phase and places it in the indicated ChemSystem.
 Species getAcid()
          Returns null, because there is no solvent or conjugate acid in this type of phase.
 Species getBase()
          Returns null, because there is no solvent or conjugate base in this type of phase.
 double getDensity()
          Returns the density of the gas.
 java.lang.String getInfo()
          Returns information about this class
 double getIonicStrength()
          Returns zero, because ionic strength has no meaning for this phase
 double getPressure()
          Returns the pressure of the gas.
 double getPressure(double _moles, double _volume)
          Returns the pressure of a gas containing the indicated number of moles and the volume of the gas.
 Species getSolvent()
          Returns null, because this phase has no solvent
 double getVolume()
          Returns the volume of the gas.
 void scale(double _factor)
          Scales the amount of the phase.
 void setDensity(double _density)
          This method performs no action, because the density of a gas is dictated by the volume of the gas and the mass of the species in the gas.
 void setMass(double _mass)
          This method performs no action, because the mass of a gas is dictated by the masses of each species in the gas and cannot be set globally.
 void setVolume(double _volume)
          Sets the volume for the phase.
 
Methods inherited from class edu.davidson.chm.equilibria.Phase
addSpecies, addSpecies, addSpecies, createSpecies, createSpecies, getAutoChargeBalance, getChemSystem, getDielectricConstant, getEDHEa, getEDHEb, getIsProtic, getLabel, getMass, getMoles, getNbrSpecies, getpH, getPhysicalState, getpOH, getSpecies, getSpecies, getSpecies, getSpeciesAt, removeSpecies, removeSpecies, setAutoChargeBalance, setDielectricConstant, setLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Gas

public Gas()

Gas

public Gas(java.lang.String _label,
           ChemSystem _chemSystem)
The minimal requirements for defining a Gas phase are a descriptive label and the chemical system that contains the phase.

Method Detail

copyOf

public Phase copyOf(ChemSystem _chemSystem)
Creates a copy of this phase and places it in the indicated ChemSystem.

Specified by:
copyOf in class Phase

getAcid

public Species getAcid()
Returns null, because there is no solvent or conjugate acid in this type of phase.

Specified by:
getAcid in class Phase

getBase

public Species getBase()
Returns null, because there is no solvent or conjugate base in this type of phase.

Specified by:
getBase in class Phase

getDensity

public double getDensity()
Returns the density of the gas.

Overrides:
getDensity in class Phase

getInfo

public java.lang.String getInfo()
Returns information about this class

Overrides:
getInfo in class Phase

getPressure

public double getPressure()
Returns the pressure of the gas. If the system is isobaric, the system pressure is returned. If the system is not isobaric, the method employs the ideal gas law. If another equation of state is desired, it is necessary to override this method and the getVolume method.

Specified by:
getPressure in class Phase
See Also:
getVolume()

getPressure

public double getPressure(double _moles,
                          double _volume)
Returns the pressure of a gas containing the indicated number of moles and the volume of the gas. This method employs the ideal gas law. If another equation of state is desired, it is necessary to override this method. This method is employed in the getPressure method (no arguments) and by gas-phase species.

Overrides:
getPressure in class Phase
Parameters:
_moles - moles of the gas-phase species
_volume - volume of the gas in liters
See Also:
getVolume()

getIonicStrength

public double getIonicStrength()
Returns zero, because ionic strength has no meaning for this phase

Specified by:
getIonicStrength in class Phase

scale

public void scale(double _factor)
Description copied from class: Phase
Scales the amount of the phase. If the factor is two, for example, the moles of each species is doubled. The method effectively creates more or less of the phase without altering the molar concentrations of the species

Overrides:
scale in class Phase
Parameters:
_factor - scaling factor

setDensity

public void setDensity(double _density)
This method performs no action, because the density of a gas is dictated by the volume of the gas and the mass of the species in the gas.

Specified by:
setDensity in class Phase
Parameters:
_density - density in grams per milliliter

getVolume

public double getVolume()
Returns the volume of the gas. If the system is not isobaric, the user-specified volume is returned. If the system is isobaric, the method employs the ideal gas law. If another equation of state is desired, it is necessary to override this method and the getVolume method.

Specified by:
getVolume in class Phase
See Also:
getPressure()

setMass

public void setMass(double _mass)
This method performs no action, because the mass of a gas is dictated by the masses of each species in the gas and cannot be set globally.

Specified by:
setMass in class Phase
Parameters:
_mass - mass in grams

getSolvent

public Species getSolvent()
Returns null, because this phase has no solvent

Specified by:
getSolvent in class Phase

setVolume

public void setVolume(double _volume)
Sets the volume for the phase. If the chemical system is isobaric, the volume is dictated by the pressure and amounts of each species. For an isobaric system, this method performs no action.

Specified by:
setVolume in class Phase
Parameters:
_volume - volume in liters