Esempio n. 1
0
    def test_create_building(self):

        pyidf.validation_level = ValidationLevel.error

        obj = Building()
        # alpha
        var_name = "Name"
        obj.name = var_name
        # real
        var_north_axis = 2.2
        obj.north_axis = var_north_axis
        # alpha
        var_terrain = "Country"
        obj.terrain = var_terrain
        # real
        var_loads_convergence_tolerance_value = 0.25005
        obj.loads_convergence_tolerance_value = var_loads_convergence_tolerance_value
        # real
        var_temperature_convergence_tolerance_value = 0.25005
        obj.temperature_convergence_tolerance_value = var_temperature_convergence_tolerance_value
        # alpha
        var_solar_distribution = "MinimalShadowing"
        obj.solar_distribution = var_solar_distribution
        # integer
        var_maximum_number_of_warmup_days = 1
        obj.maximum_number_of_warmup_days = var_maximum_number_of_warmup_days
        # integer
        var_minimum_number_of_warmup_days = 1
        obj.minimum_number_of_warmup_days = var_minimum_number_of_warmup_days

        idf = IDF()
        idf.add(obj)
        idf.save(self.path, check=False)

        with open(self.path, mode='r') as f:
            for line in f:
                log.debug(line.strip())

        idf2 = IDF(self.path)
        self.assertEqual(idf2.buildings[0].name, var_name)
        self.assertAlmostEqual(idf2.buildings[0].north_axis, var_north_axis)
        self.assertEqual(idf2.buildings[0].terrain, var_terrain)
        self.assertAlmostEqual(idf2.buildings[0].loads_convergence_tolerance_value, var_loads_convergence_tolerance_value)
        self.assertAlmostEqual(idf2.buildings[0].temperature_convergence_tolerance_value, var_temperature_convergence_tolerance_value)
        self.assertEqual(idf2.buildings[0].solar_distribution, var_solar_distribution)
        self.assertEqual(idf2.buildings[0].maximum_number_of_warmup_days, var_maximum_number_of_warmup_days)
        self.assertEqual(idf2.buildings[0].minimum_number_of_warmup_days, var_minimum_number_of_warmup_days)
Esempio n. 2
0
idf_file_path = r"Exercise1A.idf"


if __name__ == '__main__':

    logging.info("start")
    pyidf.validation_level = ValidationLevel.transition
    idf = IDF()

    obj1 = Version()
    obj1.version_identifier = "8.4"
    idf.add(obj1)

    obj2 = Building()
    obj2.name = "Exercise 1A"
    obj2.north_axis = 0.0
    obj2.terrain = "Country"
    obj2.loads_convergence_tolerance_value = 0.04
    obj2.temperature_convergence_tolerance_value = 0.4
    obj2.solar_distribution = "FullInteriorAndExterior"
    obj2.maximum_number_of_warmup_days = None
    obj2.minimum_number_of_warmup_days = 6
    idf.add(obj2)

    obj3 = Timestep()
    obj3.number_of_timesteps_per_hour = 4
    idf.add(obj3)

    obj4 = SurfaceConvectionAlgorithmInside()
    obj4.algorithm = "TARP"
    idf.add(obj4)
Esempio n. 3
0
idf_file_path = r"Exercise1A.idf"

if __name__ == '__main__':

    logging.info("start")
    pyidf.validation_level = ValidationLevel.transition
    idf = IDF()

    obj1 = Version()
    obj1.version_identifier = "8.4"
    idf.add(obj1)

    obj2 = Building()
    obj2.name = "Exercise 1A"
    obj2.north_axis = 0.0
    obj2.terrain = "Country"
    obj2.loads_convergence_tolerance_value = 0.04
    obj2.temperature_convergence_tolerance_value = 0.4
    obj2.solar_distribution = "FullInteriorAndExterior"
    obj2.maximum_number_of_warmup_days = None
    obj2.minimum_number_of_warmup_days = 6
    idf.add(obj2)

    obj3 = Timestep()
    obj3.number_of_timesteps_per_hour = 4
    idf.add(obj3)

    obj4 = SurfaceConvectionAlgorithmInside()
    obj4.algorithm = "TARP"
    idf.add(obj4)