Esempio n. 1
0
def test_tutorial_3():
    IDF.setiddname("C:/EnergyPlusV9-1-0/Energy+.idd", testing=True)
    idf = IDF("C:/EnergyPlusV9-1-0/ExampleFiles/Minimal.idf")
    idf.epw = "USA_CO_Golden-NREL.724666_TMY3.epw"
    idf.add_block(
        name="Two storey",
        coordinates=[(10, 0), (10, 5), (0, 5), (0, 0)],
        height=6,
        num_stories=2,
    )
    idf.add_block(name="One storey",
                  coordinates=[(10, 5), (10, 10), (0, 10), (0, 5)],
                  height=3)
    idf.intersect_match()
    idf.set_wwr(0.25, construction="Project External Window")
    idf.set_default_constructions()
    for c in idf.idfobjects["CONSTRUCTION"]:
        print(c)
    print(idf.getobject("MATERIAL", "DefaultMaterial"))
    print(idf.getobject("WINDOWMATERIAL:SIMPLEGLAZINGSYSTEM",
                        "DefaultGlazing"))

    src_idf = IDF("C:/EnergyPlusV9-1-0/ExampleFiles/WindowTestsSimple.idf")
    copy_constructions(source_idf=src_idf, target_idf=idf)
    for c in idf.idfobjects["CONSTRUCTION"]:
        print(c)
    for wall in idf.getsubsurfaces("wall"):
        wall.Construction_Name = "EXTERIOR"
    for roof in idf.getsubsurfaces("roof"):
        roof.Construction_Name = "ROOF31"
    for floor in idf.getsubsurfaces("floor"):
        floor.Construction_Name = "FLOOR38"
    idf.run(output_directory="tests/tutorial")
Esempio n. 2
0
move_to_origin(coordinates)
idf.set_default_constructions(
)  # INSTEAD OF THIS I NEED TO ASSIGN MATERIALS FOR EACH SURFACE
idf.match()

print("- Set Construction and Match")
#######################################################################################################################
# adding external windows for non adjacent to shading blocks

wwr_zones = {"vivienda": 0.2, "comercio": 0.7, "comun": 0.2}
custom_wwr(wwr_zones, construction="Project External Window")

shading_srfs = idf.getshadingsurfaces()
block_srfs = idf.getsurfaces("Wall")
windows = idf.getsubsurfaces("window")

shading_block = []
for i in shading_srfs:
    if 'L_block' in i.Name: shading_block.append(i)

adj_walls = []
for i in range(len(block_srfs)):
    for j in shading_block:
        ad = (populate_adjacencies(block_srfs[i], j))
        if ad:
            adj_walls.append(block_srfs[i])
            break

m = 0
for i in range(len(windows)):