Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force a dummy value for SHW in modelica loads even if not present #626

Merged
merged 11 commits into from
Apr 5, 2024

Conversation

vtnate
Copy link
Contributor

@vtnate vtnate commented Mar 11, 2024

Any background context you want to provide?

MBLv10 requires a value in the Service Hot Water column of the loads timeseries, even if it isn't used. Modelica-Builder has a feature that can update values in .mos files, so lets use that.

The UO SDK populates this column as of v0.11.0 with urbanopt/urbanopt-reporting-gem#143. Load files generated before then may be missing this data.

What does this PR accomplish?

  • Uses the modelica-builder method to set SHW load to 1/10 of the heating load or 5000W, whichever is higher.
  • Improve logging a bit

How should this be manually tested?

Generate a model using timeseries data that does not have the SHW column populated. The updated file is modelica_project/Loads/Resources/Data/<buildingname>/<load_timeseries>.mos

@vtnate vtnate added the enhancement New feature or request label Mar 11, 2024
@vtnate vtnate self-assigned this Mar 11, 2024
@vtnate vtnate requested review from nllong and sAbdelhaleem March 11, 2024 21:12
Copy link
Member

@nllong nllong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish we chatted... I wrote a helper method to do this in the 5G stuff. The method is ultimately in Modelica Builder.

https://github.com/urbanopt/geojson-modelica-translator/blob/develop/geojson_modelica_translator/modelica/GMT_Lib/DHC/DHC_5G_waste_heat_GHX_variable.py#L67-L77

mos_file = ModelicaMOS(save_filename)
total_heating_load += mos_file.retrieve_header_variable_value('Peak space heating load', cast_type=float)
total_cooling_load += mos_file.retrieve_header_variable_value('Peak space cooling load', cast_type=float)
peak_water = mos_file.retrieve_header_variable_value('Peak water heating load', cast_type=float)
total_swh_load += peak_water
if peak_water == 0:
    peak_heat = mos_file.retrieve_header_variable_value('Peak space heating load', cast_type=float)
    peak_swh = max(peak_heat / 10, 5000)

    mos_file.replace_header_variable_value('Peak water heating load', peak_swh)
    mos_file.save()

geojson_modelica_translator/utils.py Outdated Show resolved Hide resolved
@vtnate
Copy link
Contributor Author

vtnate commented Mar 18, 2024

@nllong You mean... have the modelica package do the modelica editing, and keep log messages consistent?

image

@nllong
Copy link
Member

nllong commented Mar 19, 2024

@nllong You mean... have the modelica package do the modelica editing, and keep log messages consistent?

I know, it's complicated. haha

@vtnate vtnate requested a review from nllong March 19, 2024 14:07
Copy link
Member

@nllong nllong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for using Modelica Builder! love it.

@nllong nllong merged commit a9f5947 into develop Apr 5, 2024
10 checks passed
@nllong nllong deleted the mblv10-dhw-workaround branch April 5, 2024 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants