#include <Phase.h>
Public Member Functions | |
Phase (void) | |
blank constructor. STP assumed. | |
virtual | ~Phase () |
generic destructor | |
virtual int | getNcomp (void) |
Returns number of components (1 for base class). | |
virtual double | getMW (void) |
Return molecular weight for phase (grams/mol). | |
virtual int | getCompNo (char *lab) |
virtual const char * | getCompName (int i) |
virtual const char * | getCompFormula (int i) |
virtual int | getGenericNcomp (void) |
get number of generic (1-2 element) components | |
virtual char * | getGenericCompFormula (int icomp) |
virtual int | isOxide () |
returns logical indicating if this phase can be treated as oxide | |
virtual void | setTk (double ltk) |
set temperature in Kelvins. | |
virtual void | setPa (double lpa) |
set pressure in Pascals. | |
virtual void | setMoles (double lm) throw (PhaseError *) |
set total number of moles. | |
virtual void | setMass (double w) |
set total mass in grams. | |
virtual void | setComps (double *rawcomps) |
virtual void | setCompWeights (double *wt) |
virtual void | setCompWtPct (double *wt) |
virtual void | setGenericCompWts (double *wt) throw (PhaseError *) |
virtual void | setElements (double *ele) throw (PhaseError *) |
virtual void | resetTPbounds (double lowTbound, double hiTbound, double lowPbound, double hiPbound) |
virtual double | getTk () |
return temperature in Kelvins | |
virtual double | getPa () |
return pressure in Pascals | |
virtual double | getMoles () |
return total number of moles | |
virtual double | getMass () |
return total mass in grams | |
virtual double | getDensity () |
return density in grams per cubic centimeter | |
virtual void | getComps (double *rawcomps) |
Returns component moles in caller-allocated vector. | |
virtual void | getCompWeights (double *wt) |
Returns component grams in caller-allocated vector. | |
virtual void | getCompWtPct (double *wt) |
Returns components in weight percent (deprecated).Does not allocate space. | |
virtual void | getGenericCompWts (double *wt) |
Returns grams generic components (1-2 element) in caller-allocated space. | |
virtual void | getElements (double *ele) |
Returns moles of elements in caller-allocated space. | |
virtual void | getAddElements (double *ele, double mol) |
virtual double | getGibbs () |
Gibbs free energy in Joules. | |
virtual double | getMu0 (int i) |
virtual void | getMu0 (double *m0) |
virtual double | getMu (int i) |
virtual void | getMu (double *m) |
virtual double | getActivity (int icomp) |
virtual void | getActivity (double *a) |
virtual double | getdMudX (int i, int j) |
virtual double | getdMudP (int i) |
Returns partial molar volume in m^3. | |
virtual void | getdGdm (double *dgdm) |
virtual void | getd2Gdm2 (double **d2gdm2) |
virtual void | getd3Gdm3 (double ***d3gdm3) |
virtual double | getGmix () |
virtual void | getHessian (double **h) |
virtual double | getEnthalpy () |
enthalpy in Joules | |
virtual double | getHmix () |
Enthalpy of mixing. Zero in generic case or single component. | |
virtual double | getEntropy () |
entropy in Joules/Kelvin | |
virtual void | getdSdm (double *dsdm) |
virtual void | getd2Sdm2 (double **d2sdm2) |
virtual double | getSmix () |
Entropy of mixing. Ideal in generic case. Zero for single-component. | |
virtual double | getCp () |
constant-pressure heat capacity in Joules/Kelvin | |
virtual double | getdCpdT () |
derivative of Cp with respect to temperature. | |
virtual void | getdCpdm (double *dcpdm) |
derivative of Cp with respect to composition. | |
virtual double | getVolume () |
volume in cubic meters = Joules/Pascal | |
virtual void | getdVdm (double *dvdm) |
derivative of volume with respect to composition. | |
virtual void | getd2Vdm2 (double **d2vdm2) |
second derivative of volume with respect to composition. | |
virtual double | getdVdT () |
dV/dT in M^3/Kelvin | |
virtual double | getdVdP () |
dV/dP in M^3/Pascal | |
virtual double | getd2VdT2 () |
d2V/dT2 in M^3/Kelvin^2 | |
virtual double | getd2VdTdP () |
d2V/dTdP in M^3/KelvinPascal | |
virtual double | getd2VdP2 () |
d2V/dP2 in M^3/Pascal^2 | |
virtual void | getd2VdmdT (double *d2vdmdt) |
d2VdmdT in M^3/KelvinMole | |
virtual void | getd2VdmdP (double *d2vdmdp) |
d2VdmdP in M^3/PascalMole | |
virtual double | getVmix () |
Volume of mixing. Zero in generic case or single-component. | |
virtual int | isStable () |
virtual void | printAll () |
print all properties of phase | |
virtual void | update () |
generic routine brings ordering, speciation, etc. current (if necessary). | |
Public Attributes | |
char * | name |
name of phase. | |
char * | formula |
formula of phase. | |
Protected Member Functions | |
virtual void | init () |
virtual void | checkT (double) throw (PhaseError *) |
method checks validity of argument as temperature | |
virtual void | checkP (double) throw (PhaseError *) |
method checks validity of argument as pressure | |
virtual void | checkX (double *) throw (PhaseError *) |
method checks validity of argument as composition | |
Protected Attributes | |
int | ncomp |
number of components | |
double * | elarray |
Array of element abundances.Working space. Never assume current. | |
Stoich | eleStoich |
Soich structure for elements relevant to this phase. | |
Stoich | oxStoich |
Soich structure for oxides relevant to this phase (nele=0 if not oxide). | |
double | tk |
temperature in Kelvins | |
double | pa |
pressure in Pascals | |
double | nmoles |
total number of moles | |
double | mw |
molecular weight in grams | |
const double | R |
J/Kmol. | |
const double | tr |
reference temperature | |
const double | pr |
reference pressure | |
double | lowT |
low temperature limit (K) | |
double | highT |
high temperature limit (K) | |
double | lowP |
low pressure limit (Pa) | |
double | highP |
high pressure limit (Pa) | |
int | updated |
boolean to indicate if state of system is self-consistent (if necessary) |
Generic Phase class. Parent class to all Phases. SI units throughout with Tr=273.15 and Pr=1.e5 Pa. As a general rule, space is to be allocated and values initialized in init() routine and destroyed in destructor. Parent init() should be called by each child. Parent destructor is called automatically if all destructors are virtual. Whole hierarchy converted to extensive quantities 4/14/03. Solution methods added 7/31/03
Definition at line 25 of file Phase.h.
virtual double Phase::getActivity | ( | int | icomp | ) | [virtual] |
component activities.
Reimplemented in MeltsSolution, and Solution.
virtual void Phase::getActivity | ( | double * | a | ) | [virtual] |
component activities
a | user provide ncomp vector to hold results. |
Reimplemented in MeltsSolution, and Solution.
virtual void Phase::getAddElements | ( | double * | ele, | |
double | mol | |||
) | [virtual] |
virtual const char* Phase::getCompFormula | ( | int | i | ) | [virtual] |
get component formula. Caution: string destroyed with Phase object.
i | integer component number. |
Reimplemented in SilicateLiq, and Solution.
virtual const char* Phase::getCompName | ( | int | i | ) | [virtual] |
get component name corresponding to string. Caution: string destroyed with Phase object.
i | integer component number. |
Reimplemented in SilicateLiq, and Solution.
virtual int Phase::getCompNo | ( | char * | lab | ) | [virtual] |
gets component number for input string. Match must be exact.
lab | char* to name of phase to match |
Reimplemented in Solution.
virtual void Phase::getd2Gdm2 | ( | double ** | d2gdm2 | ) | [virtual] |
second derivative of Gibbs free energy with respect to moles (Joules/mole). param d2gdm2 ncomp by ncomp array to hold results.
Reimplemented in FeNiMet, MeltsSolution, RegularSolution, Solution, and SpecSolution.
virtual void Phase::getd2Sdm2 | ( | double ** | d2sdm2 | ) | [virtual] |
second derivative of entropy with respect to moles (Joules/(mole^2.Kelvin).
d2sdm2 | ncomp by ncomp array to store result |
Reimplemented in MeltsSolution, ShomateIdealGas, Solution, and SpecSolution.
virtual void Phase::getd3Gdm3 | ( | double *** | d3gdm3 | ) | [virtual] |
third derivative of Gibbs free energy with respect to moles (Joules/mole). param d3gdm3 ncomp by ncomp by ncomp array to hold results.
Reimplemented in MeltsSolution, RegularSolution, Solution, and SpecSolution.
virtual void Phase::getdGdm | ( | double * | dgdm | ) | [virtual] |
derivative of Gibbs free energy with respect to moles (Joules/mole). param dgdm ncomp vector to hold results.
Reimplemented in MeltsSolution, and Solution.
virtual double Phase::getdMudX | ( | int | i, | |
int | j | |||
) | [virtual] |
composition derivative of chemical potential
Reimplemented in FeNiMet, MeltsSolution, RegularSolution, SilicateLiq, Solution, and SpecSolution.
virtual void Phase::getdSdm | ( | double * | dsdm | ) | [virtual] |
derivative of entropy with respect to moles (Joules/(mole.Kelvin).
dsdm | ncomp vector to store result |
Reimplemented in MeltsSolution, ShomateIdealGas, Solution, and SpecSolution.
virtual char* Phase::getGenericCompFormula | ( | int | icomp | ) | [virtual] |
Get string formula for generic component. Caution: string destroyed with Phase object.
icomp | component number < gncomp |
Reimplemented in SilicateLiq.
virtual double Phase::getGmix | ( | ) | [virtual] |
Mixing contribution to Gibbs free energy. Ideal in generic case or zero for single-component.
Reimplemented in MeltsSolution, SilicateLiq, Solution, and SpecSolution.
virtual void Phase::getHessian | ( | double ** | h | ) | [virtual] |
calculates Gibbs Hessian and returns in user-allocated space.
h | ncomp by ncomp array to hold Gibbs Hessian. |
Reimplemented in Solution.
virtual void Phase::getMu | ( | double * | m | ) | [virtual] |
chemical potential in Joules.
Reimplemented in MeltsSolution, and Solution.
virtual double Phase::getMu | ( | int | i | ) | [virtual] |
standard state chemical potential in Joules. Same as getMu0 for single-component phase.
i | component number |
Reimplemented in Feldspar, FeNiMet, Melilite, MeltsSolution, RegularSolution, SilicateLiq, Solution, and SpecSolution.
virtual void Phase::getMu0 | ( | double * | m0 | ) | [virtual] |
standard state chemical potential in Joules.
Reimplemented in Solution.
virtual double Phase::getMu0 | ( | int | i | ) | [virtual] |
standard state chemical potential in Joules.
i | component number |
Reimplemented in SilicateLiq, Solution, and SpecSolution.
virtual void Phase::init | ( | ) | [protected, virtual] |
Initialization function. Each child class must call parent init(). In 1-comp phases, parent init() must be called after formula defined. Solutions must implement own init and not call parent Phase::init() and ss array filled.
Reimplemented in AlloyLiquid, AlloySolid, Biotite, Clinoamphibole, Clinopyroxene, COHSClFGasSol, COHSGasSol, Cummingtonite, DMWvapor, DuanetalVaporPhase, DuanetalVaporSolution, Feldspar, FeLiquidMELTS, FeMet, FeMetalMELTS, FeNiLiq, FeNiMet, FeNiMetChuang, Garnet, HaarWater, Hornblende, Kalsilite, Leucite, Melilite, MeltsSolution, Nepheline, NiLiquidMELTS, NiMetalMELTS, Olivine, Orthoamphibole, Orthopyroxene, RegularSolution, RhmOxide, RobiePhase, ShomatePhase, ShomateVinetPhase, SilicateLiq, Solution, SpecSolNID, SpecSolution, Spinel, and SulfLiq.
virtual int Phase::isStable | ( | ) | [virtual] |
Checks for phase stability by Hessian test.
Reimplemented in Solution.
virtual void Phase::resetTPbounds | ( | double | lowTbound, | |
double | hiTbound, | |||
double | lowPbound, | |||
double | hiPbound | |||
) | [virtual] |
used to reset default bounds for temperature and pressure.
lowTbound | new lower temperature bound | |
hiTbound | new upper temperature bound | |
lowPbound | new lower pressure bound | |
hiPbound | new upper pressure bound |
Reimplemented in BermanLambdaPhase, and Solution.
virtual void Phase::setComps | ( | double * | rawcomps | ) | [virtual] |
Set component moles. For single-component phase, just sets moles.
rawcomps | ncomp array of moles of each component. |
Reimplemented in MeltsSolution, SilicateLiq, Solution, and SpecSolution.
virtual void Phase::setCompWeights | ( | double * | wt | ) | [virtual] |
sets component weights in grams.
wt | ncomp array of grams of each component. |
Reimplemented in Solution.
virtual void Phase::setCompWtPct | ( | double * | wt | ) | [virtual] |
sets components from vector in weight percent (nmoles set to 1.0) Maintained for backward compatibility (deprecated)
Reimplemented in Solution.
virtual void Phase::setElements | ( | double * | ele | ) | throw (PhaseError *) [virtual] |
Set moles of elements.
ele | Moles of elements on entry, remainder after max phase comp removed on exit. |
Reimplemented in MeltsSolution, and Solution.
virtual void Phase::setGenericCompWts | ( | double * | wt | ) | throw (PhaseError *) [virtual] |
sets generic component (1-2 element) weights in grams
wt | gncomp array of grams of each generic component |
Reimplemented in SilicateLiq.