mirror of
https://github.com/Cantera/cantera.git
synced 2025-02-25 18:55:29 -06:00
*** empty log message ***
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
/**
|
||||
* @file EdgeKinetics.h
|
||||
*
|
||||
* $Author$
|
||||
* @ingroup chemkinetics
|
||||
* @ingroup electrochem
|
||||
*/
|
||||
|
||||
/* $Author$
|
||||
* $Revision$
|
||||
* $Date$
|
||||
*/
|
||||
@@ -16,6 +20,10 @@
|
||||
|
||||
namespace Cantera {
|
||||
|
||||
/**
|
||||
* Heterogeneous reactions at one-dimensional interfaces between
|
||||
* multiple adjacent two-dimensional surfaces.
|
||||
*/
|
||||
class EdgeKinetics : public InterfaceKinetics {
|
||||
|
||||
public:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/**
|
||||
* @file GRI_30_Kinetics.cpp
|
||||
*
|
||||
* @ingroup chemkinetics
|
||||
*/
|
||||
|
||||
// Copyright 2001 California Institute of Technology
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
*
|
||||
* @file GRI_30_Kinetics.h
|
||||
*
|
||||
* @ingroup chemkinetics
|
||||
*/
|
||||
|
||||
// Copyright 2001 California Institute of Technology
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/**
|
||||
* @file InterfaceKinetics.h
|
||||
*
|
||||
* @ingroup chemkinetics
|
||||
*/
|
||||
/*
|
||||
* $Author$
|
||||
@@ -10,6 +11,13 @@
|
||||
|
||||
// Copyright 2001 California Institute of Technology
|
||||
|
||||
/**
|
||||
* @defgroup electrochem Electrochemistry
|
||||
*
|
||||
* Support for electrochemical reaction kinetics.
|
||||
*
|
||||
* @ingroup chemkinetics
|
||||
*/
|
||||
|
||||
#ifndef CT_IFACEKINETICS_H
|
||||
#define CT_IFACEKINETICS_H
|
||||
@@ -67,6 +75,7 @@ namespace Cantera {
|
||||
/// reactions are assumed to occur at a 2D interface between two
|
||||
/// 3D phases.
|
||||
///
|
||||
/// @ingroup chemkinetics
|
||||
class InterfaceKinetics : public Kinetics {
|
||||
|
||||
public:
|
||||
|
||||
@@ -23,6 +23,10 @@ namespace Cantera {
|
||||
// forward references
|
||||
class ReactionData;
|
||||
|
||||
/**
|
||||
* @defgroup chemkinetics Chemical Kinetics
|
||||
*/
|
||||
|
||||
/// @defgroup kineticsmgr Kinetics Managers
|
||||
/// @section kinmodman Models and Managers
|
||||
///
|
||||
@@ -106,6 +110,7 @@ namespace Cantera {
|
||||
/// in the reactions), the next 3 will be for phase 'b', and finally the
|
||||
/// net production rates for the surface species will occupy the last
|
||||
/// 5 locations.
|
||||
/// @ingroup chemkinetics
|
||||
|
||||
|
||||
//! Public interface for kinetics managers.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,25 +3,32 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace Cantera {
|
||||
namespace CanteraSpectra {
|
||||
|
||||
doublereal to_wavenumbers(doublereal freq) {
|
||||
return freq/(100.0*lightSpeed);
|
||||
}
|
||||
|
||||
doublereal from_wavenumbers(doublereal omega) {
|
||||
return omega*(100.0*lightSpeed);
|
||||
}
|
||||
|
||||
Lorentzian::Lorentzian(doublereal FWHM) {
|
||||
m_hwhm = 0.5*FWHM;
|
||||
Lorentzian::Lorentzian(doublereal gamma) {
|
||||
m_hwhm = gamma;
|
||||
m_hwhm2 = m_hwhm*m_hwhm;
|
||||
}
|
||||
|
||||
/**
|
||||
* The Lorentzian profile for collision-broadened lines.
|
||||
*
|
||||
*\f[
|
||||
* \frac{1}{\pi} \frac{\gamma}{ (\Delta\nu)^2 + \gamma^2}
|
||||
*\f]
|
||||
* Units: 1/wavenumber (or cm).
|
||||
*/
|
||||
doublereal Lorentzian::profile(doublereal deltaFreq) {
|
||||
return (1.0/Pi) *m_hwhm/(deltaFreq*deltaFreq + m_hwhm2);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* The cumulative profile, given by
|
||||
* \f[
|
||||
* \frac{1}{\pi} \tan^{-1}\left(\frac{\Delta\nu}{gamma}\right) + 0.5
|
||||
* \f]
|
||||
*/
|
||||
doublereal Lorentzian::cumulative(doublereal deltaFreq) {
|
||||
return (1.0/Pi) * atan(deltaFreq/m_hwhm) + 0.5;
|
||||
}
|
||||
@@ -30,13 +37,15 @@ namespace Cantera {
|
||||
return 2.0*m_hwhm;
|
||||
}
|
||||
|
||||
Gaussian::Gaussian(doublereal FWHM) {
|
||||
m_width = FWHM;
|
||||
m_sigma = 0.5*FWHM / sqrt(2.0 * log(2.0));
|
||||
Gaussian::Gaussian(doublereal sigma) {
|
||||
m_sigma = sigma;
|
||||
m_sigma2 = m_sigma*m_sigma;
|
||||
}
|
||||
|
||||
doublereal Gaussian::profile(doublereal deltaFreq) {
|
||||
//cout << "entered Gaussian::profile" << endl;
|
||||
//cout << "deltaFreq = " << deltaFreq << endl;
|
||||
//cout << "m_sigma = " << m_sigma << endl;
|
||||
return 1.0/(m_sigma*SqrtTwo*SqrtPi) *
|
||||
exp(-deltaFreq*deltaFreq/(2.0*m_sigma2));
|
||||
}
|
||||
@@ -46,7 +55,83 @@ namespace Cantera {
|
||||
}
|
||||
|
||||
doublereal Gaussian::width() {
|
||||
return m_width;
|
||||
return 2.0*m_sigma*sqrt(log(4.0));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param sigma The standard deviation of the Gaussian
|
||||
* @param gamma The half-width of the Lorentzian.
|
||||
*/
|
||||
Voigt::Voigt(doublereal sigma, doublereal gamma) {
|
||||
m_sigma = sigma;
|
||||
m_sigma2 = m_sigma*m_sigma;
|
||||
m_gamma_lor = gamma;
|
||||
m_sigsqrt2 = SqrtTwo*m_sigma;
|
||||
m_gamma = gamma/m_sigsqrt2;
|
||||
m_eps = 1.0e-9;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method evaluates the function
|
||||
* \f[
|
||||
* F(x, y) = \frac{y}{\pi}\int_{-\infty}^{+\infty} \frac{e^{-z^2}}
|
||||
* {(x - z)^2 + y^2} dz
|
||||
* \f]
|
||||
*/
|
||||
doublereal Voigt::F(doublereal x) {
|
||||
|
||||
if (x < 0.0) x = -x;
|
||||
double y = m_gamma;
|
||||
|
||||
double c3 = log(Pi*m_eps/2.0);
|
||||
double tau = sqrt(-log(y) - c3);
|
||||
double b = (tau + x)/y;
|
||||
double t = b*y;
|
||||
double f1, f2, f3;
|
||||
double c0 = 2.0/(Pi*m_eps);
|
||||
const double c1 = 1.0/SqrtTwo;
|
||||
const double c2 = 2.0/SqrtPi;
|
||||
|
||||
if (y > c0/m_eps) {
|
||||
throw CanteraError("Voigt::F",
|
||||
"condition that y < c0/epsion violated");
|
||||
}
|
||||
while (1 > 0) {
|
||||
f1 = c2*y*exp(-Pi*Pi/(t*t));
|
||||
f2 = fabs(y*y - Pi*Pi/(t*t));
|
||||
f3 = 1.0 - pow(exp(-Pi*Pi/(t*t)),2);
|
||||
t *= c1;
|
||||
// cout << "t = " << t << endl;
|
||||
if ((f1/(f2*f3)) < 0.5*m_eps) break;
|
||||
}
|
||||
double h = t/y;
|
||||
int N = int(0.5*b/h);
|
||||
double S = 0.0;
|
||||
double u = h/2;
|
||||
for (int i = 0; i < N; i++) {
|
||||
S += (1.0 + exp(-4.0*x*y*u))*exp(-pow(y*u-x,2))/(u*u+1.0);
|
||||
u += h;
|
||||
}
|
||||
double Q = h*S/Pi;
|
||||
double C = 0.0;
|
||||
if (y*y < Pi/h) {
|
||||
C = 2.0*exp(y*y - x*x)*cos(2*x*y)/(1.0 + exp(2*Pi/h));
|
||||
}
|
||||
else {
|
||||
return 0.0;
|
||||
}
|
||||
return Q + C;
|
||||
}
|
||||
|
||||
/**
|
||||
* Voigt profile.
|
||||
*
|
||||
*/
|
||||
doublereal Voigt::profile(doublereal deltaFreq) {
|
||||
const double ff = m_gamma_lor*m_gamma_lor/(2.0*Pi*m_sigma*m_sigma);
|
||||
return ff*F(deltaFreq/m_sigsqrt2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,23 +1,28 @@
|
||||
/**
|
||||
* @file LinerBoadener.h
|
||||
* Header file for class LineBroadener
|
||||
* @ingroup spectroscopy
|
||||
*/
|
||||
|
||||
#include "ct_defs.h"
|
||||
#include "ctexceptions.h"
|
||||
|
||||
namespace Cantera {
|
||||
using namespace Cantera;
|
||||
namespace CanteraSpectra {
|
||||
|
||||
/**
|
||||
* Base class for classes implementing line shapes of
|
||||
* various types.
|
||||
* @ingroup spectroscopy
|
||||
*/
|
||||
class LineBroadener {
|
||||
|
||||
public:
|
||||
|
||||
/// Default constructor
|
||||
LineBroadener() {}
|
||||
|
||||
/// Destructor
|
||||
virtual ~LineBroadener() {}
|
||||
|
||||
/**
|
||||
@@ -26,7 +31,8 @@ namespace Cantera {
|
||||
* P(\Delta\nu)
|
||||
*\f]
|
||||
* as a function of distance from line
|
||||
* center. This function must have total area = 1.0.
|
||||
* center \f$ \Delta\nu \f$.
|
||||
* This function must have total area = 1.0.
|
||||
* Note that this method must be overloaded in each
|
||||
* derived class. If the base class method is called,
|
||||
* an exception will be thrown.
|
||||
@@ -36,6 +42,10 @@ namespace Cantera {
|
||||
"base class method called!");
|
||||
}
|
||||
|
||||
doublereal operator()(doublereal deltaFreq) {
|
||||
return profile(deltaFreq);
|
||||
}
|
||||
|
||||
/**
|
||||
* The cumulative profile, defined as
|
||||
* \f[
|
||||
@@ -47,6 +57,7 @@ namespace Cantera {
|
||||
"base class method called!");
|
||||
}
|
||||
|
||||
virtual doublereal width() { return 0.0; }
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -55,7 +66,7 @@ namespace Cantera {
|
||||
* \f[
|
||||
* L(\Delta\nu) = \frac{1}{\pi}\frac{\gamma}{\Delta\nu^2 + \gamma^2}
|
||||
* \f]
|
||||
* where \f$ \gamma = {\mbox{FWHM}/2 \f$.
|
||||
* where \f$ \gamma = {\mbox{FWHM}/2} \f$.
|
||||
*/
|
||||
class Lorentzian : public LineBroadener {
|
||||
public:
|
||||
@@ -80,15 +91,50 @@ namespace Cantera {
|
||||
* Constructor.
|
||||
* @param FWHM Full width at half-maximum.
|
||||
*/
|
||||
Gaussian(doublereal FWHM);
|
||||
Gaussian(doublereal sigma);
|
||||
virtual doublereal profile(doublereal deltaFreq);
|
||||
virtual doublereal cumulative(doublereal deltaFreq);
|
||||
virtual doublereal width();
|
||||
|
||||
doublereal standardDev() {
|
||||
return m_sigma;
|
||||
}
|
||||
|
||||
protected:
|
||||
doublereal m_sigma;
|
||||
doublereal m_sigma2;
|
||||
doublereal m_width;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* A Voigt profile is the convolution of a Lorentzian and a
|
||||
* Gaussian profile. This profile results when Doppler
|
||||
* broadening and collisional broadening both are important.
|
||||
*/
|
||||
class Voigt : public LineBroadener {
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
Voigt(doublereal sigma, doublereal gamma);
|
||||
virtual doublereal profile(doublereal deltaFreq);
|
||||
//virtual doublereal cumulative(doublereal deltaFreq)
|
||||
//virtual doublereal width()
|
||||
|
||||
protected:
|
||||
|
||||
doublereal F(doublereal x);
|
||||
|
||||
doublereal m_sigma;
|
||||
doublereal m_gamma_lor;
|
||||
doublereal m_sigma2;
|
||||
doublereal m_width;
|
||||
doublereal m_gamma;
|
||||
doublereal m_sigsqrt2;
|
||||
doublereal m_a;
|
||||
doublereal m_eps;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -10,15 +10,17 @@
|
||||
#include "ct_defs.h"
|
||||
#include "rotor.h"
|
||||
|
||||
namespace Cantera {
|
||||
namespace CanteraSpectra {
|
||||
|
||||
/**
|
||||
* @param Bv Rotational constant, wavenumbers
|
||||
* Constructor.
|
||||
*
|
||||
* @param Bv Rotational constant, wavenumbers.
|
||||
* @dipoleMoment permanent dipole moment.
|
||||
* @param Dv Coefficient describing centrifugal
|
||||
* effects on the bond length. For a rigid rotor, Bv = 0.
|
||||
* effects on the bond length. For a rigid rotor, Bv = 0.
|
||||
* @param Hv Coefficient describing higher-order vibration-rotation
|
||||
* interactions. For a rigid rotor, Hv = 0.
|
||||
* @dipoleMoment permanent dipole moment.
|
||||
*/
|
||||
Rotor::Rotor(doublereal Bv, doublereal dipoleMoment,
|
||||
doublereal Dv, doublereal Hv ) : m_Bv(Bv),
|
||||
@@ -81,18 +83,23 @@ namespace Cantera {
|
||||
return degeneracy(J)*exp(-wnum_to_J(energy_w(J))/(Boltzmann*T));
|
||||
}
|
||||
|
||||
/** The difference in the energies of an upper and a lower state.
|
||||
*
|
||||
/**
|
||||
* The frequency at which radiation is absorbed by a transition
|
||||
* from the lower to the upper state in wavenumber units.
|
||||
*/
|
||||
doublereal Rotor::frequency(int J_lower, int J_upper) {
|
||||
return (energy_w(J_upper) - energy_w(J_lower));
|
||||
}
|
||||
|
||||
/**
|
||||
* The spectral intensity of a rotational transition.
|
||||
*/
|
||||
doublereal Rotor::intensity(int J_lower, int J_upper, doublereal T) {
|
||||
int dJ = J_upper - J_lower;
|
||||
if (dJ > 1 || dJ < -1) return 0;
|
||||
return relPopulation(J_lower, T);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,45 +1,45 @@
|
||||
#ifndef CT_ROTOR
|
||||
#define CT_ROTOR
|
||||
|
||||
/**
|
||||
* @file rotor.h
|
||||
* Header file for class Rotor.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup spectra Spectroscopic Models
|
||||
* @defgroup spectroscopy Spectroscopic Models
|
||||
*
|
||||
* These classes are used to simulate the absorption and emission spectra of
|
||||
* molecules.
|
||||
*/
|
||||
|
||||
/*
|
||||
* @ingroup thermoprops
|
||||
*/
|
||||
|
||||
#ifndef CT_ROTOR
|
||||
#define CT_ROTOR
|
||||
|
||||
#include "ct_defs.h"
|
||||
using namespace Cantera;
|
||||
|
||||
namespace Cantera {
|
||||
/**
|
||||
* Namespace for spectroscopic functions and classes.
|
||||
*/
|
||||
namespace CanteraSpectra {
|
||||
|
||||
/**
|
||||
* Class Rotor represents a non-rigid quantum-mechanical rotor.
|
||||
* @ingroup spectra
|
||||
* @ingroup spectroscopy
|
||||
*/
|
||||
class Rotor {
|
||||
public:
|
||||
|
||||
/// Default Constructor.
|
||||
Rotor() {}
|
||||
|
||||
/// Destructor.
|
||||
virtual ~Rotor() {}
|
||||
|
||||
/*
|
||||
*/
|
||||
/// Full Constructor.
|
||||
Rotor(doublereal Bv, doublereal dipoleMoment = 0.0,
|
||||
doublereal Dv = 0.0, doublereal Hv = 0.0);
|
||||
|
||||
|
||||
/// energy in wavenumbers
|
||||
doublereal energy_w(int J);
|
||||
|
||||
/// degeneracy
|
||||
int degeneracy(int J);
|
||||
|
||||
doublereal partitionFunction(doublereal T, int cutoff=-1);
|
||||
@@ -66,6 +66,7 @@ namespace Cantera {
|
||||
return freq/(100.0*lightSpeed);
|
||||
}
|
||||
|
||||
/** Convert from wavenumbers to Joules. */
|
||||
inline doublereal wnum_to_J(doublereal w) {
|
||||
return Planck * w * 100.0 * lightSpeed;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @file HarmonicOscThermo.h
|
||||
* @file AdsorbateThermo.h
|
||||
*
|
||||
* Header for a single-species standard
|
||||
* state object derived from \link Cantera::SpeciesThermoInterpType
|
||||
@@ -21,12 +21,11 @@
|
||||
|
||||
#include "SpeciesThermoInterpType.h"
|
||||
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
namespace Cantera {
|
||||
|
||||
/**
|
||||
* An adsorbed surface species.
|
||||
*
|
||||
* This class is designed specifically for use by the class
|
||||
* GeneralSpeciesThermo. It implements a model for the
|
||||
* thermodynamic properties of a molecule that can be modeled as a
|
||||
@@ -86,9 +85,9 @@ namespace Cantera {
|
||||
return (SpeciesThermoInterpType *) np;
|
||||
}
|
||||
|
||||
virtual void install(string name, int index, int type,
|
||||
const doublereal* c,
|
||||
doublereal minTemp, doublereal maxTemp, doublereal refPressure) {
|
||||
virtual void install(std::string name, int index, int type,
|
||||
const doublereal* c, doublereal minTemp, doublereal maxTemp,
|
||||
doublereal refPressure) {
|
||||
m_be = c[1];
|
||||
m_nFreqs = int(c[0]);
|
||||
for (int n = 0; n < m_nFreqs; n++) {
|
||||
@@ -120,61 +119,61 @@ namespace Cantera {
|
||||
virtual int speciesIndex() const { return m_index; }
|
||||
|
||||
|
||||
//! Compute the reference-state property of one species
|
||||
/*!
|
||||
* Given temperature T in K, this method updates the values of
|
||||
* the non-dimensional heat capacity at constant pressure,
|
||||
* enthalpy, and entropy, at the reference pressure, Pref
|
||||
* of one of the species. The species index is used
|
||||
* to reference into the cp_R, h_RT, and s_R arrays.
|
||||
*
|
||||
* @param temp Temperature (Kelvin)
|
||||
* @param cp_R Vector of Dimensionless heat capacities.
|
||||
* (length m_kk).
|
||||
* @param h_RT Vector of Dimensionless enthalpies.
|
||||
* (length m_kk).
|
||||
* @param s_R Vector of Dimensionless entropies.
|
||||
* (length m_kk).
|
||||
*/
|
||||
void updatePropertiesTemp(const doublereal temp,
|
||||
doublereal* cp_R,
|
||||
doublereal* h_RT,
|
||||
doublereal* s_R) const {
|
||||
h_RT[m_index] = _energy_RT(temp);
|
||||
cp_R[m_index] = (temp*h_RT[m_index]
|
||||
- (temp-0.01)*_energy_RT(temp-0.01))/0.01;
|
||||
s_R[m_index] = h_RT[m_index] - _free_energy_RT(temp);
|
||||
}
|
||||
|
||||
//!This utility function reports back the type of
|
||||
//! parameterization and all of the parameters for the
|
||||
//! species, index.
|
||||
/*!
|
||||
* All parameters are output variables
|
||||
*
|
||||
* @param n Species index
|
||||
* @param type Integer type of the standard type
|
||||
* @param tlow output - Minimum temperature
|
||||
* @param thigh output - Maximum temperature
|
||||
* @param pref output - reference pressure (Pa).
|
||||
* @param coeffs Vector of coefficients used to set the
|
||||
* parameters for the standard state.
|
||||
*/
|
||||
void reportParameters(int &n, int &type,
|
||||
doublereal &tlow, doublereal &thigh,
|
||||
doublereal &pref,
|
||||
doublereal* const coeffs) const {
|
||||
n = m_index;
|
||||
type = ADSORBATE;
|
||||
tlow = m_lowT;
|
||||
thigh = m_highT;
|
||||
pref = m_Pref;
|
||||
coeffs[0] = m_nFreqs;
|
||||
coeffs[1] = m_be;
|
||||
for (int i = 2; i < m_nFreqs+2; i++) {
|
||||
coeffs[i] = m_freq[i-2];
|
||||
}
|
||||
}
|
||||
//! Compute the reference-state property of one species
|
||||
/*!
|
||||
* Given temperature T in K, this method updates the values of
|
||||
* the non-dimensional heat capacity at constant pressure,
|
||||
* enthalpy, and entropy, at the reference pressure, Pref
|
||||
* of one of the species. The species index is used
|
||||
* to reference into the cp_R, h_RT, and s_R arrays.
|
||||
*
|
||||
* @param temp Temperature (Kelvin)
|
||||
* @param cp_R Vector of Dimensionless heat capacities.
|
||||
* (length m_kk).
|
||||
* @param h_RT Vector of Dimensionless enthalpies.
|
||||
* (length m_kk).
|
||||
* @param s_R Vector of Dimensionless entropies.
|
||||
* (length m_kk).
|
||||
*/
|
||||
void updatePropertiesTemp(const doublereal temp,
|
||||
doublereal* cp_R,
|
||||
doublereal* h_RT,
|
||||
doublereal* s_R) const {
|
||||
h_RT[m_index] = _energy_RT(temp);
|
||||
cp_R[m_index] = (temp*h_RT[m_index]
|
||||
- (temp-0.01)*_energy_RT(temp-0.01))/0.01;
|
||||
s_R[m_index] = h_RT[m_index] - _free_energy_RT(temp);
|
||||
}
|
||||
|
||||
//! This utility function reports back the type of
|
||||
/*! parameterization and all of the parameters for the
|
||||
* species, index.
|
||||
*
|
||||
* All parameters are output variables
|
||||
*
|
||||
* @param n Species index
|
||||
* @param type Integer type of the standard type
|
||||
* @param tlow output - Minimum temperature
|
||||
* @param thigh output - Maximum temperature
|
||||
* @param pref output - reference pressure (Pa).
|
||||
* @param coeffs Vector of coefficients used to set the
|
||||
* parameters for the standard state.
|
||||
*/
|
||||
void reportParameters(int &n, int &type,
|
||||
doublereal &tlow, doublereal &thigh,
|
||||
doublereal &pref,
|
||||
doublereal* const coeffs) const {
|
||||
n = m_index;
|
||||
type = ADSORBATE;
|
||||
tlow = m_lowT;
|
||||
thigh = m_highT;
|
||||
pref = m_Pref;
|
||||
coeffs[0] = m_nFreqs;
|
||||
coeffs[1] = m_be;
|
||||
for (int i = 2; i < m_nFreqs+2; i++) {
|
||||
coeffs[i] = m_freq[i-2];
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
//! lowest valid temperature
|
||||
@@ -193,36 +192,36 @@ namespace Cantera {
|
||||
doublereal m_be;
|
||||
|
||||
|
||||
doublereal _energy_RT(double T) const {
|
||||
doublereal x, hnu_kt, hnu, sum = 0.0;
|
||||
doublereal kt = T*Boltzmann;
|
||||
int i;
|
||||
for (i = 0; i < m_nFreqs; i++) {
|
||||
hnu = Planck * m_freq[i];
|
||||
hnu_kt = hnu/kt;
|
||||
x = exp(-hnu_kt);
|
||||
sum += hnu_kt * x/(1.0 - x);
|
||||
doublereal _energy_RT(double T) const {
|
||||
doublereal x, hnu_kt, hnu, sum = 0.0;
|
||||
doublereal kt = T*Boltzmann;
|
||||
int i;
|
||||
for (i = 0; i < m_nFreqs; i++) {
|
||||
hnu = Planck * m_freq[i];
|
||||
hnu_kt = hnu/kt;
|
||||
x = exp(-hnu_kt);
|
||||
sum += hnu_kt * x/(1.0 - x);
|
||||
}
|
||||
return sum + m_be/(GasConstant*T);
|
||||
}
|
||||
return sum + m_be/(GasConstant*T);
|
||||
}
|
||||
|
||||
doublereal _free_energy_RT(double T) const {
|
||||
doublereal x, hnu_kt, sum = 0.0;
|
||||
doublereal kt = T*Boltzmann;
|
||||
int i;
|
||||
for (i = 0; i < m_nFreqs; i++) {
|
||||
hnu_kt = Planck * m_freq[i] / kt;
|
||||
x = exp(-hnu_kt);
|
||||
sum += log(1.0 - x);
|
||||
doublereal _free_energy_RT(double T) const {
|
||||
doublereal x, hnu_kt, sum = 0.0;
|
||||
doublereal kt = T*Boltzmann;
|
||||
int i;
|
||||
for (i = 0; i < m_nFreqs; i++) {
|
||||
hnu_kt = Planck * m_freq[i] / kt;
|
||||
x = exp(-hnu_kt);
|
||||
sum += log(1.0 - x);
|
||||
}
|
||||
return sum + m_be/(GasConstant*T);
|
||||
}
|
||||
return sum + m_be/(GasConstant*T);
|
||||
}
|
||||
|
||||
doublereal _entropy_R(double T) const {
|
||||
return _energy_RT(T) - _free_energy_RT(T);
|
||||
}
|
||||
doublereal _entropy_R(double T) const {
|
||||
return _energy_RT(T) - _free_energy_RT(T);
|
||||
}
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
/**
|
||||
* @file Phase.h
|
||||
* Header file for class, Phase, which contains functions for setting the
|
||||
* state of a phase, and for referencing species by name, and also contains text for the module phases
|
||||
* (see \ref phases and class \link Cantera::Phase Phase\endlink).
|
||||
*
|
||||
* Header file for class, Phase, which contains functions for
|
||||
* setting the state of a phase, and for referencing species by
|
||||
* name, and also contains text for the module phases (see \ref
|
||||
* phases and class \link Cantera::Phase Phase\endlink).
|
||||
*/
|
||||
|
||||
/*
|
||||
* $Author$
|
||||
* $Revision$
|
||||
@@ -25,7 +28,7 @@ namespace Cantera {
|
||||
|
||||
|
||||
/**
|
||||
* @defgroup phases Phases of Matter
|
||||
* @defgroup phases Models of Phases of Matter
|
||||
*
|
||||
* These classes are used to represent the composition and state of a
|
||||
* single phase of matter.
|
||||
@@ -44,8 +47,9 @@ namespace Cantera {
|
||||
* the phases may then be described using stoichiometry base on the
|
||||
* same Elements class object.
|
||||
*
|
||||
* The member functions of class %Elements return information about the elements described
|
||||
* in a particular instantiation of the class.
|
||||
* The member functions of class %Elements return information about
|
||||
* the elements described in a particular instantiation of the
|
||||
* class.
|
||||
*
|
||||
* Class %Constituents is designed to provide information
|
||||
* about the elements and species in a phase - names, index
|
||||
@@ -64,9 +68,9 @@ namespace Cantera {
|
||||
* %Constituents also contains utilities retrieving the index of
|
||||
* a species in the phase given its name, Constituents::speciesIndex().
|
||||
*
|
||||
* Class State manages the independent variables of temperature, mass density,
|
||||
* and species mass/mole fraction that define the thermodynamic
|
||||
* state.
|
||||
* Class State manages the independent variables of temperature,
|
||||
* mass density, and species mass/mole fraction that define the
|
||||
* thermodynamic state.
|
||||
*
|
||||
* Class %State stores just enough information about a
|
||||
* multicomponent solution to specify its intensive thermodynamic
|
||||
@@ -79,18 +83,20 @@ namespace Cantera {
|
||||
* Class %State is not usually used directly in application
|
||||
* programs. Its primary use is as a base class for class
|
||||
* Phase. Class %State has no virtual methods, and none of its
|
||||
* methods are meant to be overloaded. However, this is one exception.
|
||||
* If the phase is incompressible, then the density must be replaced
|
||||
* by the pressure as the independent variable. In this case, functions
|
||||
* such as State::setMassFractions() within the class %State must actually now
|
||||
* calculate the density (at constant <I>T</I> and <I>P</I>) instead of leaving
|
||||
* it alone as befits an independent variable. Therefore, these types
|
||||
* of functions are virtual functions and need to be overloaded
|
||||
* for incompressible phases. Note, for nearly incompressible phases
|
||||
* (or phases which utilize standard states based on a <I>T</I> and <I>P</I>) this
|
||||
* change in independent variables may be advantageous as well,
|
||||
* and these functions in %State need to overload as well so that the
|
||||
* storred density within State doesn't become out of date.
|
||||
* methods are meant to be overloaded. However, this is one
|
||||
* exception. If the phase is incompressible, then the density
|
||||
* must be replaced by the pressure as the independent variable. In
|
||||
* this case, functions such as State::setMassFractions() within
|
||||
* the class %State must actually now calculate the density (at
|
||||
* constant <I>T</I> and <I>P</I>) instead of leaving it alone as
|
||||
* befits an independent variable. Therefore, these types of
|
||||
* functions are virtual functions and need to be overloaded for
|
||||
* incompressible phases. Note, for nearly incompressible phases
|
||||
* (or phases which utilize standard states based on a <I>T</I> and
|
||||
* <I>P</I>) this change in independent variables may be
|
||||
* advantageous as well, and these functions in %State need to
|
||||
* overload as well so that the storred density within State
|
||||
* doesn't become out of date.
|
||||
*
|
||||
* Class Phase derives from both clases
|
||||
* Constituents and State. In addition to the methods of those two
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
/**
|
||||
* @file PureFluidPhase.h
|
||||
* Header for a ThermoPhase object for a pure fluid phase consisting of
|
||||
* gas, liquid, mixed-gas-liquid
|
||||
* and supercrit fluid (see \ref thermoprops
|
||||
* and class \link Cantera::PureFluidPhase PureFluidPhase\endlink).
|
||||
*
|
||||
*
|
||||
* This object is only available if the WITH_PURE_FLUIDS optional compile
|
||||
* Header for a ThermoPhase class for a pure fluid phase consisting of
|
||||
* gas, liquid, mixed-gas-liquid and supercrit fluid (see \ref thermoprops
|
||||
* and class \link Cantera::PureFluidPhase PureFluidPhase\endlink).
|
||||
*
|
||||
* This class is only available if the WITH_PURE_FLUIDS optional compile
|
||||
* capability has been turned on in Cantera's makefile system.
|
||||
* It inherits from ThermoPhase, but is built on top of the tpx package.
|
||||
*/
|
||||
@@ -40,11 +39,12 @@ namespace tpx {
|
||||
|
||||
namespace Cantera {
|
||||
|
||||
//! This phase object consists of a single component that can be a gas, a liquid,
|
||||
//! a mixed gas-liquid fluid, or a fluid beyond its critical point
|
||||
//! This phase object consists of a single component that can be a
|
||||
//! gas, a liquid, a mixed gas-liquid fluid, or a fluid beyond its
|
||||
//! critical point
|
||||
/*!
|
||||
* The object inherits from ThermoPhase. However, its build on top of the
|
||||
* tpx package.
|
||||
* The object inherits from ThermoPhase. However, its build on top
|
||||
* of the tpx package.
|
||||
*
|
||||
*
|
||||
* <H2> Specification of Species Standard State Properties </H2>
|
||||
|
||||
@@ -123,7 +123,7 @@ namespace Cantera {
|
||||
* at a set number of temperatures. Between each temperature
|
||||
* the heat capacity is treated as a constant.
|
||||
* .
|
||||
* .
|
||||
* @ingroup phases .
|
||||
*/
|
||||
//@{
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
/**
|
||||
* @file ThermoPhase.h
|
||||
*
|
||||
* Header file for class ThermoPhase, the base class for phases with
|
||||
* thermodynamic properties, and the text for the Module thermoprops
|
||||
* (see \ref thermoprops and class \link Cantera::ThermoPhase ThermoPhase\endlink).
|
||||
* (see \ref thermoprops and class \link Cantera::ThermoPhase
|
||||
* ThermoPhase\endlink).
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -174,6 +176,7 @@ namespace Cantera {
|
||||
* read ThermoPhases from XML files.
|
||||
* @see newPhase(XML_Node &phase) How to call the Factory routine to create
|
||||
* and initialize %ThermoPhase objects.
|
||||
* @ingroup phases
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -12,6 +12,14 @@
|
||||
// Copyright 2001-2003 California Institute of Technology
|
||||
|
||||
|
||||
/**
|
||||
* @defgroup tranprops Transport Properties
|
||||
*
|
||||
* @ingroup phases
|
||||
*
|
||||
* These classes provide transport properties.
|
||||
*/
|
||||
|
||||
#ifndef CT_TRANSPORTBASE_H
|
||||
#define CT_TRANSPORTBASE_H
|
||||
|
||||
|
||||
Reference in New Issue
Block a user