PLaSK library
Loading...
Searching...
No Matches
cond2d.py
Go to the documentation of this file.
1#!/usr/bin/env python3
2# This file is part of PLaSK (https://plask.app) by Photonics Group at TUL
3# Copyright (c) 2022 Lodz University of Technology
4#
5# This program is free software: you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation, version 3.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13
14import unittest
15
16from numpy import *
17
18from plask import *
19from plask import material, geometry, mesh
20from electrical.shockley import Shockley2D, ShockleyCyl, ActiveCond2D
21
22eps0 = 8.854187817e-6 # pF/µm
23
24@material.simple()
26 def cond(self, T):
27 return (1e+12, 1e+12)
28 def eps(self, T):
29 return 1.
30
31
33
34 def setUp(self):
35 rect = geometry.Rectangle(1000., 300., Conductor())
36 junc = geometry.Rectangle(1000., 0.2, 'GaAs')
37 junc.role = 'active'
38 stack = geometry.Stack2D()
39 stack.append(rect)
40 stack.append(junc)
41 stack.append(rect)
42 space = geometry.Cartesian2D(stack, length=1000.)
43 self.solver = ActiveCond2D("electrical2d")
44 self.solver.geometry = space
47 self.solver.mesh = generator
48 self.solver.cond = lambda U, j, T: 0.05 + abs(j)
49 self.solver.maxerr = 1e-5
52
54 self.solver.compute()
55 correct_current = 500.
56 self.assertAlmostEqual(self.solver.get_total_current(), correct_current, 3)
57
58
59if __name__ == '__main__':
60 test = unittest.main(exit=False)
61 show()