Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 #include "cantera/base/ctml.h"
13 
14 namespace Cantera
15 {
16 
17 const int cElectron = 0;
18 const int cHole = 1;
19 
20 /**
21  * @ingroup thermoprops
22  *
23  * Class SemiconductorPhase represents electrons and holes
24  * in a semiconductor.
25  *
26  */
28 {
29 
30 public:
31 
33  SemiconductorPhase(std::string infile, std::string id="");
34 
36  *this = right;
37  }
38 
39  SemiconductorPhase& operator=(const SemiconductorPhase& right) {
40  if (&right != this) {
42  m_press = right.m_press;
43  }
44  return *this;
45  }
46 
47  //! Duplicator
49  SemiconductorPhase* idg = new SemiconductorPhase(*this);
50  return (ThermoPhase*) idg;
51  }
52 
53  // Overloaded methods of class ThermoPhase
54 
55  virtual int eosType() const {
56  return cSemiconductor;
57  }
58 
59 
60  virtual void setPressure(doublereal pres) {
61  m_press = pres;
62  }
63  virtual doublereal pressure() const {
64  return m_press;
65  }
66 
67 
68  virtual void setParametersFromXML(const XML_Node& eosdata) {
69  eosdata._require("model","Semiconductor");
70  doublereal rho = getFloat(eosdata, "density", "-");
71  setDensity(rho);
72  m_bandgap = getFloat(eosdata, "bandgap", "-");
73  doublereal e_mass = getFloat(eosdata, "electron_mass", "-");
74  doublereal h_mass = getFloat(eosdata, "hole_mass", "-");
75  doublereal e_donor = getFloat(eosdata, "donor_energy", "-");
76  doublereal n_donor = getFloat(eosdata, "donor_concentration", "-");
77  doublereal e_acceptor = getFloat(eosdata, "acceptor_energy", "-");
78  doublereal n_acceptor = getFloat(eosdata, "acceptor_concentration", "-");
79  setEffectiveMasses(e_mass, h_mass);
80  setDonorDoping(n_donor, e_donor);
81  setAcceptorDoping(n_acceptor, e_acceptor);
82  }
83 
84  void setEffectiveMasses(doublereal e_mass, doublereal h_mass) {
85  m_emass = e_mass;
86  m_hmass = h_mass;
87  }
88 
89  void setDonorDoping(doublereal n_donor, doublereal e_donor) {
90  m_ndonor = n_donor;
91  m_edonor = e_donor;
92  }
93 
94  void setAcceptorDoping(doublereal n_acceptor, doublereal e_acceptor) {
95  m_nacceptor = n_acceptor;
96  m_eacceptor = e_acceptor;
97  }
98 
99  doublereal effectiveMass_e() const {
100  return m_emass;
101  }
102 
103  doublereal effectiveMass_h() const {
104  return m_hmass;
105  }
106 
107  doublereal fermiLevel() const {
108  return m_fermi_level;
109  }
110 
111  virtual void getChemPotentials(doublereal* mu) const;
112  doublereal nc() const;
113  doublereal nv() const;
114  doublereal ec() const;
115  doublereal ev() const;
116  doublereal bandgap() const {
117  return m_bandgap;
118  }
119 
120 protected:
121 
122 private:
123  doublereal m_press;
124  doublereal m_emass;
125  doublereal m_hmass;
126  doublereal m_ndonor;
127  doublereal m_edonor;
128  doublereal m_nacceptor;
129  doublereal m_eacceptor;
130  doublereal m_fermi_level;
131  doublereal m_bandgap;
132  mutable vector_fp m_work;
133 
134  void initLengths();
135 };
136 }
137 
138 #endif
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:603
Class SemiconductorPhase represents electrons and holes in a semiconductor.
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data...
ThermoPhase & operator=(const ThermoPhase &right)
Assignment operator.
Definition: ThermoPhase.cpp:60
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
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:97
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:157
doublereal getFloat(const XML_Node &parent, const std::string &name, const std::string &type)
Get a floating-point value from a child element.
Definition: ctml.cpp:194
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:623