ViennaSHE 1.3.0
Free open-source semiconductor device simulator using spherical harmonics expansions techniques.
trapped_charge_scattering.hpp
Go to the documentation of this file.
1#ifndef VIENNASHE_TRAPPED_CHARGE_SCATTERING_HPP
2#define VIENNASHE_TRAPPED_CHARGE_SCATTERING_HPP
3
4/* ============================================================================
5 Copyright (c) 2011-2022, Institute for Microelectronics,
6 Institute for Analysis and Scientific Computing,
7 TU Wien.
8
9 -----------------
10 ViennaSHE - The Vienna Spherical Harmonics Expansion Boltzmann Solver
11 -----------------
12
13 http://viennashe.sourceforge.net/
14
15 License: MIT (X11), see file LICENSE in the base directory
16=============================================================================== */
17
18#include <limits>
19
20// ViennaGrid:
21
22#include "viennagrid/mesh/mesh.hpp"
23#include "viennagrid/mesh/coboundary_iteration.hpp"
24
25// viennashe
31
32#include "viennashe/log/log.hpp"
36
37
42namespace viennashe
43{
44 namespace she
45 {
46
51 template <typename DeviceType, typename TimeStepQuantitiesT>
52 class trapped_charge_scattering : public scattering_base<DeviceType>
53 {
55 typedef typename base_type::FacetType FacetType;
56 typedef typename base_type::CellType CellType;
57
58 public:
61
62 explicit trapped_charge_scattering(DeviceType const & device,
63 viennashe::config const & conf,
64 TimeStepQuantitiesT const & quantities)
65 : base_type(device, conf), params_(conf.scattering().trapped_charge()), quantities_(quantities)
66 { }
67
69 double kinetic_energy,
71 {
72 return get(elem, kinetic_energy, ctype);
73 }
74
76 double kinetic_energy,
78 {
79 return get(elem, kinetic_energy, ctype);
80 }
81
83
84 protected:
85
94 template <typename ElementType>
95 scatter_processes_type get(ElementType const & elem,
96 double kinetic_energy,
98 {
99 scatter_processes_type result(1);
100
101 // Final energy is always equal to initial energy:
102 result[0].initial_energy(kinetic_energy);
103 result[0].final_energy(kinetic_energy);
104 result[0].rate( getScatteringRate(elem, kinetic_energy, ctype) );
105
106 return result;
107 }
108
109
110 template <typename ElementType>
111 double getScatteringRate(ElementType const & elem,
112 double kinetic_energy,
113 viennashe::carrier_type_id ctype) const
114 {
115 const double temp = base_type::device_.get_lattice_temperature(elem);
116
117 const double NI = std::abs(this->get_charged_trap_density(elem, ctype));
118
119 double rate = get_scattering_rate(NI, kinetic_energy, temp, ctype);
120
121 // check if the rate is numerically zero
122 if ( std::abs(rate) < std::numeric_limits<double>::epsilon() ) rate = 0.0; // assign zero to ensure matrix sparsity
123
124 return rate;
125 }
126
127
130 {
131 typedef typename DeviceType::trap_level_container_type trap_level_container_type;
132 typedef typename trap_level_container_type::const_iterator trap_iterator_type;
133
134 double N = 0.0;
135
136 trap_level_container_type const & traps = this->device_.get_trap_levels(cell);
137
138 const std::size_t num_trap_unknowns = quantities_.num_trap_unknown_indices(cell);
139
140 if (num_trap_unknowns <= 0)
141 return 0.0;
142
143 if (num_trap_unknowns != traps.size())
144 throw viennashe::invalid_value_exception("The number of traps configured in the device does not match the number of unknowns for traps!", static_cast<double>(num_trap_unknowns));
145
146 std::size_t index = 0;
147 for (trap_iterator_type tit = traps.begin(); tit != traps.end(); ++tit, ++index)
148 {
149 const double occupancy = quantities_.trap_occupancy(cell, index);
150 N += tit->charge_sign() * occupancy * tit->density() ;
151 } // for trap levels
152
153 return N;
154
155 }
156
158 viennashe::carrier_type_id ctype) const
159 {
160 typedef typename viennagrid::result_of::const_coboundary_range<typename base_type::MeshType, FacetType, CellType>::type CellOnFacetContainer;
161
162 CellOnFacetContainer cells_on_facet(base_type::device_.mesh(), viennagrid::handle(base_type::device_.mesh(), facet));
163
164 CellType const & c1 = *(cells_on_facet.begin());
165 CellType const *other_cell_ptr = viennashe::util::get_other_cell_of_facet(base_type::device_.mesh(), facet, c1);
166
167 if (!other_cell_ptr)
168 return this->get_charged_trap_density(c1, ctype);
169
170 return std::sqrt(this->get_charged_trap_density(c1, ctype) *
171 this->get_charged_trap_density(*other_cell_ptr, ctype));
172 }
173
174
175 double get_scattering_rate(double NI, double kinetic_energy, double T, viennashe::carrier_type_id ctype) const
176 {
177 const double pi = viennashe::math::constants::pi;
178 const double kB = viennashe::physics::constants::kB;
179 const double hbar = viennashe::physics::constants::hbar;
180 const double q = viennashe::physics::constants::q;
181 const double eps = viennashe::materials::si::permittivity();
182 double lambda_sq = 0.0;
183 double scattering_rate = 0.0;
184
185 const double norm_k = base_type::conf_.dispersion_relation(ctype).norm_k(kinetic_energy);
186 //avoid singularity in the following expression
187 if (norm_k <= 0.0 || NI <= 0.0) return 0.0;
188
189 const double prefactor = (2.0 * pi * NI * q * q * q * q) / (hbar * eps * eps);
190
191 lambda_sq = (eps * kB * T) / (q * q * NI) ;
192
193 const double a = 4.0 * lambda_sq * norm_k * norm_k;
194
195 scattering_rate = prefactor * params_.get_fit_factor(ctype)
196 * 0.5 * (std::log(1.0 + a) - (a / (1.0 + a)) ) / 4.0 / std::pow(norm_k, 4.0);
197
198 //if(scattering_rate != 0) log::debug() << "trapped charge scat " << kinetic_energy << " " << scattering_rate << std::endl;
199
200 return scattering_rate;
201 }
202
203 private:
204
206
207 TimeStepQuantitiesT const & quantities_;
208
209 };
210
211 } //namespace she
212} //namespace viennashe
213
214
215#endif /* VIENNASHE_TRAPPED_CHARGE_SCATTERING_HPP */
216
The main SHE configuration class. To be adjusted by the user for his/her needs.
Definition: config.hpp:124
viennashe::physics::dispersion_proxy dispersion_relation(viennashe::carrier_type_id ctype) const
Returns the dispersion relation for electrons.
Definition: config.hpp:266
Defines the physical properties of a device, e.g. doping. This is the implementation for 2d and highe...
Definition: device.hpp:818
Exception for the case that an invalid value (depends on the method called) is encountered.
Definition: exception.hpp:76
double norm_k(double ekin, double theta=0, double phi=0) const
Returns the norm of the k-vector as a function of energy (and angles, eventually)....
Definition: dispersion.hpp:89
std::vector< scatter_process_descriptor > scatter_processes_type
Definition: common.hpp:90
viennagrid::result_of::cell< MeshType >::type CellType
Definition: common.hpp:87
viennagrid::result_of::facet< MeshType >::type FacetType
Definition: common.hpp:86
viennashe::config const & conf_
Definition: common.hpp:109
DeviceType const & device_
Definition: common.hpp:108
double get_fit_factor(viennashe::carrier_type_id ctype) const
Definition: config.hpp:240
double get_scattering_rate(double NI, double kinetic_energy, double T, viennashe::carrier_type_id ctype) const
double get_charged_trap_density(CellType const &cell, viennashe::carrier_type_id) const
scatter_processes_type operator()(CellType const &elem, double kinetic_energy, viennashe::carrier_type_id ctype) const
scatter_processes_type operator()(FacetType const &elem, double kinetic_energy, viennashe::carrier_type_id ctype) const
scatter_processes_type get(ElementType const &elem, double kinetic_energy, viennashe::carrier_type_id ctype) const
Returns all possible final scattering states for a carrier with initial kinetic energy 'kin_energy' f...
trapped_charge_scattering(DeviceType const &device, viennashe::config const &conf, TimeStepQuantitiesT const &quantities)
base_type::scatter_processes_type scatter_processes_type
double getScatteringRate(ElementType const &elem, double kinetic_energy, viennashe::carrier_type_id ctype) const
double get_charged_trap_density(FacetType const &facet, viennashe::carrier_type_id ctype) const
Contains the dispersion relations for different materials and different polarities.
A logging facility providing fine-grained control over logging in ViennaSHE.
A very simple material database. Needs to be replaced by something more versatile soon.
Provides a number of fundamental math constants.
Miscellaneous utilities.
@ TRAPPED_CHARGE_SCATTERING
Definition: common.hpp:47
CellT const * get_other_cell_of_facet(MeshT const &mesh, FacetT const &facet, CellT const &cell)
Helper function returning a const-pointer to the 'second cell' of a facet, or NULL if there is no sec...
Definition: misc.hpp:196
The main ViennaSHE namespace. All functionality resides inside this namespace.
Definition: accessors.hpp:40
carrier_type_id
Enumeration type for selecting the carrier type.
Definition: forwards.h:185
Provides a number of fundamental constants. All constants in SI units.
Returns a few helper routines for computing physical quantities. To be replaced in the future.
static double permittivity()
Definition: all.hpp:53
static const double pi
Pi.
Definition: constants.hpp:34
static const double q
Elementary charge.
Definition: constants.hpp:44
static const double kB
Boltzmann constant.
Definition: constants.hpp:46
static const double hbar
Modified Planck constant.
Definition: constants.hpp:50
Defines the log keys used within the viennashe::she namespace.
Common classes for scattering operators.