- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » model flattening error with Media...
model flattening error with Media type partial packages
model flattening error with Media type partial packages
Hi,
I get a flattening error message when using a Modelica.Media type partial package structure in combination with a replaceable partial record (thermodynamic state record).
A have the following structur in my Media models: (MyReplaceablePartialModelLevelOne corresponds to BaseProperties)
Code:
package Test
partial package MyPartialPackageLevelOne
constant String level = "LevelOne";
replaceable partial record MyRecord
//record variable to be defined a level higher
end MyRecord;
replaceable partial model MyReplaceablePartialModelLevelOne
Real variableOne;
Real variableTwo;
Real variableThree;
Real variableFour;
MyRecord myRecord;
equation
variableThree = 3;
variableFour = 4;
end MyReplaceablePartialModelLevelOne;
end MyPartialPackageLevelOne;
partial package MyPartialPackageLevelTwo
extends MyPartialPackageLevelOne(level = "LevelTwo");
redeclare record extends MyRecord
Real recordVariable;
end MyRecord;
end MyPartialPackageLevelTwo;
////finally used package
package MyUsedPackage
extends MyPartialPackageLevelTwo(final level = "LevelThree");
//this works!
/*
redeclare record extends MyRecord
Real recordVariable;
end MyRecord;
*/
redeclare model extends MyReplaceablePartialModelLevelOne
equation
myRecord.recordVariable = variableOne;
end MyReplaceablePartialModelLevelOne;
end MyUsedPackage;
model TestModel
package MyPackage = MyUsedPackage;
MyPackage.MyReplaceablePartialModelLevelOne modelFromPackage;
equation
modelFromPackage.variableOne =1;
modelFromPackage.variableTwo =2;
end TestModel;
end Test;
When I redeclare the record in level two it doesnt work. Following message: Error: Error occurred while flattening model Test.TestModel
When I do it on level three it works!
In Dymola both versions work.
Is that worth a bug report? I think both versions a correct Modelica, or?
I am now on revision 11620.
Thanks!
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » model flattening error with Media...