ViennaSHE 1.3.0
Free open-source semiconductor device simulator using spherical harmonics expansions techniques.
mosfet-dg.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 mesh configurations:
28#include "viennagrid/config/default_configs.hpp"
29
30
31
66template <typename DeviceType>
67void init_device(DeviceType & device)
68{
69 typedef typename DeviceType::segment_type SegmentType;
70
72 SegmentType const & gate_contact = device.segment(1);
73 SegmentType const & source_contact = device.segment(2);
74 SegmentType const & gate_oxide = device.segment(3);
75 SegmentType const & drain_contact = device.segment(4);
76 SegmentType const & source = device.segment(5);
77 SegmentType const & drain = device.segment(6);
78 SegmentType const & body = device.segment(7);
79 SegmentType const & body_contact = device.segment(8);
80
82 std::cout << "* init_device(): Setting materials..." << std::endl;
83 device.set_material(viennashe::materials::metal(), gate_contact);
84 device.set_material(viennashe::materials::metal(), source_contact);
85 device.set_material(viennashe::materials::metal(), drain_contact);
86 device.set_material(viennashe::materials::metal(), body_contact);
87
88 device.set_material(viennashe::materials::hfo2(), gate_oxide);
89
90 device.set_material(viennashe::materials::si(), source);
91 device.set_material(viennashe::materials::si(), drain);
92 device.set_material(viennashe::materials::si(), body);
93
100 std::cout << "* init_device(): Setting doping..." << std::endl;
101 device.set_doping_n(1e24, source);
102 device.set_doping_p(1e8, source);
103
104 device.set_doping_n(1e24, drain);
105 device.set_doping_p(1e8, drain);
106
107 device.set_doping_n(1e17, body);
108 device.set_doping_p(1e15, body);
109
114 device.set_contact_potential(0.8, gate_contact);
115 device.set_contact_potential(0.0, source_contact);
116 device.set_contact_potential(0.1, drain_contact);
117 device.set_contact_potential(0.0, body_contact);
118
119}
120
121
130int main()
131{
137 typedef DeviceType::segment_type SegmentType;
138
139 std::cout << viennashe::preamble() << std::endl;
140
147 std::cout << "* main(): Creating and scaling device..." << std::endl;
148 DeviceType device;
149 device.load_mesh("../examples/data/mosfet840.mesh");
150 device.scale(1e-9);
151
152
156 std::cout << "* main(): Initializing device..." << std::endl;
157 init_device(device);
158
167 std::cout << "* main(): Creating DD simulator..." << std::endl;
168
176 viennashe::config dd_cfg;
177
178 // Nonlinear solver parameters: 50 Gummel iterations with moderate damping
179 dd_cfg.nonlinear_solver().max_iters(50);
180 dd_cfg.nonlinear_solver().damping(0.5);
181
184 dd_cfg.quantum_correction(true);
187 dd_cfg.with_quantum_correction(false);
188
195 viennashe::simulator<DeviceType> dd_simulator(device, dd_cfg);
196 std::cout << "* main(): Launching DD simulator..." << std::endl;
197 dd_simulator.run();
198
206 viennashe::io::write_quantities_to_VTK_file(dd_simulator, "mosfet-dg_dd_quan");
207
208 // Write only the density gradient correction to a separate VTK file:
209 viennashe::io::write_quantity_to_VTK_file(dd_simulator.dg_pot_n(), device, "mosfet-dg_dgpot");
210
215 SegmentType const & drain_contact = device.segment(4);
216 SegmentType const & body = device.segment(6);
217
218 std::cout << "* main(): Drain electron current Id_e = " << viennashe::get_terminal_current(device, viennashe::ELECTRON_TYPE_ID,
219 dd_simulator.potential(), dd_simulator.electron_density(),
221 body, drain_contact ) * 1e-6 << std::endl;
222 std::cout << "* main(): Drain hole current Id_h = " << viennashe::get_terminal_current(device, viennashe::HOLE_TYPE_ID,
223 dd_simulator.potential(), dd_simulator.hole_density(),
225 body, drain_contact ) * 1e-6 << std::endl;
226
240 std::cout << "* main(): Setting up first-order SHE (semi-self-consistent using 40 Gummel iterations)..." << std::endl;
241 viennashe::config config;
242
243 // Set the expansion order to 1 for a first-order SHE
244 config.max_expansion_order(1);
245
246 // Use both carrier types
247 config.with_electrons(true); config.with_holes(true);
248
249 // Configure equations: SHE for electrons, continuity for holes:
250 config.set_electron_equation(viennashe::EQUATION_SHE); // SHE for electrons
252
253 // Energy spacing of 31 meV
254 config.energy_spacing(31.0 * viennashe::physics::constants::q / 1000.0);
255
256 // Set the scattering mechanisms: We use phonon scattering, but no ionized impurity scattering
257 config.scattering().acoustic_phonon().enabled(true);
258 config.scattering().optical_phonon().enabled(true);
259 config.scattering().ionized_impurity().enabled(false);
260
261 // The linear solver should run for at most 2000 iterations:
262 config.linear_solver().max_iters(2000);
263
264 // The nonlinear solver should use up to 40 Gummel iterations with a damping parameter of 0.4:
265 config.nonlinear_solver().max_iters(40);
266 config.nonlinear_solver().damping(0.4);
267
268 // Configure the first-order quantum correction
269 config.quantum_correction(true); // Solve density gradient ...
270 config.with_quantum_correction(false); // ... but don't use it to correct the potential (cf. DD solver above)
271
279 std::cout << "* main(): Computing first-order SHE..." << std::endl;
280 viennashe::simulator<DeviceType> she_simulator(device, config);
281
282 // Set the previous DD solution as an initial guess
283 she_simulator.set_initial_guess(viennashe::quantity::potential(), dd_simulator.potential());
284 she_simulator.set_initial_guess(viennashe::quantity::electron_density(), dd_simulator.electron_density());
285 she_simulator.set_initial_guess(viennashe::quantity::hole_density(), dd_simulator.hole_density());
286 she_simulator.set_initial_guess(viennashe::quantity::density_gradient_electron_correction(), dd_simulator.dg_pot_n());
287 she_simulator.set_initial_guess(viennashe::quantity::density_gradient_hole_correction(), dd_simulator.dg_pot_p());
288
289 // Run the simulation
290 she_simulator.run();
291
297 std::cout << "* main(): Writing energy distribution function from first-order SHE result..." << std::endl;
299 she_simulator.config(),
300 she_simulator.quantities().electron_distribution_function(),
301 "mosfet-dg_she_edf");
302
304 viennashe::io::write_quantity_to_VTK_file(she_simulator.potential(), device, "mosfet-dg_she_potential");
305 viennashe::io::write_quantity_to_VTK_file(she_simulator.electron_density(), device, "mosfet-dg_she_electrons");
306
309 viennashe::io::write_quantities_to_VTK_file(she_simulator, "mosfet-dg_she_quan");
310
315 std::cout << "* main(): Drain electron current Id_e = " << viennashe::get_terminal_current(
316 device, config, she_simulator.quantities().electron_distribution_function(), body, drain_contact ) * 1e-6
317 << std::endl;
318
320 std::cout << "* main(): Results can now be viewed with your favorite VTK viewer (e.g. ParaView)." << std::endl;
321 std::cout << "* main(): Don't forget to scale the z-axis by about a factor of 1e12 when examining the distribution function." << std::endl;
322 std::cout << std::endl;
323 std::cout << "*********************************************************" << std::endl;
324 std::cout << "* ViennaSHE finished successfully *" << std::endl;
325 std::cout << "*********************************************************" << std::endl;
326
327 return EXIT_SUCCESS;
328
329}
330
The main SHE configuration class. To be adjusted by the user for his/her needs.
Definition: config.hpp:124
long max_expansion_order() const
Returns the current maximum expansion order.
Definition: config.hpp:369
bool with_holes() const
Returns true if holes are considered in the simulation.
Definition: config.hpp:234
bool quantum_correction() const
Definition: config.hpp:509
nonlinear_solver_config_type & nonlinear_solver()
Returns the configuration object for the nonlinear solver.
Definition: config.hpp:495
void set_electron_equation(equation_id equ_id)
Definition: config.hpp:231
linear_solver_config_type & linear_solver()
Returns the configuration object for the linear solver.
Definition: config.hpp:485
double energy_spacing() const
Returns the uniform energy spacing of discrete energies.
Definition: config.hpp:460
void set_hole_equation(equation_id equ_id)
Definition: config.hpp:239
bool with_electrons() const
Returns true if electrons are considered in the simulation.
Definition: config.hpp:226
viennashe::she::scatter_config & scattering()
Returns the configuration object for scattering.
Definition: config.hpp:475
bool with_quantum_correction() const
Definition: config.hpp:512
Defines the physical properties of a device, e.g. doping. This is the implementation for 2d and highe...
Definition: device.hpp:818
ionized_impurity_scattering_parameters const & ionized_impurity() const
Returns the parameters for ionized impurity scattering. Const-version.
Definition: config.hpp:377
acoustic_phonon_scattering_parameters const & acoustic_phonon() const
Returns the parameters for acoustic phonon scattering. Const-version.
Definition: config.hpp:367
optical_phonon_scattering_parameters const & optical_phonon() const
Returns the parameters for optical phonon scattering. Const-version.
Definition: config.hpp:372
Class for self-consistent SHE simulations.
Definition: simulator.hpp:675
std::size_t max_iters() const
Returns the maximum number of iterative linear solver iterations.
Definition: config.hpp:155
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
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
void write_quantities_to_VTK_file(viennashe::simulator< DeviceType > const &simulator_obj, std::string filename, bool include_debug_information=false)
Generic interface function for writing simulated quantities to a VTK file.
void write_quantity_to_VTK_file(QuantityType const &quantity, DeviceType const &device, std::string filename, std::string name_in_file="viennashe_quantity")
Generic interface function for writing a quantity to a VTK file. Automatically dispatches between ver...
viennashe::models::dd::mobility< DeviceType > create_constant_mobility_model(DeviceType const &device, double mu)
Returns a mobility model, which always yields the same mobility.
Definition: mobility.hpp:61
std::string density_gradient_hole_correction()
std::string density_gradient_electron_correction()
std::string electron_density()
double get_terminal_current(DeviceT const &device, CurrentAccessorT const &current_accessor, SegmentT const &semiconductor, SegmentT const &terminal)
Returns the terminal current for a number of given vertices. Considers carrier flux and displacement ...
@ HOLE_TYPE_ID
Definition: forwards.h:188
@ ELECTRON_TYPE_ID
Definition: forwards.h:187
@ EQUATION_SHE
Definition: forwards.h:118
@ EQUATION_CONTINUITY
Definition: forwards.h:117
std::string preamble()
Prints the ViennaSHE preamble (header). Used in all the examples as well as the standalone-applicatio...
Definition: version.hpp:63
int main()
Definition: resistor1d-c.c:108
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
static const double q
Elementary charge.
Definition: constants.hpp:44