From 718d4053e1940f051ca8bcceef84123d7171af61 Mon Sep 17 00:00:00 2001 From: mlauster Date: Tue, 21 Jun 2016 16:17:27 +0200 Subject: [PATCH 01/23] fixes within issues for OpenModelica. melaten_campus.py and archetype.py work in Dymola 2016 FD01 and OpenModelica OMEdit v1.10.0-dev-131-g9b994a0 #254 --- teaser/data/output/aixlib_output.py | 39 +++++++++++++------ teaser/data/output/annex60_output.py | 5 ++- .../modelicatemplate/AixLib/AixLib_base | 1 + .../modelicatemplate/AixLib/AixLib_model | 1 + .../modelicatemplate/AixLib/AixLib_zone | 1 + .../Annex60/Annex60_FourElements | 1 + .../Annex60/Annex60_ThreeElements | 1 + .../Annex60/Annex60_TwoElements | 1 + teaser/data/output/modelicatemplate/package | 1 + 9 files changed, 38 insertions(+), 13 deletions(-) diff --git a/teaser/data/output/aixlib_output.py b/teaser/data/output/aixlib_output.py index f1d434cc8..971358b78 100644 --- a/teaser/data/output/aixlib_output.py +++ b/teaser/data/output/aixlib_output.py @@ -91,7 +91,7 @@ def export_aixlib(prj, aixlib.modelica_AHU_boundary(bldg=bldg, path=path + "\\" + bldg.name) aixlib.modelica_gains_boundary(bldg=bldg, path=path + "\\" + bldg.name) - _help_package(bldg_path, bldg.name) + _help_package(bldg_path, bldg.name, within=prj.name) _help_package_order(bldg_path, [bldg], None, bldg.name + "_DataBase") @@ -116,13 +116,17 @@ def export_aixlib(prj, zone_path + "\\" + bldg.name + "_" + zone.name.replace(" ", "") + ".mo"), 'w') out_file.write(zone_template.render_unicode( - bldg=bldg, zone=zone)) + bldg=bldg, + zone=zone, + mod_prj=prj.modelica_project)) out_file.close() - _help_package(zone_path, bldg.name + "_DataBase") - _help_package_order( - zone_path, bldg.thermal_zones, - bldg.name + "_", bldg.name + "_base") + _help_package(zone_path, + bldg.name + "_DataBase", + within=prj.name + '.' + bldg.name) + _help_package_order(zone_path, + bldg.thermal_zones, + bldg.name + "_", bldg.name + "_base") out_file = open(utilitis.get_full_path (zone_path + bldg.name + "_base.mo"), @@ -155,9 +159,10 @@ def export_aixlib(prj, utilitis.create_path(utilitis.get_full_path (bldg_path + bldg.name + "_DataBase")) - _help_package(bldg_path, bldg.name) + _help_package(bldg_path, bldg.name, within=prj.name) _help_package_order(bldg_path, [bldg], None, bldg.name + "_DataBase") + for zone in bldg.thermal_zones: zone_path = bldg_path + bldg.name + "_DataBase" + "\\" @@ -165,10 +170,20 @@ def export_aixlib(prj, zone_path + "\\" + bldg.name + "_" + zone.name.replace(" ", "") + ".mo"), 'w') out_file.write(zone_template.render_unicode( - bldg=bldg, zone=zone, - calc_core=bldg._calculation_method)) + bldg=bldg, + zone=zone, + calc_core=bldg._calculation_method, + mod_prj=prj.modelica_project)) out_file.close() + + _help_package(zone_path, + bldg.name + "_DataBase", + within=prj.name + '.' + bldg.name) + _help_package_order(zone_path, + bldg.thermal_zones, + bldg.name + "_", bldg.name + "_base") + print("Exports can be found here:") print(path) @@ -178,7 +193,7 @@ def export_aixlib(prj, -def _help_package(path, name, uses=None): +def _help_package(path, name, uses=None, within=""): '''creates a package.mo file private function, do not call @@ -197,7 +212,9 @@ def _help_package(path, name, uses=None): ("Data\\Output\\ModelicaTemplate\\package")) out_file = open( utilitis.get_full_path(path + "\\" + "package" + ".mo"), 'w') - out_file.write(package_template.render_unicode(name=name, uses=uses)) + out_file.write(package_template.render_unicode(name=name, + within=within, + uses=uses)) out_file.close() def _help_package_order(path, package_list, addition=None, extra=None): diff --git a/teaser/data/output/annex60_output.py b/teaser/data/output/annex60_output.py index 9b298a6b2..2ae17338a 100644 --- a/teaser/data/output/annex60_output.py +++ b/teaser/data/output/annex60_output.py @@ -69,7 +69,7 @@ def export_annex60(prj, utilitis.create_path(utilitis.get_full_path(bldg_path)) utilitis.create_path(utilitis.get_full_path(bldg_path+ "\\" + bldg.name + \ "_Models")) - aixlib_output._help_package(bldg_path, bldg.name) + aixlib_output._help_package(bldg_path, bldg.name, within=prj.name) aixlib_output._help_package_order(bldg_path, [bldg], None, @@ -87,7 +87,8 @@ def export_annex60(prj, merge_windows)) aixlib_output._help_package(zone_path, - bldg.name + "_Models") + bldg.name + "_Models", + within=prj.name + '.' + bldg.name) aixlib_output._help_package_order(zone_path, bldg.thermal_zones, (bldg.name + "_")) diff --git a/teaser/data/output/modelicatemplate/AixLib/AixLib_base b/teaser/data/output/modelicatemplate/AixLib/AixLib_base index 5eeeef9d2..e13b2349a 100644 --- a/teaser/data/output/modelicatemplate/AixLib/AixLib_base +++ b/teaser/data/output/modelicatemplate/AixLib/AixLib_base @@ -1,3 +1,4 @@ +within ${mod_prj}.${bldg.name}.${bldg.name}_DataBase; record ${bldg.name}_base "${bldg.name}_base" extends AixLib.DataBase.Buildings.BuildingBaseRecord( numZones = ${get_n(bldg.thermal_zones)}, diff --git a/teaser/data/output/modelicatemplate/AixLib/AixLib_model b/teaser/data/output/modelicatemplate/AixLib/AixLib_model index c72a98ff0..9e2a8c5dc 100644 --- a/teaser/data/output/modelicatemplate/AixLib/AixLib_model +++ b/teaser/data/output/modelicatemplate/AixLib/AixLib_model @@ -1,3 +1,4 @@ +within ${mod_prj}.${bldg.name}; model ${bldg.name} "This is the simulation model of ${bldg.name}" diff --git a/teaser/data/output/modelicatemplate/AixLib/AixLib_zone b/teaser/data/output/modelicatemplate/AixLib/AixLib_zone index ca1a87f7d..4b994d6f3 100644 --- a/teaser/data/output/modelicatemplate/AixLib/AixLib_zone +++ b/teaser/data/output/modelicatemplate/AixLib/AixLib_zone @@ -1,3 +1,4 @@ +within ${mod_prj}.${bldg.name}.${bldg.name}_DataBase; record ${bldg.name}_${zone.name.replace(" ", "")} "${bldg.name}_${zone.name.replace(" ", "")}" extends AixLib.DataBase.Buildings.ZoneBaseRecord( n = ${len(zone.tilt_wall)}, diff --git a/teaser/data/output/modelicatemplate/Annex60/Annex60_FourElements b/teaser/data/output/modelicatemplate/Annex60/Annex60_FourElements index a01c2dc7d..7fe36143e 100644 --- a/teaser/data/output/modelicatemplate/Annex60/Annex60_FourElements +++ b/teaser/data/output/modelicatemplate/Annex60/Annex60_FourElements @@ -1,3 +1,4 @@ +within ${within}; model ${bldg.name}_${zone.name.replace(" ", "")} "This is the simulation model of ${bldg.name}_${zone.name.replace(" ", "")}" diff --git a/teaser/data/output/modelicatemplate/Annex60/Annex60_ThreeElements b/teaser/data/output/modelicatemplate/Annex60/Annex60_ThreeElements index 9f70cccbf..8c34b05f3 100644 --- a/teaser/data/output/modelicatemplate/Annex60/Annex60_ThreeElements +++ b/teaser/data/output/modelicatemplate/Annex60/Annex60_ThreeElements @@ -1,3 +1,4 @@ +within ${within}; model ${bldg.name}_${zone.name.replace(" ", "")} "This is the simulation model of ${bldg.name}_${zone.name.replace(" ", "")}" diff --git a/teaser/data/output/modelicatemplate/Annex60/Annex60_TwoElements b/teaser/data/output/modelicatemplate/Annex60/Annex60_TwoElements index c71ae3b94..cb064b393 100644 --- a/teaser/data/output/modelicatemplate/Annex60/Annex60_TwoElements +++ b/teaser/data/output/modelicatemplate/Annex60/Annex60_TwoElements @@ -1,3 +1,4 @@ +within ${within}; model ${bldg.name}_${zone.name.replace(" ", "")} "This is the simulation model of ${bldg.name}_${zone.name.replace(" ", "")}" diff --git a/teaser/data/output/modelicatemplate/package b/teaser/data/output/modelicatemplate/package index 54c69105a..14e587063 100644 --- a/teaser/data/output/modelicatemplate/package +++ b/teaser/data/output/modelicatemplate/package @@ -1,3 +1,4 @@ +within ${within}; package ${name} extends Modelica.Icons.Package; From 24de70659c727b988d810b863dd8600dc178f3d0 Mon Sep 17 00:00:00 2001 From: MichaMans Date: Wed, 22 Jun 2016 08:52:23 +0200 Subject: [PATCH 02/23] #181 revised some os.path functions, replaced all double backslashes with single forwardslashes --- teaser/__init__.py | 2 +- teaser/data/output/aixlib_output.py | 32 +++++----- teaser/data/output/annex60_output.py | 10 +-- teaser/data/output/boundcond_output.py | 2 +- teaser/data/output/buildingelement_output.py | 2 +- teaser/data/output/text_output.py | 8 +-- .../archetypedistrict_simulation.py | 24 +++---- .../simulation/melaten_campus_simulation.py | 6 +- .../simulation/singlebuilding_simulation.py | 4 +- teaser/examples/verification/compareteaser.py | 2 +- .../verification/verification_room1.py | 2 +- .../verification/verification_room10.py | 2 +- .../verification/verification_room3.py | 2 +- .../verification/verification_room8.py | 2 +- teaser/gui/mainui.py | 64 +++++++++---------- .../archetypebuildings/nonresidential.py | 6 +- .../logic/archetypebuildings/residential.py | 6 +- .../boundaryconditions/boundaryconditions.py | 24 +++---- .../buildingsystems/buildingahu.py | 8 +-- teaser/logic/simulation/aixlib.py | 6 +- teaser/logic/utilities.py | 27 +++----- teaser/project.py | 20 +++--- tests/test_data.py | 8 +-- 23 files changed, 131 insertions(+), 138 deletions(-) diff --git a/teaser/__init__.py b/teaser/__init__.py index 491a60c22..4f8805bfa 100644 --- a/teaser/__init__.py +++ b/teaser/__init__.py @@ -18,7 +18,7 @@ else: raise Exception('This software runs on python versions 2.7 or >=3.3 only!') -new_path = utilitis.get_full_path("OutputData\\") +new_path = utilitis.get_full_path("OutputData") dire = os.path.dirname(new_path) diff --git a/teaser/data/output/aixlib_output.py b/teaser/data/output/aixlib_output.py index f1d434cc8..8882574dc 100644 --- a/teaser/data/output/aixlib_output.py +++ b/teaser/data/output/aixlib_output.py @@ -52,13 +52,13 @@ def export_aixlib(prj, # use the same zone templates for all exports zone_template = Template( filename=utilitis.get_full_path( - "Data\\Output\\ModelicaTemplate\\AixLib\\AixLib_zone")) + "Data/Output/ModelicaTemplate/AixLib/AixLib_zone")) model_template = Template( filename=utilitis.get_full_path( - "Data\\Output\\ModelicaTemplate\\AixLib\\AixLib_model")) + "Data/Output/ModelicaTemplate/AixLib/AixLib_model")) zone_base_template = Template( filename=utilitis.get_full_path( - "Data\\Output\\ModelicaTemplate\\AixLib\\AixLib_base")) + "Data/Output/ModelicaTemplate/AixLib/AixLib_base")) # list which contains exported buildings if internal_id is not None: exported_list_of_buildings = [bldg for bldg in @@ -83,13 +83,13 @@ def export_aixlib(prj, elif bldg.merge_windows_calc is False: calc_method = 'ebc' - bldg_path = path + "\\" + bldg.name + "\\" + bldg_path = path + "/" + bldg.name + "/" utilitis.create_path(utilitis.get_full_path(bldg_path)) utilitis.create_path(utilitis.get_full_path (bldg_path + bldg.name + "_DataBase")) - aixlib.modelica_set_temp(bldg=bldg, path=path + "\\" + bldg.name) - aixlib.modelica_AHU_boundary(bldg=bldg, path=path + "\\" + bldg.name) - aixlib.modelica_gains_boundary(bldg=bldg, path=path + "\\" + bldg.name) + aixlib.modelica_set_temp(bldg=bldg, path=path + "/" + bldg.name) + aixlib.modelica_AHU_boundary(bldg=bldg, path=path + "/" + bldg.name) + aixlib.modelica_gains_boundary(bldg=bldg, path=path + "/" + bldg.name) _help_package(bldg_path, bldg.name) _help_package_order(bldg_path, [bldg], None, @@ -110,10 +110,10 @@ def export_aixlib(prj, out_file.close() for zone in bldg.thermal_zones: - zone_path = bldg_path + bldg.name + "_DataBase" + "\\" + zone_path = bldg_path + bldg.name + "_DataBase" + "/" out_file = open(utilitis.get_full_path( - zone_path + "\\" + bldg.name + "_" + + zone_path + "/" + bldg.name + "_" + zone.name.replace(" ", "") + ".mo"), 'w') out_file.write(zone_template.render_unicode( bldg=bldg, zone=zone)) @@ -150,7 +150,7 @@ def export_aixlib(prj, _help_package_order(path, exported_list_of_buildings) for bldg in exported_list_of_buildings: - bldg_path = path + "\\" + bldg.name + "\\" + bldg_path = path + "/" + bldg.name + "/" utilitis.create_path(utilitis.get_full_path(bldg_path)) utilitis.create_path(utilitis.get_full_path (bldg_path + bldg.name + "_DataBase")) @@ -159,10 +159,10 @@ def export_aixlib(prj, _help_package_order(bldg_path, [bldg], None, bldg.name + "_DataBase") for zone in bldg.thermal_zones: - zone_path = bldg_path + bldg.name + "_DataBase" + "\\" + zone_path = bldg_path + bldg.name + "_DataBase" + "/" out_file = open(utilitis.get_full_path( - zone_path + "\\" + bldg.name + "_" + + zone_path + "/" + bldg.name + "_" + zone.name.replace(" ", "") + ".mo"), 'w') out_file.write(zone_template.render_unicode( bldg=bldg, zone=zone, @@ -194,9 +194,9 @@ def _help_package(path, name, uses=None): ''' package_template = Template(filename=utilitis.get_full_path - ("Data\\Output\\ModelicaTemplate\\package")) + ("Data/Output/ModelicaTemplate/package")) out_file = open( - utilitis.get_full_path(path + "\\" + "package" + ".mo"), 'w') + utilitis.get_full_path(path + "/" + "package" + ".mo"), 'w') out_file.write(package_template.render_unicode(name=name, uses=uses)) out_file.close() @@ -221,10 +221,10 @@ def _help_package_order(path, package_list, addition=None, extra=None): ''' order_template = Template(filename=utilitis.get_full_path - ("Data\\Output\\ModelicaTemplate\\package_order")) + ("Data/Output/ModelicaTemplate/package_order")) out_file = open( - utilitis.get_full_path(path + "\\" + "package" + ".order"), 'w') + utilitis.get_full_path(path + "/" + "package" + ".order"), 'w') out_file.write(order_template.render_unicode (list=package_list, addition=addition, extra=extra)) out_file.close() diff --git a/teaser/data/output/annex60_output.py b/teaser/data/output/annex60_output.py index 9b298a6b2..340bacd03 100644 --- a/teaser/data/output/annex60_output.py +++ b/teaser/data/output/annex60_output.py @@ -55,19 +55,19 @@ def export_annex60(prj, pass elif number_of_elements == 2: zone_template = Template(filename=utilitis.get_full_path( - "Data\\Output\\ModelicaTemplate\\Annex60\\Annex60_TwoElements")) + "Data/Output/ModelicaTemplate/Annex60/Annex60_TwoElements")) elif number_of_elements == 3: zone_template = Template(filename=utilitis.get_full_path( - "Data\\Output\\ModelicaTemplate\\Annex60\\Annex60_ThreeElements")) + "Data/Output/ModelicaTemplate/Annex60/Annex60_ThreeElements")) elif number_of_elements == 4: zone_template = Template(filename=utilitis.get_full_path( - "Data\\Output\\ModelicaTemplate\\Annex60\\Annex60_FourElements")) + "Data/Output/ModelicaTemplate/Annex60/Annex60_FourElements")) for bldg in exported_list_of_buildings: bldg_path = os.path.join(path, bldg.name) utilitis.create_path(utilitis.get_full_path(bldg_path)) - utilitis.create_path(utilitis.get_full_path(bldg_path+ "\\" + bldg.name + \ + utilitis.create_path(utilitis.get_full_path(bldg_path+ "/" + bldg.name + \ "_Models")) aixlib_output._help_package(bldg_path, bldg.name) aixlib_output._help_package_order(bldg_path, @@ -79,7 +79,7 @@ def export_annex60(prj, bldg.name+"_Models") out_file = open(utilitis.get_full_path( - zone_path + "\\" + bldg.name + "_" + + zone_path + "/" + bldg.name + "_" + zone.name.replace(" ", "") + ".mo"), 'w') out_file.write(zone_template.render_unicode(bldg=bldg, zone=zone, diff --git a/teaser/data/output/boundcond_output.py b/teaser/data/output/boundcond_output.py index 5009fae4c..213e7cb98 100644 --- a/teaser/data/output/boundcond_output.py +++ b/teaser/data/output/boundcond_output.py @@ -37,7 +37,7 @@ def save_bound_conditions(bound_cond, path=None, file_name=None): path = bound_cond.parent.parent.parent.data.path_uc xml_parse = bound_cond.parent.parent.parent.data.conditions_bind else: - path = path + "\\" + file_name + ".xml" + path = path + "/" + file_name + ".xml" try: xml_file = open(utilitis.get_full_path(path)) xml_parse = uc_bind.CreateFromDocument(xml_file.read()) diff --git a/teaser/data/output/buildingelement_output.py b/teaser/data/output/buildingelement_output.py index 38ac7d332..ca4e31fc8 100644 --- a/teaser/data/output/buildingelement_output.py +++ b/teaser/data/output/buildingelement_output.py @@ -38,7 +38,7 @@ def save_type_element(element, path=None, file_name=None): path = element.parent.parent.parent.data.path_tb xml_parse = element.parent.parent.parent.data.element_bind else: - path = path + "\\" + file_name + ".xml" + path = path + "/" + file_name + ".xml" try: xml_file = open(utilitis.get_full_path(path)) xml_parse = tb_bind.CreateFromDocument(xml_file.read()) diff --git a/teaser/data/output/text_output.py b/teaser/data/output/text_output.py index cfcaddab5..e5629b68c 100644 --- a/teaser/data/output/text_output.py +++ b/teaser/data/output/text_output.py @@ -19,16 +19,16 @@ def export_parameters_txt(prj, path): can be specified ''' if path is None: - path = "OutputData\\"+prj.name + path = "OutputData/"+prj.name else: - path = path+"\\"+prj.name + path = path+"/"+prj.name for bldg in prj.buildings: - bldg_path = path + "\\" + bldg.name + "\\" + bldg_path = path + "/" + bldg.name + "/" utilitis.create_path(utilitis.get_full_path(bldg_path)) readable_template = Template( filename=utilitis.get_full_path( - "Data\\Output\\TextTemplate\\ReadableBuilding")) + "Data/Output/TextTemplate/ReadableBuilding")) out_file = open(utilitis.get_full_path (bldg_path+"ReadableOutput.txt"), 'w') diff --git a/teaser/examples/simulation/archetypedistrict_simulation.py b/teaser/examples/simulation/archetypedistrict_simulation.py index 5d13461be..66ff82c4b 100644 --- a/teaser/examples/simulation/archetypedistrict_simulation.py +++ b/teaser/examples/simulation/archetypedistrict_simulation.py @@ -168,18 +168,18 @@ def example_type_district(): stored, in addition we need to define the path where the exported models are""" - outputdir_est1 = "D:\\Dymola_workspace\\EST1" - packagedir_est1 = "D:\\GIT\\TEASER\\teaser\\OutputData\\EST1" - outputdir_est1_retrofit = "D:\\Dymola_workspace\\EST1_Retrofit" - packagedir_est1_retrofit = "D:\\GIT\\TEASER\\teaser\\OutputData\\EST1_Retrofit" - outputdir_est4 = "D:\\Dymola_workspace\\EST4" - packagedir_est4 = "D:\\GIT\\TEASER\\teaser\\OutputData\\EST4" - outputdir_est4_retrofit = "D:\\Dymola_workspace\\EST4_Retrofit" - packagedir_est4_retrofit = "D:\\GIT\\TEASER\\teaser\\OutputData\\EST4_Retrofit" - outputdir_est7 = "D:\\Dymola_workspace\\EST7" - packagedir_est7 = "D:\\GIT\\TEASER\\teaser\\OutputData\\EST7" - outputdir_est7_retrofit = "D:\\Dymola_workspace\\EST7_Retrofit" - packagedir_est7_retrofit = "D:\\GIT\\TEASER\\teaser\\OutputData\\EST7_Retrofit" + outputdir_est1 = "D:/Dymola_workspace/EST1" + packagedir_est1 = "D:/GIT/TEASER/teaser/OutputData/EST1" + outputdir_est1_retrofit = "D:/Dymola_workspace/EST1_Retrofit" + packagedir_est1_retrofit = "D:/GIT/TEASER/teaser/OutputData/EST1_Retrofit" + outputdir_est4 = "D:/Dymola_workspace/EST4" + packagedir_est4 = "D:/GIT/TEASER/teaser/OutputData/EST4" + outputdir_est4_retrofit = "D:/Dymola_workspace/EST4_Retrofit" + packagedir_est4_retrofit = "D:/GIT/TEASER/teaser/OutputData/EST4_Retrofit" + outputdir_est7 = "D:/Dymola_workspace/EST7" + packagedir_est7 = "D:/GIT/TEASER/teaser/OutputData/EST7" + outputdir_est7_retrofit = "D:/Dymola_workspace/EST7_Retrofit" + packagedir_est7_retrofit = "D:/GIT/TEASER/teaser/OutputData/EST7_Retrofit" """ Now we need to create a simulation list for buildingspy diff --git a/teaser/examples/simulation/melaten_campus_simulation.py b/teaser/examples/simulation/melaten_campus_simulation.py index 15d5164f8..11542c37a 100644 --- a/teaser/examples/simulation/melaten_campus_simulation.py +++ b/teaser/examples/simulation/melaten_campus_simulation.py @@ -63,7 +63,7 @@ def main(): starttime = time.time() #Adjust this path to your TEASER teaser Examples path or whatever you want - this_path = "D:\\GIT\\TEASER\\teaser\\Examples" + this_path = "D:/GIT/TEASER/teaser/Examples" #path of the buildings xmls input_path = os.path.join(this_path, 'ExampleInputFiles', @@ -94,8 +94,8 @@ def main(): stored, in addition we need to define the path where the exported models are""" - outputDir = "D:\\TestCampusSimulation" - packageDir = output_path + "\\Reference" + "\\Project" + outputDir = "D:/TestCampusSimulation" + packageDir = output_path + "/Reference" + "/Project" """ Now we need to create a simulation list for buildingspy diff --git a/teaser/examples/simulation/singlebuilding_simulation.py b/teaser/examples/simulation/singlebuilding_simulation.py index 02fda080a..63f9c5b76 100644 --- a/teaser/examples/simulation/singlebuilding_simulation.py +++ b/teaser/examples/simulation/singlebuilding_simulation.py @@ -97,8 +97,8 @@ def main(): stored, in addition we need to define the path where the exported models are""" - outputDir = "D:\\TestCampusSimulation" - packageDir = output_path + "\\OneBuildingSim" + "\\Project" + outputDir = "D:/TestCampusSimulation" + packageDir = output_path + "/OneBuildingSim" + "/Project" """ Now we need to create a simulation list for buildingspy diff --git a/teaser/examples/verification/compareteaser.py b/teaser/examples/verification/compareteaser.py index d1d5664ff..752ccd728 100644 --- a/teaser/examples/verification/compareteaser.py +++ b/teaser/examples/verification/compareteaser.py @@ -16,7 +16,7 @@ prj = Project(False) prj.load_project(utilitis.get_full_path( - "examples\\examplefiles\\new.teaserXML")) + "examples/examplefiles/new.teaserXML")) ''' execute VDI calculation for single zone diff --git a/teaser/examples/verification/verification_room1.py b/teaser/examples/verification/verification_room1.py index c241b5bf0..442321a1f 100644 --- a/teaser/examples/verification/verification_room1.py +++ b/teaser/examples/verification/verification_room1.py @@ -23,7 +23,7 @@ def parameter_room1(): prj = Project(False) prj.load_project(utilitis.get_full_path( - "examples\\examplefiles\\VDI6007_Room1.teaserXML")) + "examples/examplefiles/VDI6007_Room1.teaserXML")) ''' execute VDI calculation for single zone diff --git a/teaser/examples/verification/verification_room10.py b/teaser/examples/verification/verification_room10.py index 55b263b1e..611f8f88f 100644 --- a/teaser/examples/verification/verification_room10.py +++ b/teaser/examples/verification/verification_room10.py @@ -27,7 +27,7 @@ def parameter_room10(): """We load the given test room defined in teaserXML-file""" prj.load_project(utilitis.get_full_path( - "examples\\examplefiles\\VDI6007_Room10.teaserXML")) + "examples/examplefiles/VDI6007_Room10.teaserXML")) """Then we calculate all parameter with the calculation core 'vdi', that is exactly as defined in VDI 6007-1.""" diff --git a/teaser/examples/verification/verification_room3.py b/teaser/examples/verification/verification_room3.py index ed1bf0760..a00fb87b7 100644 --- a/teaser/examples/verification/verification_room3.py +++ b/teaser/examples/verification/verification_room3.py @@ -20,7 +20,7 @@ def parameter_room3(): ''' prj = Project(False) prj.load_project(utilitis.get_full_path( - "examples\\examplefiles\\VDI6007_Room3.teaserXML")) + "examples/examplefiles/VDI6007_Room3.teaserXML")) ''' execute VDI calculation for single zone diff --git a/teaser/examples/verification/verification_room8.py b/teaser/examples/verification/verification_room8.py index 3de9caac6..341b2a99c 100644 --- a/teaser/examples/verification/verification_room8.py +++ b/teaser/examples/verification/verification_room8.py @@ -21,7 +21,7 @@ def parameter_room8(): ''' prj = Project(False) prj.load_project(utilitis.get_full_path( - "examples\\examplefiles\\VDI6007_Room8.teaserXML")) + "examples/examplefiles/VDI6007_Room8.teaserXML")) ''' execute VDI calculation for single zone diff --git a/teaser/gui/mainui.py b/teaser/gui/mainui.py index 63a2abb57..325e509ad 100644 --- a/teaser/gui/mainui.py +++ b/teaser/gui/mainui.py @@ -725,7 +725,7 @@ def __init__(self, parent=None, gui=True, dir=None, file=None): self.mask_label_3.setVisible(False) self.mask_label_3.setStyleSheet("background-color:rgba(0,0,0,80)") self.image_1 = QtGui.QPixmap() - self.image_1.load(utilitis.get_full_path("GUI\\GUIImages\\Bild1.png")) + self.image_1.load(utilitis.get_full_path("GUI/GUIImages/Bild1.png")) self.pix_label_1 = QtGui.QLabel(self.side_bar_group_box) self.pix_label_1.setPixmap(self.image_1) self.pix_label_1.setGeometry(QtCore.QRect(5, 500, 210, 137)) @@ -816,7 +816,7 @@ def __init__(self, parent=None, gui=True, dir=None, file=None): self.mask_label_4.setVisible(False) self.mask_label_4.setStyleSheet("background-color:rgba(0,0,0,80)") self.new_type_building_button = PictureButton(QtGui.QPixmap( - utilitis.get_full_path("GUI\\GUIImages\\Haus1.png")), + utilitis.get_full_path("GUI/GUIImages/Haus1.png")), self.ribbon_widget) self.new_type_building_button.setGeometry(QtCore.QRect(10, 5, 70, 70)) self.new_type_building_button.clicked.connect( @@ -827,7 +827,7 @@ def __init__(self, parent=None, gui=True, dir=None, file=None): self.new_type_building_label.setGeometry(QtCore.QRect(10, 80, 70, 25)) self.new_type_building_label.setText("C" + "reate Type- \nBuilding") self.new_empty_building_button = PictureButton(QtGui.QPixmap( - utilitis.get_full_path("GUI\\GUIImages\\NewEmptyBuilding.png")), + utilitis.get_full_path("GUI/GUIImages/NewEmptyBuilding.png")), self.ribbon_widget) self.new_empty_building_button.setGeometry(QtCore.QRect(95, 5, 70, 70)) self.new_empty_building_button.clicked.connect( @@ -838,7 +838,7 @@ def __init__(self, parent=None, gui=True, dir=None, file=None): self.new_empty_building_label.setGeometry(QtCore.QRect(95, 80, 70, 25)) self.new_empty_building_label.setText("Create Emp- \nty Building") self.add_zone_button = PictureButton(QtGui.QPixmap( - utilitis.get_full_path("GUI\\GUIImages\\AddZone.png")), + utilitis.get_full_path("GUI/GUIImages/AddZone.png")), self.ribbon_widget) self.add_zone_button.setGeometry(QtCore.QRect(180, 5, 70, 70)) self.add_zone_button.clicked.connect(self.add_thermal_zone) @@ -849,7 +849,7 @@ def __init__(self, parent=None, gui=True, dir=None, file=None): self.add_zone_label.setGeometry(QtCore.QRect(180, 80, 70, 25)) self.add_zone_label.setText("Create New \n Zone") self.delete_zone_button = PictureButton(QtGui.QPixmap( - utilitis.get_full_path("GUI\\GUIImages\\DeleteZone.png")), + utilitis.get_full_path("GUI/GUIImages/DeleteZone.png")), self.ribbon_widget) self.delete_zone_button.setGeometry(QtCore.QRect(265, 5, 70, 70)) self.delete_zone_button.clicked.connect(self.delete_thermal_zone) @@ -859,7 +859,7 @@ def __init__(self, parent=None, gui=True, dir=None, file=None): self.delete_label.setGeometry(QtCore.QRect(265, 80, 70, 25)) self.delete_label.setText("Delete Cur- \nrent Zone") self.edit_building_button = PictureButton(QtGui.QPixmap( - utilitis.get_full_path("GUI\\GUIImages\\EditBuilding.png")), + utilitis.get_full_path("GUI/GUIImages/EditBuilding.png")), self.ribbon_widget) self.edit_building_button.setGeometry(QtCore.QRect(350, 5, 70, 70)) self.edit_building_button.clicked.connect(self.edit_building) @@ -870,7 +870,7 @@ def __init__(self, parent=None, gui=True, dir=None, file=None): self.edit_label.setGeometry(QtCore.QRect(350, 80, 70, 25)) self.edit_label.setText("Edit\nBuilding") self.load_button = PictureButton(QtGui.QPixmap( - utilitis.get_full_path("GUI\\GUIImages\\Load.png")), + utilitis.get_full_path("GUI/GUIImages/Load.png")), self.ribbon_widget) self.load_button.setGeometry(QtCore.QRect(435, 5, 70, 70)) self.load_button.clicked.connect(self.load_building_button) @@ -879,7 +879,7 @@ def __init__(self, parent=None, gui=True, dir=None, file=None): self.load_label.setGeometry(QtCore.QRect(435, 80, 70, 25)) self.load_label.setText("Load\nBuilding") self.new_project_button = PictureButton(QtGui.QPixmap( - utilitis.get_full_path("GUI\\GUIImages\\Project_manager.png")), + utilitis.get_full_path("GUI/GUIImages/Project_manager.png")), self.ribbon_widget) self.new_project_button.setGeometry(QtCore.QRect(520, 5, 70, 70)) self.new_project_button.clicked.connect(self.create_new_project_ui) @@ -888,7 +888,7 @@ def __init__(self, parent=None, gui=True, dir=None, file=None): self.new_project_label.setGeometry(QtCore.QRect(520, 80, 70, 25)) self.new_project_label.setText("Create empty\nProject") self.open_simulation_button = PictureButton(QtGui.QPixmap( - utilitis.get_full_path("GUI\\GUIImages\\Keyschedule_rc4.png")), + utilitis.get_full_path("GUI/GUIImages/Keyschedule_rc4.png")), self.ribbon_widget) self.open_simulation_button.setGeometry(QtCore.QRect(605, 5, 70, 70)) self.open_simulation_button.clicked.connect( @@ -898,7 +898,7 @@ def __init__(self, parent=None, gui=True, dir=None, file=None): self.open_simulation_label.setGeometry(QtCore.QRect(605, 80, 70, 25)) self.open_simulation_label.setText("Open Simu-\n lation Tab") self.open_export_button = PictureButton(QtGui.QPixmap( - utilitis.get_full_path("GUI\\GUIImages\\Keyschedule_rc4.png")), + utilitis.get_full_path("GUI/GUIImages/Keyschedule_rc4.png")), self.ribbon_widget) self.open_export_button.setGeometry(QtCore.QRect(685, 5, 70, 70)) self.open_export_button.clicked.connect( @@ -908,7 +908,7 @@ def __init__(self, parent=None, gui=True, dir=None, file=None): self.open_export_label.setGeometry(QtCore.QRect(685, 80, 70, 25)) self.open_export_label.setText("Open Ex-\n port Tab") self.save_project_button = PictureButton(QtGui.QPixmap( - utilitis.get_full_path("GUI\\GUIImages\\Keyschedule_rc4.png")), + utilitis.get_full_path("GUI/GUIImages/Keyschedule_rc4.png")), self.ribbon_widget) self.save_project_button.setGeometry(QtCore.QRect(765, 5, 70, 70)) self.save_project_button.clicked.connect( @@ -1628,15 +1628,15 @@ def generate_type_building_ui(self): self.picture_layout_office_4 = QtGui.QLabel() self.picture_layout_office_2.setPixmap( QtGui.QPixmap(utilitis.get_full_path( - "GUI\\GUIImages\\OfficeBuildings\\elongated_1floor.png")).scaled( + "GUI/GUIImages/OfficeBuildings/elongated_1floor.png")).scaled( 70, 70)) self.picture_layout_office_3.setPixmap( QtGui.QPixmap(utilitis.get_full_path( - "GUI\\GUIImages\\OfficeBuildings\\elongated_2floors.png")).scaled( + "GUI/GUIImages/OfficeBuildings/elongated_2floors.png")).scaled( 70, 70)) self.picture_layout_office_4.setPixmap(QtGui.QPixmap( utilitis.get_full_path( - "GUI\\GUIImages\\OfficeBuildings\\compact_floor.png")).scaled( + "GUI/GUIImages/OfficeBuildings/compact_floor.png")).scaled( 70, 70)) self.office_layout.addWidget( self.radio_button_office_layout_1, 1, 0) @@ -1672,15 +1672,15 @@ def generate_type_building_ui(self): self.picture_window_area_office_4 = QtGui.QLabel() self.picture_window_area_office_2.setPixmap(QtGui.QPixmap( utilitis.get_full_path( - "GUI\\GUIImages\\OfficeBuildings\\punctuatedFacade.png")) + "GUI/GUIImages/OfficeBuildings/punctuatedFacade.png")) .scaled(70, 70)) self.picture_window_area_office_3.setPixmap(QtGui.QPixmap( utilitis.get_full_path( - "GUI\\GUIImages\\OfficeBuildings\\bannerFacade.png")) + "GUI/GUIImages/OfficeBuildings/bannerFacade.png")) .scaled(70, 70)) self.picture_window_area_office_4.setPixmap(QtGui.QPixmap( utilitis.get_full_path( - "GUI\\GUIImages\\OfficeBuildings\\fullGlazing.png")) + "GUI/GUIImages/OfficeBuildings/fullGlazing.png")) .scaled(70, 70)) self.office_layoutWindowArea.addWidget( self.radio_button_window_area_office_1, 1, 0) @@ -1763,13 +1763,13 @@ def generate_type_building_ui(self): self.picture_neighbour_building_residential_2 = QtGui.QLabel() self.picture_neighbour_building_residential_3 = QtGui.QLabel() self.picture_neighbour_building_residential_1.setPixmap(QPixmap( - utilitis.get_full_path("GUI\\GUIImages\\Residentials\\" + utilitis.get_full_path("GUI/GUIImages/Residentials/" "noNeighbour.png")).scaled(29, 23)) self.picture_neighbour_building_residential_2.setPixmap(QPixmap( - utilitis.get_full_path("GUI\\GUIImages\\Residentials\\" + utilitis.get_full_path("GUI/GUIImages/Residentials/" "oneNeighbour.png")).scaled(46, 23)) self.picture_neighbour_building_residential_3.setPixmap(QPixmap( - utilitis.get_full_path("GUI\\GUIImages\\Residentials\\" + utilitis.get_full_path("GUI/GUIImages/Residentials/" "twoNeighbours.png")).scaled(56, 23)) self.layout_residential_neighbour_buildings.addWidget( self.radio_button_neighbour_1, 1, 0) @@ -1797,11 +1797,11 @@ def generate_type_building_ui(self): self.picture_layout_residential_2 = QtGui.QLabel() self.picture_layout_residential_1.setPixmap(QPixmap( - utilitis.get_full_path("GUI\\GUIImages\\Residentials\\" + utilitis.get_full_path("GUI/GUIImages/Residentials/" "compact.png")).scaled(28, 28)) self.picture_layout_residential_2.setPixmap(QPixmap( - utilitis.get_full_path("GUI\\GUIImages\\Residentials\\" + utilitis.get_full_path("GUI/GUIImages/Residentials/" "elongatedComplex.png")).scaled(28, 28)) self.layout_residential_layout.addWidget( self.radio_button_residential_layout_1, 1, 0) @@ -1832,16 +1832,16 @@ def generate_type_building_ui(self): self.picture_roof_residential_3 = QtGui.QLabel() self.picture_roof_residential_4 = QtGui.QLabel() self.picture_roof_residential_1.setPixmap(QPixmap( - utilitis.get_full_path("GUI\\GUIImages\\Residentials\\" + utilitis.get_full_path("GUI/GUIImages/Residentials/" "flatRoof.png")).scaled(32, 23)) self.picture_roof_residential_2.setPixmap(QPixmap( - utilitis.get_full_path("GUI\\GUIImages\\Residentials\\" + utilitis.get_full_path("GUI/GUIImages/Residentials/" "nonHeatedAttic.png")).scaled(34, 23)) self.picture_roof_residential_3.setPixmap(QPixmap( - utilitis.get_full_path("GUI\\GUIImages\\Residentials\\" + utilitis.get_full_path("GUI/GUIImages/Residentials/" "partyHeatedAttic.png")).scaled(34, 23)) self.picture_roof_residential_4.setPixmap(QPixmap( - utilitis.get_full_path("GUI\\GUIImages\\Residentials\\" + utilitis.get_full_path("GUI/GUIImages/Residentials/" "heatedAttic.png")).scaled(34, 23)) self.layout_residential_roof.addWidget( self.radio_button_residential_roof_1, 1, 0) @@ -1888,16 +1888,16 @@ def generate_type_building_ui(self): self.picture_residential_basement_3 = QtGui.QLabel() self.picture_residential_basement_4 = QtGui.QLabel() self.picture_residential_basement_1.setPixmap(QPixmap( - utilitis.get_full_path("GUI\\GUIImages\\Residentials\\" + utilitis.get_full_path("GUI/GUIImages/Residentials/" "noCellar.png")).scaled(32, 28)) self.picture_residential_basement_2.setPixmap(QPixmap( - utilitis.get_full_path("GUI\\GUIImages\\Residentials\\" + utilitis.get_full_path("GUI/GUIImages/Residentials/" "nonHeatedCellar.png")).scaled(32, 28)) self.picture_residential_basement_3.setPixmap(QPixmap( - utilitis.get_full_path("GUI\\GUIImages\\Residentials\\" + utilitis.get_full_path("GUI/GUIImages/Residentials/" "partlyHeatedCellar.png")).scaled(32, 28)) self.picture_residential_basement_4.setPixmap(QPixmap( - utilitis.get_full_path("GUI\\GUIImages\\Residentials\\" + utilitis.get_full_path("GUI/GUIImages/Residentials/" "heatedCellar.png")).scaled(32, 28)) self.layout_residential_basement.addWidget( self.radio_button_residential_basement_1, 1, 0) @@ -2920,7 +2920,7 @@ def change_zone_values_ui(self, item): # TODO: self.graph_label = QtGui.QLabel("Red: Machines, Blue: Persons" # , Green: Lighting) - self.usagePicPixMap = QtGui.QPixmap("GUI\\sheep_PNG2186.png") + self.usagePicPixMap = QtGui.QPixmap("GUI/sheep_PNG2186.png") self.usage_pic_label = QtGui.QLabel() self.usage_pic_label.setPixmap(self.usagePicPixMap) @@ -4408,7 +4408,7 @@ def click_save_current_project(self): path = QtGui.QFileDialog.getSaveFileName( caption='Choose Filepath', - directory=utilitis.get_default_path()+"\\"+self.project.name, + directory=utilitis.get_default_path()+"/"+self.project.name, filter="Teaser File (*.teaserXML);; GML (*.gml)") last_name = path.split('/') length = len(last_name) diff --git a/teaser/logic/archetypebuildings/nonresidential.py b/teaser/logic/archetypebuildings/nonresidential.py index bead12e9b..bfe188310 100644 --- a/teaser/logic/archetypebuildings/nonresidential.py +++ b/teaser/logic/archetypebuildings/nonresidential.py @@ -29,9 +29,9 @@ def __init__(self, net_leased_area, with_ahu) - self.file_ahu = "\\AHU_"+self.name+".mat" - self.file_internal_gains = "\\InternalGains_"+self.name+".mat" - self.file_set_t = "\\Tset_"+self.name+".mat" + self.file_ahu = "/AHU_"+self.name+".mat" + self.file_internal_gains = "/InternalGains_"+self.name+".mat" + self.file_set_t = "/Tset_"+self.name+".mat" #self.file_weather = self.parent.weather_file_path def generate_archetype(self): diff --git a/teaser/logic/archetypebuildings/residential.py b/teaser/logic/archetypebuildings/residential.py index 978cc073b..196215a30 100644 --- a/teaser/logic/archetypebuildings/residential.py +++ b/teaser/logic/archetypebuildings/residential.py @@ -29,9 +29,9 @@ def __init__(self, net_leased_area, with_ahu) - self.file_ahu = "\\AHU_"+self.name+".mat" - self.file_internal_gains = "\\InternalGains_"+self.name+".mat" - self.file_set_t = "\\Tset_"+self.name+".mat" + self.file_ahu = "/AHU_"+self.name+".mat" + self.file_internal_gains = "/InternalGains_"+self.name+".mat" + self.file_set_t = "/Tset_"+self.name+".mat" #self.file_weather = self.parent.weather_file_path def generate_archetype(self): diff --git a/teaser/logic/buildingobjects/boundaryconditions/boundaryconditions.py b/teaser/logic/buildingobjects/boundaryconditions/boundaryconditions.py index c54b76147..f29b619f6 100644 --- a/teaser/logic/buildingobjects/boundaryconditions/boundaryconditions.py +++ b/teaser/logic/buildingobjects/boundaryconditions/boundaryconditions.py @@ -347,7 +347,7 @@ def profile_persons(self, value): pass else: if self.parent.parent.file_internal_gains is None: - self.parent.parent.file_internal_gains = ("\\InternalGains_" + + self.parent.parent.file_internal_gains = ("/InternalGains_" + self.parent.parent.name + ".mat") self._profile_persons = value @@ -363,7 +363,7 @@ def profile_machines(self, value): pass else: if self.parent.parent.file_internal_gains is None: - self.parent.parent.file_internal_gains = ("\\InternalGains_" + + self.parent.parent.file_internal_gains = ("/InternalGains_" + self.parent.parent.name + ".mat") self._profile_machines = value @@ -380,7 +380,7 @@ def profile_lighting(self, value): pass else: if self.parent.parent.file_internal_gains is None: - self.parent.parent.file_internal_gains = ("\\InternalGains_" + + self.parent.parent.file_internal_gains = ("/InternalGains_" + self.parent.parent.name + ".mat") @@ -408,7 +408,7 @@ def set_temp_heat(self, value): else: if self.parent is not None: if self.parent.parent.file_set_t is None: - self.parent.parent.file_set_t = ("\\TSet" + + self.parent.parent.file_set_t = ("/TSet" + self.parent.parent.name + ".mat") else: @@ -438,7 +438,7 @@ def set_temp_cool(self, value): else: if self.parent is not None: if self.parent.parent.file_set_t is None: - self.parent.parent.file_set_t = ("\\TSet_" + + self.parent.parent.file_set_t = ("/TSet_" + self.parent.parent.name + ".mat") else: @@ -519,7 +519,7 @@ def rel_humidity(self, value): pass else: if self.parent.parent.file_ahu is None: - self.parent.parent.file_ahu = ("\\AHU_" + + self.parent.parent.file_ahu = ("/AHU_" + self.parent.parent.name + ".mat") self._rel_humidity = value @@ -545,7 +545,7 @@ def min_air_exchange(self, value): pass else: if self.parent.parent.file_ahu is None: - self.parent.parent.file_ahu = ("\\AHU_" + + self.parent.parent.file_ahu = ("/AHU_" + self.parent.parent.name + ".mat") self._min_air_exchange = value @@ -571,7 +571,7 @@ def min_ahu(self, value): pass else: if self.parent.parent.file_ahu is None: - self.parent.parent.file_ahu = ("\\AHU_" + + self.parent.parent.file_ahu = ("/AHU_" + self.parent.parent.name + ".mat") self._min_ahu = value @@ -597,7 +597,7 @@ def max_ahu(self, value): pass else: if self.parent.parent.file_ahu is None: - self.parent.parent.file_ahu = ("\\AHU_" + + self.parent.parent.file_ahu = ("/AHU_" + self.parent.parent.name + ".mat") self._max_ahu = value @@ -623,7 +623,7 @@ def persons(self, value): pass else: if self.parent.parent.file_internal_gains is None: - self.parent.parent.file_internal_gains = ("\\InternalGains_" + + self.parent.parent.file_internal_gains = ("/InternalGains_" + self.parent.parent.name + ".mat") self._persons = value @@ -649,7 +649,7 @@ def machines(self, value): pass else: if self.parent.parent.file_internal_gains is None: - self.parent.parent.file_internal_gains = ("\\InternalGains_" + + self.parent.parent.file_internal_gains = ("/InternalGains_" + self.parent.parent.name + ".mat") self._machines = value @@ -675,7 +675,7 @@ def lighting_power(self, value): pass else: if self.parent.parent.file_internal_gains is None: - self.parent.parent.file_internal_gains = ("\\InternalGains_" + + self.parent.parent.file_internal_gains = ("/InternalGains_" + self.parent.parent.name + ".mat") self._lighting_power = value diff --git a/teaser/logic/buildingobjects/buildingsystems/buildingahu.py b/teaser/logic/buildingobjects/buildingsystems/buildingahu.py index 456e12ab8..e6797daf5 100644 --- a/teaser/logic/buildingobjects/buildingsystems/buildingahu.py +++ b/teaser/logic/buildingobjects/buildingsystems/buildingahu.py @@ -98,7 +98,7 @@ def profile_min_relative_humidity(self, value): if self._profile_min_relative_humidity is None: pass else: - self.parent.file_ahu = ("\\AHU_" + + self.parent.file_ahu = ("/AHU_" + self.parent.name + ".mat") @@ -114,7 +114,7 @@ def profile_max_relative_humidity(self, value): if self._profile_max_relative_humidity is None: pass else: - self.parent.file_ahu = ("\\AHU_" + + self.parent.file_ahu = ("/AHU_" + self.parent.name + ".mat") @@ -131,7 +131,7 @@ def profile_v_flow(self, value): if self._profile_v_flow is None: pass else: - self.parent.file_ahu = ("\\AHU_" + + self.parent.file_ahu = ("/AHU_" + self.parent.name + ".mat") @@ -147,7 +147,7 @@ def profile_temperature(self, value): if self._profile_temperature is None: pass else: - self.parent.file_ahu = ("\\AHU_" + + self.parent.file_ahu = ("/AHU_" + self.parent.name + ".mat") self._profile_temperature = value diff --git a/teaser/logic/simulation/aixlib.py b/teaser/logic/simulation/aixlib.py index f4d26cea4..47a3949bf 100644 --- a/teaser/logic/simulation/aixlib.py +++ b/teaser/logic/simulation/aixlib.py @@ -155,7 +155,7 @@ def modelica_set_temp(bldg, path = None): ''' if bldg.file_set_t is None: - bldg.file_set_t = "\\Tset_"+bldg.name+".mat" + bldg.file_set_t = "/Tset_"+bldg.name+".mat" else: pass @@ -217,7 +217,7 @@ def modelica_AHU_boundary(bldg, ''' if bldg.file_ahu is None: - bldg.file_ahu = "\\AHU_"+bldg.name+".mat" + bldg.file_ahu = "/AHU_"+bldg.name+".mat" else: pass @@ -307,7 +307,7 @@ def modelica_gains_boundary(bldg, ''' if bldg.file_internal_gains is None: - bldg.file_internal_gains = "\\InternalGains_"+bldg.name+".mat" + bldg.file_internal_gains = "/InternalGains_"+bldg.name+".mat" else: pass diff --git a/teaser/logic/utilities.py b/teaser/logic/utilities.py index 14f11ac01..58b4a7c31 100644 --- a/teaser/logic/utilities.py +++ b/teaser/logic/utilities.py @@ -25,26 +25,18 @@ def create_path(path): path : str ''' - + path = os.path.normpath(path) # if directory exists change into that directory if(os.path.isdir(path)): os.chdir(path) return path else: if not os.path.exists(path): - l = [] - p = "\\" - l = path.split("\\") - i = 1 - while i < len(l): - p = p + l[i] + "\\" - i = i + 1 - if not os.path.exists(p): - os.mkdir(p) - - os.chdir(p) + os.makedirs(path) + + os.chdir(path) - return p + return path def get_default_path(): '''Function to construct default path to OutputData folder @@ -54,9 +46,10 @@ def get_default_path(): ''' directory = os.path.dirname(__file__) - src = "\\teaser" + src = "teaser" last_index = directory.rfind(src) - default_path = directory[:last_index] + "\\teaser\\OutputData" + default_path = os.path.join(directory[:last_index], "teaser", "OutputData") + return default_path @@ -77,9 +70,9 @@ def get_full_path(rel_path): ''' directory = os.path.dirname(__file__) - src = "\\teaser" + src = "teaser" last_index = directory.rfind(src) - first_path = directory[:last_index]+"\\teaser\\" + first_path = os.path.join(directory[:last_index], "teaser") full_path = os.path.join(first_path, rel_path) return full_path \ No newline at end of file diff --git a/teaser/project.py b/teaser/project.py index 0e882e8ba..f748cdcdc 100644 --- a/teaser/project.py +++ b/teaser/project.py @@ -837,9 +837,9 @@ def save_project(self, file_name=None, path=None): name = file_name if path is None: - new_path = utilitis.get_full_path("OutputData") + "\\" + name + new_path = utilitis.get_full_path("OutputData") + "/" + name else: - new_path = path + "\\" + name + new_path = path + "/" + name utilitis.create_path(utilitis.get_full_path(path)) txml_out.save_teaser_xml(new_path, self) @@ -882,9 +882,9 @@ def save_citygml(self, file_name=None, path=None): name = file_name if path is None: - new_path = utilitis.get_full_path("OutputData") + "\\" + name + new_path = utilitis.get_full_path("OutputData") + "/" + name else: - new_path = path + "\\" + name + new_path = path + "/" + name utilitis.create_path(utilitis.get_full_path(path)) citygml_out.save_gml(self, new_path) @@ -942,9 +942,9 @@ def export_aixlib(self, """ if path is None: - path = utilitis.get_default_path() + "\\" + self.name + path = utilitis.get_default_path() + "/" + self.name else: - path = path + "\\" + self.name + path = path + "/" + self.name utilitis.create_path(path) @@ -980,9 +980,9 @@ def export_annex(self, """ if path is None: - path = utilitis.get_default_path() + "\\" + self.name + path = utilitis.get_default_path() + "/" + self.name else: - path = path + "\\" + self.name + path = path + "/" + self.name utilitis.create_path(path) @@ -1004,9 +1004,9 @@ def export_parameters_txt(self, path=None): ''' if path is None: - path = "OutputData\\"+self.name + path = "OutputData/"+self.name else: - path = path+"\\"+self.name + path = path+"/"+self.name text_out.export_parameters_txt(prj=self, path=path) diff --git a/tests/test_data.py b/tests/test_data.py index 187a1d4e9..26fe725a3 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -94,8 +94,8 @@ def test_calc_ebc(self): with TEASER3 values. ''' prj.set_default() - prj.load_project(utilities.get_full_path("examples\\examplefiles" - "\\new.teaserXML")) + prj.load_project(utilities.get_full_path("examples/examplefiles" + "/new.teaserXML")) therm_zone = prj.buildings[0].thermal_zones[0] prj.buildings[0].calc_building_parameter(number_of_elements=2, @@ -988,7 +988,7 @@ def test_save_use_conditions(self): '''test of save_use_conditions, no parameter checking''' import os try: - os.remove(utilities.get_default_path() + "\\" + "UseCondUT.xml") + os.remove(utilities.get_default_path() + "/" + "UseCondUT.xml") except: pass path = utilities.get_default_path() @@ -1036,7 +1036,7 @@ def test_save_type_element(self): '''test of save_type_element, no parameter checking''' import os try: - os.remove(utilities.get_default_path() + "\\" + "unitTestTB.xml") + os.remove(utilities.get_default_path() + "/" + "unitTestTB.xml") except: pass From d9c359ad5b59559ec280ee7753ab0d6c78089e90 Mon Sep 17 00:00:00 2001 From: MichaMans Date: Wed, 22 Jun 2016 10:02:50 +0200 Subject: [PATCH 03/23] #181 changed pathnames, since unix systems are case-sensetive --- setup.py | 4 ++-- teaser/data/dataclass.py | 8 ++++---- teaser/data/output/aixlib_output.py | 6 +++--- teaser/data/output/annex60_output.py | 6 +++--- teaser/data/output/material_output.py | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/setup.py b/setup.py index b649ebb3b..23f891a7e 100644 --- a/setup.py +++ b/setup.py @@ -58,5 +58,5 @@ 'teaser.examples.examplefiles': ['*.teaserXML'], 'teaser.examples.examplefiles.MelatenXML': ['*.xml']}, classifiers = ['License :: OSI Approved :: MIT License'], - setup_requires = ['mako', 'pyxb', 'pytest'], - install_requires = ['mako', 'pyxb', 'pytest']) + setup_requires = ['mako', 'pyxb', 'pytest', 'numpy', 'scipy'], + install_requires = ['mako', 'pyxb', 'pytest', 'numpy', 'scipy']) diff --git a/teaser/data/dataclass.py b/teaser/data/dataclass.py index d081a3bd3..5639be75d 100644 --- a/teaser/data/dataclass.py +++ b/teaser/data/dataclass.py @@ -45,19 +45,19 @@ def __init__(self, type_element_file=None): ''' if type_element_file is None: self.path_tb = utilitis.get_full_path( - "Data/Input/InputData/TypeBuildingElements.xml") + "data/input/inputdata/TypeBuildingElements.xml") else: - self.path_tb = utilitis.get_full_path("Data/Input/InputData/"+str( + self.path_tb = utilitis.get_full_path("data/input/inputdata/"+str( type_element_file)) __xml_file_tb = open(self.path_tb, 'r') self.element_bind = tb_bind.CreateFromDocument(__xml_file_tb.read()) self.path_uc = utilitis.get_full_path( - "Data/Input/InputData/UseConditions.xml") + "data/input/inputdata/UseConditions.xml") __xml_file_uc = open(self.path_uc, 'r') self.conditions_bind = uc_bind.CreateFromDocument(__xml_file_uc.read()) __path_mat = utilitis.get_full_path( - "Data/Input/InputData/MaterialTemplates.xml") + "data/input/inputdata/MaterialTemplates.xml") __xml_file_mat = codecs.open(__path_mat, 'r', encoding='utf-8') self.material_bind = mat_bind.CreateFromDocument(__xml_file_mat.read()) diff --git a/teaser/data/output/aixlib_output.py b/teaser/data/output/aixlib_output.py index 8882574dc..d8592a9ca 100644 --- a/teaser/data/output/aixlib_output.py +++ b/teaser/data/output/aixlib_output.py @@ -52,13 +52,13 @@ def export_aixlib(prj, # use the same zone templates for all exports zone_template = Template( filename=utilitis.get_full_path( - "Data/Output/ModelicaTemplate/AixLib/AixLib_zone")) + "data/output/modelicatemplate/AixLib/AixLib_zone")) model_template = Template( filename=utilitis.get_full_path( - "Data/Output/ModelicaTemplate/AixLib/AixLib_model")) + "data/output/modelicatemplate/AixLib/AixLib_model")) zone_base_template = Template( filename=utilitis.get_full_path( - "Data/Output/ModelicaTemplate/AixLib/AixLib_base")) + "data/output/modelicatemplate/AixLib/AixLib_base")) # list which contains exported buildings if internal_id is not None: exported_list_of_buildings = [bldg for bldg in diff --git a/teaser/data/output/annex60_output.py b/teaser/data/output/annex60_output.py index 340bacd03..b0f68b535 100644 --- a/teaser/data/output/annex60_output.py +++ b/teaser/data/output/annex60_output.py @@ -55,13 +55,13 @@ def export_annex60(prj, pass elif number_of_elements == 2: zone_template = Template(filename=utilitis.get_full_path( - "Data/Output/ModelicaTemplate/Annex60/Annex60_TwoElements")) + "data/output/modelicatemplate/Annex60/Annex60_TwoElements")) elif number_of_elements == 3: zone_template = Template(filename=utilitis.get_full_path( - "Data/Output/ModelicaTemplate/Annex60/Annex60_ThreeElements")) + "data/output/modelicatemplate/Annex60/Annex60_ThreeElements")) elif number_of_elements == 4: zone_template = Template(filename=utilitis.get_full_path( - "Data/Output/ModelicaTemplate/Annex60/Annex60_FourElements")) + "data/output/modelicatemplate/Annex60/Annex60_FourElements")) for bldg in exported_list_of_buildings: bldg_path = os.path.join(path, diff --git a/teaser/data/output/material_output.py b/teaser/data/output/material_output.py index b8006f94b..e8501fbc1 100644 --- a/teaser/data/output/material_output.py +++ b/teaser/data/output/material_output.py @@ -26,7 +26,7 @@ def save_material(material): mat_pyxb.thermal_conduc = material.thermal_conduc mat_pyxb.heat_capac = material.heat_capac - path = utilitis.get_full_path("InputData/MaterialTemplates.xml") + path = utilitis.get_full_path("inputdata/MaterialTemplates.xml") xml_file = open(path, 'r') xml_parse = mat_bind.CreateFromDocument(xml_file.read()) From 447ed8cef07a6c94239af8ddd85df0eac683e00c Mon Sep 17 00:00:00 2001 From: MichaMans Date: Wed, 22 Jun 2016 10:05:58 +0200 Subject: [PATCH 04/23] #181 revised paths for right case sensivity --- teaser/data/output/aixlib_output.py | 4 ++-- teaser/data/output/text_output.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/teaser/data/output/aixlib_output.py b/teaser/data/output/aixlib_output.py index d8592a9ca..96bcd1568 100644 --- a/teaser/data/output/aixlib_output.py +++ b/teaser/data/output/aixlib_output.py @@ -194,7 +194,7 @@ def _help_package(path, name, uses=None): ''' package_template = Template(filename=utilitis.get_full_path - ("Data/Output/ModelicaTemplate/package")) + ("data/output/modelicatemplate/package")) out_file = open( utilitis.get_full_path(path + "/" + "package" + ".mo"), 'w') out_file.write(package_template.render_unicode(name=name, uses=uses)) @@ -221,7 +221,7 @@ def _help_package_order(path, package_list, addition=None, extra=None): ''' order_template = Template(filename=utilitis.get_full_path - ("Data/Output/ModelicaTemplate/package_order")) + ("data/output/modelicatemplate/package_order")) out_file = open( utilitis.get_full_path(path + "/" + "package" + ".order"), 'w') diff --git a/teaser/data/output/text_output.py b/teaser/data/output/text_output.py index e5629b68c..074a5f50e 100644 --- a/teaser/data/output/text_output.py +++ b/teaser/data/output/text_output.py @@ -28,7 +28,7 @@ def export_parameters_txt(prj, path): utilitis.create_path(utilitis.get_full_path(bldg_path)) readable_template = Template( filename=utilitis.get_full_path( - "Data/Output/TextTemplate/ReadableBuilding")) + "data/output/texttemplate/ReadableBuilding")) out_file = open(utilitis.get_full_path (bldg_path+"ReadableOutput.txt"), 'w') From 038dfd7d023575fb783383cc0824a6859caba77f Mon Sep 17 00:00:00 2001 From: MichaMans Date: Wed, 22 Jun 2016 11:35:24 +0200 Subject: [PATCH 05/23] #181 deleted the scipy and numpy requirements, not sure if theyx will work like this --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 23f891a7e..b649ebb3b 100644 --- a/setup.py +++ b/setup.py @@ -58,5 +58,5 @@ 'teaser.examples.examplefiles': ['*.teaserXML'], 'teaser.examples.examplefiles.MelatenXML': ['*.xml']}, classifiers = ['License :: OSI Approved :: MIT License'], - setup_requires = ['mako', 'pyxb', 'pytest', 'numpy', 'scipy'], - install_requires = ['mako', 'pyxb', 'pytest', 'numpy', 'scipy']) + setup_requires = ['mako', 'pyxb', 'pytest'], + install_requires = ['mako', 'pyxb', 'pytest']) From 923e64aab5b17cbca8b586d3d0702c87832f480d Mon Sep 17 00:00:00 2001 From: PRemmen Date: Wed, 22 Jun 2016 09:52:06 +0200 Subject: [PATCH 06/23] delete experimental from annex templates --- .../modelicatemplate/Annex60/Annex60_FourElements | 10 +++++----- .../modelicatemplate/Annex60/Annex60_ThreeElements | 8 ++++---- .../modelicatemplate/Annex60/Annex60_TwoElements | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/teaser/data/output/modelicatemplate/Annex60/Annex60_FourElements b/teaser/data/output/modelicatemplate/Annex60/Annex60_FourElements index 7fe36143e..48d933332 100644 --- a/teaser/data/output/modelicatemplate/Annex60/Annex60_FourElements +++ b/teaser/data/output/modelicatemplate/Annex60/Annex60_FourElements @@ -30,10 +30,10 @@ model ${bldg.name}_${zone.name.replace(" ", "")} azi={${list_to_string(deg_to_rad_list(get_azimut(zone.orientation_wall)))}}) "Calculates direct solar radiation on titled surface for all directions" annotation (Placement(transformation(extent={{-68,52},{-48,72}}))); - Annex60.Experimental.ThermalZones.ReducedOrder.CorrectionSolarGain.CorrectionGDoublePane corGDoublePane(n=${len(zone.orientation_wall)}, UWin=${zone.ua_value_win/zone.area_win}) + Annex60.ThermalZones.ReducedOrder.CorrectionSolarGain.CorrectionGDoublePane corGDoublePane(n=${len(zone.orientation_wall)}, UWin=${zone.ua_value_win/zone.area_win}) "Correction factor for solar transmission" annotation (Placement(transformation(extent={{6,54},{26,74}}))); - Annex60.Experimental.ThermalZones.ReducedOrder.ReducedOrderZones.ThermalZoneFourElements thermalZoneFourElements( + Annex60.ThermalZones.ReducedOrder.ReducedOrderZones.ThermalZoneFourElements thermalZoneFourElements( redeclare package Medium = Modelica.Media.Air.SimpleAir, VAir=${zone.volume}, alphaExt=${zone.alpha_comb_inner_ow}, @@ -78,7 +78,7 @@ model ${bldg.name}_${zone.name.replace(" ", "")} % endif annotation (Placement(transformation(extent={{44,-2},{92,34}}))); % if merge_windows is True: - Annex60.Experimental.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007 eqAirTemp( + Annex60.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007 eqAirTemp( n=${len(zone.orientation_wall)}, wfGround=${list_to_string(zone.weightfactor_ground)}, wfWall={${list_to_string(zone.weightfactor_ow)}}, @@ -91,7 +91,7 @@ model ${bldg.name}_${zone.name.replace(" ", "")} TGround=${zone.t_ground}) "Computes equivalent air temperature" annotation (Placement(transformation(extent={{-24,-14},{-4,6}}))); % else: - Annex60.Experimental.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007WithWindow eqAirTemp( + Annex60.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007WithWindow eqAirTemp( n=${len(zone.orientation_wall)}, wfGround=${list_to_string(zone.weightfactor_ground)}, wfWall={${list_to_string(zone.weightfactor_ow)}}, @@ -183,7 +183,7 @@ model ${bldg.name}_${zone.name.replace(" ", "")} rotation=180, origin={84,-22}))); - Annex60.Experimental.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007 eqAirTempVDI( + Annex60.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007 eqAirTempVDI( aExt=${zone.solar_absorp_rt}, eExt=${zone.ir_emissivity_outer_rt}, wfGround=0, diff --git a/teaser/data/output/modelicatemplate/Annex60/Annex60_ThreeElements b/teaser/data/output/modelicatemplate/Annex60/Annex60_ThreeElements index 8c34b05f3..d3cea60c5 100644 --- a/teaser/data/output/modelicatemplate/Annex60/Annex60_ThreeElements +++ b/teaser/data/output/modelicatemplate/Annex60/Annex60_ThreeElements @@ -30,10 +30,10 @@ model ${bldg.name}_${zone.name.replace(" ", "")} azi={${list_to_string(deg_to_rad_list(get_azimut(zone.orientation_wall)))}}) "Calculates direct solar radiation on titled surface for all directions" annotation (Placement(transformation(extent={{-68,52},{-48,72}}))); - Annex60.Experimental.ThermalZones.ReducedOrder.CorrectionSolarGain.CorrectionGDoublePane corGDoublePane(n=${len(zone.orientation_wall)}, UWin=${zone.ua_value_win/zone.area_win}) + Annex60.ThermalZones.ReducedOrder.CorrectionSolarGain.CorrectionGDoublePane corGDoublePane(n=${len(zone.orientation_wall)}, UWin=${zone.ua_value_win/zone.area_win}) "Correction factor for solar transmission" annotation (Placement(transformation(extent={{6,54},{26,74}}))); - Annex60.Experimental.ThermalZones.ReducedOrder.ReducedOrderZones.ThermalZoneThreeElements thermalZoneThreeElements( + Annex60.ThermalZones.ReducedOrder.ReducedOrderZones.ThermalZoneThreeElements thermalZoneThreeElements( redeclare package Medium = Modelica.Media.Air.SimpleAir, VAir=${zone.volume}, alphaExt=${zone.alpha_comb_inner_ow}, @@ -73,7 +73,7 @@ model ${bldg.name}_${zone.name.replace(" ", "")} % endif annotation (Placement(transformation(extent={{44,-2},{92,34}}))); % if merge_windows is True: - Annex60.Experimental.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007 eqAirTemp( + Annex60.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007 eqAirTemp( n=${len(zone.orientation_wall)}, wfGround=${list_to_string(zone.weightfactor_ground)}, wfWall={${list_to_string(zone.weightfactor_ow)}}, @@ -86,7 +86,7 @@ model ${bldg.name}_${zone.name.replace(" ", "")} TGround=${zone.t_ground}) "Computes equivalent air temperature" annotation (Placement(transformation(extent={{-24,-14},{-4,6}}))); % else: - Annex60.Experimental.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007WithWindow eqAirTemp( + Annex60.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007WithWindow eqAirTemp( n=${len(zone.orientation_wall)}, wfGround=${list_to_string(zone.weightfactor_ground)}, wfWall={${list_to_string(zone.weightfactor_ow)}}, diff --git a/teaser/data/output/modelicatemplate/Annex60/Annex60_TwoElements b/teaser/data/output/modelicatemplate/Annex60/Annex60_TwoElements index cb064b393..63f3af9d5 100644 --- a/teaser/data/output/modelicatemplate/Annex60/Annex60_TwoElements +++ b/teaser/data/output/modelicatemplate/Annex60/Annex60_TwoElements @@ -30,10 +30,10 @@ model ${bldg.name}_${zone.name.replace(" ", "")} azi={${list_to_string(deg_to_rad_list(get_azimut(zone.orientation_wall)))}}) "Calculates direct solar radiation on titled surface for all directions" annotation (Placement(transformation(extent={{-68,52},{-48,72}}))); - Annex60.Experimental.ThermalZones.ReducedOrder.CorrectionSolarGain.CorrectionGDoublePane corGDoublePane(n=${len(zone.orientation_wall)}, UWin=${zone.ua_value_win/zone.area_win}) + Annex60.ThermalZones.ReducedOrder.CorrectionSolarGain.CorrectionGDoublePane corGDoublePane(n=${len(zone.orientation_wall)}, UWin=${zone.ua_value_win/zone.area_win}) "Correction factor for solar transmission" annotation (Placement(transformation(extent={{6,54},{26,74}}))); - Annex60.Experimental.ThermalZones.ReducedOrder.ReducedOrderZones.ThermalZoneTwoElements thermalZoneTwoElements( + Annex60.ThermalZones.ReducedOrder.ReducedOrderZones.ThermalZoneTwoElements thermalZoneTwoElements( redeclare package Medium = Modelica.Media.Air.SimpleAir, VAir=${zone.volume}, alphaExt=${zone.alpha_comb_inner_ow}, @@ -67,7 +67,7 @@ model ${bldg.name}_${zone.name.replace(" ", "")} % endif annotation (Placement(transformation(extent={{44,-2},{92,34}}))); % if merge_windows is True: - Annex60.Experimental.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007 eqAirTemp( + Annex60.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007 eqAirTemp( n=${len(zone.orientation_wall)}, wfGround=${list_to_string(zone.weightfactor_ground)}, wfWall={${list_to_string(zone.weightfactor_ow)}}, @@ -80,7 +80,7 @@ model ${bldg.name}_${zone.name.replace(" ", "")} TGround=${zone.t_ground}) "Computes equivalent air temperature" annotation (Placement(transformation(extent={{-24,-14},{-4,6}}))); % else: - Annex60.Experimental.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007WithWindow eqAirTemp( + Annex60.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007WithWindow eqAirTemp( n=${len(zone.orientation_wall)}, wfGround=${list_to_string(zone.weightfactor_ground)}, wfWall={${list_to_string(zone.weightfactor_ow)}}, From 312e3c734edc7ce94eb83fbe536c37b508224842 Mon Sep 17 00:00:00 2001 From: PRemmen Date: Wed, 22 Jun 2016 12:14:44 +0200 Subject: [PATCH 07/23] Add within path to annex zone template --- teaser/data/output/annex60_output.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/teaser/data/output/annex60_output.py b/teaser/data/output/annex60_output.py index 76191ddb5..8bde2a08c 100644 --- a/teaser/data/output/annex60_output.py +++ b/teaser/data/output/annex60_output.py @@ -83,12 +83,18 @@ def export_annex60(prj, zone.name.replace(" ", "") + ".mo"), 'w') out_file.write(zone_template.render_unicode(bldg=bldg, zone=zone, - merge_windows= - merge_windows)) + merge_windows=merge_windows, + within=(prj.name + + '.' + + bldg.name + + '.' + + bldg.name + + "_Models"))) aixlib_output._help_package(zone_path, bldg.name + "_Models", within=prj.name + '.' + bldg.name) + aixlib_output._help_package_order(zone_path, bldg.thermal_zones, (bldg.name + "_")) From 04501138189ac653f65ec6bd7e4e347f31931e17 Mon Sep 17 00:00:00 2001 From: PRemmen Date: Wed, 22 Jun 2016 12:18:36 +0200 Subject: [PATCH 08/23] top level package should not contain within --- teaser/data/output/aixlib_output.py | 6 ++++-- teaser/data/output/annex60_output.py | 2 +- teaser/data/output/modelicatemplate/package | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/teaser/data/output/aixlib_output.py b/teaser/data/output/aixlib_output.py index fde7544f0..7227cfc44 100644 --- a/teaser/data/output/aixlib_output.py +++ b/teaser/data/output/aixlib_output.py @@ -73,7 +73,7 @@ def export_aixlib(prj, # full model support here print("full model support") - _help_package(path, prj.name, uses) + _help_package(path, prj.name, uses, within=None) _help_package_order(path, exported_list_of_buildings) for bldg in exported_list_of_buildings: @@ -193,7 +193,7 @@ def export_aixlib(prj, -def _help_package(path, name, uses=None, within=""): +def _help_package(path, name, uses=None, within=None): '''creates a package.mo file private function, do not call @@ -205,6 +205,8 @@ def _help_package(path, name, uses=None, within=""): path of where the package.mo should be placed name : string name of the Modelica package + within : string + path of Modelica package containing this package ''' diff --git a/teaser/data/output/annex60_output.py b/teaser/data/output/annex60_output.py index 8bde2a08c..8ca05049c 100644 --- a/teaser/data/output/annex60_output.py +++ b/teaser/data/output/annex60_output.py @@ -48,7 +48,7 @@ def export_annex60(prj, else: exported_list_of_buildings = prj.buildings - aixlib_output._help_package(path, prj.name, uses) + aixlib_output._help_package(path, prj.name, uses, within=None) aixlib_output._help_package_order(path, exported_list_of_buildings) if number_of_elements == 1: diff --git a/teaser/data/output/modelicatemplate/package b/teaser/data/output/modelicatemplate/package index 14e587063..67b774987 100644 --- a/teaser/data/output/modelicatemplate/package +++ b/teaser/data/output/modelicatemplate/package @@ -1,4 +1,6 @@ +%if within is not None: within ${within}; +%endif package ${name} extends Modelica.Icons.Package; From a629867afeb4c0b7e73138e6a5796b037f733304 Mon Sep 17 00:00:00 2001 From: PRemmen Date: Wed, 22 Jun 2016 12:52:47 +0200 Subject: [PATCH 09/23] Change some names for Modelica library --- .../output/modelicatemplate/Annex60/Annex60_FourElements | 5 +++-- .../output/modelicatemplate/Annex60/Annex60_ThreeElements | 5 +++-- .../data/output/modelicatemplate/Annex60/Annex60_TwoElements | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/teaser/data/output/modelicatemplate/Annex60/Annex60_FourElements b/teaser/data/output/modelicatemplate/Annex60/Annex60_FourElements index 48d933332..bde6b1def 100644 --- a/teaser/data/output/modelicatemplate/Annex60/Annex60_FourElements +++ b/teaser/data/output/modelicatemplate/Annex60/Annex60_FourElements @@ -30,10 +30,11 @@ model ${bldg.name}_${zone.name.replace(" ", "")} azi={${list_to_string(deg_to_rad_list(get_azimut(zone.orientation_wall)))}}) "Calculates direct solar radiation on titled surface for all directions" annotation (Placement(transformation(extent={{-68,52},{-48,72}}))); - Annex60.ThermalZones.ReducedOrder.CorrectionSolarGain.CorrectionGDoublePane corGDoublePane(n=${len(zone.orientation_wall)}, UWin=${zone.ua_value_win/zone.area_win}) + Annex60.ThermalZones.ReducedOrder.SolarGain.CorrectionGDoublePane corGDoublePane(n=${len(zone.orientation_wall)}, UWin=${zone.ua_value_win/zone.area_win}) "Correction factor for solar transmission" annotation (Placement(transformation(extent={{6,54},{26,74}}))); - Annex60.ThermalZones.ReducedOrder.ReducedOrderZones.ThermalZoneFourElements thermalZoneFourElements( + Annex60.ThermalZones.ReducedOrder.RC.ThermalZoneFourElements + thermalZoneFourElements( redeclare package Medium = Modelica.Media.Air.SimpleAir, VAir=${zone.volume}, alphaExt=${zone.alpha_comb_inner_ow}, diff --git a/teaser/data/output/modelicatemplate/Annex60/Annex60_ThreeElements b/teaser/data/output/modelicatemplate/Annex60/Annex60_ThreeElements index d3cea60c5..402ad8600 100644 --- a/teaser/data/output/modelicatemplate/Annex60/Annex60_ThreeElements +++ b/teaser/data/output/modelicatemplate/Annex60/Annex60_ThreeElements @@ -30,10 +30,11 @@ model ${bldg.name}_${zone.name.replace(" ", "")} azi={${list_to_string(deg_to_rad_list(get_azimut(zone.orientation_wall)))}}) "Calculates direct solar radiation on titled surface for all directions" annotation (Placement(transformation(extent={{-68,52},{-48,72}}))); - Annex60.ThermalZones.ReducedOrder.CorrectionSolarGain.CorrectionGDoublePane corGDoublePane(n=${len(zone.orientation_wall)}, UWin=${zone.ua_value_win/zone.area_win}) + Annex60.ThermalZones.ReducedOrder.SolarGain.CorrectionGDoublePane corGDoublePane(n=${len(zone.orientation_wall)}, UWin=${zone.ua_value_win/zone.area_win}) "Correction factor for solar transmission" annotation (Placement(transformation(extent={{6,54},{26,74}}))); - Annex60.ThermalZones.ReducedOrder.ReducedOrderZones.ThermalZoneThreeElements thermalZoneThreeElements( + Annex60.ThermalZones.ReducedOrder.RC.ThermalZoneThreeElements + thermalZoneThreeElements( redeclare package Medium = Modelica.Media.Air.SimpleAir, VAir=${zone.volume}, alphaExt=${zone.alpha_comb_inner_ow}, diff --git a/teaser/data/output/modelicatemplate/Annex60/Annex60_TwoElements b/teaser/data/output/modelicatemplate/Annex60/Annex60_TwoElements index 63f3af9d5..416e46261 100644 --- a/teaser/data/output/modelicatemplate/Annex60/Annex60_TwoElements +++ b/teaser/data/output/modelicatemplate/Annex60/Annex60_TwoElements @@ -30,10 +30,11 @@ model ${bldg.name}_${zone.name.replace(" ", "")} azi={${list_to_string(deg_to_rad_list(get_azimut(zone.orientation_wall)))}}) "Calculates direct solar radiation on titled surface for all directions" annotation (Placement(transformation(extent={{-68,52},{-48,72}}))); - Annex60.ThermalZones.ReducedOrder.CorrectionSolarGain.CorrectionGDoublePane corGDoublePane(n=${len(zone.orientation_wall)}, UWin=${zone.ua_value_win/zone.area_win}) + Annex60.ThermalZones.ReducedOrder.SolarGain.CorrectionGDoublePane corGDoublePane(n=${len(zone.orientation_wall)}, UWin=${zone.ua_value_win/zone.area_win}) "Correction factor for solar transmission" annotation (Placement(transformation(extent={{6,54},{26,74}}))); - Annex60.ThermalZones.ReducedOrder.ReducedOrderZones.ThermalZoneTwoElements thermalZoneTwoElements( + Annex60.ThermalZones.ReducedOrder.RC.ThermalZoneTwoElements + thermalZoneTwoElements( redeclare package Medium = Modelica.Media.Air.SimpleAir, VAir=${zone.volume}, alphaExt=${zone.alpha_comb_inner_ow}, From 8c11a1ba9dfc9ad0b0e64b580bcb089079127553 Mon Sep 17 00:00:00 2001 From: PRemmen Date: Wed, 22 Jun 2016 13:02:17 +0200 Subject: [PATCH 10/23] still got some names wrong --- .../modelicatemplate/Annex60/Annex60_FourElements | 14 +++++++------- .../modelicatemplate/Annex60/Annex60_ThreeElements | 10 +++++----- .../modelicatemplate/Annex60/Annex60_TwoElements | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/teaser/data/output/modelicatemplate/Annex60/Annex60_FourElements b/teaser/data/output/modelicatemplate/Annex60/Annex60_FourElements index bde6b1def..478ebae72 100644 --- a/teaser/data/output/modelicatemplate/Annex60/Annex60_FourElements +++ b/teaser/data/output/modelicatemplate/Annex60/Annex60_FourElements @@ -33,7 +33,7 @@ model ${bldg.name}_${zone.name.replace(" ", "")} Annex60.ThermalZones.ReducedOrder.SolarGain.CorrectionGDoublePane corGDoublePane(n=${len(zone.orientation_wall)}, UWin=${zone.ua_value_win/zone.area_win}) "Correction factor for solar transmission" annotation (Placement(transformation(extent={{6,54},{26,74}}))); - Annex60.ThermalZones.ReducedOrder.RC.ThermalZoneFourElements + Annex60.ThermalZones.ReducedOrder.RC.FourElements thermalZoneFourElements( redeclare package Medium = Modelica.Media.Air.SimpleAir, VAir=${zone.volume}, @@ -81,7 +81,7 @@ model ${bldg.name}_${zone.name.replace(" ", "")} % if merge_windows is True: Annex60.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007 eqAirTemp( n=${len(zone.orientation_wall)}, - wfGround=${list_to_string(zone.weightfactor_ground)}, + wfGro=${list_to_string(zone.weightfactor_ground)}, wfWall={${list_to_string(zone.weightfactor_ow)}}, wfWin={${list_to_string(zone.weightfactor_win)}}, withLongwave=true, @@ -89,12 +89,12 @@ model ${bldg.name}_${zone.name.replace(" ", "")} alphaWallOut=${zone.alpha_conv_outer_ow}, alphaRadWall=${zone.alpha_rad_outer_ow}, eExt=${zone.ir_emissivity_outer_ow}, - TGround=${zone.t_ground}) "Computes equivalent air temperature" + TGro=${zone.t_ground}) "Computes equivalent air temperature" annotation (Placement(transformation(extent={{-24,-14},{-4,6}}))); % else: Annex60.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007WithWindow eqAirTemp( n=${len(zone.orientation_wall)}, - wfGround=${list_to_string(zone.weightfactor_ground)}, + wfGro=${list_to_string(zone.weightfactor_ground)}, wfWall={${list_to_string(zone.weightfactor_ow)}}, wfWin={${list_to_string(zone.weightfactor_win)}}, withLongwave=true, @@ -106,7 +106,7 @@ model ${bldg.name}_${zone.name.replace(" ", "")} aWin=${zone.solar_absorp_win}, eExt=${zone.ir_emissivity_outer_ow}, eWin=${zone.ir_emissivity_win}, - TGround=${zone.t_ground}) "Computes equivalent air temperature" + TGro=${zone.t_ground}) "Computes equivalent air temperature" annotation (Placement(transformation(extent={{-24,-14},{-4,6}}))); % endif Modelica.Blocks.Math.Add solRad[${len(zone.orientation_wall)}] @@ -187,13 +187,13 @@ model ${bldg.name}_${zone.name.replace(" ", "")} Annex60.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007 eqAirTempVDI( aExt=${zone.solar_absorp_rt}, eExt=${zone.ir_emissivity_outer_rt}, - wfGround=0, + wfGro=0, alphaWallOut=${zone.alpha_conv_outer_rt}, alphaRadWall=${zone.alpha_rad_outer_rt}, n=${len(zone.rooftops)}, wfWall={${list_to_string(zone.weightfactor_rt)}}, wfWin={${list_to_string([0] * len(zone.rooftops))}}, - TGround=285.15) "Computes equivalent air temperature for roof" + TGro=285.15) "Computes equivalent air temperature for roof" annotation (Placement(transformation(extent={{30,34},{50,54}}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature prescribedTemperatureRoof "Prescribed temperature for roof outdoor surface temperature" diff --git a/teaser/data/output/modelicatemplate/Annex60/Annex60_ThreeElements b/teaser/data/output/modelicatemplate/Annex60/Annex60_ThreeElements index 402ad8600..a2a522c96 100644 --- a/teaser/data/output/modelicatemplate/Annex60/Annex60_ThreeElements +++ b/teaser/data/output/modelicatemplate/Annex60/Annex60_ThreeElements @@ -33,7 +33,7 @@ model ${bldg.name}_${zone.name.replace(" ", "")} Annex60.ThermalZones.ReducedOrder.SolarGain.CorrectionGDoublePane corGDoublePane(n=${len(zone.orientation_wall)}, UWin=${zone.ua_value_win/zone.area_win}) "Correction factor for solar transmission" annotation (Placement(transformation(extent={{6,54},{26,74}}))); - Annex60.ThermalZones.ReducedOrder.RC.ThermalZoneThreeElements + Annex60.ThermalZones.ReducedOrder.RC.ThreeElements thermalZoneThreeElements( redeclare package Medium = Modelica.Media.Air.SimpleAir, VAir=${zone.volume}, @@ -76,7 +76,7 @@ model ${bldg.name}_${zone.name.replace(" ", "")} % if merge_windows is True: Annex60.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007 eqAirTemp( n=${len(zone.orientation_wall)}, - wfGround=${list_to_string(zone.weightfactor_ground)}, + wfGro=${list_to_string(zone.weightfactor_ground)}, wfWall={${list_to_string(zone.weightfactor_ow)}}, wfWin={${list_to_string(zone.weightfactor_win)}}, withLongwave=true, @@ -84,12 +84,12 @@ model ${bldg.name}_${zone.name.replace(" ", "")} alphaWallOut=${zone.alpha_conv_outer_ow}, alphaRadWall=${zone.alpha_rad_outer_ow}, eExt=${zone.ir_emissivity_outer_ow}, - TGround=${zone.t_ground}) "Computes equivalent air temperature" + TGro=${zone.t_ground}) "Computes equivalent air temperature" annotation (Placement(transformation(extent={{-24,-14},{-4,6}}))); % else: Annex60.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007WithWindow eqAirTemp( n=${len(zone.orientation_wall)}, - wfGround=${list_to_string(zone.weightfactor_ground)}, + wfGro=${list_to_string(zone.weightfactor_ground)}, wfWall={${list_to_string(zone.weightfactor_ow)}}, wfWin={${list_to_string(zone.weightfactor_win)}}, withLongwave=true, @@ -101,7 +101,7 @@ model ${bldg.name}_${zone.name.replace(" ", "")} aWin=${zone.solar_absorp_win}, eExt=${zone.ir_emissivity_outer_ow}, eWin=${zone.ir_emissivity_win}, - TGround=${zone.t_ground}) "Computes equivalent air temperature" + TGro=${zone.t_ground}) "Computes equivalent air temperature" annotation (Placement(transformation(extent={{-24,-14},{-4,6}}))); % endif Modelica.Blocks.Math.Add solRad[${len(zone.orientation_wall)}] diff --git a/teaser/data/output/modelicatemplate/Annex60/Annex60_TwoElements b/teaser/data/output/modelicatemplate/Annex60/Annex60_TwoElements index 416e46261..d2726a475 100644 --- a/teaser/data/output/modelicatemplate/Annex60/Annex60_TwoElements +++ b/teaser/data/output/modelicatemplate/Annex60/Annex60_TwoElements @@ -33,7 +33,7 @@ model ${bldg.name}_${zone.name.replace(" ", "")} Annex60.ThermalZones.ReducedOrder.SolarGain.CorrectionGDoublePane corGDoublePane(n=${len(zone.orientation_wall)}, UWin=${zone.ua_value_win/zone.area_win}) "Correction factor for solar transmission" annotation (Placement(transformation(extent={{6,54},{26,74}}))); - Annex60.ThermalZones.ReducedOrder.RC.ThermalZoneTwoElements + Annex60.ThermalZones.ReducedOrder.RC.TwoElements thermalZoneTwoElements( redeclare package Medium = Modelica.Media.Air.SimpleAir, VAir=${zone.volume}, @@ -70,7 +70,7 @@ model ${bldg.name}_${zone.name.replace(" ", "")} % if merge_windows is True: Annex60.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007 eqAirTemp( n=${len(zone.orientation_wall)}, - wfGround=${list_to_string(zone.weightfactor_ground)}, + wfGro=${list_to_string(zone.weightfactor_ground)}, wfWall={${list_to_string(zone.weightfactor_ow)}}, wfWin={${list_to_string(zone.weightfactor_win)}}, withLongwave=true, @@ -78,7 +78,7 @@ model ${bldg.name}_${zone.name.replace(" ", "")} alphaWallOut=${zone.alpha_conv_outer_ow}, alphaRadWall=${zone.alpha_rad_outer_ow}, eExt=${zone.ir_emissivity_outer_ow}, - TGround=${zone.t_ground}) "Computes equivalent air temperature" + TGro=${zone.t_ground}) "Computes equivalent air temperature" annotation (Placement(transformation(extent={{-24,-14},{-4,6}}))); % else: Annex60.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007WithWindow eqAirTemp( From 947dc8becc29855b89361f482315aff1c636003a Mon Sep 17 00:00:00 2001 From: PRemmen Date: Wed, 22 Jun 2016 13:59:06 +0200 Subject: [PATCH 11/23] rename variables --- .../output/modelicatemplate/Annex60/Annex60_FourElements | 2 +- .../output/modelicatemplate/Annex60/Annex60_ThreeElements | 2 +- .../output/modelicatemplate/Annex60/Annex60_TwoElements | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/teaser/data/output/modelicatemplate/Annex60/Annex60_FourElements b/teaser/data/output/modelicatemplate/Annex60/Annex60_FourElements index 478ebae72..e5618dcea 100644 --- a/teaser/data/output/modelicatemplate/Annex60/Annex60_FourElements +++ b/teaser/data/output/modelicatemplate/Annex60/Annex60_FourElements @@ -240,7 +240,7 @@ model ${bldg.name}_${zone.name.replace(" ", "")} equation % if merge_windows is False: - connect(eqAirTemp.TEqAirWindow, prescribedTemperature1.T) + connect(eqAirTemp.TEqAirWin, prescribedTemperature1.T) annotation (Line( points={{-3,-0.2},{0,-0.2},{0,20},{6.8,20}}, color={0,0,127})); % endif diff --git a/teaser/data/output/modelicatemplate/Annex60/Annex60_ThreeElements b/teaser/data/output/modelicatemplate/Annex60/Annex60_ThreeElements index a2a522c96..236cc0433 100644 --- a/teaser/data/output/modelicatemplate/Annex60/Annex60_ThreeElements +++ b/teaser/data/output/modelicatemplate/Annex60/Annex60_ThreeElements @@ -180,7 +180,7 @@ model ${bldg.name}_${zone.name.replace(" ", "")} origin={84,-22}))); equation % if merge_windows is False: - connect(eqAirTemp.TEqAirWindow, prescribedTemperature1.T) + connect(eqAirTemp.TEqAirWin, prescribedTemperature1.T) annotation (Line( points={{-3,-0.2},{0,-0.2},{0,20},{6.8,20}}, color={0,0,127})); % endif diff --git a/teaser/data/output/modelicatemplate/Annex60/Annex60_TwoElements b/teaser/data/output/modelicatemplate/Annex60/Annex60_TwoElements index d2726a475..04ab9ef00 100644 --- a/teaser/data/output/modelicatemplate/Annex60/Annex60_TwoElements +++ b/teaser/data/output/modelicatemplate/Annex60/Annex60_TwoElements @@ -83,7 +83,7 @@ model ${bldg.name}_${zone.name.replace(" ", "")} % else: Annex60.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007WithWindow eqAirTemp( n=${len(zone.orientation_wall)}, - wfGround=${list_to_string(zone.weightfactor_ground)}, + wfGro=${list_to_string(zone.weightfactor_ground)}, wfWall={${list_to_string(zone.weightfactor_ow)}}, wfWin={${list_to_string(zone.weightfactor_win)}}, withLongwave=true, @@ -95,7 +95,7 @@ model ${bldg.name}_${zone.name.replace(" ", "")} aWin=${zone.solar_absorp_win}, eExt=${zone.ir_emissivity_outer_ow}, eWin=${zone.ir_emissivity_win}, - TGround=${zone.t_ground}) "Computes equivalent air temperature" + TGro=${zone.t_ground}) "Computes equivalent air temperature" annotation (Placement(transformation(extent={{-24,-14},{-4,6}}))); % endif Modelica.Blocks.Math.Add solRad[${len(zone.orientation_wall)}] @@ -161,7 +161,7 @@ model ${bldg.name}_${zone.name.replace(" ", "")} annotation (Placement(transformation(extent={{6,-60},{22,-44}}))); equation % if merge_windows is False: - connect(eqAirTemp.TEqAirWindow, prescribedTemperature1.T) + connect(eqAirTemp.TEqAirWin, prescribedTemperature1.T) annotation (Line( points={{-3,-0.2},{0,-0.2},{0,20},{6.8,20}}, color={0,0,127})); % endif From 247ed759c98477cbcf265006d20dcb40ba5ba37e Mon Sep 17 00:00:00 2001 From: PRemmen Date: Wed, 22 Jun 2016 13:59:25 +0200 Subject: [PATCH 12/23] add area lists to set_default --- teaser/logic/buildingobjects/thermalzone.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/teaser/logic/buildingobjects/thermalzone.py b/teaser/logic/buildingobjects/thermalzone.py index cd9720577..f98f04909 100644 --- a/teaser/logic/buildingobjects/thermalzone.py +++ b/teaser/logic/buildingobjects/thermalzone.py @@ -1261,6 +1261,7 @@ def set_calc_default(self): self.weightfactor_ground = [] self.tilt_wall = [] self.orientation_wall = [] + self.outer_walls_areas = [] self.ua_value_ow = 0.0 self.r_conv_inner_ow = 0.0 @@ -1339,6 +1340,7 @@ def set_calc_default(self): self.weightfactor_win = [] self.g_sunblind_list = [] self.window_area_list = [] + self.window_areas = [] self.orientation_win = [] self.tilt_win = [] self.ua_value_win = 0.0 From 1832c33cd4ea4976bae2ad53ba5a4142b8ee9d7e Mon Sep 17 00:00:00 2001 From: PRemmen Date: Wed, 22 Jun 2016 14:20:41 +0200 Subject: [PATCH 13/23] better creation of outputdata, unittest should run --- teaser/__init__.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/teaser/__init__.py b/teaser/__init__.py index 4f8805bfa..95151dc37 100644 --- a/teaser/__init__.py +++ b/teaser/__init__.py @@ -19,13 +19,8 @@ raise Exception('This software runs on python versions 2.7 or >=3.3 only!') new_path = utilitis.get_full_path("OutputData") - -dire = os.path.dirname(new_path) - -try: - os.stat(dire) -except: - os.mkdir(dire) +if not os.path.exists(new_path): + os.makedirs(new_path) if sys.platform.startswith('win'): def read_file(path, mode='r'): From 4fb3a92c1b7a2d3f0071e5053c19726c702ccacf Mon Sep 17 00:00:00 2001 From: Peter Remmen Date: Wed, 22 Jun 2016 14:58:56 +0200 Subject: [PATCH 14/23] change version number --- README.md | 2 +- doc/conf.py | 2 +- doc/index.rst | 2 +- setup.py | 2 +- teaser/gui/mainui.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c17548ce5..3c91b8eea 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ IEA-EBC [Annex60](https://github.com/iea-annex60/modelica-annex60). ### Version -The current version is 0.3.5, which is a pre-release. +The current version is 0.3.6, which is a pre-release. ### How to cite TEASER diff --git a/doc/conf.py b/doc/conf.py index 327b685e8..4f0133e12 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -60,7 +60,7 @@ # The short X.Y version. version = '0.3.' # The full version, including alpha/beta/rc tags. -release = '0.3.5' +release = '0.3.6' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/index.rst b/doc/index.rst index 4b6b5d00d..05fd2ac4e 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -60,7 +60,7 @@ IEA-EBC `Annex60 `_. Version ================== -The current version is 0.3.5, which is a pre-release. +The current version is 0.3.6, which is a pre-release. How to cite TEASER ================== diff --git a/setup.py b/setup.py index b649ebb3b..fe7dd108a 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup setup(name='teaser', - version='0.3.5', + version='0.3.6', description='Tool for Energy Analysis and Simulation for Efficient Retrofit ', url='https://github.com/RWTH-EBC/TEASER', author='RWTH Aachen University, E.ON Energy Research Center, Institute of Energy Efficient Buildings and Indoor Climate', diff --git a/teaser/gui/mainui.py b/teaser/gui/mainui.py index 325e509ad..bbdabcc97 100644 --- a/teaser/gui/mainui.py +++ b/teaser/gui/mainui.py @@ -92,7 +92,7 @@ def __init__(self, parent=None, gui=True, dir=None, file=None): self.resize(900, 800) self.setMinimumSize(QtCore.QSize(900, 800)) self.setMaximumSize(QtCore.QSize(900, 800)) - teaserVersion = "0.3.5 beta" + teaserVersion = "0.3.6 beta" self.setWindowTitle("TEASER Version %s" % teaserVersion) self.central_widget = QtGui.QWidget(self) self.central_widget.setObjectName(_fromUtf8("central_widget")) From c35de7e601fb4b04eb9e6b57e36dea979b6a450b Mon Sep 17 00:00:00 2001 From: PRemmen Date: Thu, 23 Jun 2016 14:44:52 +0200 Subject: [PATCH 15/23] Solve bug for Annex60 4 Elements --- teaser/logic/simulation/annex.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/teaser/logic/simulation/annex.py b/teaser/logic/simulation/annex.py index f3c2c02ef..cc3afbd65 100644 --- a/teaser/logic/simulation/annex.py +++ b/teaser/logic/simulation/annex.py @@ -101,6 +101,11 @@ def compare_orientation(bldg, number_of_elements=3): zone.window_area_list.append(0.0) zone.g_sunblind_list.append(0.0) zone.window_areas.append(0.0) + elif number_of_elements == 4 and i[1] >= 90: + zone.weightfactor_win.append(0.0) + zone.window_area_list.append(0.0) + zone.g_sunblind_list.append(0.0) + zone.window_areas.append(0.0) else: if number_of_elements != 4: From 9b8a1f613215b54aa43f4f486f7319a8bc645b98 Mon Sep 17 00:00:00 2001 From: PRemmen Date: Thu, 23 Jun 2016 16:49:30 +0200 Subject: [PATCH 16/23] remove parameters from calc all buildings function call --- teaser/project.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/teaser/project.py b/teaser/project.py index f748cdcdc..d81f6b16f 100644 --- a/teaser/project.py +++ b/teaser/project.py @@ -114,33 +114,27 @@ def instantiate_data_class(self, type_element_file=None): ''' return DataClass(type_element_file) - def calc_all_buildings(self, - number_of_elements=2, - merge_windows=False, - used_library='AixLib'): + def calc_all_buildings(self): '''Calculates values for all project buildings - Parameters - ---------- + You need to set the following parameters in the Project class. - number_of_elements : int - defines the number of elements, that areaaggregated, between 1 + number_of_elements_calc : int + defines the number of elements, that area aggregated, between 1 and 4, default is 2 For AixLib you should always use 2 elements!!! - merge_windows : bool + merge_windows_calc : bool True for merging the windows into the outer walls, False for separate resistance for window, default is False For AixLib vdi calculation is True, ebc calculation is False - used_library : str + used_library_calc : str used library (AixLib and Annex60 are supported) ''' - self._number_of_elements_calc = number_of_elements - self._merge_windows_calc = merge_windows - self._used_library_calc = used_library + for bldg in reversed(self.buildings): try: bldg.calc_building_parameter( From 5dd82c102ca809b93d6c37ff616c1031d86dad17 Mon Sep 17 00:00:00 2001 From: PRemmen Date: Fri, 24 Jun 2016 09:16:55 +0200 Subject: [PATCH 17/23] add the lists rooftops and groundfloors to set_calc_default --- teaser/logic/buildingobjects/thermalzone.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/teaser/logic/buildingobjects/thermalzone.py b/teaser/logic/buildingobjects/thermalzone.py index f98f04909..d2048d59e 100644 --- a/teaser/logic/buildingobjects/thermalzone.py +++ b/teaser/logic/buildingobjects/thermalzone.py @@ -1251,6 +1251,8 @@ def retrofit_zone(self, window_type=None, material=None): def set_calc_default(self): self.outer_walls_help = [] + self.rooftops = [] + self.ground_floors = [] self.r1_ow = 0.0 self.c1_ow = 0.0 From ae5b09093176980abdb6d8325a68db64f5319951 Mon Sep 17 00:00:00 2001 From: PRemmen Date: Fri, 24 Jun 2016 09:26:46 +0200 Subject: [PATCH 18/23] remove parameters from calc_all_buildings --- tests/test_data.py | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/tests/test_data.py b/tests/test_data.py index 26fe725a3..c27ac5228 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -97,10 +97,10 @@ def test_calc_ebc(self): prj.load_project(utilities.get_full_path("examples/examplefiles" "/new.teaserXML")) therm_zone = prj.buildings[0].thermal_zones[0] - - prj.buildings[0].calc_building_parameter(number_of_elements=2, - merge_windows=False, - used_library='AixLib') + prj.number_of_elements_calc = 2 + prj.merge_windows_calc = False + prj.used_library_calc = 'AixLib' + prj.buildings[0].calc_building_parameter() assert round(therm_zone.r1_iw, 11) == 4.62113e-06 assert round(therm_zone.c1_iw, 2) == 1209810287.22 @@ -577,12 +577,14 @@ def test_calc_all_buildings(self): helptest.building_test2(prj) helptest.building_test2(prj) - prj.calc_all_buildings(number_of_elements=2, - merge_windows=True, - used_library='AixLib') - prj.calc_all_buildings(number_of_elements=2, - merge_windows=False, - used_library='AixLib') + prj.number_of_elements_calc = 2 + prj.merge_windows_calc = True + prj.used_library_calc = 'AixLib' + prj.calc_all_buildings() + prj.number_of_elements_calc = 2 + prj.merge_windows_calc = False + prj.used_library_calc = 'AixLib' + prj.calc_all_buildings() def test_retrofit_all_buildings(self): '''test of retrofit_all_buildings, no calculation verification''' @@ -592,13 +594,15 @@ def test_retrofit_all_buildings(self): def test_export_aixlib(self): '''test of export_aixlib, no calculation verification''' - prj.calc_all_buildings(number_of_elements=2, - merge_windows=True, - used_library='AixLib') + prj.number_of_elements_calc = 2 + prj.merge_windows_calc = True + prj.used_library_calc = 'AixLib' + prj.calc_all_buildings() prj.export_aixlib(building_model='MultizoneEquipped') - prj.calc_all_buildings(number_of_elements=2, - merge_windows=False, - used_library='AixLib') + prj.number_of_elements_calc = 2 + prj.merge_windows_calc = False + prj.used_library_calc = 'AixLib' + prj.calc_all_buildings() prj.export_aixlib(building_model='MultizoneEquipped') def test_export_parameters_txt(self): From 7ff72ceaa9dea56da3da96e5306da3f5945eabd3 Mon Sep 17 00:00:00 2001 From: PRemmen Date: Fri, 24 Jun 2016 12:38:57 +0200 Subject: [PATCH 19/23] change examples that also has open modelica compatible export --- teaser/examples/archetype.py | 56 +++++++++++++++++++++-------- teaser/examples/melaten_campus.py | 58 +++++++++++++++++++++++-------- teaser/examples/singlebuilding.py | 36 +++++++++++++++---- 3 files changed, 116 insertions(+), 34 deletions(-) diff --git a/teaser/examples/archetype.py b/teaser/examples/archetype.py index 075f04606..b2eeccf61 100644 --- a/teaser/examples/archetype.py +++ b/teaser/examples/archetype.py @@ -46,24 +46,53 @@ def example_type_building(): with_ahu=True, construction_type="heavy") - """We need to set the projects calculation method. The library we want to use is AixLib, we are using a two element model and want an extra resistance for the windows. To export the parameters to a Modelica record, we use the export_aixlib - function. path = None indicates, that we want to store the records in \ - TEASER'S Output folder""" + ''' + We need to set the projects calculation method. The library we want to + use is AixLib, we are using a two element model and want an extra resistance + for the windows. To export the parameters to a Modelica record, we use + the export_aixlib function. path = None indicates, that we want to store + the records in TEASER'S Output folder + ''' + prj.used_library_calc = 'AixLib' prj.number_of_elements_calc = 2 prj.merge_windows_calc = False + + prj.calc_all_buildings() + + ''' + Export the Modelica Record. If you have a Dymola License you can export + the model with a central AHU (MultizoneEquipped) (only default for office + and institute buildings) + ''' + prj.export_aixlib(building_model="MultizoneEquipped", zone_model="ThermalZoneEquipped", corG=True, internal_id=None, path=None) - """or we could also use the Annex60 models""" - #prj.used_library_calc = "Annex60" - #prj.export_annex(number_of_elements=2, - # merge_windows=False, - # internal_id=None, - # path=None) + ''' + For OpenModelica you need to exclude the centralAHU (because it is using + state machines). Therefore use the building_model "Multizone" + ''' + + #prj.export_aixlib(building_model="Multizone", + # zone_model="ThermalZoneEquipped", + # corG=True, + # internal_id=None, + # path=None) + + + '''Or we use Annex60 method (e.g with four elements). Which exports one + Model per zone''' + + #prj.used_library_calc = 'Annex60' + #prj.number_of_elements_calc = 4 + #prj.merge_windows_calc = False + + #prj.calc_all_buildings() + #prj.export_annex() """Now we retrofit all buildings in the year 2015 (EnEV2014). \ That includes new insulation layer and new windows. The name is changed \ @@ -71,17 +100,16 @@ def example_type_building(): prj.name = "Project_Retrofit" prj.retrofit_all_buildings(2015) - prj.calc_all_buildings(number_of_elements=2, - merge_windows=False, - used_library='AixLib') + prj.calc_all_buildings() + + '''You could also change the exports here as seen above''' + prj.export_aixlib(building_model="MultizoneEquipped", zone_model="ThermalZoneEquipped", corG=True, internal_id=None, path=None) - - prj.save_project("Retrofit_Building", path=None) diff --git a/teaser/examples/melaten_campus.py b/teaser/examples/melaten_campus.py index dff134993..ee10584bb 100644 --- a/teaser/examples/melaten_campus.py +++ b/teaser/examples/melaten_campus.py @@ -43,35 +43,65 @@ def main(): info_list = read_XMLs(input_path) prj = create_reference_project(info_list) + + ''' + We need to set the projects calculation method. The library we want to + use is AixLib, we are using a two element model and want an extra resistance + for the windows. To export the parameters to a Modelica record, we use + the export_aixlib function. path = None indicates, that we want to store + the records in TEASER'S Output folder + ''' + + prj.used_library_calc = 'AixLib' prj.number_of_elements_calc = 2 prj.merge_windows_calc = False - prj.used_library_calc = "AixLib" + + prj.calc_all_buildings() + + ''' + Export the Modelica Record. If you have a Dymola License you can export + the model with a central AHU (MultizoneEquipped) (only default for office + and institute buildings) + ''' + prj.export_aixlib(building_model="MultizoneEquipped", zone_model="ThermalZoneEquipped", corG=True, internal_id=None, path=None) - """or we could also use the Annex60 models""" - #prj.used_library_calc = "Annex60" - #prj.export_annex(number_of_elements=2, - # merge_windows=False, - # internal_id=None, - # path=None) + ''' + For OpenModelica you need to exclude the centralAHU (because it is using + state machines). Therefore use the building_model "Multizone" + ''' + + #prj.export_aixlib(building_model="Multizone", + # zone_model="ThermalZoneEquipped", + # corG=True, + # internal_id=None, + # path=None) + + + '''Or we use Annex60 method (e.g with four elements). Which exports one + Model per zone''' + + #prj.used_library_calc = 'Annex60' + #prj.number_of_elements_calc = 4 + #prj.merge_windows_calc = False + + #prj.calc_all_buildings() + #prj.export_annex() + prj.retrofit_all_buildings(2015) + + '''You could also change the exports here as seen above''' + prj.export_aixlib(building_model="MultizoneEquipped", zone_model="ThermalZoneEquipped", corG=True, internal_id=None, path=None) - """or we could also use the Annex60 models""" - - #prj.export_annex(number_of_elements=2, - # merge_windows=False, - # internal_id=None, - # path=None) - def read_XMLs(input_path): """Reads the building XMLs to list of `BuildingInfo` objects diff --git a/teaser/examples/singlebuilding.py b/teaser/examples/singlebuilding.py index dea7fa4a0..b26d1f9da 100644 --- a/teaser/examples/singlebuilding.py +++ b/teaser/examples/singlebuilding.py @@ -223,7 +223,11 @@ def example_create_building(): ground.area = 140.0 ''' - We calculate the RC Values according to AixLib procedure + We need to set the projects calculation method. The library we want to + use is AixLib, we are using a two element model and want an extra resistance + for the windows. To export the parameters to a Modelica record, we use + the export_aixlib function. path = None indicates, that we want to store + the records in TEASER'S Output folder ''' prj.used_library_calc = 'AixLib' @@ -231,19 +235,39 @@ def example_create_building(): prj.merge_windows_calc = False prj.calc_all_buildings() + ''' - Export the Modelica Record + Export the Modelica Record. If you have a Dymola License you can export + the model with a central AHU (MultizoneEquipped) (only default for office + and institute buildings) ''' + prj.export_aixlib(building_model="MultizoneEquipped", zone_model="ThermalZoneEquipped", corG=True, internal_id=None, path=None) - '''Or we use Annex60 method with for elements''' - #prj.calc_all_buildings(number_of_elements=4, - # merge_windows=False, - # used_library='Annex60') + ''' + For OpenModelica you need to exclude the centralAHU (because it is using + state machines). Therefore use the building_model "Multizone" + ''' + + #prj.export_aixlib(building_model="Multizone", + # zone_model="ThermalZoneEquipped", + # corG=True, + # internal_id=None, + # path=None) + + + '''Or we use Annex60 method (e.g with four elements). Which exports one + Model per zone''' + + #prj.used_library_calc = 'Annex60' + #prj.number_of_elements_calc = 4 + #prj.merge_windows_calc = False + + #prj.calc_all_buildings() #prj.export_annex() ''' From 8c8f597c549580ac9eac3a3a5971dbf068744669 Mon Sep 17 00:00:00 2001 From: MichaMans Date: Fri, 24 Jun 2016 12:57:09 +0200 Subject: [PATCH 20/23] #263 updated example and the example docu --- doc/teaser.Examples.rst | 44 +++++++++++++++++++++---------- teaser/examples/singlebuilding.py | 4 +-- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/doc/teaser.Examples.rst b/doc/teaser.Examples.rst index a8d8bb0d0..b17f81b96 100644 --- a/doc/teaser.Examples.rst +++ b/doc/teaser.Examples.rst @@ -2,9 +2,11 @@ examples ======================= You can find more examples in the example package of the TEASER distribution. +e.g.: +[PathOfYourPythonDistribution/Lib/site-packages/teaser] -example_archetype.py +archetype.py ------------------------------------------- This module contains an example how to create an archetype Building, to retrofit @@ -58,6 +60,7 @@ TEASER'S Output folder:: prj.used_library_calc = 'AixLib' prj.number_of_elements_calc = 2 prj.merge_windows_calc = False + prj.calc_all_buildings() prj.export_aixlib( building_model="MultizoneEquipped", zone_model="ThermalZoneEquipped", @@ -68,7 +71,11 @@ TEASER'S Output folder:: We could also use Annex60 models with same calculation method:: prj.used_library_calc = "Annex60" - prj.export_annex() + prj.calc_all_buildings() + prj.export_annex(number_of_elements=2, + merge_windows=False, + internal_id=None, + path=None) Now we retrofit all buildings in the year 2015 (EnEV2014). That includes new insulation layer and new windows. The name is changed to Retrofit:: @@ -89,7 +96,7 @@ XML file:: -example_createbuilding.py +singlebuilding.py --------------------------------------------- This module shows how to create a building from scratch (or arbitrary sources) @@ -97,8 +104,20 @@ calculate parameters for a Modelica model and save this example building in a XML based format. The used classes are imported one after another. Of course you can import all the classes at the beginning:: - from teaser.project import Project from teaser.logic.buildingobjects.building import Building + from teaser.logic.buildingobjects.buildingphysics.groundfloor import\ + GroundFloor + from teaser.logic.buildingobjects.buildingphysics.innerwall import InnerWall + from teaser.logic.buildingobjects.buildingphysics.layer import Layer + from teaser.logic.buildingobjects.buildingphysics.material import Material + from teaser.logic.buildingobjects.buildingphysics.outerwall import OuterWall + from teaser.logic.buildingobjects.buildingphysics.rooftop import Rooftop + from teaser.logic.buildingobjects.buildingphysics.window import Window + from teaser.logic.buildingobjects.thermalzone import ThermalZone + from teaser.logic.buildingobjects.boundaryconditions.boundaryconditions \ + import BoundaryConditions + from teaser.project import Project + prj = Project(load_data=True) bldg = Building(parent=prj) @@ -112,8 +131,6 @@ Set some building parameters:: Instantiate a ThermalZone class, with building as parent and set some parameters of the thermal zone:: - from teaser.logic.buildingobjects.thermalzone import ThermalZone - tz = ThermalZone(parent=bldg) tz.name = "Living Room" tz.area = 45.0 @@ -122,9 +139,6 @@ some parameters of the thermal zone:: Instantiate UseConditionsOffice18599 class with thermal zone as parent, and load the use conditions for the usage 'Living':: - from teaser.logic.buildingobjects.boundaryconditions.boundaryconditions import \ - BoundaryConditions - tz.use_conditions = BoundaryConditions(parent=tz) tz.use_conditions.load_use_conditions("Living") @@ -314,11 +328,13 @@ Export the Modelica model:: Or we use Annex60 method with for elements:: - prj.calc_all_buildings( - number_of_elements=4, - merge_windows=False, - used_library='Annex60') - prj.export_annex() + prj.used_library_calc = 'Annex60' + + + prj.calc_all_buildings() + prj.export_annex(number_of_elements=2, + merge_windows=False, + used_library='Annex60') Save teaserXML and CityGML:: diff --git a/teaser/examples/singlebuilding.py b/teaser/examples/singlebuilding.py index dea7fa4a0..64589c5c8 100644 --- a/teaser/examples/singlebuilding.py +++ b/teaser/examples/singlebuilding.py @@ -11,8 +11,8 @@ First we need to import the classes we want to use ''' -from teaser.logic.buildingobjects.boundaryconditions.boundaryconditions import \ - BoundaryConditions +from teaser.logic.buildingobjects.boundaryconditions.boundaryconditions \ + import BoundaryConditions from teaser.logic.buildingobjects.building import Building from teaser.logic.buildingobjects.buildingphysics.groundfloor import\ GroundFloor From dc0189814a4c669992bc9ad3a08b00a09e7b17b6 Mon Sep 17 00:00:00 2001 From: PRemmen Date: Fri, 24 Jun 2016 14:10:41 +0200 Subject: [PATCH 21/23] add infiltration temp and rate to Mutlizone model --- .../modelicatemplate/AixLib/AixLib_model | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/teaser/data/output/modelicatemplate/AixLib/AixLib_model b/teaser/data/output/modelicatemplate/AixLib/AixLib_model index 9e2a8c5dc..61399c560 100644 --- a/teaser/data/output/modelicatemplate/AixLib/AixLib_model +++ b/teaser/data/output/modelicatemplate/AixLib/AixLib_model @@ -69,6 +69,18 @@ model ${bldg.name} "modelica://${mod_prj}/${bldg.name}/${bldg.file_internal_gains}")) annotation (Placement(transformation(extent={{84,18},{64,38}}))); + Modelica.Blocks.Sources.CombiTimeTable combiTimeTable(table=[ + 0 + % for tz in bldg.thermal_zones: + ,${tz.infiltration_rate} ${';' if (loop.last) else ''} + %endfor + 3600 + % for tz in bldg.thermal_zones: + ,${tz.infiltration_rate} + %endfor + ]) + annotation (Placement(transformation(extent={{-74,-2},{-54,18}}))); + equation connect(weather.SolarRadiation_OrientedSurfaces, multizone.radIn) @@ -81,6 +93,14 @@ equation connect(tableInternalGains.y, multizone.internalGains) annotation (Line(points={{63,28},{46,28},{46,27.25},{26.11,27.25}}, color={0,0,127})); + % for i, zo in enumerate(bldg.thermal_zones): + connect(weather.WeatherDataVector[${i+1}], multizone.ventilationTemperature[${i+1}]) + annotation (Line(points={{-9.1,67},{-9.1,52.5},{-24.38,52.5},{-24.38,15}}, + color={0,0,127})); + % endfor + + connect(combiTimeTable.y, multizone.ventilationRate) annotation (Line(points={{-51,8}, + {-24.38,8},{-24.38,7.5}}, color={0,0,127})); annotation (experiment( StopTime=31536000, From f29a70d912948447f027a34e1e944f8e3d4bc49c Mon Sep 17 00:00:00 2001 From: PRemmen Date: Fri, 24 Jun 2016 14:18:15 +0200 Subject: [PATCH 22/23] update doc --- doc/teaser.Examples.rst | 75 ++++++++++++++++++++++++++++------------- 1 file changed, 52 insertions(+), 23 deletions(-) diff --git a/doc/teaser.Examples.rst b/doc/teaser.Examples.rst index b17f81b96..107e8d758 100644 --- a/doc/teaser.Examples.rst +++ b/doc/teaser.Examples.rst @@ -68,7 +68,14 @@ TEASER'S Output folder:: internal_id=None, path=None) -We could also use Annex60 models with same calculation method:: +For OpenModelica you need to exclude the centralAHU (because it uses state machines). Therefore use the building_model "Multizone":: + prj.export_aixlib(building_model="Multizone", + zone_model="ThermalZoneEquipped", + corG=True, + internal_id=None, + path=None) + +We could also use Annex60 models with same calculation method, which exports one model per zone:: prj.used_library_calc = "Annex60" prj.calc_all_buildings() @@ -82,6 +89,9 @@ insulation layer and new windows. The name is changed to Retrofit:: prj.name = "Project_Retrofit" prj.retrofit_all_buildings(2015) + +Again, we need to export the model, ou could also change the exports here as seen above:: + prj.export_record( building_model="MultizoneEquipped", zone_model="ThermalZoneEquipped", @@ -128,7 +138,7 @@ Set some building parameters:: bldg.city = "46325 Fantastic Town" bldg.year_of_construction = 1988 -Instantiate a ThermalZone class, with building as parent and set +Instantiate a ThermalZone class, with building as parent and set some parameters of the thermal zone:: tz = ThermalZone(parent=bldg) @@ -141,7 +151,7 @@ Instantiate UseConditionsOffice18599 class with thermal zone as parent, and load tz.use_conditions = BoundaryConditions(parent=tz) tz.use_conditions.load_use_conditions("Living") - + Define two elements representing a pitched roof and define Layers and Materials explicitly:: @@ -164,11 +174,11 @@ Set coefficient of heat transfer:: roof_south.inner_radiation = 20.0 roof_south.outer_radiation = 5.0 - + Set layer and material. The id indicates the position of the layer from inside to outside:: - layer_1s = Layer(parent=roof_south, id=0) + layer_1s = Layer(parent=roof_south, id=0) layer_1s.thickness = 0.15 material_1_2 = Material(layer_1s) @@ -219,12 +229,12 @@ Set layer and material:: material_1_1.density = 1400.0 material_1_1.heat_capac = 0.6 material_1_1.thermal_conduc = 2.5 - - + + For the remaining Outer and Inner walls as well as Windows, we save the information in python dicitonaries, iterate them and instantiate the corresponding classes. In addition we are using the load_type_element function to determine the building physics from statistical data -The key of the dict is the walls's name, while the value is a list with parameters the +The key of the dict is the walls's name, while the value is a list with parameters the [year of construciton, construction type, area, tilt,orientation]:: out_wall_dict = {"Outer Wall 1": [bldg.year_of_construction, 'heavy', @@ -299,7 +309,7 @@ The key of the dict is the walls's name, while the value is a list with paramete win_material.name = "GlasWindow" win_material.thermal_conduc = 0.067 win_material.transmittance = 0.9 - + For a GroundFloor we are using the load_type_element function explicitly, which needs the year of construction and the construction type ('heavy' or 'light'):: @@ -309,7 +319,12 @@ or 'light'):: ground.load_type_element(year=1988, construction='heavy') ground.area = 140.0 -We calculate the RC Values according to AixLib procedure:: + +We need to set the projects calculation method. The library we want to +use is AixLib, we are using a two element model and want an extra resistance +for the windows. To export the parameters to a Modelica record, we use +the export_aixlib function. path = None indicates, that we want to store +the records in TEASER'S Output folder:: prj.used_library_calc = 'AixLib' prj.number_of_elements_calc = 2 @@ -317,24 +332,38 @@ We calculate the RC Values according to AixLib procedure:: prj.calc_all_buildings() -Export the Modelica model:: - prj.export_aixlib( - building_model="MultizoneEquipped", - zone_model="ThermalZoneEquipped", - corG=True, - internal_id=None, - path=None) +Export the Modelica Record. If you have a Dymola License you can export +the model with a central AHU (MultizoneEquipped) (only default for office +and institute buildings):: -Or we use Annex60 method with for elements:: + prj.export_aixlib(building_model="MultizoneEquipped", + zone_model="ThermalZoneEquipped", + corG=True, + internal_id=None, + path=None) - prj.used_library_calc = 'Annex60' +For OpenModelica you need to exclude the centralAHU (because it is using +state machines). Therefore use the building_model "Multizone" - prj.calc_all_buildings() - prj.export_annex(number_of_elements=2, - merge_windows=False, - used_library='Annex60') + + prj.export_aixlib(building_model="Multizone", + zone_model="ThermalZoneEquipped", + corG=True, + internal_id=None, + path=None) + + +'''Or we use Annex60 method (e.g with four elements). Which exports one +Model per zone''' + + prj.used_library_calc = 'Annex60' + prj.number_of_elements_calc = 4 + prj.merge_windows_calc = False + + prj.calc_all_buildings() + prj.export_annex() Save teaserXML and CityGML:: From cad3b54615f05c0dd8b68014d6cbe2cdb227519f Mon Sep 17 00:00:00 2001 From: PRemmen Date: Fri, 24 Jun 2016 14:24:41 +0200 Subject: [PATCH 23/23] fix small bugs in doc --- doc/teaser.Examples.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/teaser.Examples.rst b/doc/teaser.Examples.rst index 107e8d758..ea528574f 100644 --- a/doc/teaser.Examples.rst +++ b/doc/teaser.Examples.rst @@ -69,6 +69,7 @@ TEASER'S Output folder:: path=None) For OpenModelica you need to exclude the centralAHU (because it uses state machines). Therefore use the building_model "Multizone":: + prj.export_aixlib(building_model="Multizone", zone_model="ThermalZoneEquipped", corG=True, @@ -92,7 +93,7 @@ insulation layer and new windows. The name is changed to Retrofit:: Again, we need to export the model, ou could also change the exports here as seen above:: - prj.export_record( + prj.export_aixlib( building_model="MultizoneEquipped", zone_model="ThermalZoneEquipped", corG=True, @@ -345,7 +346,7 @@ and institute buildings):: For OpenModelica you need to exclude the centralAHU (because it is using -state machines). Therefore use the building_model "Multizone" +state machines). Therefore use the building_model "Multizone":: prj.export_aixlib(building_model="Multizone", @@ -355,8 +356,8 @@ state machines). Therefore use the building_model "Multizone" path=None) -'''Or we use Annex60 method (e.g with four elements). Which exports one -Model per zone''' +Or we use Annex60 method (e.g with four elements). Which exports one +Model per zone:: prj.used_library_calc = 'Annex60' prj.number_of_elements_calc = 4