Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Problem with molar mass in media library

Problem with molar mass in media library

Hi,

I wanted to use a gas mixture with varying composition and got a problem while looking at the molar mass. Following is a simple test:

Code:


model molarMassesTest "Test gas mixtures"
  extends Modelica.Icons.Example;
  package Medium = Modelica.Media.IdealGases.MixtureGases.SimpleNaturalGas "Medium model";
  Medium.BaseProperties medium();
  parameter Real data[:]=medium.MMX;
  Real molm "molar mass from media library";
  Real molm2 "molar mass calculated by myself";
equation
  medium.X = {0.0, 0.0, 0.0, 0.0, 0.0+time, 1.0-time};
  medium.p = 100000;
  medium.T = 300;
  molm = medium.MM;
  molm2 = 1 / sum(medium.state.X[j] / data[j] for j in 1:size(medium.state.X, 1));
end molarMassesTest;

It seems, that the molar mass from media library is constant. This shouldn't because the composition is changing. I checked MixtureGasNase and the function there is identical to the function for molm2. Did I miss something or made a mistake?

Thanks in advance for your help !

 

Re: Problem with molar mass in media library

Update...just checked the bug tickes database - Ticket #2858 is what I mean...

There are 0 guests and 0 other users also viewing this topic
You are here: