Cantera  2.1.2
SemiconductorPhase.cpp
Go to the documentation of this file.
1 //! @file SemiconductorPhase.cpp
3 
4 using namespace std;
5 
6 namespace Cantera
7 {
8 
9 const doublereal JD_const1 = 1.0/sqrt(8.0);
10 const doublereal JD_const2 = 3.0/16.0 - sqrt(3.0)/9.0;
11 
12 static doublereal JoyceDixon(doublereal r)
13 {
14  return log(r) + JD_const1*r - JD_const2*r*r;
15 }
16 
17 
18 SemiconductorPhase::SemiconductorPhase(std::string infile,
19  std::string id_) {}
20 
21 
22 // doublereal SemiconductorPhase::ionizedDonorConcentration() {
23 // return 1.0/(1.0 + 2.0*exp( fermiLevel() - m_edonor));
24 //}
25 
26 //doublereal SemiconductorPhase::ionizedAcceptorConcentration() {
27 // return 1.0/(1.0 + 2.0*exp( m_eacceptor - fermiLevel()));
28 //}
29 
30 //doublereal SemiconductorPhase::_dn(doublereal efermi) {
31 // m_fermi_level = efermi;
32 // return electronConcentration() - holeConcentration() +
33 // ionizedAcceptorConcentration() - ionizedDonorConcentration();
34 //}
35 void SemiconductorPhase::getChemPotentials(doublereal* mu) const
36 {
37  getActivityConcentrations(DATA_PTR(m_work));
38  doublereal r = m_work[0]/nc();
39  mu[0] = ec() + GasConstant*temperature()*(JoyceDixon(r));
40  mu[1] = ev() + GasConstant*temperature()*(log(m_work[1]/nv()));
41 }
42 
43 // units: kmol/m^3
44 doublereal SemiconductorPhase::nc() const
45 {
46  doublereal fctr = effectiveMass_e() * Boltzmann * temperature()/
47  (2.0*Pi*Planck_bar*Planck_bar);
48  return 2.0*pow(fctr, 1.5)/Avogadro;
49 }
50 
51 doublereal SemiconductorPhase::nv() const
52 {
53  doublereal fctr = effectiveMass_h() * Boltzmann * temperature()/
54  (2.0*Pi*Planck_bar*Planck_bar);
55  return 2.0*pow(fctr, 1.5)/Avogadro;
56 }
57 
58 doublereal SemiconductorPhase::ev() const
59 {
60  return 0.0;
61 }
62 
63 /**
64  * Energy at the top of the conduction band. By default, energies
65  * are referenced to this energy, and so this function simply
66  * returns zero.
67  */
68 doublereal SemiconductorPhase::ec() const
69 {
70  return ev() + bandgap();
71 }
72 
73 
74 // private
75 void SemiconductorPhase::initLengths()
76 {
77  m_work.resize(nSpecies());
78 }
79 }
const doublereal Pi
Pi.
Definition: ct_defs.h:51
const doublereal Avogadro
Avogadro's Number [number/kmol].
Definition: ct_defs.h:63
#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:78