def test_WaterHeatPumpCoolingRequired(self):
        """Warning! Not validated yet and may have errors"""
        t_out = 35
        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.HeatPumpWater,
            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), -411.6)
        self.assertEqual(round(Office.cooling_sys_electricity, 2), 52.12)
        self.assertEqual(round(Office.heating_sys_electricity, 2), 0)
        self.assertEqual(round(Office.t_m, 2), 25.33)
        self.assertEqual(round(Office.cop, 2), 7.9)
        self.assertTrue(Office.has_cooling_demand)

        self.assertEqual(Office.lighting_demand, 0)
    def test_lightingrequired_infl(self):

        t_out = 10
        t_m_prev = 22
        # Internal heat gains, in Watts
        internal_gains = 10

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

        # Illuminance after transmitting through the window
        ill = 14000  # 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.6,
            thermal_capacitance_per_floor_area=165000,
            t_set_heating=20.0,
            t_set_cooling=26.0,
            max_cooling_energy_per_floor_area=-12.0,
            max_heating_energy_per_floor_area=12.0,
            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.t_m, 2), 22.43)
        self.assertEqual(Office.energy_demand, 0)
        self.assertEqual(round(Office.cooling_sys_electricity, 2), 0)
        self.assertEqual(round(Office.heating_sys_electricity, 2), 0)
        self.assertEqual(round(Office.lighting_demand, 2), 401.31)
Exemplo n.º 3
0
    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)
    SolarGains.append(SouthWindow.solar_gains)
    COP.append(Office.cop)

annualResults = pd.DataFrame({
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)

print(Office.floor_area)
print(Office.room_vol)
print(Office.total_internal_area)