﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
2858	Nasty bug with package constants in Modelica.Media gas mixture models	Francesco Casella	Per Östlund	"Consider this test case:
{{{
model TestMixture
  package Medium = Modelica.Media.IdealGases.MixtureGases.FlueGasSixComponents;
  Medium.BaseProperties medium;
  Medium.MolarMass MM[:] = Medium.data.MM;
equation 
  medium.p = 1e5;
  medium.T = 300;
  medium.X[1] = time;
  medium.X[2] = 1 - time;
  medium.X[3:6] = zeros(4);
end TestMixture;
}}}

The record Medium.data.MM should contain the molar masses of the six components of the gas. Unfortunately, all six components of the array turn out to be equal to the molar mass of the last component (CO2 in this case).

This result is obtained using r22544 of OMC. I have been reported that if older versions of OMC with the previous Inst module were used, the value of the first component turned up, though I haven't checked this myself.

Apparently something goes wrong when the modifier 

{{{
     data={Common.SingleGasesData.N2,
    Common.SingleGasesData.H2,
    Common.SingleGasesData.CO,
    Common.SingleGasesData.O2,
    Common.SingleGasesData.H2O,
    Common.SingleGasesData.CO2}
}}}

is expanded in the medium model.

This is a particularly nasty bug, because the compiler does not produce any error, but simple gives wrong numerical results. Basically, all models using Modelica.Media with ideal gas mixtures are invalid.

I would strongly urge to fix this issue before releasing 1.9.1. - if that is not possible, then at least the compiler should give an error when trying to compile these models, instead of producing wrong simulation code.

Thanks to Andrea Brambilla of ETH Zurich for reporting this problem."	defect	closed	blocker	2.0.0	New Instantiation	trunk	fixed		andreabr@… Per Östlund Martin Sjölund Mahder Alemseged Gebremedhin
