Cantera  2.3.0
SemiconductorPhase.h
Go to the documentation of this file.
1 /**
2  * @file SemiconductorPhase.h
3  */
4 
5 // This file is part of Cantera. See License.txt in the top-level directory or
6 // at http://www.cantera.org/license.txt for license and copyright information.
7 
8 #ifndef CT_SEMICONDPHASE_H
9 #define CT_SEMICONDPHASE_H
10 
11 #include "mix_defs.h"
12 #include "ThermoPhase.h"
13 #include "cantera/base/ctml.h"
14 
15 namespace Cantera
16 {
17 
18 const int cElectron = 0;
19 const int cHole = 1;
20 
21 /**
22  * @ingroup thermoprops
23  *
24  * Class SemiconductorPhase represents electrons and holes in a semiconductor.
25  * @deprecated Broken and unused. To be removed after Cantera 2.3.
26  *
27  */
29 {
30 public:
32  warn_deprecated("class SemiconductorPhase",
33  "To be removed after Cantera 2.3.");
34  }
35  SemiconductorPhase(std::string infile, std::string id="");
36 
38  *this = right;
39  }
40 
41  SemiconductorPhase& operator=(const SemiconductorPhase& right) {
42  if (&right != this) {
44  m_press = right.m_press;
45  }
46  return *this;
47  }
48 
50  SemiconductorPhase* idg = new SemiconductorPhase(*this);
51  return (ThermoPhase*) idg;
52  }
53 
54  // Overloaded methods of class ThermoPhase
55 
56  virtual int eosType() const {
57  warn_deprecated("SemiconductorPhase::eosType",
58  "To be removed after Cantera 2.3.");
59  return cSemiconductor;
60  }
61  virtual std::string type() const {
62  return "Semiconductor";
63  }
64 
65  virtual void setPressure(doublereal pres) {
66  m_press = pres;
67  }
68  virtual doublereal pressure() const {
69  return m_press;
70  }
71 
72  virtual void setParametersFromXML(const XML_Node& eosdata) {
73  eosdata._require("model","Semiconductor");
74  doublereal rho = getFloat(eosdata, "density", "-");
75  setDensity(rho);
76  m_bandgap = getFloat(eosdata, "bandgap", "-");
77  doublereal e_mass = getFloat(eosdata, "electron_mass", "-");
78  doublereal h_mass = getFloat(eosdata, "hole_mass", "-");
79  doublereal e_donor = getFloat(eosdata, "donor_energy", "-");
80  doublereal n_donor = getFloat(eosdata, "donor_concentration", "-");
81  doublereal e_acceptor = getFloat(eosdata, "acceptor_energy", "-");
82  doublereal n_acceptor = getFloat(eosdata, "acceptor_concentration", "-");
83  setEffectiveMasses(e_mass, h_mass);
84  setDonorDoping(n_donor, e_donor);
85  setAcceptorDoping(n_acceptor, e_acceptor);
86  }
87 
88  void setEffectiveMasses(doublereal e_mass, doublereal h_mass) {
89  m_emass = e_mass;
90  m_hmass = h_mass;
91  }
92 
93  void setDonorDoping(doublereal n_donor, doublereal e_donor) {
94  m_ndonor = n_donor;
95  m_edonor = e_donor;
96  }
97 
98  void setAcceptorDoping(doublereal n_acceptor, doublereal e_acceptor) {
99  m_nacceptor = n_acceptor;
100  m_eacceptor = e_acceptor;
101  }
102 
103  doublereal effectiveMass_e() const {
104  return m_emass;
105  }
106 
107  doublereal effectiveMass_h() const {
108  return m_hmass;
109  }
110 
111  doublereal fermiLevel() const {
112  return m_fermi_level;
113  }
114 
115  virtual void getChemPotentials(doublereal* mu) const;
116  doublereal nc() const;
117  doublereal nv() const;
118 
119  /*!
120  * Energy at the top of the conduction band. By default, energies are
121  * referenced to this energy, and so this function simply returns zero.
122  */
123  doublereal ec() const;
124  doublereal ev() const;
125  doublereal bandgap() const {
126  return m_bandgap;
127  }
128 
129 private:
130  doublereal m_press;
131  doublereal m_emass;
132  doublereal m_hmass;
133  doublereal m_ndonor;
134  doublereal m_edonor;
135  doublereal m_nacceptor;
136  doublereal m_eacceptor;
137  doublereal m_fermi_level;
138  doublereal m_bandgap;
139  mutable vector_fp m_work;
140 
141  void initLengths();
142 };
143 }
144 
145 #endif
Class SemiconductorPhase represents electrons and holes in a semiconductor.
virtual int eosType() const
Equation of state type flag.
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data...
ThermoPhase & operator=(const ThermoPhase &right)
Definition: ThermoPhase.cpp:59
virtual std::string type() const
String indicating the thermodynamic model implemented.
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:97
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Definition: global.cpp:54
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:93
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:576
virtual void setParametersFromXML(const XML_Node &eosdata)
Set equation of state parameter values from XML entries.
virtual doublereal pressure() const
Return the thermodynamic pressure (Pa).
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:178
virtual ThermoPhase * duplMyselfAsThermoPhase() const
Duplication routine for objects which inherit from ThermoPhase.
Namespace for the Cantera kernel.
Definition: application.cpp:29
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.
Definition: Phase.h:622