uesgraphs.examples.e16_complete_geojson_to_modelica

GeoJSON Import to Modelica Code Generation

This example demonstrates the workflow for generating modelica simulation files.

=== Main lesson: Know your template! ===

The pipeline checks, which parameters are required for each component template. Following parameters are read from template: - MAIN, - AUX and - CONNECTOR

Those parameters have to be provided either via graph attributes, excel template or references. This example shows how to use it.

Workflow Overview:

  1. GeoJSON Import: Load network topology, buildings, and supply stations from GeoJSON files

  2. Demand Data Assignment: Attach heating, DHW, and cooling demand time series to buildings

  3. Excel-Based Configuration: Use Excel template to configure all simulation and component parameters

  4. Modelica Generation: Automatically generate ready-to-simulate Modelica code

Excel Configuration Structure:

The Excel template has four sheets: 1. Simulation: Simulation parameters (solver, time settings, medium, etc.) 2. Pipes: Pipe network parameters (template, insulation, roughness, etc.) 3. Supply: Supply station parameters (template, max heat demand, pressures, etc.) 4. Demands: Demand substation parameters (template, temperatures, heat exchanger settings, etc.)

Input Data Requirements:

  • Network GeoJSON: LineString features representing the pipe network

  • Buildings GeoJSON: Point or Polygon features for demand buildings

  • Supply GeoJSON: Point features for supply stations (with is_supply_heating=True)

  • Demand CSVs: Time series for heating, DHW, and cooling demands (8760 hourly values)

  • Ground Temperature CSV: Ground temperature profiles at various depths

Example Directory Structure:

workspace/e16/ ├── simple_district_graph.json # Saved UESGraph after GeoJSON import ├── models/ # Generated Modelica files │ └── Sim20250102_123456_MySimulation/ │ ├── MySimulation.mo # Main Modelica model │ ├── package.mo # Modelica package definition │ └── [component models] # Individual component files └── [demand and ground temp CSVs] # Input time series data

Notes:

  • The pipeline automatically handles parameter assignment and validation

  • Missing buildings in demand files will use dummy demand profiles

  • The Excel template can be customized for different simulation scenarios

  • Generated Modelica models are compatible with Dymola and require AixLib library

Functions

main()

workspace_example([name_workspace])

Creates a local workspace with given name (copied from e1_readme_example)

uesgraphs.examples.e16_complete_geojson_to_modelica.workspace_example(name_workspace=None)[source]

Creates a local workspace with given name (copied from e1_readme_example)

Parameters:

name_workspace (str) – Name of the local workspace to be created

Returns:

workspace – Full path to the new workspace

Return type:

str

uesgraphs.examples.e16_complete_geojson_to_modelica.main()[source]