-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add defaults for Valve params and assert for check #201
Merged
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
bb87395
Added defaults for Valve params and assert for check
dzimmer 4106258
Omit SI-units in description of parameter m_flow_ref_set
tobolar b7db257
Typos
RaphaelGebhart 3b5dd4f
Changed V_flow_ref to final parameter
RaphaelGebhart 858bdd0
Added default value + assert for d_valve (ThermofluidStream.FlowContr…
RaphaelGebhart f7d58a9
Same as before for TFS.Undirected
RaphaelGebhart b97b5af
assert to initial equations
dzimmer 73da448
turned m_flow_ref into parameter
dzimmer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dzimmer @casella Considering only parameters are involved here, wouldn't it be better/more efficient/performant to place these
if
statements in aninitial equation
section, so they are only evaluated once instead of continuously?Or can it be expected (is it specified, maybe?) that tools optimize that out and only execute it once, anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that Dymola will optimize for it but the specification does not say anything about it.
Moving to initial equations seems like a good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the assertion level is set to "error". So the current model's evaluation shall be aborted. The simulation itself still may continue with another evaluation, but IMO is not the case here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stupid me... Of course that is why I did not care when implementing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh? It will only abort if the assert fails, no? If not, does this not check if Kvs>0 over and over again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meaning, if you have FlowCoeffType.Kvs, and a Kvs of, say, 0.1, you would still trigger an assert check at every time step?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least there is a Modelica example with assert() for parameters.
https://build.openmodelica.org/Documentation/ModelicaReference.Operators.%27assert()%27.html
and assert for parameters is used e.g. in:
I can't tell how often the assert is evaluated tho.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
V_flow_ref
tofinal parameter V_flow_ref
d_valve
(ThermofluidStream.FlowControl.SpecificValveType
).I didnt know how to suggest the changes, i hope its fine, that i directly pushed them.
Could we also change
m_flow_ref
inThermofluidStream.FlowControl.Internal.PartialValve
toparameter m_flow_ref
, or does that cause issues concerning conversion script or so?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushing directly is the best way.
I'll move the assert to the initial and if I do not find any reason against it would change m_flow_ref to a parameter