Opened 8 years ago

Closed 7 years ago

#4269 closed defect (fixed)

Record constant in function is initialized wrongly

Reported by: Martin Sjölund Owned by: Lennart Ochel
Priority: high Milestone: 1.13.0
Component: Code Generation Version: v1.12.0
Keywords: Cc: julien.vasseur@…

Description

loadModel(BuildSysPro);getErrorString();
BuildSysPro.BaseClasses.Media.OLD_THERMHYGAERO.AirFunctions.Psat(1.0);getErrorString();

has a problem because in:

record CteAH
   ...
  parameter Real TKref=273.15;
  parameter Real Lv0=AirFunctions.Lv(
      TKref,
      TKref,
      rv);
  ...
end CteAH;

... Lv0 is not evaluated and in functions containing a variable of type CteAH, the binding for Lv0 is AirFunctions.Lv(TKref, TKref, rv), but TKref doesn't exist (the binding is not prefixed / sorted according to the dependencies).

@Julien: Making the record constant instead of parameter would work around the bug in OpenModelica. Adding Modelica_LinearSystems2 to the uses annotation would fix the remaining part to pass code generation of the entire library in OM (see http://libraries.openmodelica.org/branches/master/BuildSysPro/BuildSysPro.html for the report on current status on the OM master).

Change History (2)

comment:1 by Francesco Casella, 7 years ago

Milestone: 1.12.01.13.0

Milestone moved to 1.13.0 due to 1.12.0 already being released.

comment:2 by Martin Sjölund, 7 years ago

Resolution: fixed
Status: newclosed

This seems to be fixed already.

Note: See TracTickets for help on using tickets.