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.10 $
41 //
42 // Revision Date : $Date: 2014/05/01 22:27:13 $
43 //
44 // Current Owner : $Author: lcmusso $
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 #include <iostream>
56 
57 namespace Xyce {
58 namespace Device {
59 
60 // forward declaration:
61 class Specie;
62 
64  {
73  };
74 
75 /// \brief Abstract interface class for "rate calculator" strategy pattern
76 ///
77 /// Each reaction in a reaction network has a rate constant calculator
78 /// associated with it. The interface is defined by the RateCalculator
79 /// class.
81 {
82 public:
83  virtual double computeRateConstant(double T) = 0; ///< return rate constant at given temperature
84  virtual double computeRateConstant(double T,std::vector<double> &concs,std::vector<double> &constant_vec) = 0; ///< return rate constant with Bourgoin Corbett enhancement at given temperature
85  virtual double rateConstantScaleFactor() = 0; ///< return current scale factor for rate constant
86  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)
87  virtual CalcType calcType() = 0; ///< return the type of this calculator
88  virtual RateCalculator *Clone()=0; ///< create a copy of this calculator
89  virtual ~RateCalculator() {}
90 
91 };
92 
93 /// \brief Class for trivial, constant rate constant (independent of temperature)
94 ///
95 /// This is the most basic rate calculator that returns a constant value
96 /// provided in the reaction network input file.
97 ///
99 {
100 public:
101  SimpleRateCalculator(double k, double C0, double t0, double x0);
103 
104  virtual SimpleRateCalculator *Clone();
105  virtual double computeRateConstant(double T);
106  virtual double computeRateConstant(double T,std::vector<double> &concs,std::vector<double> &constant_vec);
107  virtual double rateConstantScaleFactor();
108  inline virtual void setScaleFactors(double C0, double t0, double x0)
109  {rk0=C0*t0;};
110 
111  inline virtual CalcType calcType() {return SIMPLECALC;};
112 private:
113  double K;
114  double rk0;
115 };
116 
117 /// \brief Rate constant calculator for Electron or Hole capture reaction
118 ///
119 /// These reactions are of the form R + E -> P; electron_capture(\f$\sigma\f$)
120 /// or R+H->P; hole_capture(\f$\sigma\f$).
121 /// The reaction rate is then \f$\sigma \times v\f$, where v is 2.3e7 for
122 /// electron capture and 1.9e7 for holes.
123 ///
124 
126 {
127 public:
128  CaptureRateCalculator(double sigma, double v, double C0, double t0,
129  double x0);
131  virtual CaptureRateCalculator *Clone();
132 
133  virtual double computeRateConstant(double T);
134  virtual double computeRateConstant(double T,std::vector<double> &concs,std::vector<double> &constant_vec);
135  virtual double rateConstantScaleFactor();
136  inline virtual void setScaleFactors(double C0, double t0, double x0)
137  {rk0=C0*t0;};
138  inline virtual CalcType calcType() {return CAPTURECALC;};
139 private:
140  double K;
141  double rk0;
142 };
143 
144 /// \brief Rate constant calculator for Electron or Hole emission reaction
145 ///
146 /// These reactions are of the form R -> P+E; electron_emission(\f$\sigma\f$,Energy)
147 /// or R->P+H; hole_emission(\f$\sigma\f$,Energy).
148 /// The reaction rate is then \f$K_f*exp(E/K_bT)\f$, with \f$K_f=\sigma*v*N\f$.
149 /// N is 2.86e19 for electron emission and 2.66e19 for hole emission.
150 /// v is 2.3e7 for electron emission and 1.9e7 for hole emission.
151 ///
153 {
154 public:
155  EmissionRateCalculator(double sigma, double v, double N, double Energy,
156  double C0, double t0, double x0);
158  virtual EmissionRateCalculator *Clone();
159 
160  virtual double computeRateConstant(double T);
161  virtual double computeRateConstant(double T,std::vector<double> &concs,std::vector<double> &constant_vec);
162  virtual double rateConstantScaleFactor();
163  inline virtual void setScaleFactors(double C0, double t0, double x0)
164  {T0=t0;};
165  inline virtual CalcType calcType() {return EMISSIONCALC;};
166 private:
167  double K_f;
168  double E;
169  double T0;
170 };
171 
172 /// \brief Rate constant calculator for a irreversible two-species complexing reaction
173 ///
174 /// These are reactions of the form A+B->AB.
175 /// There must be two separate species on the reactants side, or one specie
176 /// with a stoichiometric coefficient of exactly 2.0.
177 ///
178 /// The rate constant formula depends on the product of the charge states of
179 /// the two species, which we will call \f$ij\f$.
180 /// - If \f$ij > 0\f$: the reaction rate is zero
181 /// - 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$.
182 /// - 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$.
183 ///
184 /// Note that the diffusion coefficients of species are temperature dependent.
185 ///
187 {
188 public:
189  ComplexRateCalculator(std::vector<Specie> &VariableSpecies,
190  std::vector<Specie> &ConstantSpecies,
191  std::vector< std::pair<int,double> > &Reactants,
192  double C0, double t0, double x0);
194  virtual ComplexRateCalculator *Clone();
195 
196  virtual double computeRateConstant(double T);
197  virtual double computeRateConstant(double T,std::vector<double> &concs,std::vector<double> &constant_vec);
198  virtual double rateConstantScaleFactor();
199  inline virtual void setScaleFactors(double C0, double t0, double x0)
200  {rk0=C0*t0;};
201  inline virtual CalcType calcType() {return COMPLEXCALC;};
202 private:
205  bool Tdep;
206  double rk0;
207 };
208 
209 // for a irreversible two-species decomplexing reaction
210 // AB->A+B
212 {
213 public:
214  DecomplexRateCalculator(std::vector<Specie> &VariableSpecies,
215  std::vector<Specie> &ConstantSpecies,
216  std::vector< std::pair<int,double> > &Reactants,
217  std::vector< std::pair<int,double> > &Products,
218  double bindingEnergy,
219  double degenAB,
220  double degenA,
221  double degenB,
222  double siliconConcentration,
223  double C0, double t0, double x0);
225  virtual DecomplexRateCalculator *Clone();
226 
227  virtual double computeRateConstant(double T);
228  virtual double computeRateConstant(double T,std::vector<double> &concs,std::vector<double> &constant_vec);
229  virtual double rateConstantScaleFactor();
230  inline virtual void setScaleFactors(double C0, double t0, double x0)
231  {
232  // The rate constant includes the concentration of silicon, which
233  // means it scales differently. See comments in
234  // N_DEV_RxnRegion::scaleRateConstants for details
235  rk0=t0;
236  c0=C0;
237  };
238  inline virtual CalcType calcType() {return DECOMPLEXCALC;};
239 
240 private:
243  bool Tdep;
244  double deltaE;
246  double concSi;
247  double rk0;
248  double c0;
249 };
250 
251 // for a two-species complexing reaction
252 // with diffusion enhanced hole capture
253 // A + B + H ->AB
255 {
256 public:
257  BourgoinCorbettHoleRateCalculator(std::vector<Specie> &VariableSpecies,
258  std::vector<Specie> &ConstantSpecies,
259  std::vector< std::pair<int,double> > &Reactants,
260  std::vector< std::pair<int,double> > &Products,
261  double sigma,
262  double C0, double t0, double x0);
265 
266  virtual double computeRateConstant(double T);
267  virtual double computeRateConstant(double T,std::vector<double> &concs,std::vector<double> &constant_vec);
268  virtual double rateConstantScaleFactor();
269  inline virtual void setScaleFactors(double C0, double t0, double x0)
270  {
271  rk0=C0*C0*t0;
272  };
273  inline virtual CalcType calcType() {return BCHOLECALC;};
274 
275 private:
278  bool Tdep;
279  double sigma;
280  double rk0;
281  double c0;
282 };
283 
284 } // namespace Device
285 } // namespace Xyce
286 
287 #endif