Xyce  6.1
N_DEV_Specie.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // Copyright Notice
3 //
4 // Copyright 2002 Sandia Corporation. Under the terms
5 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
6 // Government retains certain rights in this software.
7 //
8 // Xyce(TM) Parallel Electrical Simulator
9 // Copyright (C) 2002-2015 Sandia Corporation
10 //
11 // This program is free software: you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation, either version 3 of the License, or
14 // (at your option) any later version.
15 //
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, see <http://www.gnu.org/licenses/>.
23 //-----------------------------------------------------------------------------
24 
25 //-----------------------------------------------------------------------------
26 // Filename : $RCSfile: N_DEV_Specie.h,v $
27 //
28 // Purpose :
29 //
30 // Special Notes :
31 //
32 // Creator : Tom Russo, SNL, Electrical and Microsystems Modeling
33 //
34 // Creation Date : 07/27/2006
35 //
36 // Revision Information:
37 // ---------------------
38 //
39 // Revision Number: $Revision: 1.14.2.1 $
40 //
41 // Revision Date : $Date: 2015/04/02 18:20:09 $
42 //
43 // Current Owner : $Author: tvrusso $
44 //-----------------------------------------------------------------------------
45 
46 #ifndef N_DEV_Specie_H
47 #define N_DEV_Specie_H
48 
49 #include <string>
50 #include <vector>
51 #include <cmath>
52 
53 #include <N_DEV_Const.h>
54 #include <vector>
55 #include <iostream>
56 
57 namespace Xyce {
58 namespace Device {
59 
60 class Specie
61 {
62 public:
63  Specie(std::string name, double diff_prefac, double act_energy,
64  int charge_state, int index)
65  : Name(name),
66  DiffusionPrefactor(diff_prefac),
67  ActivationEnergy(act_energy),
68  ChargeState(charge_state),
69  carrierIndex(-1),
70  sigma(0.0),
71  hopLength(0.0),
72  thermalVelocity(0.0),
73  enhancedDiffusion(false),
74  myIndex(index-3),
76  {
77  //Note that myIndex is being assigned with 3 subtracted from the count. This is because the carriers, the
78  //first two species in the list, are treated as "Constant" species and are not in the concentrations arrays
79  //that hold defect concentrations that have to be used in the reactions. Also, the count starts at 1 so an
80  //there's an extra -- to get to the zero index
81  } ;
82 
83  inline const std::string & getName() const {return (Name); };
84  inline void setName(std::string &name) {Name = name;};
85  inline int getChargeState() {return (ChargeState);};
86  inline void setChargeState(int chargestate) {ChargeState=chargestate;};
87  inline double getDiffPrefactor() {return(DiffusionPrefactor);} ;
88  inline void setDiffPrefactor(double p) {DiffusionPrefactor=p;};
89  inline double getActEnergy() {return(ActivationEnergy);};
90  inline void setActEnergy(double Energy) {ActivationEnergy=Energy;};
91  inline bool getEnhancedDiffusion() {return enhancedDiffusion;}
92  void setBCEnhancedDiffusion(int cI, double sigma, int BCCC, double hopLength);
93  inline int getBCCarrierIndex(){return carrierIndex;}
94  inline double getBCHopLength(){return hopLength;}
95  inline double getBCSigma(){return sigma;}
96  inline int getMyIndex(){ return myIndex;}
97  inline int getBCCarrierCharge(){ return BCCarrierCharge;}
98  inline void setBCThermalVelocity(double TV){ thermalVelocity = TV;}
99  template <class ScalarT>
100  ScalarT getDiffusionCoefficient(ScalarT Temperature);
101  template <class ScalarT>
102  ScalarT getDiffusionCoefficient(ScalarT Temperature,
103  std::vector<ScalarT> &concs,std::vector<ScalarT> &constant_vec);
104 private:
105  std::string Name;
109  //Some species have diffusion enhanced by carrier capture
111  double sigma;
112  double hopLength;
115  int myIndex;
117 
118 };
119 
120 //-----------------------------------------------------------------------------
121 // Function : Specie::getDiffusionCoefficient
122 // Purpose : Accessor
123 // Special Notes :
124 // Scope : public
125 // Creator : Tom Russo, SNL, Electrical and Microsystems Modeling
126 // Creation Date : 7/27/06
127 //-----------------------------------------------------------------------------
128 template <class ScalarT>
129 inline ScalarT Specie::getDiffusionCoefficient(ScalarT Temperature)
130 {
131 
132  return DiffusionPrefactor*exp(-ActivationEnergy/(CONSTboltz*Temperature/CONSTQ));
133 }
134 
135 
136 //-----------------------------------------------------------------------------
137 // Function : Specie::getDiffusionCoefficient
138 // Purpose : compute the diffusion coefficient included bourgoin corbett enhancement
139 // Special Notes :
140 // Scope : public
141 // Creator : Lawrence C Musson, SNL
142 // Creation Date : 04/16/2014
143 //-----------------------------------------------------------------------------
144  template <class ScalarT>
145  ScalarT Specie::getDiffusionCoefficient(ScalarT Temperature,
146  std::vector<ScalarT> &concs,std::vector<ScalarT> &constant_vec)
147  {
148 
149  ScalarT DF = DiffusionPrefactor*exp(-ActivationEnergy/(CONSTboltz*Temperature/CONSTQ));
150 
152  DF += sigma*thermalVelocity*constant_vec[carrierIndex]*hopLength*hopLength/6.0;
153 
154  return DF;
155 
156  }
157 
158 
159 
160 } // namespace Device
161 } // namespace Xyce
162 
163 #endif
ScalarT getDiffusionCoefficient(ScalarT Temperature)
Definition: N_DEV_Specie.h:129
#define CONSTQ
Definition: N_DEV_Const.h:51
Pure virtual class to augment a linear system.
const std::string & getName() const
Definition: N_DEV_Specie.h:83
void setActEnergy(double Energy)
Definition: N_DEV_Specie.h:90
void setName(std::string &name)
Definition: N_DEV_Specie.h:84
void setDiffPrefactor(double p)
Definition: N_DEV_Specie.h:88
Specie(std::string name, double diff_prefac, double act_energy, int charge_state, int index)
Definition: N_DEV_Specie.h:63
double getDiffPrefactor()
Definition: N_DEV_Specie.h:87
void setBCEnhancedDiffusion(int cI, double sigma, int BCCC, double hopLength)
Definition: N_DEV_Specie.C:68
void setChargeState(int chargestate)
Definition: N_DEV_Specie.h:86
void setBCThermalVelocity(double TV)
Definition: N_DEV_Specie.h:98
#define CONSTboltz
Definition: N_DEV_Const.h:53