PHOTON USE
  p

  1 15 1


  vec z 1 sh
  gr ou z 1
  msg( Velocity vectors
  pause;cl
  con h1 z 1 fil;.001
  gr ou z 1
  msg( Single fluid enthalpy contours
  pause;cl
  con hfav z 1 fil;.001
  gr ou z 1
  msg( Fluid-averaged enthalpy contours
  pause;cl
  con hf1 z 1 fil;.001
  gr ou z 1
  msg( 1st fluid enthalpy contours
  pause;cl
  con hf2 z 1 fil;.001
  gr ou z 1
  msg( 2nd fluid enthalpy contours
  pause;cl
  con hf3 z 1 fil;.001
  gr ou z 1
  msg( 3rd fluid enthalpy contours
  pause;cl
  con hf4 z 1 fil;.001
  gr ou z 1
  msg( 4th fluid enthalpy contours
  pause;cl
  con hf5 z 1 fil;.001
  gr ou z 1
  msg( 5th fluid enthalpy contours
  pause;cl
  con tsin z 1 fil;.001
  gr ou z 1
  msg( Single-fluid temperature
  pause;cl
  con tfav z 1 fil;.001
  gr ou z 1
  msg( Fluid-averaged temperature
  pause;cl
  con tf1 z 1 fil;.001
  gr ou z 1
  msg( 1st fluid temperature
  pause;cl
  con tf2 z 1 fil;.001
  gr ou z 1
  msg( 2nd fluid temperature
  pause;cl
  con tf3 z 1 fil;.001
  gr ou z 1
  msg( 3rd fluid temperature
  pause;cl
  con tf4 z 1 fil;.001
  gr ou z 1
  msg( 4th fluid temperature
  pause;cl
  con tf5 z 1 fil;.001
  gr ou z 1
  msg( 5th fluid temperature
  pause;cl
  con ych4 z 1 fil;.001
  gr ou z 1
  msg( Single-fluid CH4 mass fraction
  pause;cl
  con fuav z 1 fil;.001
  gr ou z 1
  msg( Fluid-averaged CH4 mass fraction
  pause;cl
  con fu1 z 1 fil;.001
  gr ou z 1
  msg( 1st fluid CH4 mass fraction
  pause;cl
  con fu2 z 1 fil;.001
  gr ou z 1
  msg( 2nd fluid CH4 mass fraction
  pause;cl
  con fu3 z 1 fil;.001
  gr ou z 1
  msg( 3rd fluid CH4 mass fraction
  pause;cl
  con fu4 z 1 fil;.001
  gr ou z 1
  msg( 4th fluid CH4 mass fraction
  pause;cl
  con fu5 z 1 fil;.001
  gr ou z 1
  msg( 5th fluid CH4 mass fraction
  pause;cl
  con yo2 z 1 fil;.001
  gr ou z 1
  msg( Single-fluid O2 mass fraction
  pause;cl
  con oxav z 1 fil;.001
  gr ou z 1
  msg( Fluid-averaged O2 mass fraction
  pause;cl
  con ox1 z 1 fil;.001
  gr ou z 1
  msg( 1st fluid O2 mass fraction
  pause;cl
  con ox2 z 1 fil;.001
  gr ou z 1
  msg( 2nd fluid O2 mass fraction
  pause;cl
  con ox3 z 1 fil;.001
  gr ou z 1
  msg( 3rd fluid O2 mass fraction
  pause;cl
  con ox4 z 1 fil;.001
  gr ou z 1
  msg( 4th fluid O2 mass fraction
  pause;cl
  con ox5 z 1 fil;.001
  gr ou z 1
  msg( 5th fluid O2 mass fraction
  pause;cl
  con yco2 z 1 fil;.001
  gr ou z 1
  msg( Single-fluid CO2 mass fraction
  pause;cl
  con prav z 1 fil;.001
  gr ou z 1
  msg( Fluid-averaged CO2 mass fraction
  pause;cl
  con pr1 z 1 fil;.001
  gr ou z 1
  msg( 1st fluid CO2 mass fraction
  pause;cl
  con pr2 z 1 fil;.001
  gr ou z 1
  msg( 2nd fluid CO2 mass fraction
  pause;cl
  con pr3 z 1 fil;.001
  gr ou z 1
  msg( 3rd fluid CO2 mass fraction
  pause;cl
  con pr4 z 1 fil;.001
  gr ou z 1
  msg( 4th fluid CO2 mass fraction
  pause;cl
  con pr5 z 1 fil;.001
  gr ou z 1
  msg( 5th fluid CO2 mass fraction
  pause;cl
  con yco z 1 fil;.001
  gr ou z 1
  msg( Single-fluid CO mass fraction
  pause;cl
  con coav z 1 fil;.001
  gr ou z 1
  msg( Fluid-averaged CO mass fraction
  pause;cl
  con co1 z 1 fil;.001
  gr ou z 1
  msg( 1st fluid CO mass fraction
  pause;cl
  con co2 z 1 fil;.001
  gr ou z 1
  msg( 2nd fluid CO mass fraction
  pause;cl
  con co3 z 1 fil;.001
  gr ou z 1
  msg( 3rd fluid CO mass fraction
  pause;cl
  con co4 z 1 fil;.001
  gr ou z 1
  msg( 4th fluid CO mass fraction
  pause;cl
  con co5 z 1 fil;.001
  gr ou z 1
  msg( 5th fluid CO mass fraction
  pause;cl
  con yh2o z 1 fil;.001
  gr ou z 1
  msg( Single-fluid H2O mass fraction
  pause;cl
  con hoav z 1 fil;.001
  gr ou z 1
  msg( Fluid-averaged H2O mass fraction
  pause;cl
  con ho1 z 1 fil;.001
  gr ou z 1
  msg( 1st fluid H2O mass fraction
  pause;cl
  con ho2 z 1 fil;.001
  gr ou z 1
  msg( 2nd fluid H2O mass fraction
  pause;cl
  con ho3 z 1 fil;.001
  gr ou z 1
  msg( 3rd fluid H2O mass fraction
  pause;cl
  con ho4 z 1 fil;.001
  gr ou z 1
  msg( 4th fluid H2O mass fraction
  pause;cl
  con ho5 z 1 fil;.001
  gr ou z 1
  msg( 5th fluid H2O mass fraction
  pause;cl
  con yn2 z 1 fil;.001
  gr ou z 1
  msg( Single-fluid and fluid-averaged N2 mass fraction
  pause
  ENDUSE

  DISPLAY

      5-fluids population:

      2CH4  + 3O2 ->  2CO +4H2O
      2CO   +  O2 ->  2CO2

  ENDDIS



  
     GROUP 1. Run title and other preliminaries


     -------------------------------
TEXT(Two-step reaction: 5 fluids
     -------------------------------

REAL(HIN,GMIXL,CLEN,WIDTH,WIN1,WIN2,REYNO,WD2)
REAL(TKEIN1,EPIN1,TKEIN2,EPIN2)
INTEGER(IYJ);IYJ=3
REYNO=1.E6;WIDTH=0.3;HIN=1.;WD2=0.5*WIDTH
WIN1=8.;WIN2=14.0

    GROUP 3. X-direction grid specification
NX=20;CLEN=70.*WD2;GRDPWR(X,NX,CLEN,2.0)
    GROUP 4. Y-direction grid specification
NY=15;GRDPWR(Y,NY,WD2,1.0)

    GROUP 5. Z-direction grid specification

    GROUP 7. Variables stored, solved & named

       * Solve for P1, U1, V1,
         H1  - single-fluid total enthalpy
         MIXF- single-fluid mixture fraction
SOLVE(P1,U1,V1,H1,MIXF)
SOLUTN(P1,Y,Y,Y,N,N,N)
       * Solve for single-fluid  mass fractions
SOLVE(YCH4,YO2,YCO,YH2O,YCO2,YN2)
       * Solve for total enthalpies of each fluid
SOLVE(HF1,HF2,HF3,HF4,HF5)
       * Solve for CH4 mass fractions of each fluid
SOLVE(FU1,FU2,FU3,FU4,FU5)
       * Solve for O2 mass fractions of each fluid
SOLVE(OX1,OX2,OX3,OX4,OX5)
       * Solve for CO2 mass fractions of each fluid
solve(PR1,PR2,PR3,PR4,PR5)
       * Solve for H2O mass fractions of each fluid
solve(HO1,HO2,HO3,HO4,HO5)
       * Solve for CO mass fractions of each fluid
solve(CO1,CO2,CO3,CO4,CO5)
       * Store temperature of each fluid.
STORE(TF1,TF2,TF3,TF4,TF5)
       * Store fluid-averaged enthalpy, fuel, oxidant and product
STORE (HFAV,FUAV,TFAV,OXAV,PRAV,TSIN,HOAV,COAV)
       * Store reciprocal of turbulent time scale
STORE(EPKE)
       * Store COefficients for child fluids
STORE(COF2,COF3,COF4)
       * Store VALues for child enthalpies
STORE(VHF2,VHF3,VHF4)
       * Store VALues for child-CH4 mass fractions
STORE(VFU2,VFU3,VFU4)
       * Store VALues for child-O2 mass fractions
STORE(VOX2,VOX3,VOX4)
       * Store VALues for child-CO2 mass fractions
STORE(VPR2,VPR3,VPR4)
       * Store VALues for child-H2O mass fractions
STORE(VHO2,VHO3,VHO4)
       * Store VALues for child-CO mass fractions
STORE(VCO2,VCO3,VCO4)
       * Solve for Fluid mass fractions, store their
         averaged value, RMS fluctuations and
         specify micromixing constant
INTEGER(NFLUIDS)
real(conmix)
NFLUIDS=5
conmix=10.
 STORE(MNSQ,AVEF)
 DO II=1,NFLUIDS
 SOLVE(F:II:)
 ENDDO
       * Combustion related inputs
REAL(CPFU,CPOX,HFU,HFUEL,TFUEL,TOX,HOX)
         ** Inlet temperatures of fuel and oxidant
TFUEL = 300.0;TOX   =300.0
         ** Constant specific heats
CPFU=  1300.
CPOX=  CPFU
         ** Heat of combustion
HFU=5.5e7
         ** Inlet enthalpies of fuel and oxidant
HOX  = CPOX*TOX;HFUEL= CPFU*TFUEL + HFU
       * Wall heat sink
REAL(SINK)
SINK=-1.e4*0.
       * Select K-E model of hydrodynamic turbulencs
TURMOD(KEMODL)
KELIN=3.
    GROUP 8. Terms (in differential equations) & devices
TERMS(H1,N,Y,Y,N,Y,N)
    GROUP 9. Properties of the medium (or media)
RHO1=1.
REAL(RHOIN1,RHOIN2)
RHOIN1=RHO1
RHOIN2=RHO1
ENUL=WIN1*WIDTH/REYNO

    Group 10.

    PLANTBEGIN
  
NAMSAT=MOSG
         * Single-fluid
           ** Reaction:   2CH4  + 3O2 ->  2CO +4H2O
PATCH(CH42CO,PHASEM,1,NX,1,NY,1,NZ,1,1)
   CO= 1.  *4.*EPKE*AMIN1(YCH4,YO2/3.)/(YCH4+tiny)
COVAL(CH42CO,YCH4,GRND,0.0)
   CO= 3.  *4.*EPKE*AMIN1(YCH4,YO2/3.)/(YO2+tiny)
COVAL(CH42CO,YO2,GRND,0.0)
   VAL=  1.75*4.*EPKE*AMIN1(YCH4,YO2/3.)
COVAL(CH42CO,YCO,FIXFLU,GRND)
   VAL=  2.25*4.*EPKE*AMIN1(YCH4,YO2/3.)
COVAL(CH42CO,YH2O,FIXFLU,GRND)
           ** Reaction:   2CO +  O2 -> 2CO2
PATCH(CO2CO2,PHASEM,1,NX,1,NY,1,NZ,1,1)
   CO= 1.  *4.*EPKE*AMIN1(YCO,YO2/.57)/(YCO+tiny)
COVAL(CO2CO2,YCO,GRND,0.)
   CO= 0.57*4.*EPKE*AMIN1(YCO,YO2/.57)/(YO2+tiny)
COVAL(CO2CO2,YO2,GRND,0.)
   VAL=  1.57*4.*EPKE*AMIN1(YCO,YO2/.57)
COVAL(CO2CO2,YCO2,FIXFLU,GRND)
           ** Single-fluid temperature
  TSIN=(H1-5.5e7*YCH4-7.45e6*YCO)/1300.
store(sums)
           ** Mass conservation
   SUMS=YCH4+YO2+YCO+YH2O+YCO2+YN2

       * Micromixing contributions to CVA transport
         ** Contributions to enthalpies
PATCH(MICRHF,PHASEM,1,NX,1,NY,1,NZ,1,1)
   CO = :CONMIX:*EPKE*COF2
   VAL= VHF2
COVAL(MICRHF,HF2,GRND,GRND)
   CO = :CONMIX:*EPKE*COF3
   VAL= VHF3
COVAL(MICRHF,HF3,GRND,GRND)
   CO = :CONMIX:*EPKE*COF4
   VAL= VHF4
COVAL(MICRHF,HF4,GRND,GRND)
         ** Contributions to CH4 mass fractions
PATCH(MICRFU,PHASEM,1,NX,1,NY,1,NZ,1,1)
   CO = :CONMIX:*EPKE*COF2
   VAL= VFU2
COVAL(MICRFU,FU2,GRND,GRND)
   CO = :CONMIX:*EPKE*COF3
   VAL= VFU3
COVAL(MICRFU,FU3,GRND,GRND)
   CO = :CONMIX:*EPKE*COF4
   VAL= VFU4
COVAL(MICRFU,FU4,GRND,GRND)
         ** Contributions to O2 mass fractions
PATCH(MICROX,PHASEM,1,NX,1,NY,1,NZ,1,1)
   CO = :CONMIX:*EPKE*COF2
   VAL= VOX2
COVAL(MICROX,OX2,GRND,GRND)
   CO = :CONMIX:*EPKE*COF3
   VAL= VOX3
COVAL(MICROX,OX3,GRND,GRND)
   CO = :CONMIX:*EPKE*COF4
   VAL= VOX4
COVAL(MICROX,OX4,GRND,GRND)
         ** Contributions to CO2 mass fractions
PATCH(MICRPR,PHASEM,1,NX,1,NY,1,NZ,1,1)
   CO = :CONMIX:*EPKE*COF2
   VAL= VPR2
COVAL(MICRPR,PR2,GRND,GRND)
   CO = :CONMIX:*EPKE*COF3
   VAL= VPR3
COVAL(MICRPR,PR3,GRND,GRND)
   CO = :CONMIX:*EPKE*COF4
   VAL= VPR4
COVAL(MICRPR,PR4,GRND,GRND)
         ** Contributions to H2O mass fractions
PATCH(MICH2O,PHASEM,1,NX,1,NY,1,NZ,1,1)
   CO = :CONMIX:*EPKE*COF2
   VAL= VHO2
COVAL(MICH2O,HO2,GRND,GRND)
   CO = :CONMIX:*EPKE*COF3
   VAL= VHO3
COVAL(MICH2O,HO3,GRND,GRND)
   CO = :CONMIX:*EPKE*COF4
   VAL= VHO4
COVAL(MICH2O,HO4,GRND,GRND)
         ** Contributions to CO mass fractions
PATCH(MICCO,PHASEM,1,NX,1,NY,1,NZ,1,1)
   CO = :CONMIX:*EPKE*COF2
   VAL= VCO2
COVAL(MICCO,CO2,GRND,GRND)
   CO = :CONMIX:*EPKE*COF3
   VAL= VCO3
COVAL(MICCO,CO3,GRND,GRND)
   CO = :CONMIX:*EPKE*COF4
   VAL= VCO4
COVAL(MICCO,CO4,GRND,GRND)
       * North-wall heat losses for each fluid
         are made proportional to its mass fraction
PATCH(COOLWALL,NORTH,1,NX,NY,NY,1,NZ,1,1)
     VAL=:SINK:*F1
COVAL(COOLWALL,HF1,FIXFLU,GRND)
     VAL=:SINK:*F2
COVAL(COOLWALL,HF2,FIXFLU,GRND)
     VAL=:SINK:*F3
COVAL(COOLWALL,HF3,FIXFLU,GRND)
     VAL=:SINK:*F4
COVAL(COOLWALL,HF4,FIXFLU,GRND)
     VAL=:SINK:*F5
COVAL(COOLWALL,HF5,FIXFLU,GRND)
       * CH4 sources for each fluid
PATCH(FURATE,PHASEM,1,NX,1,NY,1,NZ,1,1)
     CO= 1.  *4.*EPKE*AMIN1(FU1,OX1/3.)/(FU1+tiny)*F1
COVAL(FURATE,FU1,GRND,0.0)
     CO= 1.  *4.*EPKE*AMIN1(FU2,OX2/3.)/(FU2+tiny)*F2
COVAL(FURATE,FU2,GRND,0.0)
     CO= 1.  *4.*EPKE*AMIN1(FU3,OX3/3.)/(FU3+tiny)*F3
COVAL(FURATE,FU3,GRND,0.0)
     CO= 1.  *4.*EPKE*AMIN1(FU4,OX4/3.)/(FU4+tiny)*F4
COVAL(FURATE,FU4,GRND,0.0)
     CO= 1.  *4.*EPKE*AMIN1(FU5,OX5/3.)/(FU5+tiny)*F5
COVAL(FURATE,FU5,GRND,0.0)
       * O2 sources for each fluid
         ** Reaction 1
PATCH(OXRATE1,PHASEM,1,NX,1,NY,1,NZ,1,1)
     CO= 3.  *4.*EPKE*AMIN1(FU1,OX1/3.)/(OX1+tiny)*F1
COVAL(OXRATE1,OX1,GRND,0.0)
     CO= 3.  *4.*EPKE*AMIN1(FU2,OX2/3.)/(OX2+tiny)*F2
COVAL(OXRATE1,OX2,GRND,0.0)
     CO= 3.  *4.*EPKE*AMIN1(FU3,OX3/3.)/(OX3+tiny)*F3
COVAL(OXRATE1,OX3,GRND,0.0)
     CO= 3.  *4.*EPKE*AMIN1(FU4,OX4/3.)/(OX4+tiny)*F4
COVAL(OXRATE1,OX4,GRND,0.0)
     CO= 3.  *4.*EPKE*AMIN1(FU5,OX5/3.)/(OX5+tiny)*F5
COVAL(OXRATE1,OX5,GRND,0.0)
         ** Reaction 2
PATCH(OXRATE2,PHASEM,1,NX,1,NY,1,NZ,1,1)
     CO= 0.57*4.*EPKE*AMIN1(CO1,OX1/.57)/(OX1+tiny)*F1
COVAL(OXRATE2,OX1,GRND,0.0)
     CO= 0.57*4.*EPKE*AMIN1(CO2,OX2/.57)/(OX2+tiny)*F2
COVAL(OXRATE2,OX2,GRND,0.0)
     CO= 0.57*4.*EPKE*AMIN1(CO3,OX3/.57)/(OX3+tiny)*F3
COVAL(OXRATE2,OX3,GRND,0.0)
     CO= 0.57*4.*EPKE*AMIN1(CO4,OX4/.57)/(OX4+tiny)*F4
COVAL(OXRATE2,OX4,GRND,0.0)
     CO= 0.57*4.*EPKE*AMIN1(CO5,OX5/.57)/(OX5+tiny)*F5
COVAL(OXRATE2,OX5,GRND,0.0)
       * CO2 sources for each fluid
PATCH(PRRATE,PHASEM,1,NX,1,NY,1,NZ,1,1)
     VAL=  1.57*4.*EPKE*AMIN1(CO1,OX1/.57)*F1
COVAL(PRRATE,PR1,FIXFLU,GRND)
     VAL=  1.57*4.*EPKE*AMIN1(CO2,OX2/.57)*F2
COVAL(PRRATE,PR2,FIXFLU,GRND)
     VAL=  1.57*4.*EPKE*AMIN1(CO3,OX3/.57)*F3
COVAL(PRRATE,PR3,FIXFLU,GRND)
     VAL=  1.57*4.*EPKE*AMIN1(CO4,OX4/.57)*F4
COVAL(PRRATE,PR4,FIXFLU,GRND)
     VAL=  1.57*4.*EPKE*AMIN1(CO5,OX5/.57)*F5
COVAL(PRRATE,PR5,FIXFLU,GRND)
       * H2O sources for each fluid
PATCH(H2ORATE,PHASEM,1,NX,1,NY,1,NZ,1,1)
     VAL=  2.25*4.*EPKE*AMIN1(FU1,OX1/3.)*F1
COVAL(H2ORATE,HO1,FIXFLU,GRND)
     VAL=  2.25*4.*EPKE*AMIN1(FU2,OX2/3.)*F2
COVAL(H2ORATE,HO2,FIXFLU,GRND)
     VAL=  2.25*4.*EPKE*AMIN1(FU3,OX3/3.)*F3
COVAL(H2ORATE,HO3,FIXFLU,GRND)
     VAL=  2.25*4.*EPKE*AMIN1(FU4,OX4/3.)*F4
COVAL(H2ORATE,HO4,FIXFLU,GRND)
     VAL=  2.25*4.*EPKE*AMIN1(FU5,OX5/3.)*F5
COVAL(H2ORATE,HO5,FIXFLU,GRND)
       * CO sources for each fluid
         ** Reaction 1
PATCH(CORATE1,PHASEM,1,NX,1,NY,1,NZ,1,1)
     VAL=  1.75*4.*EPKE*AMIN1(FU1,OX1/3.)*F1
COVAL(CORATE1,CO1,FIXFLU,GRND)
     VAL=  1.75*4.*EPKE*AMIN1(FU2,OX2/3.)*F2
COVAL(CORATE1,CO2,FIXFLU,GRND)
     VAL=  1.75*4.*EPKE*AMIN1(FU3,OX3/3.)*F3
COVAL(CORATE1,CO3,FIXFLU,GRND)
     VAL=  1.75*4.*EPKE*AMIN1(FU4,OX4/3.)*F4
COVAL(CORATE1,CO4,FIXFLU,GRND)
     VAL=  1.75*4.*EPKE*AMIN1(FU5,OX5/3.)*F5
COVAL(CORATE1,CO5,FIXFLU,GRND)
         ** Reaction 2
PATCH(CORATE2,PHASEM,1,NX,1,NY,1,NZ,1,1)
     CO= 1.  *4.*EPKE*AMIN1(CO1,OX1/.57)/(CO1+tiny)*F1
COVAL(CORATE2,CO1,GRND,0.)
     CO= 1.  *4.*EPKE*AMIN1(CO2,OX2/.57)/(CO2+tiny)*F2
COVAL(CORATE2,CO2,GRND,0.)
     CO= 1.  *4.*EPKE*AMIN1(CO3,OX3/.57)/(CO3+tiny)*F3
COVAL(CORATE2,CO3,GRND,0.)
     CO= 1.  *4.*EPKE*AMIN1(CO4,OX4/.57)/(CO4+tiny)*F4
COVAL(CORATE2,CO4,GRND,0.)
     CO= 1.  *4.*EPKE*AMIN1(CO5,OX5/.57)/(CO5+tiny)*F5
COVAL(CORATE2,CO5,GRND,0.)
       * COefficients for child fluids
  COF2=F1*F3+F1*F4/2.+F1*F5/3.+tiny
  COF3=F2*F4+F1*F4/2.+F2*F5/2.+F1*F5/3.+tiny
  COF4=F3*F5+F2*F5/2.+F1*F5/3.+tiny
       * VALues for child enthalpies
  VHF2=HF1/2.+(F1*F3/2.*HF3+F1*F4/4.*HF4+F1*F5/6.*HF5)/COF2
  VHF3=(F1*F4/4.+F1*F5/6.)*HF1+(F2*F4/2.+F2*F5/4.)*HF2
  VHF3=VHF3+(F1*F4/4.+F2*F4/2.)*HF4+(F1*F5/6.+F2*F5/4.)*HF5
  VHF3=VHF3/COF3
  VHF4=HF5/2.+(F3*F5/2.*HF3+F2*F5/4.*HF2+F1*F5/6.*HF1)/COF4
       * VALues for child CH4
  VFU2=FU1/2.+(F1*F3/2.*FU3+F1*F4/4.*FU4+F1*F5/6.*FU5)/COF2
  VFU3=(F1*F4/4.+F1*F5/6.)*FU1+(F2*F4/2.+F2*F5/4.)*FU2
  VFU3=VFU3+(F1*F4/4.+F2*F4/2.)*FU4+(F1*F5/6.+F2*F5/4.)*FU5
  VFU3=VFU3/COF3
  VFU4=FU5/2.+(F3*F5/2.*FU3+F2*F5/4.*FU2+F1*F5/6.*FU1)/COF4
       * VALues for child O2
  VOX2=OX1/2.+(F1*F3/2.*OX3+F1*F4/4.*OX4+F1*F5/6.*OX5)/COF2
  VOX3=(F1*F4/4.+F1*F5/6.)*OX1+(F2*F4/2.+F2*F5/4.)*OX2
  VOX3=VOX3+(F1*F4/4.+F2*F4/2.)*OX4+(F1*F5/6.+F2*F5/4.)*OX5
  VOX3=VOX3/COF3
  VOX4=OX5/2.+(F3*F5/2.*OX3+F2*F5/4.*OX2+F1*F5/6.*OX1)/COF4
       * VALues for child CO2
  VPR2=PR1/2.+(F1*F3/2.*PR3+F1*F4/4.*PR4+F1*F5/6.*PR5)/COF2
  VPR3=(F1*F4/4.+F1*F5/6.)*PR1+(F2*F4/2.+F2*F5/4.)*PR2
  VPR3=VPR3+(F1*F4/4.+F2*F4/2.)*PR4+(F1*F5/6.+F2*F5/4.)*PR5
  VPR3=VPR3/COF3
  VPR4=PR5/2.+(F3*F5/2.*PR3+F2*F5/4.*PR2+F1*F5/6.*PR1)/COF4
       * VALues for child H2O
  VHO2=HO1/2.+(F1*F3/2.*HO3+F1*F4/4.*HO4+F1*F5/6.*HO5)/COF2
  VHO3=(F1*F4/4.+F1*F5/6.)*HO1+(F2*F4/2.+F2*F5/4.)*HO2
  VHO3=VHO3+(F1*F4/4.+F2*F4/2.)*HO4+(F1*F5/6.+F2*F5/4.)*HO5
  VHO3=VHO3/COF3
  VHO4=HO5/2.+(F3*F5/2.*HO3+F2*F5/4.*HO2+F1*F5/6.*HO1)/COF4
       * VALues for child CO
  VCO2=CO1/2.+(F1*F3/2.*CO3+F1*F4/4.*CO4+F1*F5/6.*CO5)/COF2
  VCO3=(F1*F4/4.+F1*F5/6.)*CO1+(F2*F4/2.+F2*F5/4.)*CO2
  VCO3=VCO3+(F1*F4/4.+F2*F4/2.)*CO4+(F1*F5/6.+F2*F5/4.)*CO5
  VCO3=VCO3/COF3
  VCO4=CO5/2.+(F3*F5/2.*CO3+F2*F5/4.*CO2+F1*F5/6.*CO1)/COF4
       * Temperatures of the fluids
  TF1=(HF1-5.5e7*FU1-7.45e6*CO1)/1300.
  TF2=(HF2-5.5e7*FU2-7.45e6*CO2)/1300.
  TF3=(HF3-5.5e7*FU3-7.45e6*CO3)/1300.
  TF4=(HF4-5.5e7*FU4-7.45e6*CO4)/1300.
  TF5=(HF5-5.5e7*FU5-7.45e6*CO5)/1300.
       * Fluid-averaged properties
  HFAV=F1*HF1+F2*HF2+F3*HF3+F4*HF4+F5*HF5
  FUAV=F1*FU1+F2*FU2+F3*FU3+F4*FU4+F5*FU5
  TFAV=F1*TF1+F2*TF2+F3*TF3+F4*TF4+F5*TF5
  OXAV=F1*OX1+F2*OX2+F3*OX3+F4*OX4+F5*OX5
  PRAV=F1*PR1+F2*PR2+F3*PR3+F4*PR4+F5*PR5
  HOAV=F1*HO1+F2*HO2+F3*HO3+F4*HO4+F5*HO5
  COAV=F1*CO1+F2*CO2+F3*CO3+F4*CO4+F5*CO5
       * Checks for conservation
         ** In-fluid, SUM1, SUM2, SUM3, SUM4 and whole
            population mass fractions, SUAV, should be
            summed to unity
store(SUM1,SUM2,SUM3,SUM4,SUM5,SUAV)
   SUM1=FU1+OX1+PR1+CO1+HO1+YN2
   SUM2=FU2+OX2+PR2+CO2+HO2+YN2
   SUM3=FU3+OX3+PR3+CO3+HO3+YN2
   SUM4=FU4+OX4+PR4+CO4+HO4+YN2
   SUM5=FU5+OX5+PR5+CO5+HO5+YN2
   SUAV=FUAV+OXAV+PRAV+COAV+HOAV+YN2
    PLANTEND

    GROUP 11. Initialization of variable or porosity fields
FIINIT(U1)=0.5*(WIN1+WIN2)

  ** TKEIN = 0.25*WIN1*WIN1*FRIC where FRIC=0.018 AT REYNO=1.E5
TKEIN1=0.25*WIN1*WIN1*0.018
TKEIN2=0.25*WIN2*WIN2*0.018
   FIINIT(KE)=0.5*(TKEIN1+TKEIN2)
  ** EPIN = 0.1643*KIN**1.5/LMIX where LMIX=0.045*WIDTH
GMIXL=0.011*WD2
EPIN2=TKEIN2**1.5/GMIXL*0.1643
EPIN1=TKEIN1**1.5/GMIXL*0.1643
    GROUP 13. Boundary conditions and special sources
  ** Inlet Boundaries
INLET(IN1,WEST,1,1,1,IYJ,1,NZ,1,1)
VALUE(IN1,P1 , RHOIN1*WIN1)
VALUE(IN1,U1 , WIN1)
VALUE(IN1,H1,HFUEL)
VALUE(IN1,MIXF,1.0)
VALUE(IN1,YCH4,1.0)
VALUE(IN1,YO2 ,0.0)
VALUE(IN1,YCO ,0.0)
VALUE(IN1,YH2O,0.0)
VALUE(IN1,YCO2,0.0)
VALUE(IN1,YN2 ,0.0)
VALUE(IN1,KE , TKEIN1)
VALUE(IN1,EP , EPIN1)

INLET(IN2,WEST,1,1,IYJ+1,NY,1,NZ,1,1)
VALUE(IN2,P1, RHOIN2*WIN2)
VALUE(IN2,U1, WIN2)
VALUE(IN2,H1,HOX)
VALUE(IN2,MIXF,0.0)
VALUE(IN2,YCH4,0.0)
VALUE(IN2,YO2 ,0.232)
VALUE(IN2,YCO ,0.0)
VALUE(IN2,YH2O,0.0)
VALUE(IN2,YCO2,0.0)
VALUE(IN2,YN2 ,0.768)
VALUE(IN2,KE, TKEIN2)
VALUE(IN2,EP, EPIN2)

 DO II=1,NFLUIDS
 VALUE(IN1 ,F:II:,0.000000E+00)
 VALUE(IN1 ,HF:II:,HFUEL)
 VALUE(IN1 ,FU:II:,1.0)
 VALUE(IN1 ,OX:II:,0.0)
 VALUE(IN1 ,PR:II:,0.0)
 VALUE(IN1 ,HO:II:,0.0)
 VALUE(IN1 ,CO:II:,0.0)
 ENDDO
 VALUE(IN1 ,F:NFLUIDS:,1.000000E+00)

 DO II=1,NFLUIDS
 VALUE(IN2 ,F:II:, 0.000000E+00)
 VALUE(IN2 ,HF:II:,HOX)
 VALUE(IN2 ,FU:II:,0.0)
 VALUE(IN2 ,OX:II:,0.232)
 VALUE(IN2 ,PR:II:,0.0)
 VALUE(IN2 ,HO:II:,0.0)
 VALUE(IN2 ,CO:II:,0.0)
 ENDDO
 VALUE(IN2 ,F1,1.000000E+00)
    * Fluid interaction sources
 PATCH(MICROMIX,PHASEM,1,NX,1,NY,1,NZ,1,1)
 DO II=1,NFLUIDS
 COVAL(MICROMIX,F:II:, GRND        , SAME        )
 ENDDO
   * Outlet boundary
PATCH(OUTLET,EAST,NX,NX,1,NY,1,NZ,1,1)
COVAL(OUTLET,P1,fixp,0.0)
   * North-Wall boundary (generalised wall functions)
WALL (WFNN,NORTH,1,NX,NY,NY,1,NZ,1,1)
    * North-wall heat losses for single-fluid enthalpy
PATCH(HEATLOSS,NORTH,1,NX,NY,NY,1,NZ,1,1)
COVAL(HEATLOSS,H1,FIXFLU,SINK)
    GROUP 15. Termination of sweeps
LSWEEP=500
RESFAC=1.e-3
    GROUP 16. Termination of iterations
LITHYD=10

 DO II=1,NFLUIDS
 VARMIN(F:II:)=0.0;VARMAX(F:II:)=1.
 VARMIN(FU:II:)=0.0;VARMAX(FU:II:)=1.
 VARMIN(OX:II:)=0.0;VARMAX(OX:II:)=1.
 VARMIN(PR:II:)=0.0;VARMAX(PR:II:)=1.
 VARMIN(HO:II:)=0.0;VARMAX(HO:II:)=1.
 VARMIN(CO:II:)=0.0;VARMAX(CO:II:)=1.
 ENDDO
 VARMIN(YCH4)=0.0;VARMAX(YCH4)=1.
 VARMIN(YO2) =0.0;VARMAX(YO2) =1.
 VARMIN(YCO) =0.0;VARMAX(YCO) =1.
 VARMIN(YH2O)=0.0;VARMAX(YH2O)=1.
 VARMIN(YCO2)=0.0;VARMAX(YCO2)=1.
 VARMIN(YN2) =0.0;VARMAX(YN2) =1.
 VARMIN(MIXF)=0.0;VARMAX(MIXF)=1.



    GROUP 17. Under-relaxation devices
RELAX(P1,LINRLX,0.3)
RELAX(V1,FALSDT,0.01)
RELAX(U1,FALSDT,0.01)
RELAX(KE,FALSDT,0.01)
RELAX(EP,FALSDT,0.01)
RELAX(H1,FALSDT,0.01)
RELAX(MIXF,FALSDT,0.01)
RELAX(YCH4,FALSDT,0.01)
RELAX(YCO ,FALSDT,0.01)
RELAX(YCO2,FALSDT,0.01)
RELAX(YH2O,FALSDT,0.01)
RELAX(YCO2,FALSDT,0.01)
RELAX(YN2 ,FALSDT,0.01)

 DO II=1,NFLUIDS
 relax(f:ii:,linrlx,0.25)
 RELAX(HF:II:,FALSDT,1.1)
 RELAX(FU:II:,FALSDT,.01)
 RELAX(OX:II:,FALSDT,.01)
 RELAX(PR:II:,FALSDT,.01)
 RELAX(HO:II:,FALSDT,.01)
 RELAX(CO:II:,FALSDT,.01)
 ENDDO

    GROUP 19. Data communicated by SATELLITE to GROUND

 SPEDAT(SET,MFM,MFMMOD,C,MFM)
 SPEDAT(SET,MFM,NFLUIDS,I,nfluids)
 SPEDAT(SET,MFM,NFLR,I,1)
 SPEDAT(SET,MFM,NFLF,I,nfluids)
 SPEDAT(SET,MFM,CONREA,R,0.0)
 SPEDAT(SET,MFM,CONMIX,R,:conmix:)
 SPEDAT(SET,MFM,VISCON,R,0.00000E+00)

    GROUP 21. Print-out of variables
WALPRN=T;OUTPUT(KE,Y,Y,Y,Y,Y,Y)

    GROUP 22. Monitor print-out
IXMON=NX/2;IYMON=1;UWATCH=T

    GROUP 23. Field print-out and plot control
NPLT=1;NXPRIN=1;NYPRIN=1
NYPRIN=1;IYPRF=1;IYPRL=30
TSTSWP=-1
STOP