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

Dehardcoding temperature parameter value in time series templates #379

Open
amyeallen1 opened this issue Apr 26, 2021 · 4 comments
Open
Assignees
Labels

Comments

@amyeallen1
Copy link

amyeallen1 commented Apr 26, 2021

Hack Session!

In the TimeSeries template, Tb_HeaWater_Nominal is defined with a hard-coded offset from Ta_HeaWater_Nominal:

I'm happy to dehardcode this, and set Tb_HeaWater_Nominal the same way Ta_HeaWater_Nominal is set, unless there's a reason we're hardcoding it with a fixed offset?

@nllong @macintoshpie

This will happen after V9 upgrade.

@amyeallen1 amyeallen1 changed the title Dehardcoding temperature parameter values in load models templates Dehardcoding temperature parameter values in time series templates Apr 26, 2021
@amyeallen1 amyeallen1 changed the title Dehardcoding temperature parameter values in time series templates Dehardcoding temperature parameter value in time series templates Apr 26, 2021
@amyeallen1 amyeallen1 self-assigned this Apr 26, 2021
@macintoshpie
Copy link
Contributor

I don't think I know the answer to this, probably a better question for @nllong

@amyeallen1
Copy link
Author

Kk! I think the reason this was left hard-coded was b/c I was unsure about how this parameter value was used. After running the OSU models, I see that this parameter value is used to set the HHW return temperature, so I'm going to go ahead and de-hardcode it. @nllong @macintoshpie

@macintoshpie
Copy link
Contributor

I'm stumped, below are my notes. My best guess is that I either misunderstand how Modelica parameters work or this is some JModelica strangeness. Maybe someone could try what I've done but run the model in Dymola instead and see what happens, otherwise we should punt or speak with a Modelica expert.

Here are the things I tried, all ultimately failing with this same error (I also tried setting the log level to 4 but never got any more useful info).

The lines changed were 20-22 (

). I tested it by running test_time_series_heating_indirect.py. Note that when testing the value templated in as T_aHeaWat_nominal ends up being 313.15.

  1. Just set it to 308.15 (T_aHeaWat_nominal - 5): parameter Modelica.SIunits.Temperature T_bHeaWat_nominal=308.15
  2. Replace T_aHeaWat_nominal with 313.15
parameter Modelica.SIunits.Temperature T_bHeaWat_nominal(
    min=273.15,
    displayUnit="degC")=313.15-5
  1. Set it to value while keeping modifications
parameter Modelica.SIunits.Temperature T_bHeaWat_nominal(
    min=273.15,
    displayUnit="degC")=308.15

I also tried diffing the stdout from running the file unmodified with the modified version and there were no additional warnings/errors before the line reporting that it failed to initialize.

@macintoshpie
Copy link
Contributor

We tested this in Dymol and had no issues, this is apparently a JModelica specific issue. We decided to wait until the optimica docker image is ready to use (see #405).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

3 participants