CodePlexProject Hosting for Open Source Software

The example, shown below defines the air mixture at temperature and pressure reached with the isentropic compression with the compression ratio of 10

$model = New-ModelObject $GRI3 -OptIn -Species n2, o2 $mixture = $model.CreateIdealGasMixture(" *main { N2 = 0.79 O2 = ? [pressure] = ? [temperature] = ? [base temperature] = 300.0 ! K [base pressure] = 1.0 ! ATM [compression ratio] = 10 } " ) "The resulting mixture is: $($mixture)"

The resulting mixture is: [T] = 727.24106209756 [P] = 24.2413687365853 o2 = 0.21 n2 = 0.79

$model = New-ModelObject $GRI3 -OptIn -Species n2, o2 $mixture = $model.CreateIdealGasMixture(" *main { N2 = 0.79 O2 = ? [pressure] = ? [temperature] = 500 ! K [base temperature] = 300.0 ! K [base pressure] = 1.0 ! ATM [compression ratio] = ? } " ) "The resulting mixture is: $($mixture)"

The resulting mixture is: [T] = 500 [P] = 6.11481897463845 o2 = 0.21 n2 = 0.79

$model = New-ModelObject $GRI3 -OptIn -Species n2, o2 $mixture = $model.CreateIdealGasMixture(" *main { N2 = 0.79 O2 = ? [pressure] = 10 [temperature] = ? [base temperature] = 300.0 ! K [base pressure] = 1 ! ATM [compression ratio] = ? } " ) "The resulting mixture is: $($mixture)"

The resulting mixture is: [T] = 572.686356459766 [P] = 10 o2 = 0.21 n2 = 0.79

In the above, specifying the compression ratio value along is silently interpreted by Gmix as the isentropic compression case. In order to change the compression type while remaining all the previously specified settings, the question sign assigned to the mach number parameter needs to be added to the mixture definition:

$model = New-ModelObject $GRI3 -OptIn -Species n2, o2 $mixture = $model.CreateIdealGasMixture(" *main { N2 = 0.79 O2 = ? [pressure] = ? [temperature] = ? [base temperature] = 300.0 ! K [base pressure] = 1 ! ATM [compression ratio] = 4 [mach number] = ? } " ) "The resulting mixture is: $($mixture)"

The resulting mixture is: [T] = 792.031358970752 [P] = 10.56041811961 o2 = 0.21 n2 = 0.79

As before, the request to build the mixture can be inverted, so that, for example, the pressure behind the shock wave can be predefined and the final temperature and the mach number become unknown:

$model = New-ModelObject $GRI3 -OptIn -Species n2, o2 $mixture = $model.CreateIdealGasMixture(" *main { N2 = 0.79 O2 = ? [pressure] = 100 ! ATM [temperature] = ? [base temperature] = 300.0 ! K [base pressure] = 1 ! ATM [mach number] = ? } " ) "The resulting mixture is: $($mixture)"

The resulting mixture is: [T] = 4237.51351449752 [P] = 100 o2 = 0.21 n2 = 0.79

Finally consider a complex mixture definition, where both the chemical composition and the thermodynamic state are specified implicitly:

$model = New-ModelObject $GRI3 $mixture = $model.CreateIdealGasMixture(" *main { [fuel] = ? [oxidizer] = ? [mixture fraction] = 0.06 [pressure] = ? [temperature] = 5000 [base temperature] = 300.0 ! K [base pressure] = 1 ! ATM [mach number] = ? } [oxidizer] { O2 = 0.5 AR = ? } [fuel] { C2H4 = 0.5 AR = 0.1 [dilutant] = ? } [dilutant] { N2 = 0.1 AR = 0.1 CO2 = ? } " ) "The resulting mixture is: $($mixture)"

The resulting mixture is: [T] = 5000 [P] = 107.527291613991 o2 = 0.469070467253461 co2 = 0.0197949009577851 c2h4 = 0.0309295327465392 n2 = 0.00247436261972314 ar = 0.477730736422492

Last edited Nov 20, 2013 at 8:29 PM by AlexeyE, version 6