-
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
Functions with wrong type argument called in new tank models? #195
Comments
Yes, record ThermodynamicState
AbsolutePressure p;
Temperature T;
end ThermodynamicState; But record ThermodynamicState
AbsolutePressure p;
Temperature T;
MassFraction X[ns];
end ThermodynamicState; I.e. it has an extra field |
Thank you for pointing this out, in Dymola there isn´t even a warning. I will look into it, but since it is outside my comfort zone, it might take a while to find a good solution. I will take your analysis into account.
|
I also understood that. The mixture medium has two components, hence Bottom line: this probably works in Dymola in the specific case of two pure components, because you can compute the air and liquid properties as a function of |
I think the function call should be I only work part time and I do not have time to formally suggest the changes until earliest Thursday. |
Sounds good, it should also work in OMC. BTW, you should be able to skip the |
Many of the recently added models, e.g.
ThermofluidStream.Boundaries.Tests.TankExtendedTest2
fail in OMC with this errorThis is the offending code:
ThermofluidStream/ThermofluidStream/Boundaries/Internal/PartialTank.mo
Lines 126 to 129 in 38553ff
where
ThermofluidStream/ThermofluidStream/Boundaries/Internal/PartialTank.mo
Lines 3 to 5 in 38553ff
and
ThermofluidStream/ThermofluidStream/Boundaries/Internal/PartialTank.mo
Line 58 in 38553ff
I'm not sure how Dymola handles this code, but as far as I understand, OMC is right to complain:
tank.medium.state
is aThermodynamicState
record from an instance ofBaseProperties
from packageThermofluidStream.Media.myMedia.GasAndIncompressible.JP8DryAir
, while the functiondensity()
is called once from packageMedium.Liquid
, i.e.ThermofluidStream.Media.myMedia.Incompressible.Examples.JP8
and once from packageMedium.Gas
, i.e.ThermofluidStream.Media.myMedia.Air.DryAirNasa
.This cannot work: the
density()
function and theBaseProperties
model instance should both be taken from the same package to be consistent, otherwise how could they compute the right density?@perost, can you please double-check and comment?
As I understand, you should probably define
PartialGasAndIncompressible.BaseProperties
to contain two state records, e.g.then, you could have something like
of course PartialGasAndIncompressible.BaseProperties can also contain
but this state should contain the information about the overall properties of the gas-liquid mixture.
The text was updated successfully, but these errors were encountered: