def test_CoolingRequired(self):
        t_out = 25
        t_m_prev = 24
        # Internal heat gains, in Watts
        internal_gains = 10

        # Solar heat gains after transmitting through the winow, in Watts
        solar_gains = 4000

        # Illuminance after transmitting through the window
        ill = 44000  # Lumens

        # Occupancy for the timestep [people/hour/square_meter]
        occupancy = 0.1

        # Set Zone Parameters
        Office = Zone(
            window_area=13.5,
            walls_area=15.19 - 13.5,
            floor_area=34.3,
            room_vol=106.33,
            total_internal_area=142.38,
            lighting_load=11.7,
            lighting_control=300,
            lighting_utilisation_factor=0.45,
            lighting_maintenance_factor=0.9,
            u_walls=0.2,
            u_windows=1.1,
            ach_vent=1.5,
            ach_infl=0.5,
            ventilation_efficiency=0,
            thermal_capacitance_per_floor_area=165000,
            t_set_heating=20,
            t_set_cooling=26,
            max_cooling_energy_per_floor_area=-12,
            max_heating_energy_per_floor_area=12,
            heating_supply_system=supply_system.DirectHeater,
            cooling_supply_system=supply_system.DirectCooler,
            heating_emission_system=emission_system.AirConditioning,
            cooling_emission_system=emission_system.AirConditioning,
        )

        Office.solve_energy(internal_gains, solar_gains, t_out, t_m_prev)
        Office.solve_lighting(ill, occupancy)

        self.assertEqual(round(Office.energy_demand, 2), -264.75)
        self.assertEqual(round(Office.cooling_sys_electricity, 2), 264.75)
        self.assertEqual(round(Office.heating_sys_electricity, 2), 0)
        self.assertEqual(round(Office.t_m, 2), 25.15)
        self.assertTrue(Office.has_cooling_demand)

        self.assertEqual(Office.lighting_demand, 0)
예제 #2
0
    Altitude, Azimuth = Zurich.calc_sun_position(
        latitude_deg=47.480, longitude_deg=8.536, year=2015, hoy=hour)

    SouthWindow.calc_solar_gains(sun_altitude=Altitude, sun_azimuth=Azimuth,
                                 normal_direct_radiation=Zurich.weather_data[
                                     'dirnorrad_Whm2'][hour],
                                 horizontal_diffuse_radiation=Zurich.weather_data['difhorrad_Whm2'][hour])

    SouthWindow.calc_illuminance(sun_altitude=Altitude, sun_azimuth=Azimuth,
                                 normal_direct_illuminance=Zurich.weather_data[
                                     'dirnorillum_lux'][hour],
                                 horizontal_diffuse_illuminance=Zurich.weather_data['difhorillum_lux'][hour])

    Office.solve_energy(internal_gains=internal_gains,
                        solar_gains=SouthWindow.solar_gains,
                        t_out=t_out,
                        t_m_prev=t_m_prev)

    Office.solve_lighting(
        illuminance=SouthWindow.transmitted_illuminance, occupancy=occupancy)

    # Set the previous temperature for the next time step
    t_m_prev = Office.t_m_next

    HeatingDemand.append(Office.heating_demand)
    HeatingEnergy.append(Office.heating_energy)
    CoolingDemand.append(Office.cooling_demand)
    CoolingEnergy.append(Office.cooling_energy)
    ElectricityOut.append(Office.electricity_out)
    IndoorAir.append(Office.t_air)
    OutsideTemp.append(t_out)
# Example Inputs
t_air = 10
t_m_prev = 22
internal_gains = 10  # Internal heat gains, in Watts
# Solar heat gains after transmitting through the winow [Watts]
solar_gains = 2000
ill = 44000  # Illuminance after transmitting through the window [Lumens]
occupancy = 0.1  # Occupancy for the timestep [people/hour/square_meter]

# Initialise an instance of the Zone. Empty brackets take on the
# default parameters. See ZonePhysics.py to see the default values
Office = Zone()

# Solve for Zone energy
Office.solve_energy(internal_gains, solar_gains, t_air, t_m_prev)

# Solve for Zone lighting
Office.solve_lighting(ill, occupancy)

print(Office.t_m)  # Printing Room Temperature of the medium

print(Office.lighting_demand)  # Print Lighting Demand
print(Office.energy_demand)  # Print heating/cooling loads

# Example of how to change the set point temperature after running a simulation
Office.theta_int_h_set = 20.0

# Solve again for the new set point temperature
Office.solve_energy(internal_gains, solar_gains, t_air, t_m_prev)