Xyce  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
N_DEV_RateConstantCalculators.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-2014 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_RateConstantCalculators.h,v $
27 //
28 // Purpose : strategy pattern for reactions with different temperature
29 // dependent rate constant styles
30 //
31 // Special Notes :
32 //
33 // Creator : Tom Russo, SNL, Electrical and Microsystems Modeling
34 //
35 // Creation Date : 07/27/2006
36 //
37 // Revision Information:
38 // ---------------------
39 //
40 // Revision Number: $Revision: 1.8.2.3 $
41 //
42 // Revision Date : $Date: 2014/03/01 18:39:05 $
43 //
44 // Current Owner : $Author: tvrusso $
45 //-----------------------------------------------------------------------------
46 
47 #ifndef N_DEV_RateConstantCalculators_H
48 #define N_DEV_RateConstantCalculators_H
49 
50 #include <N_UTL_Misc.h>
51 
52 #include <string>
53 #include <vector>
54 
55 namespace Xyce {
56 namespace Device {
57 
58 // forward declaration:
59 class Specie;
60 
62  {
69  };
70 
71 /// \brief Abstract interface class for "rate calculator" strategy pattern
72 ///
73 /// Each reaction in a reaction network has a rate constant calculator
74 /// associated with it. The interface is defined by the RateCalculator
75 /// class.
77 {
78 public:
79  virtual double computeRateConstant(double T) = 0; ///< return rate constant at given temperature
80  virtual double rateConstantScaleFactor() = 0; ///< return current scale factor for rate constant
81  virtual void setScaleFactors(double C0, double t0, double x0)=0; ///< set concentration, time, and space scale factors (space scale factor is currently unused by any calculator)
82  virtual CalcType calcType() = 0; ///< return the type of this calculator
83  virtual RateCalculator *Clone()=0; ///< create a copy of this calculator
84  virtual ~RateCalculator() {}
85 
86 };
87 
88 /// \brief Class for trivial, constant rate constant (independent of temperature)
89 ///
90 /// This is the most basic rate calculator that returns a constant value
91 /// provided in the reaction network input file.
92 ///
94 {
95 public:
96  SimpleRateCalculator(double k, double C0, double t0, double x0);
98 
99  virtual SimpleRateCalculator *Clone();
100  virtual double computeRateConstant(double T);
101  virtual double rateConstantScaleFactor();
102  inline virtual void setScaleFactors(double C0, double t0, double x0)
103  {rk0=C0*t0;};
104 
105  inline virtual CalcType calcType() {return SIMPLECALC;};
106 private:
107  double K;
108  double rk0;
109 };
110 
111 /// \brief Rate constant calculator for Electron or Hole capture reaction
112 ///
113 /// These reactions are of the form R + E -> P; electron_capture(\f$\sigma\f$)
114 /// or R+H->P; hole_capture(\f$\sigma\f$).
115 /// The reaction rate is then \f$\sigma \times v\f$, where v is 2.3e7 for
116 /// electron capture and 1.9e7 for holes.
117 ///
118 
120 {
121 public:
122  CaptureRateCalculator(double sigma, double v, double C0, double t0,
123  double x0);
125  virtual CaptureRateCalculator *Clone();
126 
127  virtual double computeRateConstant(double T);
128  virtual double rateConstantScaleFactor();
129  inline virtual void setScaleFactors(double C0, double t0, double x0)
130  {rk0=C0*t0;};
131  inline virtual CalcType calcType() {return CAPTURECALC;};
132 private:
133  double K;
134  double rk0;
135 };
136 
137 /// \brief Rate constant calculator for Electron or Hole emission reaction
138 ///
139 /// These reactions are of the form R -> P+E; electron_emission(\f$\sigma\f$,Energy)
140 /// or R->P+H; hole_emission(\f$\sigma\f$,Energy).
141 /// The reaction rate is then \f$K_f*exp(E/K_bT)\f$, with \f$K_f=\sigma*v*N\f$.
142 /// N is 2.86e19 for electron emission and 2.66e19 for hole emission.
143 /// v is 2.3e7 for electron emission and 1.9e7 for hole emission.
144 ///
146 {
147 public:
148  EmissionRateCalculator(double sigma, double v, double N, double Energy,
149  double C0, double t0, double x0);
151  virtual EmissionRateCalculator *Clone();
152 
153  virtual double computeRateConstant(double T);
154  virtual double rateConstantScaleFactor();
155  inline virtual void setScaleFactors(double C0, double t0, double x0)
156  {T0=t0;};
157  inline virtual CalcType calcType() {return EMISSIONCALC;};
158 private:
159  double K_f;
160  double E;
161  double T0;
162 };
163 
164 /// \brief Rate constant calculator for a irreversible two-species complexing reaction
165 ///
166 /// These are reactions of the form A+B->AB.
167 /// There must be two separate species on the reactants side, or one specie
168 /// with a stoichiometric coefficient of exactly 2.0.
169 ///
170 /// The rate constant formula depends on the product of the charge states of
171 /// the two species, which we will call \f$ij\f$.
172 /// - If \f$ij > 0\f$: the reaction rate is zero
173 /// - If \f$ij == 0\f$: The reaction rate is \f$\frac{4\pi\times 5\times10^{-8}}{D_1D_2}\f$ where \f$D_n\f$ is the diffusion coefficient of species \f$n\f$.
174 /// - If \f$ij < 0\f$: The reaction rate is \f$\frac{4\pi\times 5\times10^{-8}}{TD_1D_2}\f$ where \f$D_n\f$ is the diffusion coefficient of species \f$n\f$.
175 ///
176 /// Note that the diffusion coefficients of species are temperature dependent.
177 ///
179 {
180 public:
181  ComplexRateCalculator(std::vector<Specie> &VariableSpecies,
182  std::vector<Specie> &ConstantSpecies,
183  std::vector< std::pair<int,double> > &Reactants,
184  double C0, double t0, double x0);
186  virtual ComplexRateCalculator *Clone();
187 
188  virtual double computeRateConstant(double T);
189  virtual double rateConstantScaleFactor();
190  inline virtual void setScaleFactors(double C0, double t0, double x0)
191  {rk0=C0*t0;};
192  inline virtual CalcType calcType() {return COMPLEXCALC;};
193 private:
196  bool Tdep;
197  double rk0;
198 };
199 
200 // for a irreversible two-species decomplexing reaction
201 // AB->A+B
203 {
204 public:
205  DecomplexRateCalculator(std::vector<Specie> &VariableSpecies,
206  std::vector<Specie> &ConstantSpecies,
207  std::vector< std::pair<int,double> > &Reactants,
208  std::vector< std::pair<int,double> > &Products,
209  double bindingEnergy,
210  double degenAB,
211  double degenA,
212  double degenB,
213  double siliconConcentration,
214  double C0, double t0, double x0);
216  virtual DecomplexRateCalculator *Clone();
217 
218  virtual double computeRateConstant(double T);
219  virtual double rateConstantScaleFactor();
220  inline virtual void setScaleFactors(double C0, double t0, double x0)
221  {
222  // The rate constant includes the concentration of silicon, which
223  // means it scales differently. See comments in
224  // N_DEV_RxnRegion::scaleRateConstants for details
225  rk0=t0;
226  c0=C0;
227  };
228  inline virtual CalcType calcType() {return DECOMPLEXCALC;};
229 
230 private:
233  bool Tdep;
234  double deltaE;
236  double concSi;
237  double rk0;
238  double c0;
239 };
240 
241 } // namespace Device
242 } // namespace Xyce
243 
244 #endif