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

Issue1125 st ro be #1127

Merged
merged 6 commits into from
Apr 7, 2020
Merged

Issue1125 st ro be #1127

merged 6 commits into from
Apr 7, 2020

Conversation

Mathadon
Copy link
Member

@Mathadon Mathadon commented Apr 1, 2020

closes #1125

@Mathadon Mathadon self-assigned this Apr 1, 2020
@Mathadon
Copy link
Member Author

Mathadon commented Apr 2, 2020

@cprotopa do you agree with these changes?

annotation (Placement(transformation(extent={{-120,-30},{-160,-10}})));
Modelica.Blocks.Sources.RealExpression mDHW(y=strobe.tabDHW.y[id]/60)
Modelica.Blocks.Sources.RealExpression mDHW(y=strobe.tabDHW_internal[id]/60)
Copy link
Contributor

Choose a reason for hiding this comment

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

Concerning mDHW I think a larger update is needed.
StROBe actually outputs liters/minute water withdrawal. Here there is a division by 60 to make it in l/s. We need to see what would be the best units here. Would SI not be m3/s? Also, it's not really "mass flow". A big discussion, I suggest to open in another issue.

Copy link
Member Author

Choose a reason for hiding this comment

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

SI is kg/s. Best to discuss this in a separate issue indeed, if it's really an issue :)

@cprotopa
Copy link
Contributor

cprotopa commented Apr 2, 2020

The model works fine for me, so I believe the changes are correctly implemented.
Of course, the change from Celsius to Kelvin makes sense. We should just try to inform as many people as possible, because they might have adapted their code elsewhere to perform this change, and this will cause a problem.

Since we are at it, though, I would suggest we make some more thorough clean up of IDEAS.BoundaryConditions.Occupants. Specifically I think everything in the following folders is totally outdated and not used anywhere, so it could even be removed.

  • IDEAS.BoundaryConditions.Occupants.Extern.Files
  • IDEAS.BoundaryConditions.Occupants.Extern.Interfaces
  • IDEAS.BoundaryConditions.Occupants.StROBe
  • IDEAS.BoundaryConditions.Occupants.Examples.Occupant

Btw, also:

  • IDEAS.BoundaryConditions.Climate.Time.Elements

Perhaps this should be done in a separate pull request? What would be best, @Mathadon ?

@Mathadon
Copy link
Member Author

Mathadon commented Apr 2, 2020

Yup, good to make a separate issue/pull request for that!

The C-to-K conversion I did not notice before and is indeed a bit dangerous. @jelgerjansen was this intentional, and what is the rationale for making the change?

@jelgerjansen
Copy link
Contributor

jelgerjansen commented Apr 2, 2020

@Mathadon I made the change because the other temperatures (eg. the indoor building temperature) are expressed in Kelvin and it made more sense to me to do the conversion at the lowest level.
But the manipulation from C-to-K can of course also be done in my own models.
(We could always adapt the documentation such that it's clear for the users that the setpoints are expressed in degrees Celcius)

@Mathadon
Copy link
Member Author

Mathadon commented Apr 2, 2020 via email

@cprotopa
Copy link
Contributor

cprotopa commented Apr 2, 2020

Hm.. Which variable though? If it's locally changed, say we change the name of TSet_signal, nobody will notice, as it's not used elsewhere.
If, on the other hand, we change the RealOutput TSet of the IDEAS.Templates.Interfaces.BaseClasses.Occupant to TSetK, then it should be also changed in all occupant models in the library that use the template, and in the connection equation in IDEAS.Templates.Interfaces.Building. In order for it to be noticed by users, then it should be also changed in IDEAS.Templates.Interfaces.BaseClasses.HeatingSystem, and all models that use this latter one.
To me, this seems like the only way to propagate the change of a variable name in all components of the library, making sure that somebody who made a custom component will get an error message.
Or am I missing something..?
Of course, they will also probably get some warning of too high temperature here and there. Is this perhaps an approach? Set some max value for the input, that would create a warning? At least we could cover the case where somebody altered the input file to contain K already. Just a thought...

@Mathadon
Copy link
Member Author

Mathadon commented Apr 2, 2020

Uhm, yes that would definitely be an option. I wasn't sure where the input actually comes from. It's set by a user? Or is it read from file? In both cases we could indeed add a warning/error..

@cprotopa
Copy link
Contributor

cprotopa commented Apr 2, 2020

StrobeInfoManager reads external text files, which the user chooses. Normally, these are the ones generated by StROBe, so they are in degrees C. But I can imagine somebody could have chosen to post-process these files to be in K.

In fact, TSet of the Occupant template is actually specified as

 Modelica.Blocks.Interfaces.RealOutput[nZones] TSet(
    final quantity="ThermodynamicTemperature",
    unit="K",
    displayUnit="degC",
    min=0) 

It is also used as such for example in IDEAS.Templates.Heating.BaseClasses.HysteresisHeating, where TSensor is directly subtracted from TSet. Makes sense to have all temperatures everywhere in SI, of course.

Another option I can think of, is to actually change the StROBe python code to produce the files in K in the first place. This means we would leave the model in IDEAS as is, and assume input files are appropriately in K.
We can perhaps additionally use a boolean in the StROBe component that would specify whether the input is in C or K, and change it or not. Perhaps here can be a check (based on temperature values?).

@Mathadon
Copy link
Member Author

Mathadon commented Apr 2, 2020 via email

@cprotopa
Copy link
Contributor

cprotopa commented Apr 2, 2020

Ok, then I will change StROBe.

What can be added for clarity in IDEAS.BoundaryConditions.Occupants.Extern.StrobeInfoManager is to include the expected units for the inputs. For example this can be at least added in the string parameters comments. E.g.:

 parameter String FilNam_mDHW = "none.txt"   "File with hot water tapping profiles (in l/min)" ;
 parameter String FilNam_QCon = "none.txt"    "File with (convective) internal heat gain profiles (in W)" ;
 parameter String FilNam_TSet = "none.txt"    "File with (main) space heating setpoint profiles (in K)";

The units are W for P,Q, Q_Con, Q_Rad, PHp, and PPv. It's then K for TSet and TSet2, and l/min for mDHW (this last one we will discuss in another issue).

@jelgerjansen could you also add this? Otherwise I will do it afterwards.

@jelgerjansen
Copy link
Contributor

I reverted the temperature conversion and updated the documentation. (@Mathadon will add my last commit to this issue)

@Mathadon
Copy link
Member Author

Mathadon commented Apr 2, 2020

this is ready to merge when unit tests pass

@Mathadon Mathadon merged commit 10d5bf6 into master Apr 7, 2020
@Mathadon Mathadon deleted the issue1125_StROBe branch April 7, 2020 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add conditional connectors to StrobeInfoManager and update StROBe component
3 participants