edu.davidson.chm.equilibria
Class Species

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

public class Species
extends java.lang.Object
implements PhysicalConstants

A Species object contains the information necessary to describe a chemical species

Copyright: Copyright (c) David N. Blauch

Version:
2.0
Author:
David N. Blauch

Field Summary
protected  double analMoles
           
protected  ChemSpecies chemSpecies
           
protected  ChemSystem chemSystem
           
protected  double FW
           
protected  int index
           
protected  double IONSIZE
           
protected  boolean isAcid
           
protected  boolean isBase
           
protected  boolean isReactive
           
protected  boolean isSolvent
           
protected  double moles
           
protected  Phase phase
           
protected  char PHYSSTATE
           
protected  java.lang.String[] RESERVED
           
 
Fields inherited from interface edu.davidson.chm.equilibria.PhysicalConstants
F, k, No, perm, qe, R, RJ
 
Constructor Summary
Species()
          The default constructor should never be used.
Species(ChemSpecies _chemSpecies, Phase _phase)
          Creates a species consisting of the indicated ChemSpecies in the indicated Phase.
Species(ChemSpecies _chemSpecies, Phase _phase, double _moles)
          Creates a species consisting of the indicated ChemSpecies in the indicated Phase.
 
Method Summary
 double getActivity()
          Returns the activity of the species.
 double getActivityCoefficient()
          Returns the activity coefficient for the species.
 double getAnalConc()
          Returns the analytical concentration (mole/L)
 double getAnalMass()
          Returns the analytical mass in grams
 double getAnalMoles()
          Returns the analytical number of moles
 double getAnalPressure()
          Returns the analytical partial pressure.
 double getCharge()
          Returns the charge on the species.
 ChemSpecies getChemSpecies()
          Returns the ChemSpecies for this Species.
 ChemSystem getChemSystem()
          Returns the chemical system in which the species exists
 double getConc()
          Returns the molar concentration.
 double getFW()
          Returns the formula weight of the species
protected  int getIndex()
          Returns the index of this Species (used in Equilibria.class)
 java.lang.String getInfo()
          Returns information about this class
 double getIonSize()
          Returns the Debye-Huckel ion size parameter in angstroms
protected  boolean getIsAcid()
          Returns the isAcid property
protected  boolean getIsBase()
          Returns the isBase property
protected  boolean getIsReactive()
          Returns the isReactive status
protected  boolean getIsSolvent()
          Returns the isSolvent status
 java.lang.String getLabel()
          Returns the phase label
 double getMass()
          Returns the mass in grams
 double getMoles()
          Returns the moles of the species.
 Phase getPhase()
          Returns the phase in which the species exists
 char getPhysicalState()
          Returns the physical state of the species.
 double getPressure()
          Returns the partial pressure of the species in atmospheres.
 boolean isEquivalent(Species _sp)
          Returns true if the Species is equivalent to the user-supplied Species.
 void setAnalConc(double _analConc)
          Sets the analytical concentration (moles/L).
 void setAnalMass(double _analMass)
          Sets the analytical mass of the species
 void setAnalMoles(double _analMoles)
          Sets the analytical number of moles.
 void setAnalPressure(double _analPressure)
          Sets the analytical partial pressure in atmospheres.
 void setFW(double _fw)
          Sets the formula weight of the species by calling the setFW method of the ChemSpecies.
protected  void setIndex(int _index)
          Sets the index of this species (used in Equilibria.class)
 void setIonSize(double _ionSize)
          Sets the Debye-Huckel ion size parameter in angstroms by calling the setIonSize method of the ChemSpecies.
protected  void setIsAcid(boolean _isAcid)
          Sets the isAcid property
protected  void setIsBase(boolean _isBase)
          Sets the isBase property
protected  void setIsReactive(boolean _isReactive)
          Sets the isReactive status
protected  void setIsSolvent(boolean _isSolvent)
          Sets the isSolvent status
 void setLabel(java.lang.String _label)
          Sets the label for the species by calling the setLabel method of the ChemSpecies.
protected  void setMoles(double _moles)
          Sets the number of moles of the species.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FW

protected final double FW
See Also:
Constant Field Values

PHYSSTATE

protected final char PHYSSTATE
See Also:
Constant Field Values

IONSIZE

protected final double IONSIZE
See Also:
Constant Field Values

RESERVED

protected final java.lang.String[] RESERVED

chemSpecies

protected ChemSpecies chemSpecies

phase

protected Phase phase

chemSystem

protected ChemSystem chemSystem

isSolvent

protected boolean isSolvent

isReactive

protected boolean isReactive

index

protected int index

isAcid

protected boolean isAcid

isBase

protected boolean isBase

moles

protected double moles

analMoles

protected double analMoles
Constructor Detail

Species

public Species()
The default constructor should never be used.


Species

public Species(ChemSpecies _chemSpecies,
               Phase _phase)
Creates a species consisting of the indicated ChemSpecies in the indicated Phase.


Species

public Species(ChemSpecies _chemSpecies,
               Phase _phase,
               double _moles)
Creates a species consisting of the indicated ChemSpecies in the indicated Phase.

Parameters:
_moles - amount of species
Method Detail

getActivityCoefficient

public double getActivityCoefficient()
Returns the activity coefficient for the species.


getActivity

public double getActivity()
Returns the activity of the species.


getAnalConc

public double getAnalConc()
Returns the analytical concentration (mole/L)


getAnalMass

public double getAnalMass()
Returns the analytical mass in grams


getAnalMoles

public double getAnalMoles()
Returns the analytical number of moles


getAnalPressure

public double getAnalPressure()
Returns the analytical partial pressure. Returns the system pressure if the species is not in the gas phase.


getCharge

public double getCharge()
Returns the charge on the species.


getChemSpecies

public ChemSpecies getChemSpecies()
Returns the ChemSpecies for this Species.


getChemSystem

public ChemSystem getChemSystem()
Returns the chemical system in which the species exists


getConc

public double getConc()
Returns the molar concentration.


getFW

public double getFW()
Returns the formula weight of the species


getInfo

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


getIonSize

public double getIonSize()
Returns the Debye-Huckel ion size parameter in angstroms


getLabel

public java.lang.String getLabel()
Returns the phase label


getMass

public double getMass()
Returns the mass in grams


getMoles

public double getMoles()
Returns the moles of the species. The number of moles cannot be set; it is always calculated.


getPhase

public Phase getPhase()
Returns the phase in which the species exists


getPhysicalState

public char getPhysicalState()
Returns the physical state of the species.

s = solid (this must be the same as the phase and this species is the only species in the phase)

l = liquid (either the phase is a pure liquid, or this species is the solvent in a solution)

g = gas (this must be the same as the phase)

d = solute


getPressure

public double getPressure()
Returns the partial pressure of the species in atmospheres. Returns the system pressure if the species is not in the gas phase. For gas-phase species, the ideal gas law is employed. To employ a different equation of state, override the getPressure(double _moles, double _volume) method in the associated Phase class.

See Also:
Phase.getPressure(), Gas.getPressure()

isEquivalent

public boolean isEquivalent(Species _sp)
Returns true if the Species is equivalent to the user-supplied Species. To be equivalent, both Species must be the same ChemSpecies. Both Species must also have the same physical state. If the Species are solutes, both solvents must have the same ChemSpecies.


setAnalConc

public void setAnalConc(double _analConc)
Sets the analytical concentration (moles/L). The volume of the phase is used to set the analytical moles; thus the volume should be set before setting the analytical concentration.


setAnalMass

public void setAnalMass(double _analMass)
Sets the analytical mass of the species


setAnalMoles

public void setAnalMoles(double _analMoles)
Sets the analytical number of moles.


setAnalPressure

public void setAnalPressure(double _analPressure)
Sets the analytical partial pressure in atmospheres. The temperature of the system and the volume of the phase are used to set the analytical moles; thus these values should be set prior to setting the analytical partial pressure. This method does nothing if the species is not in the gas phase.


setFW

public void setFW(double _fw)
Sets the formula weight of the species by calling the setFW method of the ChemSpecies.

See Also:
ChemSpecies.setFW(double)

setIonSize

public void setIonSize(double _ionSize)
Sets the Debye-Huckel ion size parameter in angstroms by calling the setIonSize method of the ChemSpecies.

See Also:
ChemSpecies.setIonSize(double)

setLabel

public void setLabel(java.lang.String _label)
Sets the label for the species by calling the setLabel method of the ChemSpecies.

See Also:
ChemSpecies.setLabel(java.lang.String)

getIndex

protected int getIndex()
Returns the index of this Species (used in Equilibria.class)


getIsAcid

protected boolean getIsAcid()
Returns the isAcid property


getIsBase

protected boolean getIsBase()
Returns the isBase property


getIsReactive

protected boolean getIsReactive()
Returns the isReactive status


getIsSolvent

protected boolean getIsSolvent()
Returns the isSolvent status


setIndex

protected void setIndex(int _index)
Sets the index of this species (used in Equilibria.class)


setIsAcid

protected void setIsAcid(boolean _isAcid)
Sets the isAcid property


setIsBase

protected void setIsBase(boolean _isBase)
Sets the isBase property


setIsReactive

protected void setIsReactive(boolean _isReactive)
Sets the isReactive status


setIsSolvent

protected void setIsSolvent(boolean _isSolvent)
Sets the isSolvent status


setMoles

protected void setMoles(double _moles)
Sets the number of moles of the species.