ViennaSHE 1.3.0
Free open-source semiconductor device simulator using spherical harmonics expansions techniques.
carrier_velocity.hpp
Go to the documentation of this file.
1#ifndef VIENNASHE_SHE_CARRIER_VELOCITY_HPP
2#define VIENNASHE_SHE_CARRIER_VELOCITY_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
19
20#include <math.h>
21#include <fstream>
22#include <iostream>
23
24#include "viennagrid/mesh/mesh.hpp"
25#include "viennagrid/algorithm/volume.hpp"
26
27#include "viennashe/forwards.h"
37
38
43namespace viennashe
44{
45 namespace she
46 {
47
49 template <typename DeviceType,
50 typename SHEQuantity>
52 {
53 public:
54 typedef std::vector<double> value_type;
55
56 carrier_velocity_wrapper(DeviceType const & device,
57 viennashe::config const & conf,
58 SHEQuantity const & quan)
59 : device_(device), quan_(quan),
60 current_density_(device, conf, quan), carrier_density_(conf, quan) {}
61
63 template <typename CellT>
64 value_type operator()(CellT const & cell) const
65 {
66 typedef typename viennagrid::result_of::point<CellT>::type PointType;
67
68 std::vector<double> carrier_velocity(3);
69
70 if (!viennashe::materials::is_semiconductor(device_.get_material(cell)))
71 return carrier_velocity;
72
73 double value_Y_00 = viennashe::math::SphericalHarmonic(0,0)(0.0, 0.0);
74 double polarity = (quan_.get_carrier_type_id() == ELECTRON_TYPE_ID) ? -1.0 : 1.0;
75
76 carrier_velocity = current_density_(cell);
77 double carrier_density = carrier_density_(cell);
78
79 for (std::size_t i=0; i<static_cast<std::size_t>(PointType::dim); ++i)
80 carrier_velocity[i] = -polarity * value_Y_00 * carrier_velocity[i] / carrier_density / viennashe::physics::constants::q; //cf. current_density_wrapper on these additional prefactors
81
82 return carrier_velocity;
83 }
84
85 private:
86
87 DeviceType const & device_;
88 SHEQuantity const & quan_;
89
92 };
93
94
102 template <typename DeviceType,
103 typename SHEQuantity,
104 typename ContainerType>
106 viennashe::config const & conf,
107 SHEQuantity const & quan,
108 ContainerType & container)
109 {
110 carrier_velocity_wrapper<DeviceType, SHEQuantity> velocity_wrapper(device, conf, quan);
111
113 }
114
115
116 } //namespace she
117} //namespace viennashe
118
119#endif
Common routines for the assembly of SHE equations.
Provides an accessor for the carrier density.
The main SHE configuration class. To be adjusted by the user for his/her needs.
Definition: config.hpp:124
Defines the physical properties of a device, e.g. doping. This is the implementation for 2d and highe...
Definition: device.hpp:818
An accessor for the carrier density in the device.
Accessor class providing the carrier velocity inside the device.
carrier_velocity_wrapper(DeviceType const &device, viennashe::config const &conf, SHEQuantity const &quan)
value_type operator()(CellT const &cell) const
Functor interface returning the average carrier drift velocity at the provided cell.
Accessor class providing the carrier velocity inside the device.
Contains forward declarations and definition of small classes that must be defined at an early stage.
Provides the SHE coupling matrices and computes higher-order coupling matrices if required....
Implementation of numerical integration routines.
Writer for arbitrary macroscopic quantities.
Provides a number of fundamental math constants.
Miscellaneous utilities.
bool is_semiconductor(long material_id)
Convenience function for checking whether the supplied material ID refers to a semiconductor.
Definition: all.hpp:156
void write_carrier_velocity_to_container(DeviceType const &device, viennashe::config const &conf, SHEQuantity const &quan, ContainerType &container)
Convenience function for writing the average expansion order to the container provided.
The main ViennaSHE namespace. All functionality resides inside this namespace.
Definition: accessors.hpp:40
@ ELECTRON_TYPE_ID
Definition: forwards.h:187
void write_macroscopic_quantity_to_container(DeviceType const &device, MacroscopicQuantityAccessor const &quantity, ContainerType &quantity_container)
Writes the provided macroscopic quantity to the container provided.
Definition: macroscopic.hpp:46
Provides a number of fundamental constants. All constants in SI units.
Provides an accessor for the current density.
static const double q
Elementary charge.
Definition: constants.hpp:44