def declination_angle(day_of_year): """ Declination angle, in degrees, as a func. of day of year. (Seasonality) :param day_of_year: Julian day (1 == Jan. 1, 365 == Dec. 31) :return: Declination angle [deg] """ # Declination (seasonality) # Source: https://www.pveducation.org/pvcdrom/properties-of-sunlight/declination-angle return -23.45 * cosd(360 / 365 * (day_of_year + 10)) # in degrees
def solar_elevation_angle(latitude, day_of_year, time): """ Elevation angle of the sun [degrees] for a local observer. :param latitude: Latitude [degrees] :param day_of_year: Julian day (1 == Jan. 1, 365 == Dec. 31) :param time: Time after local solar noon [seconds] :return: Solar elevation angle [degrees] (angle between horizon and sun). Returns 0 if the sun is below the horizon. """ # Solar elevation angle (including seasonality, latitude, and time of day) # Source: https://www.pveducation.org/pvcdrom/properties-of-sunlight/elevation-angle declination = declination_angle(day_of_year) solar_elevation_angle = cas.asin( sind(declination) * sind(latitude) + cosd(declination) * cosd(latitude) * cosd(time / 86400 * 360) ) * 180 / cas.pi # in degrees solar_elevation_angle = cas.fmax(solar_elevation_angle, 0) return solar_elevation_angle
def solar_flux_outside_atmosphere_normal(day_of_year): """ Normal solar flux at the top of the atmosphere (variation due to orbital eccentricity) :param day_of_year: Julian day (1 == Jan. 1, 365 == Dec. 31) :return: Solar flux [W/m^2] """ # Space effects # # Source: https://www.itacanet.org/the-sun-as-a-source-of-energy/part-2-solar-energy-reaching-the-earths-surface/#2.1.-The-Solar-Constant # solar_flux_outside_atmosphere_normal = 1367 * (1 + 0.034 * cas.cos(2 * cas.pi * (day_of_year / 365.25))) # W/m^2; variation due to orbital eccentricity # Source: https://www.pveducation.org/pvcdrom/properties-of-sunlight/solar-radiation-outside-the-earths-atmosphere return 1366 * ( 1 + 0.033 * cosd(360 * (day_of_year - 2) / 365)) # W/m^2; variation due to orbital eccentricity
def incidence_angle_function(latitude, day_of_year, time, scattering=True): """ What is the fraction of insolation that a horizontal surface will receive as a function of sun position in the sky? :param latitude: Latitude [degrees] :param day_of_year: Julian day (1 == Jan. 1, 365 == Dec. 31) :param time: Time since (local) solar noon [seconds] :param scattering: Boolean: include scattering effects at very low angles? """ # Old description: # To first-order, this is true. In class, Kevin Uleck claimed that you have higher-than-cosine losses at extreme angles, # since you get reflection losses. However, an experiment by Sharma appears to not reproduce this finding, showing only a # 0.4-percentage-point drop in cell efficiency from 0 to 60 degrees. So, for now, we'll just say it's a cosine loss. # Sharma: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6611928/ elevation_angle = solar_elevation_angle(latitude, day_of_year, time) theta = 90 - elevation_angle # Angle between panel normal and the sun, in degrees cosine_factor = cosd(theta) if not scattering: return cosine_factor else: return cosine_factor * scattering_factor(elevation_angle)