- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Problem with molar mass in media library
Page Start Prev 1 Next End
Problem with molar mass in media library
Problem with molar mass in media library
Nov-18-16 20:06:52
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 !
Page Start Prev 1 Next End
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Problem with molar mass in media library
There are 0 guests and 0 other users also viewing this topic