Xyce  6.1
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-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_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.15 $
41 //
42 // Revision Date : $Date: 2015/04/08 19:18:22 $
43 //
44 // Current Owner : $Author: tvrusso $
45 //-----------------------------------------------------------------------------
46 
47 #ifndef N_DEV_RateConstantCalculators_H
48 #define N_DEV_RateConstantCalculators_H
49 
50 #include <string>
51 #include <vector>
52 
53 #include <iostream>
54 
55 // ---------- Forward Declarations ----------
56 
57 namespace Xyce {
58 namespace Device {
59 
60 // forward declaration:
61 class Specie;
62 
64  {
74  };
75 
76 /// \brief Abstract interface class for "rate calculator" strategy pattern
77 ///
78 /// Each reaction in a reaction network has a rate constant calculator
79 /// associated with it. The interface is defined by the RateCalculator
80 /// class.
82 {
83 public:
84  virtual double computeRateConstant(double T) = 0; ///< return rate constant at given temperature
85  virtual double computeRateConstant(double T,std::vector<double> &concs,std::vector<double> &constant_vec) = 0; //
86  virtual double rateConstantScaleFactor() = 0; ///< return current scale factor for rate constant
87  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)
88  virtual CalcType calcType() = 0; ///< return the type of this calculator
91  virtual RateCalculator *Clone()=0; ///< create a copy of this calculator
92  virtual ~RateCalculator() {}
93  virtual void setBulkMaterial(std::string material)=0;
94  virtual bool isBulkMaterialSet()=0;
95 
96  protected:
98  std::string bulkMaterial;
99 };
100 
101 /// \brief Class for trivial, constant rate constant (independent of temperature)
102 ///
103 /// This is the most basic rate calculator that returns a constant value
104 /// provided in the reaction network input file.
105 ///
107 {
108 public:
109  SimpleRateCalculator(double k, double C0, double t0, double x0);
111 
112  virtual SimpleRateCalculator *Clone();
113  virtual double computeRateConstant(double T);
114  virtual double computeRateConstant(double T,std::vector<double> &concs,std::vector<double> &constant_vec);
115  virtual double rateConstantScaleFactor();
116  inline virtual void setScaleFactors(double C0, double t0, double x0)
117  {rk0=C0*t0;};
118 
119  inline virtual CalcType calcType() {return SIMPLECALC;};
120  inline virtual void setBulkMaterial(std::string material){bulkMaterial = material; bulkMaterialSet=true;};
121  inline virtual bool isBulkMaterialSet(){return bulkMaterialSet;};
122  //bool bulkMaterialSet;
123  std::string myReactionName;
124 private:
125  double K;
126  double rk0;
127  //std::string bulkMaterial;
128 };
129 
130 /// \brief Rate constant calculator for Electron or Hole capture reaction
131 ///
132 /// These reactions are of the form R + E -> P; electron_capture(\f$\sigma\f$)
133 /// or R+H->P; hole_capture(\f$\sigma\f$).
134 /// The reaction rate is then \f$\sigma \times v\f$, where v is 2.3e7 for
135 /// electron capture and 1.9e7 for holes.
136 ///
137 
139 {
140 public:
141  CaptureRateCalculator(double sigma, double v, double C0, double t0,
142  double x0);
144  virtual CaptureRateCalculator *Clone();
145 
146  virtual double computeRateConstant(double T);
147  virtual double computeRateConstant(double T,std::vector<double> &concs,std::vector<double> &constant_vec);
148  virtual double rateConstantScaleFactor();
149  inline virtual void setScaleFactors(double C0, double t0, double x0)
150  {rk0=C0*t0;};
151  inline virtual CalcType calcType() {return CAPTURECALC;};
152  inline virtual void setBulkMaterial(std::string material){bulkMaterial = material; bulkMaterialSet=true;};
153  inline virtual bool isBulkMaterialSet(){return bulkMaterialSet;};
154  std::string myReactionName;
155  //bool bulkMaterialSet;
156 private:
157  double K;
158  double rk0;
159  // std::string bulkMaterial;
160 };
161 
162 /// \brief Rate constant calculator for Electron or Hole emission reaction
163 ///
164 /// These reactions are of the form R -> P+E; electron_emission(\f$\sigma\f$,Energy)
165 /// or R->P+H; hole_emission(\f$\sigma\f$,Energy).
166 /// The reaction rate is then \f$K_f*exp(E/K_bT)\f$, with \f$K_f=\sigma*v*N\f$.
167 /// N is 2.86e19 for electron emission and 2.66e19 for hole emission.
168 /// v is 2.3e7 for electron emission and 1.9e7 for hole emission.
169 ///
171 {
172 public:
173  EmissionRateCalculator(double sigma, double v, double N, double Energy,
174  double C0, double t0, double x0);
176  virtual EmissionRateCalculator *Clone();
177 
178  virtual double computeRateConstant(double T);
179  virtual double computeRateConstant(double T,std::vector<double> &concs,std::vector<double> &constant_vec);
180  virtual double rateConstantScaleFactor();
181  inline virtual void setScaleFactors(double C0, double t0, double x0)
182  {T0=t0;};
183  inline virtual CalcType calcType() {return EMISSIONCALC;};
184  inline virtual void setBulkMaterial(std::string material){bulkMaterial = material; bulkMaterialSet=true;};
185  inline virtual bool isBulkMaterialSet(){return bulkMaterialSet;};
186  std::string myReactionName;
187  //bool bulkMaterialSet;
188 private:
189  double K_f;
190  double E;
191  double T0;
192  // std::string bulkMaterial;
193 };
194 
195 
196 /// \brief Rate constant calculator for Electron or Hole emission reaction
197 ///
198 /// These reactions are of the form R -> P+E and uise Fermi-Dirac statistics;
199 ///
201 {
202 public:
203  FDEmissionRateCalculator(double sigma, double Energy, double v,
204  double C0, double t0, double x0);
206  virtual FDEmissionRateCalculator *Clone();
207 
208  virtual double computeRateConstant(double T);
209  virtual double computeRateConstant(double T,std::vector<double> &concs,std::vector<double> &constant_vec);
210  virtual double rateConstantScaleFactor();
211  inline virtual void setScaleFactors(double C0, double t0, double x0)
212  {T0=t0;};
213  inline virtual CalcType calcType() {return FDEMISSIONCALC;};
214  inline virtual void setBulkMaterial(std::string material){bulkMaterial = material; bulkMaterialSet=true;};
215  inline virtual bool isBulkMaterialSet(){return bulkMaterialSet;};
216  std::string myReactionName;
217  //bool bulkMaterialSet;
218 private:
219  double K_f;
220  double E;
221  double T0;
222  // std::string bulkMaterial;
223 };
224 
225 /// \brief Rate constant calculator for a irreversible two-species complexing reaction
226 ///
227 /// These are reactions of the form A+B->AB.
228 /// There must be two separate species on the reactants side, or one specie
229 /// with a stoichiometric coefficient of exactly 2.0.
230 ///
231 /// The rate constant formula depends on the product of the charge states of
232 /// the two species, which we will call \f$ij\f$.
233 /// - If \f$ij > 0\f$: the reaction rate is zero
234 /// - 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$.
235 /// - 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$.
236 ///
237 /// Note that the diffusion coefficients of species are temperature dependent.
238 ///
240 {
241 public:
242  ComplexRateCalculator(std::vector<Specie> &VariableSpecies,
243  std::vector<Specie> &ConstantSpecies,
244  std::vector< std::pair<int,double> > &Reactants,
245  double C0, double t0, double x0);
247  virtual ComplexRateCalculator *Clone();
248 
249  virtual double computeRateConstant(double T);
250  virtual double computeRateConstant(double T,std::vector<double> &concs,std::vector<double> &constant_vec);
251  virtual double rateConstantScaleFactor();
252  inline virtual void setScaleFactors(double iC0, double t0, double x0)
253  {rk0=iC0*t0; classC0=iC0;};
254  inline virtual CalcType calcType() {return COMPLEXCALC;};
255  inline virtual void setBulkMaterial(std::string material){bulkMaterial = material; bulkMaterialSet=true;};
256  inline virtual bool isBulkMaterialSet(){return bulkMaterialSet;};
257  std::string myReactionName;
258  //bool bulkMaterialSet;
259 private:
262  bool Tdep;
263  double rk0;
266  double classC0;
267  // std::string bulkMaterial;
268 };
269 
271 {
272 public:
273  ComplexMultiplierRateCalculator(std::vector<Specie> &VariableSpecies,
274  std::vector<Specie> &ConstantSpecies,
275  std::vector< std::pair<int,double> > &Reactants,
276  double C0, double t0, double x0,
277  double multiplier);
280 
281  virtual double computeRateConstant(double T);
282  virtual double computeRateConstant(double T,std::vector<double> &concs,std::vector<double> &constant_vec);
283  virtual double rateConstantScaleFactor();
284  inline virtual void setScaleFactors(double C0, double t0, double x0)
285  {rk0=C0*t0;};
286  inline virtual CalcType calcType() {return COMPLEXCALC;};
287  inline virtual void setBulkMaterial(std::string material){bulkMaterial = material; bulkMaterialSet=true;};
288  inline virtual bool isBulkMaterialSet(){return bulkMaterialSet;};
289  std::string myReactionName;
290  //bool bulkMaterialSet;
291 private:
294  bool Tdep;
295  double rk0;
298  double multiplier;
299  // std::string bulkMaterial;
300 };
301 
302 // for a irreversible two-species decomplexing reaction
303 // AB->A+B
305 {
306 public:
307  DecomplexRateCalculator(std::vector<Specie> &VariableSpecies,
308  std::vector<Specie> &ConstantSpecies,
309  std::vector< std::pair<int,double> > &Reactants,
310  std::vector< std::pair<int,double> > &Products,
311  double bindingEnergy,
312  double degenAB,
313  double degenA,
314  double degenB,
315  double siliconConcentration,
316  double C0, double t0, double x0);
318  virtual DecomplexRateCalculator *Clone();
319 
320  virtual double computeRateConstant(double T);
321  virtual double computeRateConstant(double T,std::vector<double> &concs,std::vector<double> &constant_vec);
322  virtual double rateConstantScaleFactor();
323  inline virtual void setScaleFactors(double C0, double t0, double x0)
324  {
325  // The rate constant includes the concentration of silicon, which
326  // means it scales differently. See comments in
327  // N_DEV_RxnRegion::scaleRateConstants for details
328  rk0=t0;
329  c0=C0;
330  };
331  inline virtual CalcType calcType() {return DECOMPLEXCALC;};
332  inline virtual void setBulkMaterial(std::string material){bulkMaterial = material; bulkMaterialSet=true;};
333  inline virtual bool isBulkMaterialSet(){return bulkMaterialSet;};
334  //bool bulkMaterialSet;
335  std::string myReactionName;
336 
337 private:
340  bool Tdep;
341  double deltaE;
343  double concSi;
344  double rk0;
345  double c0;
348  double classC0;
349  // std::string bulkMaterial;
350 };
351 
352 // for a two-species complexing reaction
353 // with diffusion enhanced hole capture
354 // A + B + H ->AB
356 {
357 public:
358  BourgoinCorbettHoleRateCalculator(std::vector<Specie> &VariableSpecies,
359  std::vector<Specie> &ConstantSpecies,
360  std::vector< std::pair<int,double> > &Reactants,
361  std::vector< std::pair<int,double> > &Products,
362  double sigma,
363  double C0, double t0, double x0);
366 
367  virtual double computeRateConstant(double T);
368  virtual double computeRateConstant(double T,std::vector<double> &concs,std::vector<double> &constant_vec);
369  virtual double rateConstantScaleFactor();
370  inline virtual void setScaleFactors(double C0, double t0, double x0)
371  {
372  rk0=C0*C0*t0;
373  };
374  inline virtual CalcType calcType() {return BCHOLECALC;};
375  inline virtual void setBulkMaterial(std::string material){bulkMaterial = material; bulkMaterialSet=true;};
376  inline virtual bool isBulkMaterialSet(){return bulkMaterialSet;};
377  //bool bulkMaterialSet;
378  std::string myReactionName;
379 
380 private:
383  bool Tdep;
384  double sigma;
385  double rk0;
386  double c0;
387  // std::string bulkMaterial;
388 };
389 
390 
391 
392 } // namespace Device
393 } // namespace Xyce
394 
395 #endif
FDEmissionRateCalculator(double sigma, double Energy, double v, double C0, double t0, double x0)
Rate constant calculator for Electron or Hole emission reaction.
virtual void setScaleFactors(double C0, double t0, double x0)
set concentration, time, and space scale factors (space scale factor is currently unused by any calcu...
virtual void setBulkMaterial(std::string material)
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 calcu...
EmissionRateCalculator(double sigma, double v, double N, double Energy, double C0, double t0, double x0)
virtual double rateConstantScaleFactor()
return current scale factor for rate constant
virtual double computeRateConstant(double T)
return rate constant at given temperature
virtual void setScaleFactors(double iC0, double t0, double x0)
set concentration, time, and space scale factors (space scale factor is currently unused by any calcu...
Pure virtual class to augment a linear system.
virtual void setBulkMaterial(std::string material)
Rate constant calculator for Electron or Hole emission reaction.
virtual double rateConstantScaleFactor()=0
return current scale factor for rate constant
virtual EmissionRateCalculator * Clone()
create a copy of this calculator
virtual void setScaleFactors(double C0, double t0, double x0)
set concentration, time, and space scale factors (space scale factor is currently unused by any calcu...
ComplexRateCalculator(std::vector< Specie > &VariableSpecies, std::vector< Specie > &ConstantSpecies, std::vector< std::pair< int, double > > &Reactants, double C0, double t0, double x0)
virtual double rateConstantScaleFactor()
return current scale factor for rate constant
virtual CalcType calcType()
return the type of this calculator
virtual void setScaleFactors(double C0, double t0, double x0)
set concentration, time, and space scale factors (space scale factor is currently unused by any calcu...
virtual void setScaleFactors(double C0, double t0, double x0)
set concentration, time, and space scale factors (space scale factor is currently unused by any calcu...
virtual double computeRateConstant(double T)=0
return rate constant at given temperature
virtual BourgoinCorbettHoleRateCalculator * Clone()
create a copy of this calculator
virtual void setScaleFactors(double C0, double t0, double x0)
set concentration, time, and space scale factors (space scale factor is currently unused by any calcu...
virtual ComplexRateCalculator * Clone()
create a copy of this calculator
virtual CalcType calcType()
return the type of this calculator
virtual SimpleRateCalculator * Clone()
create a copy of this calculator
ComplexMultiplierRateCalculator(std::vector< Specie > &VariableSpecies, std::vector< Specie > &ConstantSpecies, std::vector< std::pair< int, double > > &Reactants, double C0, double t0, double x0, double multiplier)
virtual double computeRateConstant(double T)
return rate constant at given temperature
SimpleRateCalculator(double k, double C0, double t0, double x0)
virtual CalcType calcType()
return the type of this calculator
virtual double computeRateConstant(double T)
return rate constant at given temperature
virtual ComplexMultiplierRateCalculator * Clone()
create a copy of this calculator
Rate constant calculator for a irreversible two-species complexing reaction.
virtual void setBulkMaterial(std::string material)
virtual CalcType calcType()
return the type of this calculator
virtual double rateConstantScaleFactor()
return current scale factor for rate constant
virtual CalcType calcType()
return the type of this calculator
virtual double computeRateConstant(double T)
return rate constant at given temperature
virtual double computeRateConstant(double T)
return rate constant at given temperature
virtual double rateConstantScaleFactor()
return current scale factor for rate constant
virtual double rateConstantScaleFactor()
return current scale factor for rate constant
virtual void setBulkMaterial(std::string material)
CaptureRateCalculator(double sigma, double v, double C0, double t0, double x0)
virtual bool isBulkMaterialSet()=0
DecomplexRateCalculator(std::vector< Specie > &VariableSpecies, std::vector< Specie > &ConstantSpecies, std::vector< std::pair< int, double > > &Reactants, std::vector< std::pair< int, double > > &Products, double bindingEnergy, double degenAB, double degenA, double degenB, double siliconConcentration, double C0, double t0, double x0)
virtual void setScaleFactors(double C0, double t0, double x0)
set concentration, time, and space scale factors (space scale factor is currently unused by any calcu...
virtual FDEmissionRateCalculator * Clone()
create a copy of this calculator
virtual RateCalculator * Clone()=0
create a copy of this calculator
virtual double computeRateConstant(double T)
return rate constant at given temperature
virtual void setBulkMaterial(std::string material)
virtual CalcType calcType()
return the type of this calculator
virtual CalcType calcType()
return the type of this calculator
virtual double computeRateConstant(double T)
return rate constant at given temperature
virtual void setBulkMaterial(std::string material)
Class for trivial, constant rate constant (independent of temperature)
virtual void setBulkMaterial(std::string material)=0
Abstract interface class for "rate calculator" strategy pattern.
virtual double rateConstantScaleFactor()
return current scale factor for rate constant
BourgoinCorbettHoleRateCalculator(std::vector< Specie > &VariableSpecies, std::vector< Specie > &ConstantSpecies, std::vector< std::pair< int, double > > &Reactants, std::vector< std::pair< int, double > > &Products, double sigma, double C0, double t0, double x0)
virtual double computeRateConstant(double T)
return rate constant at given temperature
Rate constant calculator for Electron or Hole capture reaction.
virtual DecomplexRateCalculator * Clone()
create a copy of this calculator
virtual double rateConstantScaleFactor()
return current scale factor for rate constant
virtual CalcType calcType()=0
return the type of this calculator
virtual double rateConstantScaleFactor()
return current scale factor for rate constant
virtual void setScaleFactors(double C0, double t0, double x0)
set concentration, time, and space scale factors (space scale factor is currently unused by any calcu...
virtual CaptureRateCalculator * Clone()
create a copy of this calculator
virtual CalcType calcType()
return the type of this calculator