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")
def test_tutorial_1(): 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="Boring hut", coordinates=[(10, 0), (10, 10), (0, 10), (0, 0)], height=3.5) idf.intersect_match() idf.set_wwr(0.6, construction="Project External Window") idf.set_default_constructions() idf.to_obj("tests/tutorial/boring_hut.obj") idf.run(output_directory="tests/tutorial")
finalGroundSurfaceCoordinatesList.append([(x[0] - 300950, x[1] - 5037400) for x in (groundSurface)]) from geomeppy import IDF IDF.setiddname('/Applications/EnergyPlus-9-2-0/Energy+.idd') idf = IDF('/Applications/EnergyPlus-9-2-0/ExampleFiles/Minimal.idf') idf.epw = '/Applications/EnergyPlus-9-2-0/WeatherData/USA_CA_San.Francisco.Intl.AP.724940_TMY3.epw' #for i in range(len(finalGroundSurfaceCoordinatesList)): for i in range(300, 500): idf.add_block(name='Block' + str(i), coordinates=finalGroundSurfaceCoordinatesList[i], height=differenceList[i]) idf.set_wwr(0.6) idf.view_model() idf.intersect_match() idf.translate_to_origin() idf.set_default_constructions() # Heating and cooling system stat = idf.newidfobject( "HVACTEMPLATE:THERMOSTAT", Name="Zone Stat", Constant_Heating_Setpoint=20, Constant_Cooling_Setpoint=25, ) for zone in idf.idfobjects["ZONE"]: idf.newidfobject( "HVACTEMPLATE:ZONE:IDEALLOADSAIRSYSTEM",
def test_tutorial_2(): 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_default_constructions() # add a heating system stat = idf.newidfobject( "HVACTEMPLATE:THERMOSTAT", Name="Zone Stat", Constant_Heating_Setpoint=20, Constant_Cooling_Setpoint=25, ) for zone in idf.idfobjects["ZONE"]: idf.newidfobject( "HVACTEMPLATE:ZONE:IDEALLOADSAIRSYSTEM", Zone_Name=zone.Name, Template_Thermostat_Name=stat.Name, ) # add some output variables idf.newidfobject( "OUTPUT:VARIABLE", Variable_Name="Zone Ideal Loads Supply Air Total Heating Energy", Reporting_Frequency="Hourly", ) idf.newidfobject( "OUTPUT:VARIABLE", Variable_Name="Zone Ideal Loads Supply Air Total Cooling Energy", Reporting_Frequency="Hourly", ) # run a set of simulations, moving glazing from mostly on the South facade, to mostly on the North facade north_wwr = [i / 10 for i in range(1, 10)] south_wwr = [1 - wwr for wwr in north_wwr] for north, south in zip(north_wwr, south_wwr): idf.set_wwr(north, construction="Project External Window", orientation="north") idf.set_wwr(south, construction="Project External Window", orientation="south") idf.run( output_prefix=f"{north}_{south}_", output_directory="tests/tutorial", expandobjects=True, verbose="q", ) results = [] for north, south in zip(north_wwr, south_wwr): eso = ESO(f"tests/tutorial/{north}_{south}_out.eso") heat = eso.total_kwh( "Zone Ideal Loads Supply Air Total Heating Energy") cool = eso.total_kwh( "Zone Ideal Loads Supply Air Total Cooling Energy") results.append([north, south, heat, cool, heat + cool]) # print out the results headers = ["WWR-N", "WWR-S", "Heat", "Cool", "Total"] header_format = "{:>10}" * (len(headers)) print(header_format.format(*headers)) row_format = "{:>10.1f}" * (len(headers)) for row in results: print(row_format.format(*row))
h_center[0] = h_center[0] + j[0] h_center[1] = h_center[1] + j[1] for k in range(2): h_center[k] = h_center[k] / (-n) idf.translate(h_center) move_to_origin() idf.set_default_constructions() idf.intersect_match() ####################################################################################################################### # adding external windows for non adjacent to shading blocks idf.set_wwr(wwr=0.4, construction="Project External Window") shading_srfs = idf.getshadingsurfaces() block_srfs = idf.getsurfaces("Wall") windows = idf.getsubsurfaces("window") adj_walls = [] for i in range(len(block_srfs)): for j in shading_srfs: ad = (populate_adjacencies(block_srfs[i], j)) if ad: adj_walls.append(block_srfs[i]) break m = 0 for i in range(len(windows)):