Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SemiconductorPhase.cpp
Go to the documentation of this file.
1 //! @file SemiconductorPhase.cpp
3 
4 using namespace std;
5 
6 namespace Cantera
7 {
8 static doublereal JoyceDixon(doublereal r)
9 {
10  return log(r) + 1.0/sqrt(8.0)*r - (3.0/16.0 - sqrt(3.0)/9.0)*r*r;
11 }
12 
13 
14 SemiconductorPhase::SemiconductorPhase(std::string infile,
15  std::string id_) {}
16 
17 void SemiconductorPhase::getChemPotentials(doublereal* mu) const
18 {
19  getActivityConcentrations(DATA_PTR(m_work));
20  mu[0] = ec() + GasConstant*temperature()*(JoyceDixon(m_work[0]/nc()));
21  mu[1] = ev() + GasConstant*temperature()*(log(m_work[1]/nv()));
22 }
23 
24 // units: kmol/m^3
25 doublereal SemiconductorPhase::nc() const
26 {
27  doublereal fctr = effectiveMass_e() * Boltzmann * temperature()/
28  (2.0*Pi*Planck_bar*Planck_bar);
29  return 2.0*pow(fctr, 1.5)/Avogadro;
30 }
31 
32 doublereal SemiconductorPhase::nv() const
33 {
34  doublereal fctr = effectiveMass_h() * Boltzmann * temperature()/
35  (2.0*Pi*Planck_bar*Planck_bar);
36  return 2.0*pow(fctr, 1.5)/Avogadro;
37 }
38 
39 doublereal SemiconductorPhase::ev() const
40 {
41  return 0.0;
42 }
43 
44 /**
45  * Energy at the top of the conduction band. By default, energies
46  * are referenced to this energy, and so this function simply
47  * returns zero.
48  */
49 doublereal SemiconductorPhase::ec() const
50 {
51  return ev() + bandgap();
52 }
53 
54 
55 // private
56 void SemiconductorPhase::initLengths()
57 {
58  m_work.resize(nSpecies());
59 }
60 }
const doublereal Pi
Pi.
Definition: ct_defs.h:51
const doublereal Avogadro
Avogadro's Number [number/kmol].
Definition: ct_defs.h:61
#define DATA_PTR(vec)
Creates a pointer to the start of the raw data for a vector.
Definition: ct_defs.h:36
const doublereal Boltzmann
Boltzmann's constant [J/K].
Definition: ct_defs.h:76