コード例 #1
0
ファイル: test_material.py プロジェクト: secondmover/pyidf
    def test_create_material(self):

        pyidf.validation_level = ValidationLevel.error

        obj = Material()
        # alpha
        var_name = "Name"
        obj.name = var_name
        # alpha
        var_roughness = "VeryRough"
        obj.roughness = var_roughness
        # real
        var_thickness = 1.50005
        obj.thickness = var_thickness
        # real
        var_conductivity = 0.0001
        obj.conductivity = var_conductivity
        # real
        var_density = 0.0001
        obj.density = var_density
        # real
        var_specific_heat = 100.0
        obj.specific_heat = var_specific_heat
        # real
        var_thermal_absorptance = 0.500045
        obj.thermal_absorptance = var_thermal_absorptance
        # real
        var_solar_absorptance = 0.5
        obj.solar_absorptance = var_solar_absorptance
        # real
        var_visible_absorptance = 0.5
        obj.visible_absorptance = var_visible_absorptance

        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.materials[0].name, var_name)
        self.assertEqual(idf2.materials[0].roughness, var_roughness)
        self.assertAlmostEqual(idf2.materials[0].thickness, var_thickness)
        self.assertAlmostEqual(idf2.materials[0].conductivity, var_conductivity)
        self.assertAlmostEqual(idf2.materials[0].density, var_density)
        self.assertAlmostEqual(idf2.materials[0].specific_heat, var_specific_heat)
        self.assertAlmostEqual(idf2.materials[0].thermal_absorptance, var_thermal_absorptance)
        self.assertAlmostEqual(idf2.materials[0].solar_absorptance, var_solar_absorptance)
        self.assertAlmostEqual(idf2.materials[0].visible_absorptance, var_visible_absorptance)
コード例 #2
0
ファイル: test_material.py プロジェクト: secondmover/pyidf
    def test_create_material(self):

        pyidf.validation_level = ValidationLevel.error

        obj = Material()
        # alpha
        var_name = "Name"
        obj.name = var_name
        # alpha
        var_roughness = "VeryRough"
        obj.roughness = var_roughness
        # real
        var_thickness = 1.50005
        obj.thickness = var_thickness
        # real
        var_conductivity = 0.0001
        obj.conductivity = var_conductivity
        # real
        var_density = 0.0001
        obj.density = var_density
        # real
        var_specific_heat = 100.0
        obj.specific_heat = var_specific_heat
        # real
        var_thermal_absorptance = 0.500045
        obj.thermal_absorptance = var_thermal_absorptance
        # real
        var_solar_absorptance = 0.5
        obj.solar_absorptance = var_solar_absorptance
        # real
        var_visible_absorptance = 0.5
        obj.visible_absorptance = var_visible_absorptance

        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.materials[0].name, var_name)
        self.assertEqual(idf2.materials[0].roughness, var_roughness)
        self.assertAlmostEqual(idf2.materials[0].thickness, var_thickness)
        self.assertAlmostEqual(idf2.materials[0].conductivity,
                               var_conductivity)
        self.assertAlmostEqual(idf2.materials[0].density, var_density)
        self.assertAlmostEqual(idf2.materials[0].specific_heat,
                               var_specific_heat)
        self.assertAlmostEqual(idf2.materials[0].thermal_absorptance,
                               var_thermal_absorptance)
        self.assertAlmostEqual(idf2.materials[0].solar_absorptance,
                               var_solar_absorptance)
        self.assertAlmostEqual(idf2.materials[0].visible_absorptance,
                               var_visible_absorptance)
コード例 #3
0
    obj12 = SiteGroundTemperatureBuildingSurface()
    obj12.january_ground_temperature = 18.3
    obj12.february_ground_temperature = 18.2
    obj12.march_ground_temperature = 18.3
    obj12.april_ground_temperature = 18.4
    obj12.may_ground_temperature = 20.1
    obj12.june_ground_temperature = 22.0
    obj12.july_ground_temperature = 22.3
    obj12.august_ground_temperature = 22.5
    obj12.september_ground_temperature = 22.5
    obj12.october_ground_temperature = 20.7
    obj12.november_ground_temperature = 18.9
    obj12.december_ground_temperature = 18.5
    idf.add(obj12)

    obj13 = Material()
    obj13.name = "PLASTERBOARD-1"
    obj13.roughness = "MediumSmooth"
    obj13.thickness = 0.012
    obj13.conductivity = 0.16
    obj13.density = 950.0
    obj13.specific_heat = 840.0
    obj13.thermal_absorptance = 0.9
    obj13.solar_absorptance = 0.6
    obj13.visible_absorptance = 0.6
    idf.add(obj13)

    obj14 = Material()
    obj14.name = "FIBERGLASS QUILT-1"
    obj14.roughness = "Rough"
    obj14.thickness = 0.066
コード例 #4
0
    obj12 = SiteGroundTemperatureBuildingSurface()
    obj12.january_ground_temperature = 18.3
    obj12.february_ground_temperature = 18.2
    obj12.march_ground_temperature = 18.3
    obj12.april_ground_temperature = 18.4
    obj12.may_ground_temperature = 20.1
    obj12.june_ground_temperature = 22.0
    obj12.july_ground_temperature = 22.3
    obj12.august_ground_temperature = 22.5
    obj12.september_ground_temperature = 22.5
    obj12.october_ground_temperature = 20.7
    obj12.november_ground_temperature = 18.9
    obj12.december_ground_temperature = 18.5
    idf.add(obj12)

    obj13 = Material()
    obj13.name = "PLASTERBOARD-1"
    obj13.roughness = "MediumSmooth"
    obj13.thickness = 0.012
    obj13.conductivity = 0.16
    obj13.density = 950.0
    obj13.specific_heat = 840.0
    obj13.thermal_absorptance = 0.9
    obj13.solar_absorptance = 0.6
    obj13.visible_absorptance = 0.6
    idf.add(obj13)

    obj14 = Material()
    obj14.name = "FIBERGLASS QUILT-1"
    obj14.roughness = "Rough"
    obj14.thickness = 0.066