Exemple #1
0
def test_declination():
    site = Site(latitude=47.68, longitude=-122.25, elevation=20.0)
    time = Time()
    solar_angles = SolarAngles(time=time, site=site)

    assert round(solar_angles.declination.max(), 2) == 23.45
    assert round(solar_angles.declination.min(), 2) == -23.45
Exemple #2
0
def test_equation_of_time():
    site = Site(latitude=47.68, longitude=-122.25, elevation=20.0)
    time = Time()
    solar_angles = SolarAngles(time=time, site=site)

    assert round(solar_angles.equation_of_time.max(), 1) == 16.4
    assert round(solar_angles.equation_of_time.min(), 1) == -14.3
Exemple #3
0
def test_gamma():
    site = Site(latitude=47.68, longitude=-122.25, elevation=20.0)
    time = Time()
    solar_angles = SolarAngles(time=time, site=site)

    assert round(solar_angles.gamma.max(), 0) == 359
    assert round(solar_angles.gamma.min(), 0) == 0
Exemple #4
0
def test_surface_init():
    site = Site()
    time = Time()
    solar_angles = SolarAngles(time=time, site=site)
    surface = Surface('surface1', azimuth=0, tilt=90, width=1, height=1)

    assert surface is not None
Exemple #5
0
def test_sun_surface_azimuth():
    site = Site(latitude=47.68, longitude=-122.25, elevation=20.0)
    time = Time()
    solar_angles = SolarAngles(time=time, site=site)
    surface = Surface('surface1', azimuth=0, tilt=90, width=1, height=1)
    surface_solar_angles = SurfaceSolarAngles(time, solar_angles, surface)

    assert round(surface_solar_angles.sun_surface_azimuth.max(), 0) == 90.0
    assert round(surface_solar_angles.sun_surface_azimuth.min(), 0) == 0.0
Exemple #6
0
def test_heat_transfer_surface_init():
    site = Site()
    time = Time()
    solar_angles = SolarAngles(time=time, site=site)
    weather = EPW(time)
    weather.direct_normal_radiation = np.ones(time.length)
    weather.diffuse_horizontal_radiation = np.ones(time.length)
    surface = Surface('surface1', azimuth=0, tilt=90, width=1, height=1)
    ht_surface = HeatTransferSurface('ht_surface1', time, solar_angles,
                                     weather, surface)

    assert ht_surface is not None
Exemple #7
0
def test_external_shortwave_radiation_init():
    settings = Settings('')
    site = Site()
    time = Time()
    solar_angles = SolarAngles(time=time, site=site)
    weather = EPW(time)
    weather.direct_normal_radiation = np.ones(time.length)
    weather.diffuse_horizontal_radiation = np.ones(time.length)
    surface = Surface('surface1', azimuth=0, tilt=90, width=1, height=1)
    surface_solar_angles = SurfaceSolarAngles(time, solar_angles, surface)
    external_shortwave_radiation = ExternalShortwaveRadiation(
        time, solar_angles, weather, surface, surface_solar_angles)

    assert external_shortwave_radiation is not None
Exemple #8
0
def test_incident_diffuse_radiation():
    settings = Settings('')
    site = Site(latitude=0, longitude=0, elevation=0.0)
    time = Time()
    weather = EPW(time)
    weather.direct_normal_radiation = np.ones(time.length)
    weather.diffuse_horizontal_radiation = np.ones(time.length)
    solar_angles = SolarAngles(time=time, site=site)
    surface = Surface('surface1', azimuth=0, tilt=90, width=1, height=1)
    surface_solar_angles = SurfaceSolarAngles(time, solar_angles, surface)
    external_shortwave_radiation = ExternalShortwaveRadiation(
        time, solar_angles, weather, surface, surface_solar_angles)

    assert round(external_shortwave_radiation.incident_diffuse_radiation.max(),
                 2) == 1.3
    assert round(external_shortwave_radiation.incident_diffuse_radiation.min(),
                 2) == 0.55
Exemple #9
0
def test_solar_angles_init():
    site = Site()
    time = Time()
    solar_angles = SolarAngles(time=time, site=site)

    assert solar_angles is not None