Opened 10 years ago

Closed 10 years ago

#3095 closed defect (fixed)

Losing class modifiers during flattening

Reported by: Adrian Pop Owned by: Adrian Pop
Priority: blocker Milestone: 1.9.2
Component: Frontend Version: trunk
Keywords: Cc: Francesco Casella, dersh@…

Description (last modified by Adrian Pop)

Flattening: ModelicaTest.Fluid.TestComponents.Sensors.TestTemperature1
should give orifice1.port_b.h_outflow having a start value from:

package StandardWater = WaterIF97_ph;

package WaterIF97_ph  
        extends WaterIF97_base(ThermoStates = Modelica.Media.Interfaces.Choices.IndependentVariables.ph, final ph_explicit = true, final dT_explicit = false, final pT_explicit = false, smoothModel = false, onePhase = false);
end WaterIF97_ph;

partial package WaterIF97_base
        extends Interfaces.PartialTwoPhaseMedium(mediumName = "WaterIF97", substanceNames = {"water"}, singleState = false, SpecificEnthalpy(start = 1.0e5, nominal = 5.0e5), Density(start = 150, nominal = 500), AbsolutePressure(start = 50e5, nominal = 10e5, min = 611.657, max = 100e6), Temperature(start = 500, nominal = 500, min = 273.15, max = 2273.15), smoothModel = false, onePhase = false, fluidConstants = waterConstants);
...
end WaterIF97_base;

Seems we're loosing class modifier:

SpecificEnthalpy(start = 1.0e5, nominal = 5.0e5)

when instantiating StandardWater.

Change History (8)

comment:1 by Adrian Pop, 10 years ago

Description: modified (diff)
Owner: changed from somebody to Adrian Pop
Status: newaccepted

comment:2 by Adrian Pop, 10 years ago

Cc: Francesco Casella added

comment:3 by Willi Braun, 10 years ago

Is that also connected to #3051?

comment:4 by Adrian Pop, 10 years ago

Yes. Seems similar to #3051.

I think it only happens if you have a short class definition that you extends in the mix something like:

type X = Y(mods).
type Z
  extends X(more mods);
end Z;

comment:5 by Adam Dershowitz <dersh@…>, 10 years ago

Cc: dersh@… added

comment:6 by Francesco Casella, 10 years ago

Milestone: Future1.9.2
Priority: highblocker
Summary: Loosing class modifiers during flatteningLosing class modifiers during flattening

One more example of this behaviour is shown by ThermoPower.PowerPlants.SteamTurbineGroup.Tests.TestST3LRh_bypass, after the changes in revision 377 of the library have been applied.

Self-contained test package (TestST3LRh_bypassTotal-update1.zip) and test script (test-update1.mos) can be found attached to #3104.

This is a very serious bug for thermo-hydraulic models, which depend critically on start attributes. Great care has been taken at providing reasonable defaults in the Medium models, if they get lost and the default of zero is out of range, all kind of crazy runtime errors can take place.

comment:7 by Adrian Pop, 10 years ago

Fixed in r24990.

comment:8 by Adrian Pop, 10 years ago

Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.