Specifying physical units

If one or more parameters defining the IdealGasMixture state are given in different units comparing to these used by default (Atmosphere, Kelvin, Mole Fractions (X), etc), you can use the units – reserved keyword in order to inform the Gmix engine on how to interpret the input values.
For example, the following script defines the pure air mixture at temperature of 20 Celsius, pressure of 100000 Pascal and the chemical composition expressed in terms of mass ractions.
$model = New-ModelObject $GRI3 -OptIn -Species o2, n2
$mixture = $model.CreateIdealGasMixture("
    *main{
        [units] = (Pascal, Celsius, Y)
        N2 = ?
        O2 = 0.233
        [pressure] = 100000
        [temperature] = 20
    }
")
"The mixture state is: $($mixture)" 
Here the units operator sets the units to Pascals, Celsius and Mass Fractions (see Y). Additionally, if the specified mass fractions are given in percents instead of these normalized on unit, the Y- mass fraction sign needs to be postfixed with 100:
$model = New-ModelObject $GRI3 -OptIn -Species o2, n2
$mixture = $model.CreateIdealGasMixture("
    *main{
        [units] = (Pascal, Celsius, Y100)
        N2 = ?
        O2 = 23.3
        [pressure] = 100000
        [temperature] = 20
    }
")
"The mixture state is: $($mixture)" 
SpecifyingUnits.png
It is perfectly fine to express a mixture definition in terms of a number of complex components that are defined using different physical units. As an example, consider the following script
$model = New-ModelObject $GRI3 
$mixture = $model.CreateIdealGasMixture("
    *main
    {
        [units]    = (Atmosphere)
        [oxidizer] = ?
        [fuel]     = ?
        [equivalence ratio] = 0.9
        [pressure] = 1
        [temperature] = ?
    }
    [oxidizer]
    {
        [units] = (Celsius, Atmosphere, x)
        [pressure] = 1
        [temperature] = 20
        n2 = 0.3
        [inert] = 0.1
        o2 = ?
    }
    [fuel]
    {
        [units] = (Kelvin, Atmosphere, Y100)
        [pressure] = 1
        [temperature] = 400
        C2H4 = 1
        CO = ?
        H2 = 55
    }
    [inert]
    {
        [units] = (Kelvin, Atmosphere, X100)
        [pressure] = 1
        [temperature] = 500
        ar = 77
        n2 = ?
    }
")
"The mixture state is: $($mixture)" 

In the above example, the mixture consists of complex oxidizer and fuel mixed in the proportions to achieve the equivalence ratio of 0.9. The oxidizer is defined as a mixture of nitrogen, oxygen and an inert component. All 3 components (fuel, oxidizer and inert) are defined using different units.
SpecifyingUnitsComplexDefinition.png

Last edited Nov 30, 2013 at 2:06 PM by AlexeyE, version 3

Comments

angela12 Mar 27, 2014 at 4:00 PM 
gracias por la info