Opened 17 years ago
Last modified 12 years ago
#130 closed defect (fixed)
Modifiers are not propagated correctly inside redeclared model
Reported by: | Francesco Casella | Owned by: | Francesco Casella |
---|---|---|---|
Priority: | critical | Milestone: | 1.9.0 |
Component: | Frontend | Version: | |
Keywords: | Cc: | Francesco Casella, Adrian Pop |
Description
N/A
Attachments (1)
Change History (4)
by , 17 years ago
Attachment: | SimpleFluid.mo added |
---|
comment:1 by , 17 years ago
Created an attachment (id=19)
Modelica package with test cases
Please consider the model SimpleFluid.Examples.Test4 in the attached package (requires the Modelica library to compile).
The Volume model contains the following declaration:
model Volume "ControlVolume"
replaceable model Medium = Media.Air;
Medium medium(p(start = pstart,fixed=false), T(start=Tstart,fixed=false))
"Medium properties";
...
In SimpleFluid.Examples.Test4, we set volume.pstart = 2e5. However, when you instantiate the model, you get:
Real volume.medium.p(quantity = "Pressure", unit = "Pa", displayUnit = "bar", start = 100000.0);
This start value of 100000 is the default value defined in the SimpleFluid.Media.BaseProperties model. We set this to a generic nonzero value, in order to avoid division-by-zero errors at initialization. However, the actual value of 2e5 should be used instead. The fixed = false modifier is also ignored, leading to unwanted additional initial equations.
I'm not sure if the problem is with the replaceable model (which we don't redeclare, though), or with the two-level-deep modifier.
comment:2 by , 13 years ago
volume.medium.p now gets the correct start value, so this issue seems to have been fixed some time ago.
comment:3 by , 12 years ago
Component: | → Frontend |
---|---|
Milestone: | → 1.9.0 |
Modelica package with test cases