Teaser

class geojson_modelica_translator.model_connectors.load_connectors.teaser.Teaser(system_parameters, geojson_load)

Bases: LoadBase

TEASER is different than the other model connectors since TEASER creates all of the building models with multiple thermal zones when running, at which point each building then needs to be processed.

__init__(system_parameters, geojson_load)

Base class for load connectors.

Parameters:
  • system_parameters – SystemParameter object, the entire system parameter file which will be used to generate this load.

  • geojson_load – dict, the GeoJSON portion of the load to be added (a single feature).

Methods

__init__(system_parameters, geojson_load)

Base class for load connectors.

add_building(urbanopt_building[, mapper])

Add building to the load to be translated.

copy_required_mo_files(dest_folder[, within])

Copy any required_mo_files to the destination and update the within clause if defined.

fix_gains_file(f)

Temporary hack to fix the gains files in TEASER. This method does the following:

ft2_to_m2(area_in_ft2)

Converts square feet to square meters

get_modelica_type(scaffold)

lookup_building_type(building_type)

Look up the building type from the Enumerations in the building_properties.json schema.

post_process(scaffold[, keep_original_models])

Cleanup the export of the TEASER files into a format suitable for the district-based analysis.

render_instance(template_params)

Templates the *_Instance file for the model. The templated result will be inserted into the final District Energy System model in order to instantiate/define the model instance.

run_template(template, save_file_name[, ...])

Helper method to create the file from Jinja2's templating framework.

to_dict(scaffold)

to_modelica(scaffold[, keep_original_models])

Save the TEASER representation of a sinlge building to the filesystem.

Attributes

building_name

instance_template_path

model_name

simple_gmt_type

add_building(urbanopt_building, mapper=None)

Add building to the load to be translated. This is simply a helper method.

Parameters:
  • urbanopt_building – an urbanopt_building (also known as a geojson_load)

  • mapper – placeholder object for mapping between urbanopt_building and load_connector building.

copy_required_mo_files(dest_folder, within=None)

Copy any required_mo_files to the destination and update the within clause if defined. The required mo files need to be added as full paths to the required_mo_files member variable in the connectors derived classes.

Parameters:
  • dest_folder – String, folder to copy the resulting MO files into.

  • within – String, within clause to be replaced in the .mo file. Note that the original MO file needs to

have a within clause defined to be replaced.

fix_gains_file(f)
Temporary hack to fix the gains files in TEASER. This method does the following:
  • makes the dimension of the matrix to 8761,4

  • adds in a timestep for t=0

Parameters:

f – string, fully qualified path to file

Returns:

None

ft2_to_m2(area_in_ft2: float) float

Converts square feet to square meters

Parameters:

area_in_ft2 – Area in square feet to be converted to square meters

lookup_building_type(building_type)

Look up the building type from the Enumerations in the building_properties.json schema. TEASER documentation on building types is here (look into the python files):

https://github.com/RWTH-EBC/TEASER/tree/development/teaser/logic/archetypebuildings/bmvbs

post_process(scaffold, keep_original_models=False)

Cleanup the export of the TEASER files into a format suitable for the district-based analysis. This includes the following:

  • Update the partial to inherit from the GeojsonExport class defined in MBL.

  • Rename the files to remove the names of the buildings

  • Move the files to the Loads level and remove the Project folder (default export method from TEASER)

  • Add heat port

  • Add return temperature

  • Add fluid ports for the indoor air volume.

  • Remove weaDat and rely on weaBus

  • Add latent fraction multiplier

  • Add TAir output

  • Add TRad output

  • Add nPorts variable

  • Propagate use of moisture balance

  • Wrap the thermal zones into a single model

Parameters:
  • scaffold – Scaffold object, Scaffold of the entire directory of the project.

  • keep_original_models – boolean, do not delete the original models generated by TEASER

Returns:

None

render_instance(template_params)

Templates the *_Instance file for the model. The templated result will be inserted into the final District Energy System model in order to instantiate/define the model instance.

Parameters:

template_params – dict, parameters for the template

Returns:

tuple (str, str), the templated result followed by the name of the file used for templating

run_template(template, save_file_name, do_not_add_to_list=False, **kwargs)

Helper method to create the file from Jinja2’s templating framework.

Parameters:
  • template – object, Jinja template from the template_env.get_template() command.

  • save_file_name – string, fully qualified path to save the rendered template to.

  • do_not_add_to_list – boolean, set to true if you do not want the file to be added to the package.order

  • kwargs – These are the arguments that need to be passed to the template.

Returns:

None

to_modelica(scaffold, keep_original_models=False)

Save the TEASER representation of a sinlge building to the filesystem. The path will be scaffold.loads_path.files_dir.

Parameters:
  • scaffold – Scaffold object, contains all the paths of the project

  • keep_original_models – boolean, whether or not to remove the models after exporting from Teaser