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

Bug in Fluid.Sources.Boundary* (and other source models) #1672

Open
mwetter opened this issue Dec 11, 2022 · 0 comments
Open

Bug in Fluid.Sources.Boundary* (and other source models) #1672

mwetter opened this issue Dec 11, 2022 · 0 comments
Labels

Comments

@mwetter
Copy link
Contributor

mwetter commented Dec 11, 2022

Source models such as Fluid.Sources.Boundary_pT have a parameter verifyInputs = false. If this is kept false, the instance medium is removed. Otherwise, it is not removed, and results in an underdetermined system of equations.

To reproduce, set verifyInputs=false in the instance sin in IBPSA.Fluid.Sources.Examples.PropertySource_T.

Simulating it in OMEdit yields, because of missing assignments to medium,

[2] 17:09:58 Symbolic Warning
[IBPSA.Media.Air: 87:3-88:60]: Variable sin.medium.X[1] does not have any remaining equation to be solved in.
  The original equations were:
  Equation 83: sin.medium.X[2] = 1.0 - sin.medium.X[1], which needs to solve for sin.medium.X[2]
  Equation 82: sin.medium.X[1] = sin.medium.Xi[1], which needs to solve for sin.medium.Xi[1]
  Equation 80: sin.medium.state.X[1] = sin.medium.X[1], which needs to solve for sin.medium.state.X[1]
  Equation 75: sin.medium.R_s = 287.0512249529787 * sin.medium.X[2] + 461.5233290850878 * sin.medium.X[1], which needs to solve for sin.medium.R_s
  Equation 74: sin.medium.h = 1006.0 * sin.medium.dT * sin.medium.X[2] + (2501014.5 + 1860.0 * sin.medium.dT) * sin.medium.X[1], which needs to solve for sin.medium.dT
  Equation 72: sin.medium.MM = 1.0 / (55.50843506179199 * sin.medium.X[1] + 34.52428788658843 * sin.medium.X[2]), which needs to solve for sin.medium.MM

As I would think nobody ever used this feature, as it also does not work in MassFlowSource_T, I suggest the parameter verifyInputs is removed, an entry in the conversion script is done, and the instance medium is removed.

We could however keep the instance medium at the cost of a slight overhead (and have it always present) because currently, OMEdit fails if started with OMEdit --NAPI=true because to display temperature, it uses either T (a parameter) or T_in (a conditionally removable connector) and the parser issues the error

[3] 17:27:30 Translation Warning
[IBPSA.Fluid.Sources.Boundary_pT: 180:10-209:102]: Conditional component ‘T_in‘ is used in a non-connect context.

when the package IBPSA.Fluid.Sources is opened in OMEdit (using OMEdit --NAPI=true package.mo), presumably because it does not like the conditionally removable connector. Hence, either OMEdit will need to be updated, or we need to keep the instance medium so that we have a means to access the temperature, which is defined in Modelica.Media.Interfaces.PartialMedium.BaseProperties and hence exists for all media.
@casella: Do you think this issue of the last paragraph should be fixed in OMEdit, or in the Modelica model?

@mwetter mwetter added the bug label Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant