Cantera  2.3.0
SemiconductorPhase.cpp
Go to the documentation of this file.
1 //! @file SemiconductorPhase.cpp
2 
3 // This file is part of Cantera. See License.txt in the top-level directory or
4 // at http://www.cantera.org/license.txt for license and copyright information.
5 
7 
8 using namespace std;
9 
10 namespace Cantera
11 {
12 static doublereal JoyceDixon(doublereal r)
13 {
14  return log(r) + 1.0/sqrt(8.0)*r - (3.0/16.0 - sqrt(3.0)/9.0)*r*r;
15 }
16 
17 SemiconductorPhase::SemiconductorPhase(std::string infile,
18  std::string id_) {
19  warn_deprecated("class SemiconductorPhase",
20  "To be removed after Cantera 2.3.");
21 }
22 
23 void SemiconductorPhase::getChemPotentials(doublereal* mu) const
24 {
25  getActivityConcentrations(m_work.data());
26  mu[0] = ec() + RT()*(JoyceDixon(m_work[0]/nc()));
27  mu[1] = ev() + RT()*(log(m_work[1]/nv()));
28 }
29 
30 // units: kmol/m^3
31 doublereal SemiconductorPhase::nc() const
32 {
33  doublereal fctr = effectiveMass_e() * Boltzmann * temperature()/
34  (2.0*Pi*Planck_bar*Planck_bar);
35  return 2.0*pow(fctr, 1.5)/Avogadro;
36 }
37 
38 doublereal SemiconductorPhase::nv() const
39 {
40  doublereal fctr = effectiveMass_h() * Boltzmann * temperature()/
41  (2.0*Pi*Planck_bar*Planck_bar);
42  return 2.0*pow(fctr, 1.5)/Avogadro;
43 }
44 
45 doublereal SemiconductorPhase::ev() const
46 {
47  return 0.0;
48 }
49 
50 doublereal SemiconductorPhase::ec() const
51 {
52  return ev() + bandgap();
53 }
54 
55 // private
56 void SemiconductorPhase::initLengths()
57 {
58  m_work.resize(nSpecies());
59 }
60 }
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Definition: global.cpp:54
STL namespace.
const doublereal Pi
Pi.
Definition: ct_defs.h:51
const doublereal Avogadro
Avogadro's Number [number/kmol].
Definition: ct_defs.h:61
Namespace for the Cantera kernel.
Definition: application.cpp:29
const doublereal Boltzmann
Boltzmann's constant [J/K].
Definition: ct_defs.h:76