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);
        }
        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);
        }
Example #3
0
        public void ConversionRoundTrip()
        {
            Energy joule = Energy.FromJoules(1);

            AssertEx.EqualTolerance(1, Energy.FromBritishThermalUnits(joule.BritishThermalUnits).Joules, BritishThermalUnitsTolerance);
            AssertEx.EqualTolerance(1, Energy.FromCalories(joule.Calories).Joules, CaloriesTolerance);
            AssertEx.EqualTolerance(1, Energy.FromDecathermsEc(joule.DecathermsEc).Joules, DecathermsEcTolerance);
            AssertEx.EqualTolerance(1, Energy.FromDecathermsImperial(joule.DecathermsImperial).Joules, DecathermsImperialTolerance);
            AssertEx.EqualTolerance(1, Energy.FromDecathermsUs(joule.DecathermsUs).Joules, DecathermsUsTolerance);
            AssertEx.EqualTolerance(1, Energy.FromElectronVolts(joule.ElectronVolts).Joules, ElectronVoltsTolerance);
            AssertEx.EqualTolerance(1, Energy.FromErgs(joule.Ergs).Joules, ErgsTolerance);
            AssertEx.EqualTolerance(1, Energy.FromFootPounds(joule.FootPounds).Joules, FootPoundsTolerance);
            AssertEx.EqualTolerance(1, Energy.FromGigabritishThermalUnits(joule.GigabritishThermalUnits).Joules, GigabritishThermalUnitsTolerance);
            AssertEx.EqualTolerance(1, Energy.FromGigawattHours(joule.GigawattHours).Joules, GigawattHoursTolerance);
            AssertEx.EqualTolerance(1, Energy.FromJoules(joule.Joules).Joules, JoulesTolerance);
            AssertEx.EqualTolerance(1, Energy.FromKilobritishThermalUnits(joule.KilobritishThermalUnits).Joules, KilobritishThermalUnitsTolerance);
            AssertEx.EqualTolerance(1, Energy.FromKilocalories(joule.Kilocalories).Joules, KilocaloriesTolerance);
            AssertEx.EqualTolerance(1, Energy.FromKilojoules(joule.Kilojoules).Joules, KilojoulesTolerance);
            AssertEx.EqualTolerance(1, Energy.FromKilowattHours(joule.KilowattHours).Joules, KilowattHoursTolerance);
            AssertEx.EqualTolerance(1, Energy.FromMegabritishThermalUnits(joule.MegabritishThermalUnits).Joules, MegabritishThermalUnitsTolerance);
            AssertEx.EqualTolerance(1, Energy.FromMegajoules(joule.Megajoules).Joules, MegajoulesTolerance);
            AssertEx.EqualTolerance(1, Energy.FromMegawattHours(joule.MegawattHours).Joules, MegawattHoursTolerance);
            AssertEx.EqualTolerance(1, Energy.FromThermsEc(joule.ThermsEc).Joules, ThermsEcTolerance);
            AssertEx.EqualTolerance(1, Energy.FromThermsImperial(joule.ThermsImperial).Joules, ThermsImperialTolerance);
            AssertEx.EqualTolerance(1, Energy.FromThermsUs(joule.ThermsUs).Joules, ThermsUsTolerance);
            AssertEx.EqualTolerance(1, Energy.FromWattHours(joule.WattHours).Joules, WattHoursTolerance);
        }
        public void TestWorkFunction()
        {
            var metal        = new Metal(Length.FromNanometers(10));
            var workFunction = Energy.FromElectronVolts(5);

            metal.SetWorkFunction(workFunction);

            Assert.AreEqual(metal.WorkFunction, workFunction);
        }
        /**
         * Find the distance to the conduction band in Cm when the energy is set to the
         * provided level.
         *
         * @param energy - energy level used to evaluate the structure.
         *
         * @return thickness - distance to conduction band in Cm.
         */
        public Length DistanceToConductionBand(Energy energy)
        {
            // find between which points the energy of interest lies
            // if energy is above all the points return 0 distance
            if (EvalPoints.All(p => ConductionBandEnergy(p) <= energy))
            {
                return(Length.Zero);
            }

            EvalPoint abovePoint  = null;
            EvalPoint belowPoint  = null;
            var       aboveEnergy = Energy.FromElectronVolts(1E10);
            var       belowEnergy = Energy.FromElectronVolts(-1E10);

            // a ridiculus start energy if we
            // find a point above the energy it will definately be lower than this value.
            foreach (var p in EvalPoints)
            {
                var cbEnergy = ConductionBandEnergy(p);
                if (cbEnergy > energy && cbEnergy < aboveEnergy)
                {
                    aboveEnergy = cbEnergy;
                    abovePoint  = p;
                }

                if (cbEnergy < energy && cbEnergy > belowEnergy)
                {
                    belowEnergy = cbEnergy;
                    belowPoint  = p;
                }
            }

            // if we didn't find a point in energy below the input energy then tunnel through whole dielectric
            if (belowPoint == null)
            {
                return(Thickness);
            }

            // make sure that we have above and below points
            if (belowPoint == null || abovePoint == null)
            {
                // we did something wrong
                return(null);                // negative thickness so we know something is wrong
            }

            // interpolate cross points
            var slope = (aboveEnergy - belowEnergy).ToPotential()
                        / (abovePoint.Location - belowPoint.Location);
            var intercept = aboveEnergy.ToPotential() - slope * abovePoint.Location;
            var distance  = (energy.ToPotential() - intercept) / slope;

            return(distance);
        }
        private static Semiconductor CreateTestSemiconductor()
        {
            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);

            return(semiconductor);
        }
        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 TestStructureWithOnlySemiconductorIsInvalid()
        {
            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);

            Assert.That(!structure.IsValid);
        }
Example #9
0
        public void ConversionRoundTrip()
        {
            Energy joule = Energy.FromJoules(1);

            Assert.AreEqual(1, Energy.FromBritishThermalUnits(joule.BritishThermalUnits).Joules, BritishThermalUnitsTolerance);
            Assert.AreEqual(1, Energy.FromCalories(joule.Calories).Joules, CaloriesTolerance);
            Assert.AreEqual(1, Energy.FromElectronVolts(joule.ElectronVolts).Joules, ElectronVoltsTolerance);
            Assert.AreEqual(1, Energy.FromErgs(joule.Ergs).Joules, ErgsTolerance);
            Assert.AreEqual(1, Energy.FromFootPounds(joule.FootPounds).Joules, FootPoundsTolerance);
            Assert.AreEqual(1, Energy.FromGigawattHours(joule.GigawattHours).Joules, GigawattHoursTolerance);
            Assert.AreEqual(1, Energy.FromJoules(joule.Joules).Joules, JoulesTolerance);
            Assert.AreEqual(1, Energy.FromKilocalories(joule.Kilocalories).Joules, KilocaloriesTolerance);
            Assert.AreEqual(1, Energy.FromKilojoules(joule.Kilojoules).Joules, KilojoulesTolerance);
            Assert.AreEqual(1, Energy.FromKilowattHours(joule.KilowattHours).Joules, KilowattHoursTolerance);
            Assert.AreEqual(1, Energy.FromMegajoules(joule.Megajoules).Joules, MegajoulesTolerance);
            Assert.AreEqual(1, Energy.FromMegawattHours(joule.MegawattHours).Joules, MegawattHoursTolerance);
            Assert.AreEqual(1, Energy.FromWattHours(joule.WattHours).Joules, WattHoursTolerance);
        }
        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);
        }
Example #11
0
        private static List <MaterialParameterViewModel> GetMetalParameterSection(Metal material)
        {
            var metalSection = new List <MaterialParameterViewModel>();
            var metalField   = new NumericMaterialParameterViewModel(ParameterType.WorkFunction)
            {
                Minimum  = 0.0,
                Maximum  = 10,
                StepSize = 0.1,
                Value    = material.WorkFunction?.ElectronVolts ?? 0.0
            };

            metalField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.WorkFunction = Energy.FromElectronVolts(metalField.Value);
            };

            metalSection.Add(GetThicknessSection(material));
            metalSection.Add(metalField);
            return(metalSection);
        }
Example #12
0
 /// <inheritdoc cref="Energy.FromElectronVolts(double?)"/>
 public static Energy?ElectronVolts(this double?value) => Energy.FromElectronVolts(value);
 /// <inheritdoc cref="Energy.FromElectronVolts(UnitsNet.QuantityValue)" />
 public static Energy ElectronVolts <T>(this T value) =>
 Energy.FromElectronVolts(Convert.ToDouble(value));
Example #14
0
        private static List <MaterialParameterViewModel> GetDielectricParameterSection(Dielectric material)
        {
            var dielectricSection = new List <MaterialParameterViewModel>();
            var bandGapField      = new NumericMaterialParameterViewModel(ParameterType.BandGap)
            {
                Minimum  = 0,
                Maximum  = 10,
                StepSize = 0.1,
                Value    = material.BandGap?.ElectronVolts ?? 0.0
            };

            bandGapField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.BandGap = Energy.FromElectronVolts(bandGapField.Value);
            };

            var eaField = new NumericMaterialParameterViewModel(ParameterType.ElectronAffinity)
            {
                Minimum  = 0,
                Maximum  = 5,
                StepSize = 0.05,
                Value    = material.ElectronAffinity?.ElectronVolts ?? 0.0
            };

            eaField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.ElectronAffinity = Energy.FromElectronVolts(eaField.Value);
            };

            var dcField = new NumericMaterialParameterViewModel(ParameterType.DielectricConstant)
            {
                Minimum  = .1,
                Maximum  = 30,
                StepSize = 1,
                Value    = material.DielectricConstant
            };

            dcField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.DielectricConstant = dcField.Value;
            };

            dielectricSection.Add(GetThicknessSection(material));
            dielectricSection.Add(bandGapField);
            dielectricSection.Add(eaField);
            dielectricSection.Add(dcField);

            return(dielectricSection);
        }
 public void NumberToElectronVoltsTest() =>
 Assert.Equal(Energy.FromElectronVolts(2), 2.ElectronVolts());
Example #16
0
 /// <inheritdoc cref="Energy.FromElectronVolts(double?)"/>
 public static Energy?ElectronVolts(this decimal?value) => Energy.FromElectronVolts(value == null ? (double?)null : Convert.ToDouble(value.Value));
Example #17
0
 /// <inheritdoc cref="Energy.FromElectronVolts(double)"/>
 public static Energy ElectronVolts(this decimal value) => Energy.FromElectronVolts(Convert.ToDouble(value));
Example #18
0
 /// <inheritdoc cref="Energy.FromElectronVolts(double?)"/>
 public static Energy?ElectronVolts(this float?value) => Energy.FromElectronVolts(value);
 public static Energy?ElectronVolts <T>(this T?value) where T : struct => Energy.FromElectronVolts(value == null ? (double?)null : Convert.ToDouble(value.Value));
Example #20
0
 /// <inheritdoc cref="Energy.FromElectronVolts(double)"/>
 public static Energy ElectronVolts(this long value) => Energy.FromElectronVolts(value);
Example #21
0
        private static List <MaterialParameterViewModel> GetSemiconductorParameterSection(Semiconductor material)
        {
            var semiconductorSection = new List <MaterialParameterViewModel>();
            var bgField = new MaterialParameterViewModel <string>(ParameterType.SemiconductorBandGap)
            {
                Value = material.BandGap?.Expression
            };

            bgField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.BandGap = new MathExpression <Energy>(bgField.Value);
            };

            semiconductorSection.Add(bgField);

            var eaField = new NumericMaterialParameterViewModel(ParameterType.ElectronAffinity)
            {
                Minimum  = 0,
                Maximum  = 5,
                StepSize = 0.05,
                Value    = material.ElectronAffinity?.ElectronVolts ?? 0.0
            };

            eaField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.ElectronAffinity = Energy.FromElectronVolts(eaField.Value);
            };

            semiconductorSection.Add(eaField);

            var dcField = new NumericMaterialParameterViewModel(ParameterType.DielectricConstant)
            {
                Minimum  = 0,
                Maximum  = 30,
                StepSize = 1,
                Value    = material.DielectricConstant
            };

            dcField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.DielectricConstant = dcField.Value;
            };

            semiconductorSection.Add(dcField);

            var iccField = new MaterialParameterViewModel <string>(ParameterType.IntrinsicCarrierConcentration)
            {
                Value = material.IntrinsicCarrierConcentration?.Expression
            };

            iccField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.IntrinsicCarrierConcentration = new MathExpression <Concentration>(iccField.Value);
            };

            semiconductorSection.Add(iccField);

            var dtField = new MaterialParameterViewModel <DopingType>(ParameterType.DopingType)
            {
                Value = material.DopingType
            };

            dtField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.DopingType = dtField.Value;
            };

            semiconductorSection.Add(dtField);

            var dopCField = new MaterialParameterViewModel <string>(ParameterType.DopantConcentration)
            {
                Value = material.DopantConcentration?.Expression
            };

            dopCField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.DopantConcentration = new MathExpression <Concentration>(dopCField.Value);
            };

            semiconductorSection.Add(dopCField);

            var tempField = new NumericMaterialParameterViewModel(ParameterType.Temperature)
            {
                Minimum  = 100.0,
                Maximum  = 500.0,
                StepSize = 25.0,
                Value    = material.Temperature?.Kelvin ?? 0.0
            };

            tempField.PropertyChanged += (sender, e) =>
            {
                if (e.PropertyName != "Value")
                {
                    return;
                }
                material.Temperature = new Temperature(tempField.Value);
            };

            semiconductorSection.Add(tempField);

            return(semiconductorSection);
        }