Code Monkey home page Code Monkey logo

urbanopt / geojson-modelica-translator Goto Github PK

View Code? Open in Web Editor NEW
18.0 18.0 11.0 39.49 MB

GeoJSON to Modelica Translator that is focused on district energy system design and analysis.

Home Page: https://www.nrel.gov/buildings/urbanopt.html

License: Other

Makefile 0.01% Python 78.88% Modelica 20.63% Motoko 0.21% Dockerfile 0.28%
district-cooling district-heating geojson microgrid modelica modelica-library python urban-analytics urban-planning

geojson-modelica-translator's People

Contributors

antoinegautier avatar chengnanshi-work avatar dependabot[bot] avatar helarga avatar jingwang-cub avatar kflemin avatar macintoshpie avatar nllong avatar tanushree04 avatar vtnate avatar yanfeinrel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

geojson-modelica-translator's Issues

[5/18] Addt'l building type mappings

mapped to institutional blgs in TEASER. Some diversity has been achieved.

for RC models only

High level architecture discussions w/ Katherine.

Complete: 14 April

Rounding TEASER model parameter values

TEASER models generated when running pytest (e.g. tests/output/geojson_1/Loads/B5a6b99ec37f4de7f94020090/ICT.mo) may include parameter values that would better be rounded for readability.

Expected Behavior

  Buildings.ThermalZones.ReducedOrder.RC.TwoElements
  thermalZoneTwoElements(
    redeclare package Medium = Modelica.Media.Air.DryAirNasa,
    VAir=260.9,
    hConvExt=2.05,
    hConvWin=2.70,
    gWin=0.67

Actual Behavior

  Buildings.ThermalZones.ReducedOrder.RC.TwoElements
  thermalZoneTwoElements(
    redeclare package Medium = Modelica.Media.Air.DryAirNasa,
    VAir=260.9433707086081,
    hConvExt=2.0490178828959125,
    hConvWin=2.7000000000000006,
    gWin=0.6700000000000002,

Steps to Reproduce

Run pytest

Version Information

TEASER: URBANopt/0.7.2

Using medium model from MBL

TEASER models generated when running pytest (e.g. tests/output/geojson_1/Loads/B5a6b99ec37f4de7f94020090/ICT.mo) use different medium models than the ones from MBL. Especially Modelica.Media.Air.DryAirNasa is not suited for moisture modeling.

Expected Behavior

  Buildings.ThermalZones.ReducedOrder.RC.TwoElements
  thermalZoneTwoElements(
    redeclare package Medium = Buildings.Media.Air,

Actual Behavior

  Buildings.ThermalZones.ReducedOrder.RC.TwoElements
  thermalZoneTwoElements(
    redeclare package Medium = Modelica.Media.Air.DryAirNasa,

Steps to Reproduce

Run pytest

Version Information

TEASER: URBANopt/0.7.2

Error at install

Running pip install -r requirements.txt yields the following error:
ERROR: tox 3.13.2 has requirement importlib-metadata<1,>=0.12, but you'll have importlib-metadata 1.3.0 which is incompatible.
However it seems innocuous as all tests pass afterwards.

Implement building mechanical systems

  1. Pick a typical air-terminals. == confirm with Nick
  2. make modelica air-terminal
  3. add air-terminals to translator
  4. translate air-terminals to modelica
  5. integrate modelica air-terminal with modelica building model

Correct table attributes in resource files for internal gains

Actual Behavior

Currently, simulating the generated RC models yields the following error.

Error: The following error was detected at time: 0
End-of-file reached when reading numeric data of matrix "Internals(8760,19)" from file "/home/agautier/gitrepo/modelica-buildings/Buildings/Applications/DHC/Loads/Examples/BaseClasses/GeojsonExportRC/Resources/Data/OfficeBuilding/InternalGains_Restroom.txt"

In the referenced resource file (here InternalGains_Restroom.txt) the table attributes (here Internals(8760, 19)) are invalid and should be updated with the actual number of columns (4 and not 19).

Steps to Reproduce

Run pytest.

Version Information

Modelica Buildings Library: 7.0.0
TEASER: 0.7.2
Python: 3.7.6

[6/12] Run UO Example Project with Spawn

  1. get the example project to work w/ TEASER. *complete
  2. get to work w/ Spawn *complete

.idf files needed from Katherine/Rawad
put into repo for example project

Update systems parameters file to point to these files correctly

currently works w/ TEASER

Initial Evaluation: 17 April

UO End to End Example (GeoJSON to Multiple TEASER Bldgs w/ Static District Supply)

Est Completion: ?

o Need to try and run the translator on a generic geojson file from URBANopt. Ask Katherine for a reasonable file to start with. Run it through the translator and figure out what is missing.
o If everything just works, then we need to demonstrate why this all matters, which speaks to creating a single design alternative for now. Perhaps that is a 4GDHC vs a 5GDHC system.

We need to get an exemplar GeoJSON from the URBANopt UI project that has, let’s say, 10 buildings in that. We need to make sure that we can translate that into a fully articulated Modelica model with 10 buildings (some can be RC models and some can be Spawn). The buildings should be connected to ETS systems and connected to an infinite source district system.

Stub Out EnergyTransferStation Template

  1. make a fake EnergyTransferStation modelica model
  2. add ETS to translator
  3. translate ETS to modelica
  4. Integrate with AirTerminal and Building, both in Modelica
  5. Make the process automatic
  6. wait for actual ETS model from CU-Boulder,
  7. integrate actual ETS with AirTerminal and Building, both in Modelica

Update IDF, MOS, EPW files to run in Dymola

Expected Behavior

When running Spawn models the paths work okay for JModelica and the Spawn models should run in Dymola.

Actual Behavior

The IDF and EPW files are not found when running within Dymola.

Steps to Reproduce

  • Run py.test to generate the tests/model_connectors/output/spawn_single project.
  • Open the coupling.mo file in Dymola
  • Run simulate and plot

[5/12] Connect Terminal Unit to RC Model

Create a template for RC building model for connecting terminal units and flow distribution
Add unit test to exercise this functionality (TEASER)
Nick will do Spawn verification (#59)

Completed for:
Spawn (verify unit test)

Date: 14 April

Fix running unit tests with PyCharm

Py.test works when running from the root of the project; however, if you run a specific test with an IDE (such as PyCharm), then the tests file due to not finding the resources correctly.

This will also (likely) result in an update to the system parameters file to ensure that the paths to the supplemental resources (e.g., EPW files, MOS, files, IDF files, etc) need to be relative from the path.

Syntax error in requirements.txt

Running pip install -r requirements.txt yields:

ERROR: Invalid requirement: 'requests=2.22.0' (from line 7 of requirements.txt)
Hint: = is not a valid operator. Did you mean == ?

Remove Dymola annotations

Expected Behavior

Generated Modelica models should not contain Dymola specific annotations such as:

experiment(__Dymola_Algorithm="Cvode")
__Dymola_experimentSetupOutput(...)

Those will be will be checked for through #1807.

Actual Behavior

Models generated when running pytest, e.g., tests/output/geojson_1/Loads/B5a6b99ec37f4de7f94020090/Floor.mo currently include:

annotation (experiment(
  StartTime=0,
  StopTime=31536000,
  Interval=3600,
  __Dymola_Algorithm="Cvode"),
  __Dymola_experimentSetupOutput(equidistant=true,
  events=false));

Steps to Reproduce

Run pytest

Version Information

Modelica Buildings Library: 7.0.0
TEASER: 0.7.2
Python: 3.7.6

Correct description strings in generated RC models

Expected Behavior

Some description strings of generated RC models need to be corrected.

Actual Behavior

Examples are taken from tests/output/geojson_1/Loads/B5a6b99ec37f4de7f94020090/Floor.mo.

  • The model description string ends with with traceable ID None.
  • No description is provided for the heat port port_a.

Steps to Reproduce

Run pytest.

Version Information

Modelica Buildings Library: 7.0.0
TEASER: 0.7.2
Python: 3.7.6

Ensure idf file names are unique

This is needed until #1566 is closed (@mwetter working on it).
The two exported models simulate together only when modifying the idf files names so that they are different (the absolute paths being different is not sufficient).

Add run modelica method

Enable the user (and the unit tests) to run a modelica model using the jmodelica docker container.

ETS Template is requiring files incorrectly

The ETS template and related tests are requiring files in strange ways. For example:

base_folder = os.path.join(os.getcwd(), "geojson_modelica_translator")
        dest_path = "/system_parameters/schema.json"
        self.system_parameters_geojson = base_folder + dest_path

The schema.json file should not be read other than using an instance of the system_parameters file. This most likely relates to #62 since the schema is incorrect, I suspect that the ETS template is reading value from the schema and not an instance.

Furthermore, string replacements like this need to be verified.

 self.thermal_junction_properties_geojson = self.thermal_junction_properties_geojson.replace("\\", "/")

Data are being written to the tests folder that are actually being used in the ETS model

directory_up_two_levels = os.path.abspath(os.path.join(__file__, "../../.."))
        self.directory_ets_templated = os.path.join(
            directory_up_two_levels + "/tests/output_ets"
        )

Fix System Parameter ETS Schema

The schema for the ETS elements are invalid.

image

image

These need to follow the rules of JSONSchema. The values that are present appear to be the defaults.

"Test" failed after "Build"

My test failed after build the product.
Reason: it looks for the "test" folder in TEASEROutput/Project/TestBuilding/, which is an external folder parallell to geojson-modelica-translator.
Solution-1: i copied the "test" folder within geojson-modelica-translator, to replace the "test" folder in TEASEROutput. The tests all passed.
Solution-2: py.test tests

The error message are in the attachment: failure.txt.
failures.txt

Spawn model path

Move spawn models out of experimental and into Buildings.ThermalZones.EnergyPlus.BaseClasses.

[5/13] Expose additional connectors of RC model

Currently the wrapper around TEASER RC model only exposes the convective heat port. This issue is for exposing additional connectors that are needed to model HVAC terminal units or to post process computed variables. The additional connectors to expose are:

  • intGainsRad: Auxiliary port for internal radiative gains
  • ports[nPorts]: Auxiliary fluid inlets and outlets to indoor air volume
  • QLat_flow: Latent heat gains for the room
  • TAir: Indoor air temperature
  • TRad: Mean indoor radiation temperature

Connect ETS to Spawn Building

Connect ETS to a Spawn building, finish the template.

assume infinite source from district system
Date Complete: 17 April

Correct parameter names in generated RC models

Actual Behavior

The generated RC models have incorrect parameter names.
Examples are taken from tests/output/geojson_1/Loads/B5a6b99ec37f4de7f94020090/Floor.mo.

  • hConvExt should be hConExt.
  • hConvWin...
  • hConvInt...
  • hConvWallOut...
  • hConvWinOut...

Note: The convention in MBL (as much as possible) is to truncate to 3 characters the different patterns in the Camel case notation (except for physical quantities or other variables that have a standard symbol). Here the convention is actually violated for Wall which is unfortunate...

IN ADDITION

All instances should be renamed according with the new naming conventions.

  • Modelica.Blocks.Sources.Constant alphaWall should rather be Modelica.Blocks.Sources.Constant hConWall.

Steps to Reproduce

Run pytest.

Version Information

Modelica Buildings Library: 7.0.0
TEASER: 0.7.2
Python: 3.7.6

Develop CLI for running geojson translator

The CLI should be simple for now. I imagine something like:

./geojson-translator --input my.geojson --system-parameters params.json --output-directory save_here
  • include SPAWN and CSV

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.