teaser.data.output package

Subpackages

Submodules

teaser.data.output.aixlib_output module

This module contains function for AixLib model generation

teaser.data.output.aixlib_output.export_multizone(buildings, prj, path=None, use_postprocessing_calc=False, export_vars=None)[source]

Exports models for AixLib library

Exports a building for AixLib.ThermalZones.ReducedOrder.Multizone.MultizoneEquipped models using the ThermalZoneEquipped and supporting models, like tables and weather model. Depending on chosen calculation method the parameter set to 1,2, 3 or 4 element model. By default it uses the correction for solar glazing (corG) and decoupled heat conduction through windows ( merge_windows=False). In contrast to versions < 0.5 TEASER now does not support any other model options, as we observed no need, since single ThermalZones are identical with IBPSA models. If you miss one of the old options please contact us.

This function uses Mako Templates specified in data.output.modelicatemplates.AixLib

Parameters:
buildingslist of instances of Building

list of TEASER instances of a Building that is exported to a AixLib MultizoneEquipped models. If you want to export a single building, please pass it over as a list containing only that building.

prjinstance of Project

Instance of TEASER Project object to access Project related information, e.g. name or version of used libraries

pathstring

if the Files should not be stored in default output path of TEASER, an alternative path can be specified as a full path

use_postprocessing_calcbool

If activated the exported model will use the multizonePostProcessing to calculate common outputs for simulation time like total heating demands. Only supported for Aixlib. Default is False.

export_varsstr

Holds the string about which variables to export following the __Dymola_selection syntax.

Attributes:
lookupTemplateLookup object

Instance of mako.TemplateLookup to store general functions for templates

zone_template_1Template object

Template for ThermalZoneRecord using 1 element model

zone_template_2Template object

Template for ThermalZoneRecord using 2 element model

zone_template_3Template object

Template for ThermalZoneRecord using 3 element model

zone_template_4Template object

Template for ThermalZoneRecord using 4 element model

model_templateTemplate object

Template for MultiZone model

teaser.data.output.besmod_output module

This module contains function for BESMod model generation

teaser.data.output.besmod_output.convert_input(building_zones_input: float | Dict[int | str, float | Dict[str, float]], buildings: List[Building]) Dict[str, str][source]

Convert input values for BESMod zone specific parameters to a dictionary.

Supports single values, dictionaries keyed by construction year, or dictionaries keyed by building names. If single values are given then all buildings and zones get this values set. If a dictionary keyed by construction year is given then all zones of a building get the value set of the next higher year corresponding to the construction year of the building. If a dictionary keyed by building name is given the value must be a single value for all zones or another dictionary specifying for each zone name a value.

Parameters:
building_zones_inputUnion[float, Dict[Union[int, str], Union[float, Dict[str, float]]]]

Input value(s) for BESMod parameters. Can be a single value, a dictionary keyed by construction year, or a dictionary keyed by building name. Example: - Single value: 328.15 - Dictionary keyed by construction year: {1970: 348.15, 1990: 328.15} - Dictionary keyed by building name: {

“Building1”: 328.15, “Building2”: {

“Zone1”: 328.15, “Zone2”: 308.15

}

}

buildingsList[Building]

List of TEASER Building instances.

Returns:
Dict[str, str]

Dictionary mapping building names to BESMod parameter input strings.

Raises:
ValueError

If the input dictionary has invalid values.

KeyError

If the input dictionary is missing required keys.

teaser.data.output.besmod_output.export_besmod(buildings: List[Building] | Building, prj: Project, path: str | None = None, examples: List[str] | None = None, THydSup_nominal: float | Dict[str, float] | None = None, QBuiOld_flow_design: Dict[str, Dict[str, float]] | None = None, THydSupOld_design: float | Dict[str, float] | None = None, custom_examples: Dict[str, str] | None = None, custom_script: Dict[str, str] | None = None) None[source]

Export building models for BESMod simulations.

This function generates BESMod.Systems.Demand.Building.TEASERThermalZone models for one or more TEASER buildings. It also allows exporting examples from BESMod.Examples, including the building models.

Parameters:
buildingsUnion[List[Building], Building]

TEASER Building instances to export as BESMod models. Can be a single Building or a list of Buildings.

prjProject

TEASER Project instance containing project metadata such as library versions and weather file paths.

examplesOptional[List[str]]

Names of BESMod examples to export alongside the building models. Supported Examples: “TEASERHeatLoadCalculation”, “HeatPumpMonoenergetic”, and “GasBoilerBuildingOnly”.

pathOptional[str]

Alternative output path for storing the exported files. If None, the default TEASER output path is used.

THydSup_nominalOptional[Union[float, Dict[str, float]]]

Nominal supply temperature(s) for the hydraulic system. Required for certain examples (e.g., HeatPumpMonoenergetic, GasBoilerBuildingOnly). See docstring of teaser.data.output.besmod_output.convert_input() for further information.

QBuiOld_flow_designOptional[Dict[str, Dict[str, float]]]

For partially retrofitted systems specify the old nominal heat flow of all zones in the Buildings in a nested dictionary with the building names and in a level below the zone names as keys. By default, only the radiator transfer system is not retrofitted in BESMod.

THydSupOld_designOptional[Union[float, Dict[str, float]]]

Design supply temperatures for old, non-retrofitted hydraulic systems.

custom_examples: Optional[Dict[str, str]]

Specify custom examples with a dictionary containing the example name as the key and the path to the corresponding custom mako template as the value.

custom_script: Optional[Dict[str, str]]

Specify custom .mos scripts for the existing and custom examples with a dictionary containing the example name as the key and the path to the corresponding custom mako template as the value.

Raises:
ValueError

If given example is not supported.

ValueError

If THydSup_nominal is not provided for examples requiring it.

AssertionError

If the used library for calculations is not AixLib.

NotImplementedError

If a building uses a thermal zone model other than the four-element model.

Notes

The function uses Mako templates for generating Modelica models.

teaser.data.output.buildingelement_output module

This module contains function to save building element classes.

teaser.data.output.buildingelement_output.delete_type_element(element, data_class)[source]

Delete typical element in json.

Deletes typical building elements according to their construction year and their construction type in the the json file for type building elements. If the Project parent is set, it automatically saves it to the file given in Project.data. Alternatively you can specify a path to a file of TypeBuildingElements. If this file does not exist, a new file is created.

Parameters:
elementBuildingElement()

Instance of BuildingElement or inherited Element of TEASER

data_classDataClass()

DataClass containing the bindings for TypeBuildingElement and Material (typically this is the data class stored in prj.data, but the user can individually change that.)

teaser.data.output.buildingelement_output.save_type_element(element, data_class)[source]

Save information about building element to json.

Saves typical building elements according to their construction year and their construction type in the json file for type building elements. If the Project parent is set, it automatically saves it to the file given in Project.data. Alternatively you can specify a path to a file of TypeBuildingElements. If this file does not exist, a new file is created.

Parameters:
elementBuildingElement()

Instance of BuildingElement or inherited Element of TEASER

data_classDataClass()

DataClass containing the bindings for TypeBuildingElement and Material (typically this is the data class stored in prj.data, but the user can individually change that.

teaser.data.output.ibpsa_output module

modelica_output

This module contains function to call Templates for IBPSA model generation

teaser.data.output.ibpsa_output.export_ibpsa(buildings, prj, path=None, library='AixLib')[source]

Exports models for IBPSA library

Export a building to several models for IBPSA.ThermalZones.ReducedOrder. Depending on the chosen calculation method models for 1, 2, 3, or 4 element model are exported. In addition you can specify if windows should be lumped into the walls, like it is done in VDI 6007 (merge_windows=True) or not. For each zone, one model is exported, if you want to combine all thermal zones into one model, consider using AixLib. The export includes internal gains from use conditions ( calculated in teaser.logic.calculation.ibpsa) but does not include any heating or cooling equipment.

Parameters:
buildingslist of instances of Building

list of TEASER instances of a Building that are exported If you want to export a single building, please pass it over as a list containing only that building.

prjinstance of Project

Instance of TEASER Project object to access Project related information, e.g. name or version of used libraries

pathstring

if the Files should not be stored in default output path of TEASER, an alternative path can be specified as a full path

librarystr

Used library within the framework of IBPSA library. The models are identical in each library, but IBPSA Modelica library is just a core set of models and should not be used standalone. Valid values are ‘AixLib’ (default), ‘Buildings’, ‘BuildingSystems’ and ‘IDEAS’.

Attributes:
lookupTemplateLookup object

Instance of mako.TemplateLookup to store general functions for templates

model_template_1Template object

Template for ThermalZoneRecord using 1 element model

model_template_2Template object

Template for ThermalZoneRecord using 2 element model

model_template_3Template object

Template for ThermalZoneRecord using 3 element model

model_template_4Template object

Template for ThermalZoneRecord using 4 element model

teaser.data.output.material_output module

This module contains function to save material classes.

teaser.data.output.material_output.save_material(material, data_class)[source]

Material saver.

Saves material and their properties the JSON file for type building elements. If the Project parent is set, it automatically saves it to the file given in Project.data. Alternatively you can specify a path to a file with Materials. If this file does not exist, a new file is created.

Parameters:
materialMaterial()

instance of TEASERS Material class

data_classDataClass()

DataClass containing the bindings for TypeBuildingElement and Material (typically this is the data class stored in prj.data, but the user can individually change that.

teaser.data.output.modelica_output module

This module contains functions for all modelica model generations with AixLib, IBPSA and BESMod

teaser.data.output.modelica_output.copy_weather_data(source_path, destination_path)[source]

Copies the imported .mos weather file to the results folder.

Parameters:
source_pathstr

path of local weather file

destination_pathstr

path of where the weather file should be placed

teaser.data.output.modelica_output.create_package(path, name, uses=None, within=None)[source]

creates a package.mo file

private function, do not call

Parameters:
pathstring

path of where the package.mo should be placed

namestring

name of the Modelica package

uses[string]

list of used versions for the package in the form ‘Library_name(version=”x.x.x”)’

withinstring

path of Modelica package containing this package

teaser.data.output.modelica_output.create_package_order(path, package_list, addition=None, extra=None)[source]

creates a package.order file

private function, do not call

Parameters:
pathstring

path of where the package.order should be placed

package_list[buildings or thermal_zones]

objects with the attribute name of all models or packages contained in the package

additionstring

if there should be a prefix of package_list.string it can be specified

extra[string]

list of extra packages or models not contained in package_list can be specified

teaser.data.output.runUnitTests module

teaser.data.output.teaserjson_output module

Saves alls Project data into a json.

teaser.data.output.teaserjson_output.save_teaser_json(path, project)[source]

Save a project to a JSON file.

The function needs to be written.

Parameters:
path: string

complete path to the output file

project: Project()

Teaser instance of Project()

teaser.data.output.teaserjson_output.set_basic_data(wall_out, element)[source]

Set basic data of building elements.

Parameters:
wall_outcollection.OrderedDict

OrderedDict for walls

elementTEASERClass

teaser class representation of a building element

teaser.data.output.teaserjson_output.set_layer_data(wall_out, element)[source]

Set layer data of building element.

Parameters:
wall_outcollection.OrderedDict

OrderedDict for walls

elementTEASERClass

teaser class representation of a building element

teaser.data.output.usecond_output module

This module contains function to save UseConditions classes.

teaser.data.output.usecond_output.save_use_conditions(use_cond, data_class)[source]

Use conditions saver.

Saves use conditions according to their usage type in the the JSON file for use conditions in InputData. If the Project parent is set, it automatically saves it to the file given in Project.data. Alternatively you can specify a path to a file of UseConditions. If this file does not exist, a new file is created.

Parameters:
bound_condUseCondtiions()

Instance of TEASERs BuildingObjects.UseCondtiions

data_classDataClass()

DataClass containing the bindings for TypeBuildingElement and Material (typically this is the data class stored in prj.data, but the user can individually change that.ile