def test_issue_4(self): """ uibei shouldn't fail when energy_lo == chem_potential """ try: ibei.uibei(2, 1., 300., 1.) except: self.fail("uibei fails when energy_lo == chem_potential")
def test_issue_2_uibei(self): """ Refactor of issue 2 focusing on uibei """ try: ibei.uibei(2, bandgap, temp_sun, 1.2) except: self.fail("Error raised with arguments.")
def photon_flux(self): """ Number of photons per unit time per unit area :returns: `astropy.units.Quantity` in units of :math:`s^{-1} cm^{-2}`. """ photon_flux = self.emissivity * uibei(2, 0, self.temp, 0) return photon_flux.to("1/(s*cm2)")
def photon_flux(self): """ Number of photons per unit time per unit area :returns: `astropy.units.Quantity` in units of :math:`s^{-1} cm^{-2}`. """ photon_flux = self.emissivity * uibei(2, self.bandgap, self.temp, 0) return photon_flux.to("1/(s*cm2)")
def calc_power_density(self): """ Solar cell power density The output power density is calculated according to DeVos's :cite:`9780198513926` Eq. 6.4. Note that this expression assumes fully concentrated sunlight and is therefore not completely general. This method returns values of type :class:`astropy.units.Quantity` with units of [W m^-2]. """ electron_energy = constants.e.si * self.voltage if self.bandgap == 0: solar_flux = units.Quantity(0., "1/(m2*s)") solar_cell_flux = units.Quantity(0., "1/(m2*s)") else: solar_flux = uibei(2, self.bandgap, self.temp_sun, 0) solar_cell_flux = uibei(2, self.bandgap, self.temp_planet, electron_energy) power_density = electron_energy * (solar_flux - solar_cell_flux) return power_density.to("W/m^2")
def calc_power_density(self): """ Solar cell power density The output power density is calculated according to a slight modification of Shockley & Queisser's :cite:`10.1063/1.1736034` Eq. 2.4. This method returns values of type :class:`astropy.units.Quantity` with units of [W m^-2]. """ if self.bandgap == 0: solar_flux = units.Quantity(0., "1/(m2*s)") else: solar_flux = uibei(2, self.bandgap, self.temp_sun, 0) power_density = self.bandgap * solar_flux return power_density.to("W/m^2")
def photon_energy_flux(self): """ Energy flux emitted by Stefan-Boltzmann radiation The energy flux (or power density) of Stefan-Boltzmann photons is given by .. math:: j = \\frac{2 \pi^{5} k^{4}}{15 c^{2} h^{3}} T^{4} :returns: `astropy.units.Quantity` in units of :math:`W cm^{-2}`. """ energy_flux = self.emissivity * uibei(3, 0, self.temp, 0) return energy_flux.to("W/cm2")
def photon_energy_flux(self): """ Energy flux emitted by Stefan-Boltzmann radiation The energy flux (or power density) of Stefan-Boltzmann photons is given by .. math:: j = \\frac{2 \pi^{5} k^{4}}{15 c^{2} h^{3}} T^{4} :returns: `astropy.units.Quantity` in units of :math:`W cm^{-2}`. """ energy_flux = self.emissivity * uibei(3, self.bandgap, self.temp, 0) return energy_flux.to("W/cm2")
def test_issue_31(self): """ Passing `energy_lo=0` with `chem_potential=0` should yield nonzero result """ energy_flux = ibei.uibei(3, 0., 300., 0.) self.assertGreater(energy_flux, 0)