ViennaSHE 1.3.0
Free open-source semiconductor device simulator using spherical harmonics expansions techniques.
mos1d_potential_kink.cpp
Go to the documentation of this file.
1/* ============================================================================
2 Copyright (c) 2011-2022, Institute for Microelectronics,
3 Institute for Analysis and Scientific Computing,
4 TU Wien.
5
6 -----------------
7 ViennaSHE - The Vienna Spherical Harmonics Expansion Boltzmann Solver
8 -----------------
9
10 http://viennashe.sourceforge.net/
11
12 License: MIT (X11), see file LICENSE in the base directory
13=============================================================================== */
14
15#if defined(_MSC_VER)
16 // Disable name truncation warning obtained in Visual Studio
17 #pragma warning(disable:4503)
18#endif
19
20#include <iostream>
21#include <cstdlib>
22#include <vector>
23
24// ViennaSHE includes:
25#include "viennashe/core.hpp"
26
27// ViennaGrid default configuration and centroid() algorithm:
28#include "viennagrid/config/default_configs.hpp"
29#include "viennagrid/algorithm/centroid.hpp"
30
31
39{
40
41 mos1d_mesh_generator(double len_gate, double cs_gate, double len_oxide, double cs_ox, double len_bulk, double cs_bulk)
42 : len_gate_(len_gate), cs_gate_(cs_gate), len_oxide_(len_oxide), cs_ox_(cs_ox), len_bulk_(len_bulk), cs_bulk_(cs_bulk)
43 { }
44
45 template < typename MeshT, typename SegmentationT >
46 void operator()(MeshT & mesh, SegmentationT & seg) const
47 {
49
50 gconf.add_segment(0, len_gate_, static_cast<unsigned long>(len_gate_ /cs_gate_ + 1.0) );
51 gconf.add_segment(len_gate_, len_oxide_, static_cast<unsigned long>(len_oxide_/cs_ox_ + 1.0) );
52 gconf.add_segment(len_gate_+len_oxide_, len_bulk_, static_cast<unsigned long>(len_bulk_ /cs_bulk_ + 1.0) );
53 gconf.add_segment(len_gate_+len_oxide_+len_bulk_, 1e-9, 10 );
54
55 viennashe::util::generate_device(mesh, seg, gconf);
56 }
57
58private:
59 double len_gate_;
60 double cs_gate_;
61 double len_oxide_;
62 double cs_ox_;
63 double len_bulk_;
64 double cs_bulk_;
65
66};
67
73template <typename DeviceType>
74void init_device(DeviceType & device, double Vg_init)
75{
76 typedef typename DeviceType::segment_type SegmentType;
77
78 SegmentType const & gate = device.segment(0);
79 SegmentType const & oxide = device.segment(1);
80 SegmentType const & silicon = device.segment(2);
81 SegmentType const & bulk = device.segment(3);
82
83 std::cout << "* init_device(): Setting material ..." << std::endl;
84
85 device.set_material(viennashe::materials::metal(), gate);
86 device.set_material(viennashe::materials::metal(), bulk);
87 device.set_material(viennashe::materials::hfo2(), oxide);
88 device.set_material(viennashe::materials::si(), silicon);
89
90 std::cout << "* init_device(): Setting doping (per cell) ..." << std::endl;
91
92 //intrinsic doping for silicon to compensate built-in potentials
93 device.set_doping_n(1e16, silicon);
94 device.set_doping_p(1e16, silicon);
95
96 std::cout << "* init_device(): Setting contact potentials (per cell) ..." << std::endl;
97
98 device.set_contact_potential(0.0, bulk);
99 device.set_contact_potential(Vg_init, gate);
100
101 std::cout << "* init_device(): DONE!" << std::endl;
102
103} // init_device()
104
105int main()
106{
107 typedef viennagrid::line_1d_mesh MeshType;
108
109 typedef viennashe::device<MeshType> DeviceType;
110
111 //typedef viennagrid::result_of::const_cell_range<MeshType>::type CellContainer;
112 //typedef viennagrid::result_of::iterator<CellContainer>::type CellIterator;
113 //typedef viennagrid::result_of::const_facet_range<MeshType>::type FacetContainer;
114
115 std::cout << "* main(): Initializing device ..." << std::endl;
116
117 DeviceType device;
118
119 const double len_gate = 1e-9;
120 const double cs_gate = 1e-10;
121 const double len_oxide = 1e-9;
122 const double cs_ox = 2e-10;
123 const double len_bulk = 1e-9;
124 const double cs_bulk = 1e-10;
125
126 double Vg = 0.3;
127
128 mos1d_mesh_generator mosgen(len_gate, cs_gate, len_oxide, cs_ox, len_bulk, cs_bulk);
129 device.generate_mesh(mosgen);
130
131 init_device(device, Vg);
132
133 //
134 // Use a drift-diffusion simulation for obtaining an initial guess of the potential:
135 //
136 std::cout << "* main(): Creating DD simulator..." << std::endl;
137
138 viennashe::config dd_cfg;
139 dd_cfg.with_electrons(false);
140 dd_cfg.with_holes(false);
141 dd_cfg.nonlinear_solver().max_iters(20);
142 dd_cfg.nonlinear_solver().damping(1.0);
143
144 viennashe::simulator<DeviceType> dd_simulator(device, dd_cfg);
145
146 std::cout << "* main(): Launching simulator..." << std::endl;
147
148 dd_simulator.run();
149
150 double pot_gate_left = dd_simulator.potential().at(viennagrid::cells(device.mesh())[12]);
151 double pot_gate_right = dd_simulator.potential().at(viennagrid::cells(device.mesh())[13]);
152 double dx_gate = viennagrid::norm(viennagrid::centroid(viennagrid::cells(device.mesh())[13]) - viennagrid::centroid(viennagrid::cells(device.mesh())[12]));
153 double field_gate = (pot_gate_left - pot_gate_right) / dx_gate;
154
155 double pot_bulk_left = dd_simulator.potential().at(viennagrid::cells(device.mesh())[22]);
156 double pot_bulk_right = dd_simulator.potential().at(viennagrid::cells(device.mesh())[23]);
157 double dx_bulk = viennagrid::norm(viennagrid::centroid(viennagrid::cells(device.mesh())[23]) - viennagrid::centroid(viennagrid::cells(device.mesh())[22]));
158 double field_bulk = (pot_bulk_left - pot_bulk_right) / dx_bulk;
159
160
161 std::cout << "Field in gate: " << field_gate << std::endl;
162 std::cout << "Field in bulk: " << field_bulk << std::endl;
163 std::cout << "Ratio of electric fields: " << field_gate / field_bulk << std::endl;
164 double permittivity_ox = viennashe::materials::permittivity(device.get_material(viennagrid::cells(device.mesh())[13]));
165 double permittivity_bulk = viennashe::materials::permittivity(device.get_material(viennagrid::cells(device.mesh())[23]));
166 std::cout << "Ratio of permittivities: " << permittivity_bulk / permittivity_ox << std::endl;
167
169 gpwriter(device, viennashe::util::any_filter(), dd_simulator.potential(), "mos1d_potential_kink.dat");
170
171 std::cout << std::endl;
172 if ( std::abs(field_gate / field_bulk - permittivity_bulk / permittivity_ox) > 0.01 )
173 {
174 std::cout << "TEST FAILED: Ratios of fields do not correspond to ratio of permittivities!" << std::endl;
175 return EXIT_FAILURE;
176 }
177 else
178 std::cout << "TEST PASSED: Ratios match!" << std::endl;
179 std::cout << std::endl;
180
181 std::cout << "*********************************************************" << std::endl;
182 std::cout << "* Test finished successfully *" << std::endl;
183 std::cout << "*********************************************************" << std::endl;
184
185 return EXIT_SUCCESS;
186}
The main SHE configuration class. To be adjusted by the user for his/her needs.
Definition: config.hpp:124
bool with_holes() const
Returns true if holes are considered in the simulation.
Definition: config.hpp:234
nonlinear_solver_config_type & nonlinear_solver()
Returns the configuration object for the nonlinear solver.
Definition: config.hpp:495
bool with_electrons() const
Returns true if electrons are considered in the simulation.
Definition: config.hpp:226
Defines the physical properties of a device, e.g. doping. This is the implementation for 2d and highe...
Definition: device.hpp:818
Class for self-consistent SHE simulations.
Definition: simulator.hpp:675
std::size_t max_iters() const
Returns the maximum number of nonlinear solver iterations.
Definition: config.hpp:317
double damping() const
Returns the damping for the nonlinear solver.
Definition: config.hpp:328
Configuration class for the simple mesh generator.
void add_segment(double start_x, double start_y, double len_x, double len_y, unsigned long points_x, unsigned long points_y)
Convenience header, which includes all core functionality available in ViennaSHE.
void init_device(DeviceType &device, double Vg_init, double Nd, double Na)
Initalizes the MOS 1D device for testing.
Definition: mos1d_dg.hpp:94
double permittivity(long material_id)
Convenience function for returning the permittivity of the material identified by the ID provided.
Definition: all.hpp:214
void generate_device(MeshT &mesh, SegmentationT &seg, device_generation_config const &conf)
Public interface for mesh generation of simple one- or two-dimensional meshes. Device must be rectang...
int main()
Definition: resistor1d-c.c:108
MOS 1D test-grid generator.
Definition: mos1d_dg.hpp:55
mos1d_mesh_generator(double len_gate, double cs_gate, double len_oxide, double cs_ox, double len_bulk, double cs_bulk)
Definition: mos1d_dg.hpp:57
void operator()(MeshT &mesh, SegmentationT &seg) const
Definition: mos1d_dg.hpp:62
Writes quantities to a file which can be processed by Gnuplot. Works for 1d, 2d and 3d only.
A class referring to hafnium dioxide.
Definition: all.hpp:119
A class referring to any metal contact.
Definition: all.hpp:44
A class referring to silicon and providing certain material parameters Note that this is the default ...
Definition: all.hpp:50
A trivial filter, all objects are accepted.
Definition: filter.hpp:41