def test_HVAC_building_tracker(hvacBuilding: HvacBuilding): # check that the temperature is getting cooler every time for i in range(10): hvacBuilding.step(0) assert len(hvacBuilding.GetHvacBuildingTracker().GetHouseTempArray()) > 9
def test_HVAC_off(hvacBuilding: HvacBuilding): """Tests the typical building gets colder and colder when the heater and cooler are both off Arguments: hvacBuilding {HvacBuilding} -- the hvac Building test fixture object """ # check that the temperature is getting cooler every time currentBuildingTemperature = 22 for i in range(10): hvacBuilding.step(0) assert hvacBuilding.current_temperature < currentBuildingTemperature currentBuildingTemperature = hvacBuilding.current_temperature
def test_WattsToDTH(hvacBuilding: HvacBuilding): """Tests the conversion of watts to DTH Arguments: hvacBuilding {HvacBuilding} -- the hvac Building test fixture object """ assert hvacBuilding.ConvertWattsToDTH(5000000, 3600) == pytest.approx(17.06, 0.01)
def test_HVAC_on(hvacBuilding: HvacBuilding): """Tests the typical building gets colder and colder when the heater and cooler are both off Arguments: hvacBuilding {HvacBuilding} -- the hvac Building test fixture object """ # check that the temperature is getting cooler every time currentBuildingTemperature = 22 # turn on the furnace, it shouldn't change for the first while till we have completed the startup # so it will say at 22 for the first section hvacBuilding.building_hvac.TurnHeatingOn() for i in range(60): hvacBuilding.step(55) assert hvacBuilding.current_temperature > currentBuildingTemperature currentBuildingTemperature = hvacBuilding.current_temperature assert hvacBuilding.building_hvac.TotalPowerUsed > 0
def hvacBuilding(): conditioned_floor_area = 100 return HvacBuilding( HVAC(), heat_mass_capacity=16500 * conditioned_floor_area, #heat_mass_capacity=165000 * conditioned_floor_area, heat_transmission=500, initial_building_temperature=22, conditioned_floor_area=conditioned_floor_area)
from tensorforce.contrib.openai_gym import OpenAIGym # Create an instance of HVAC to simulate the Furnance # use any parameters specific for your furnace hvac = HVAC() # Create the hvac building tracker to keep track of the simulation over time tracker = HvacBuildingTracker() # create the building model with the hvac and the tracker conditioned_floor_area = 100 hvacBuilding = HvacBuilding( hvac, heat_mass_capacity=16500 * conditioned_floor_area, heat_transmission=200, initial_building_temperature=18, conditioned_floor_area=conditioned_floor_area, hvacBuildingTracker = tracker ) environment = HvacBuildingEnvironment(hvacBuilding) # a set of temperatures in Northern Utah, USA for one day loganOutsideTemperatures = [1.11, 2.22, 1.67, 1.67, 2.22, 1.11, 1.11, 2.78, 4.44, 4.44, 5.56, 6.67, 6.67, 7.22, 6.67, 2.22, 2.22, 1.67, 1.11, 1.11, 0.56, 1.11, 0.00, 0.00] print() print("Starting Hvac Building Example") print() # simulate one day numberOfHeatingOn = 0 # for outsideTemperature in loganOutsideTemperatures:
from models import HvacBuilding from util import HvacBuildingTracker # Create an instance of HVAC to simulate the Furnance # use any parameters specific for your furnace hvac = HVAC() # Create the hvac building tracker to keep track of the simulation over time tracker = HvacBuildingTracker() # create the building model with the hvac and the tracker conditioned_floor_area = 100 hvacBuilding = HvacBuilding(hvac, heat_mass_capacity=16500 * conditioned_floor_area, heat_transmission=200, initial_building_temperature=18, conditioned_floor_area=conditioned_floor_area, hvacBuildingTracker=tracker) # a set of temperatures in Northern Utah, USA for one day loganOutsideTemperatures_October = [ 1.11, 2.22, 1.67, 1.67, 2.22, 1.11, 1.11, 2.78, 4.44, 4.44, 5.56, 6.67, 6.67, 7.22, 6.67, 2.22, 2.22, 1.67, 1.11, 1.11, 0.56, 1.11, 0.00, 0.00 ] loganOutsideTemperatures = [ -7, -8, -8, -8, -8, -9, -10, -9, -8, -7, -4, -2, -3, -2, -2, -1, -2, -3, -3, -4, -4, -4, -4, -4 ] print() print("Starting Hvac Building Example")