47 #include <Xyce_config.h>
51 #include <N_UTL_Misc.h>
63 #include <N_ERH_ErrorMgr.h>
140 std::vector<double> &concs,
141 std::vector<double> &constant_vec)
170 double C0,
double t0,
226 std::vector<double> &concs,
227 std::vector<double> &constant_vec)
255 double N,
double Energy,
256 double C0,
double t0,
302 return(
K_f*exp(-
E/KbT));
314 std::vector<double> &concs,
315 std::vector<double> &constant_vec)
318 return(
K_f*exp(-
E/KbT));
350 std::vector<Specie> &VariableSpecies, std::vector<Specie> &ConstantSpecies,
351 std::vector< std::pair<int,double> > &Reactants,
352 double C0,
double t0,
double x0)
357 if ( ! ((Reactants.size() == 1 && Reactants[0].second == 2.0) ||
358 (Reactants.size() == 2 && Reactants[0].second == 1.0 &&
359 Reactants[1].second == 1.0)))
362 msg =
"ComplexRateCalculator: Invalid attempt to use complex rate method.";
363 msg =
" This method is only valid for binary complexing reactions:\n";
364 if (Reactants.size() == 1)
366 msg +=
" Only one reactant specified, but its stoichimetric coefficient is not 2.\n";
368 else if (Reactants.size() == 2)
370 msg +=
" Two reactants specified, but both stoichimetric coefficient are not 1.\n";
374 msg +=
" More than two reactants specified.\n";
378 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL,msg);
381 if (Reactants[0].first >= 0)
382 Specie1 = &(VariableSpecies[Reactants[0].first]);
384 Specie1 = &(ConstantSpecies[-(Reactants[0].first+1)]);
387 if (Reactants.size() == 1)
393 if (Reactants[1].first >= 0)
394 Specie2 = &(VariableSpecies[Reactants[1].first]);
396 Specie2 = &(ConstantSpecies[-(Reactants[1].first+1)]);
433 reaction_distance_factor(right.reaction_distance_factor),
435 Specie1(right.Specie1),
436 Specie2(right.Specie2)
482 std::vector<double> &concs,
483 std::vector<double> &constant_vec)
526 std::vector<Specie> &VariableSpecies, std::vector<Specie> &ConstantSpecies,
527 std::vector< std::pair<int,double> > &Reactants,
528 std::vector< std::pair<int,double> > &Products,
529 double bindingEnergy,
double degenAB,
double degenA,
double degenB,
530 double siliconConcentration,
531 double C0,
double t0,
double x0)
532 :concSi(siliconConcentration),
537 deltaE(bindingEnergy)
542 if ( ! ((Products.size() == 1 && Products[0].second == 2.0) ||
543 (Products.size() == 2 && Products[0].second == 1.0 &&
544 Products[1].second == 1.0)))
547 msg =
"DeomplexRateCalculator: Invalid attempt to use decomplex rate method.";
548 msg =
" This method is only valid for decomplexing reactions with two products:\n";
549 if (Products.size() == 1)
551 msg +=
" Only one product specified, but its stoichimetric coefficient is not 2.\n";
553 else if (Products.size() == 2)
555 msg +=
" Two products specified, but both stoichimetric coefficient are not 1.\n";
559 msg +=
" More than two products specified.\n";
563 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL,msg);
566 if (Products[0].first >= 0)
567 Specie1 = &(VariableSpecies[Products[0].first]);
569 Specie1 = &(ConstantSpecies[-(Products[0].first+1)]);
572 if (Products.size() == 1)
578 if (Products[1].first >= 0)
579 Specie2 = &(VariableSpecies[Products[1].first]);
581 Specie2 = &(ConstantSpecies[-(Products[1].first+1)]);
616 :Specie1(right.Specie1),
617 Specie2(right.Specie2),
618 reaction_distance_factor(right.reaction_distance_factor),
620 deltaE(right.deltaE),
621 gammaA(right.gammaA),
622 gammaB(right.gammaB),
623 gammaAB(right.gammaAB),
624 concSi(right.concSi),
679 std::vector<double> &concs,
680 std::vector<double> &constant_vec)
726 std::vector<Specie> &VariableSpecies, std::vector<Specie> &ConstantSpecies,
727 std::vector< std::pair<int,double> > &Reactants,
728 std::vector< std::pair<int,double> > &Products,
730 double C0,
double t0,
double x0)
736 if ( ! (Reactants.size() == 3 && Reactants[0].second == 1.0 &&
737 Reactants[1].second == 1.0 && Reactants[2].second == 1.0) )
740 msg =
"BourgoinCorbettCalculator: Invalid attempt to use rate method.";
741 msg =
" This method is only valid for ternary reactions:\n";
744 N_ERH_ErrorMgr::report(N_ERH_ErrorMgr::DEV_FATAL,msg);
748 if (Reactants[0].first >= 0)
749 Specie1 = &(VariableSpecies[Reactants[0].first]);
751 Specie1 = &(ConstantSpecies[-(Reactants[0].first+1)]);
754 if (Reactants.size() == 1)
760 if (Reactants[1].first >= 0)
761 Specie2 = &(VariableSpecies[Reactants[1].first]);
763 Specie2 = &(ConstantSpecies[-(Reactants[1].first+1)]);
768 double carrierThermalVelocity;
770 if(Reactants[2].first == -1)
771 carrierThermalVelocity = 20335471.413078606;
773 carrierThermalVelocity = 16805108.930336751;
806 :Specie1(right.Specie1),
807 Specie2(right.Specie2),
808 reaction_distance_factor(right.reaction_distance_factor),
865 std::vector<double> &concs,
866 std::vector<double> &constant_vec)