#5729 closed defect (invalid)
LibRAS is broken with the NF
Reported by: | Francesco Casella | Owned by: | Per Östlund |
---|---|---|---|
Priority: | high | Milestone: | 1.16.0 |
Component: | New Instantiation | Version: | |
Keywords: | Cc: |
Description
Please compare the coverage report of LibRAS
between the OF and NF. The OF flattens 8/10 and simulates 5/10, the NF flattens 0/10.
Maybe there are problems with the source code, but I guess it's mostly NF issues.
For example, compiling LibRAS.Culture.SSCulture_V with the NF gives:
[LibRAS/Culture/PartialCulture.mo:14:3-14:140:writable] Error: Variable loss not found in scope PartialCulture.
but the line in question contains
parameter Waste.WasteData waste = Waste.WasteData(fish=fish, feed=feed, loss=loss) "WasteData record" annotation(choicesAllMatching=true);
and the definition of WasteData contains the line
parameter Real loss = 0.1 "Feed loss factor";
@perost, can you please check if those issues are real?
Thanks!
Note:
See TracTickets
for help on using tickets.
The issue here is not what
WasteData
contains, but the fact thatPartialCulture
doesn't have any variable calledloss
. So this is a library issue.The reason why this works with the OF is because it handles extends incorrectly. The OF will happily flatten an incorrect model such as:
Since
SSCulture_V
extendsPartialCulture
and also contains a declaration forloss
it works with the OF, even though it shouldn't.If the incorrect modifier for
loss
is removed the next error that occurs is:which is the line:
The error is caused by
sum({... for t in hold(ft)})
, sincehold(ft)
as the error says isn't a parameter expression which means the size of the array can't be calculated. As far as I can see this can be fixed by simply removing the{
and}
and just use the reduction form ofsum
rather than constructing an array and then callingsum
on it.The next error that occurs is:
This is correct,
m_S_tot
is declared to be of the typeModelica.SIunits.MassFlowRate
which is just a fancy Real and not a connector in any way. At this point I gave up trying to fix the library.