Cantera  2.1.2
SemiconductorPhase.h
Go to the documentation of this file.
1 /**
2  * @file SemiconductorPhase.h
3  */
4 
5 // Copyright 2003 California Institute of Technology
6 
7 #ifndef CT_SEMICONDPHASE_H
8 #define CT_SEMICONDPHASE_H
9 
10 #include "mix_defs.h"
11 #include "ThermoPhase.h"
12 
13 namespace Cantera
14 {
15 
16 const int cElectron = 0;
17 const int cHole = 1;
18 
19 /**
20  * @ingroup thermoprops
21  *
22  * Class SemiconductorPhase represents electrons and holes
23  * in a semiconductor.
24  *
25  */
27 {
28 
29 public:
30 
32  SemiconductorPhase(std::string infile, std::string id="");
33 
35  *this = operator=(right);
36  }
37 
38  SemiconductorPhase& operator=(const SemiconductorPhase& right) {
39  if (&right != this) {
41  m_press = right.m_press;
42  }
43  return *this;
44  }
45 
46  //! Duplicator
48  SemiconductorPhase* idg = new SemiconductorPhase(*this);
49  return (ThermoPhase*) idg;
50  }
51 
52  // Overloaded methods of class ThermoPhase
53 
54  virtual int eosType() const {
55  return cSemiconductor;
56  }
57 
58 
59  virtual void setPressure(doublereal pres) {
60  m_press = pres;
61  }
62  virtual doublereal pressure() const {
63  return m_press;
64  }
65 
66 
67  virtual void setParametersFromXML(const XML_Node& eosdata) {
68  eosdata._require("model","Semiconductor");
69  doublereal rho = ctml::getFloat(eosdata, "density", "-");
70  setDensity(rho);
71  m_bandgap = ctml::getFloat(eosdata, "bandgap", "-");
72  doublereal e_mass = ctml::getFloat(eosdata, "electron_mass", "-");
73  doublereal h_mass = ctml::getFloat(eosdata, "hole_mass", "-");
74  doublereal e_donor = ctml::getFloat(eosdata, "donor_energy", "-");
75  doublereal n_donor = ctml::getFloat(eosdata, "donor_concentration", "-");
76  doublereal e_acceptor = ctml::getFloat(eosdata, "acceptor_energy", "-");
77  doublereal n_acceptor = ctml::getFloat(eosdata, "acceptor_concentration", "-");
78  setEffectiveMasses(e_mass, h_mass);
79  setDonorDoping(n_donor, e_donor);
80  setAcceptorDoping(n_acceptor, e_acceptor);
81  }
82 
83  void setEffectiveMasses(doublereal e_mass, doublereal h_mass) {
84  m_emass = e_mass;
85  m_hmass = h_mass;
86  }
87 
88  void setDonorDoping(doublereal n_donor, doublereal e_donor) {
89  m_ndonor = n_donor;
90  m_edonor = e_donor;
91  }
92 
93  void setAcceptorDoping(doublereal n_acceptor, doublereal e_acceptor) {
94  m_nacceptor = n_acceptor;
95  m_eacceptor = e_acceptor;
96  }
97 
98  doublereal effectiveMass_e() const {
99  return m_emass;
100  }
101 
102  doublereal effectiveMass_h() const {
103  return m_hmass;
104  }
105 
106  doublereal fermiLevel() const {
107  return m_fermi_level;
108  }
109 
110  virtual void getChemPotentials(doublereal* mu) const;
111  doublereal nc() const;
112  doublereal nv() const;
113  doublereal ec() const;
114  doublereal ev() const;
115  doublereal bandgap() const {
116  return m_bandgap;
117  }
118 
119 protected:
120 
121 private:
122  doublereal m_press;
123  doublereal m_emass;
124  doublereal m_hmass;
125  doublereal m_ndonor;
126  doublereal m_edonor;
127  doublereal m_nacceptor;
128  doublereal m_eacceptor;
129  doublereal m_fermi_level;
130  doublereal m_bandgap;
131  mutable vector_fp m_work;
132 
133  void initLengths();
134 };
135 }
136 
137 #endif
138 
139 
140 
141 
142 
void _require(const std::string &a, const std::string &v) const
Require that the current xml node have an attribute named by the first argument, a, and that this attribute have the the string value listed in the second argument, v.
Definition: xml.cpp:614
Class SemiconductorPhase represents electrons and holes in a semiconductor.
ThermoPhase & operator=(const ThermoPhase &right)
Assignment operator.
Definition: ThermoPhase.cpp:57
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:100
doublereal getFloat(const Cantera::XML_Node &parent, const std::string &name, const std::string &type)
Get a floating-point value from a child element.
Definition: ctml.cpp:267
virtual ThermoPhase * duplMyselfAsThermoPhase() const
Duplicator.
virtual void setPressure(doublereal pres)
Set the internally stored pressure (Pa) at constant temperature and composition.
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:101
doublereal ec() const
Energy at the top of the conduction band.
virtual doublereal pressure() const
Return the thermodynamic pressure (Pa).
virtual void setParametersFromXML(const XML_Node &eosdata)
Set equation of state parameter values from XML entries.
virtual int eosType() const
Equation of state type flag.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Definition: ct_defs.h:165
Header file for class ThermoPhase, the base class for phases with thermodynamic properties, and the text for the Module thermoprops (see Thermodynamic Properties and class ThermoPhase).
virtual void setDensity(const doublereal density_)
Set the internally stored density (kg/m^3) of the phase Note the density of a phase is an independent...
Definition: Phase.h:549