private static Structure CreateMIMTestStructure()
        {
            var topMetal = new Metal(Length.FromNanometers(4));

            topMetal.SetWorkFunction(Energy.FromElectronVolts(4.45));

            var oxide = new Dielectric(Length.FromNanometers(2));

            oxide.DielectricConstant = 3.9;
            oxide.BandGap            = Energy.FromElectronVolts(8.9);
            oxide.ElectronAffinity   = Energy.FromElectronVolts(0.95);

            var bottomMetal = new Metal(Length.FromNanometers(4));

            bottomMetal.SetWorkFunction(Energy.FromElectronVolts(4.45));

            var structure = new Structure();

            structure.Temperature = new Temperature(300);
            structure.AddLayer(bottomMetal);
            structure.AddLayer(oxide);
            structure.AddLayer(topMetal);

            return(structure);
        }
        private static Structure CreateSiO2TestStructure()
        {
            var topMetal = new Metal(Length.FromNanometers(4));

            topMetal.SetWorkFunction(Energy.FromElectronVolts(4.45));

            var oxide = new Dielectric(Length.FromNanometers(2));

            oxide.DielectricConstant = 3.9;
            oxide.BandGap            = Energy.FromElectronVolts(8.9);
            oxide.ElectronAffinity   = Energy.FromElectronVolts(0.95);

            var semiconductor = new Semiconductor();

            semiconductor.BandGap                       = Energy.FromElectronVolts(1.1252);
            semiconductor.ElectronAffinity              = Energy.FromElectronVolts(4.05);
            semiconductor.DielectricConstant            = 11.7;
            semiconductor.IntrinsicCarrierConcentration = Concentration.FromPerCubicCentimeter(1.41E10);
            semiconductor.DopingType                    = DopingType.N;
            semiconductor.DopantConcentration           = Concentration.FromPerCubicCentimeter(1E18);

            var structure = new Structure();

            structure.Temperature = new Temperature(300);
            structure.AddLayer(semiconductor);
            structure.AddLayer(oxide);
            structure.AddLayer(topMetal);

            return(structure);
        }
        public void TestWorkFunction()
        {
            var metal        = new Metal(Length.FromNanometers(10));
            var workFunction = Energy.FromElectronVolts(5);

            metal.SetWorkFunction(workFunction);

            Assert.AreEqual(metal.WorkFunction, workFunction);
        }
        public void TestPotential()
        {
            var thickness = Length.FromNanometers(10);
            var metal     = new Metal(thickness);

            metal.SetWorkFunction(Energy.FromElectronVolts(5));

            var expectedPotential = ElectricPotential.Zero;

            var actualPotential = metal.GetPotential(thickness);

            Assert.AreEqual(expectedPotential, actualPotential);
        }
        public void TestStructureWithoutDielectricIsInvalid()
        {
            var topMetal = new Metal(Length.FromNanometers(10));

            topMetal.SetWorkFunction(Energy.FromElectronVolts(4.9));

            var semiconductor = new Semiconductor();

            semiconductor.BandGap                       = Energy.FromElectronVolts(1.125);
            semiconductor.ElectronAffinity              = Energy.FromElectronVolts(4.05);
            semiconductor.DielectricConstant            = 11.7;
            semiconductor.IntrinsicCarrierConcentration = Concentration.FromPerCubicCentimeter(1.41E10);
            semiconductor.DopingType                    = DopingType.N;
            semiconductor.DopantConcentration           = Concentration.FromPerCubicCentimeter(1E18);

            var structure = new Structure();

            structure.AddLayer(semiconductor);
            structure.AddLayer(topMetal);

            Assert.That(!structure.IsValid);
        }