﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3089	Flattening error concerning records of records	Francesco Casella	Per Östlund	"Consider the attached Save Total file. When compiling, eventually OMC issues the following error:
{{{
[D:/Temp/CentrifugalPumpTotal.mo:2682:9-2682:64:writable] Error: Variable sat.liq.d not found in scope Cryogenics.Components.CentrifugalPump$pump.Medium.setSat_p
}}}

Now, {{{pump.Medium}}} is {{{Cryogenics.Media.HeliumHelmholtz}}}, which extends {{{HelmholtzMedia.HelmholtzFluids.Helium}}}, which extends {{{Interfaces.PartialHelmholtzMedium}}}, which contains the two declarations
{{{
  redeclare record extends ThermodynamicState(phase(start=0))
    // inherits phase integer
    Temperature T ""Temperature of medium"";
    AbsolutePressure p ""Absolute pressure of medium"";
    Density d ""Density of medium"";
    SpecificEnergy u ""Specific inner energy of medium"";
    SpecificEnthalpy h ""Specific enthalpy of medium"";
    SpecificEntropy s ""Specific entropy of medium"";
  end ThermodynamicState;

  redeclare record extends SaturationProperties
    // inherits Tsat and psat
    ThermodynamicState liq;
    ThermodynamicState vap;
  end SaturationProperties;
}}}

and the redeclaration of {{{setSat_p}}} containing the offending statement:
{{{
redeclare function setSat_p 
  input AbsolutePressure p;
  output SaturationProperties sat;
...
algorithm
...
  sat.liq.d := 1.02*Ancillary.bubbleDensity_T(T=sat.Tsat);
}}}

According to the above declarations, {{{sat.liq.d}}} and {{{sat.vap.d}}} should be well-defined.

The model compiles and runs in Dymola."	defect	closed	critical	2.0.0	New Instantiation	trunk	fixed		
