DISPLAY
  Stirred reactor, with 1D (reactedness population), transient.
  
  The is initially full of reacted fluid, measured by F:NFLUIDS: .
  
  Completely-unreacted fluid, measured by F1, enters in the A 
  stream; no fluid at all enters in the B stream.
  
  The final steady state is of interest; and, in particular, 
  whether this consists almost completely of low-numbered fluids, 
  F1, F2 etc, in which case the reactor is said to have been 
  'extinguished', or whether significant mass fractions of 
  higher-numbered fluids are to be found.
  
  The final value of the variable AVER  (i.e. average reactedness) 
  is the simplest indicator. When extinction occurs, it tends 
  asymptotically to zero; otherwise it maintains a finite value of 
  between (say) 35 and 100 %.
  
  Its precise value depends upon the 'physical' constants CONMIX, 
  CONREA, and RATEXP; and also on the 'numerical-grid-related' 
  quantities, LSTEP and NFLR.
  ENDDIS
#mfm      
   Set the micro-mixing and reaction-rate constants 
CONMIX=100.0; CONREA=1.0; RATEXP=5.0
NFLR=100   ! set the number of reactedness subdivisions
   Make consequential settings
#mfm1
FLOWA=1.0  ! inflow rate of A stream
FLOWB=0.0  ! inflow rate of B stream
RA=0.0     ! reactedness of A stream
RB=1.0     ! reactedness of B stream
   Make further consequential settings
#mfm2
STEADY=F; LSTEP=50; TLAST=1.0
GRDPWR(T,LSTEP,TLAST,1.0)

FIINIT(F:NFLUIDS:)=1.0
  re-set final patch argument to LSTEP
PATCH(INFLOWA,CELL,1,1,1,1,1,1,1,LSTEP)
PATCH(INFLOWB,CELL,1,1,1,1,1,1,1,LSTEP)
PATCH(OUTFLOW,VOLUME,1,1,1,1,1,1,1,LSTEP)
 
REAL(DUM);DUM = 1.0  +  RB * (NFLUIDS-1)
INTEGER(IB);IB=DUM
FLUIDB=F:IB:
FLUIDB
COVAL(INFLOWB,:FLUIDB:,ONLYMS,1.)
conmix
conrea  
LSWEEP=25

TEXT(AWSR transient, conmix=:conmix: conrea=:conrea:

SPEDAT(SET,MFM,CONMIX,R,:CONMIX:)   ! transmit data to gxmfm
SPEDAT(SET,MFM,CONREA,R,:CONREA:)
SPEDAT(SET,GXMONI,TRANSIENT,L,F)

SOLVE(RCTD)                         ! reactedness of ideal WSR
PATCH(WHOLE,VOLUME,1,NX,1,NY,1,NZ,1,LSTEP) ! source via In-Form
REAL(CON)
CON=CONREA*(1. + RATEXP) * (2. + RATEXP)
(source of RCTD at WHOLE is :CON:*(1-RCTD)*RCTD^:RATEXP: with line)  
FIINIT(RCTD)=1.0                    ! initialise so as to ignite
VARMAX(RCTD)=1.0 ; VARMIN(RCTD)=0.0 ! set limits 
RELAX(RCTD,LINRLX,0.1)              ! relax

PATCH(PROFILES,PROFIL,1,1,1,1,1,1,1,LSTEP) ! use line-printer plot
INTEGER(NFL)                               ! for time-wise profiles
NFL=:NFLUIDS:                              ! for some of the fluid
COVAL(PROFILES,F:NFL:,0.0,1.0)             ! mass fractions and of 
COVAL(PROFILES,F:NFL-2:,0.0,0.1)
COVAL(PROFILES,F:NFL-4:,0.0,0.1)
COVAL(PROFILES,F:NFL-6:,0.0,0.1)
COVAL(PROFILES,AVER,0.0,1.0)               ! average reactedness &
COVAL(PROFILES,RCTD,0.0,1.0)               ! IWSR reactedness
DISTIL=T
 EX(P1  )=   1.000E+00; EX(RCTD)=   9.735E-01; EX(F1  )=   2.001E-02
 EX(F2  )=   5.298E-04; EX(F3  )=   5.134E-04; EX(F4  )=   5.163E-04
 EX(F5  )=   5.226E-04; EX(F6  )=   5.305E-04; EX(F7  )=   5.397E-04
 EX(F8  )=   5.498E-04; EX(F9  )=   5.607E-04; EX(F10 )=   5.723E-04
 EX(F11 )=   5.845E-04; EX(F12 )=   5.973E-04; EX(F13 )=   6.107E-04
 EX(F14 )=   6.247E-04; EX(F15 )=   6.392E-04; EX(F16 )=   6.544E-04
 EX(F17 )=   6.701E-04; EX(F18 )=   6.865E-04; EX(F19 )=   7.034E-04
 EX(F20 )=   7.210E-04; EX(F21 )=   7.391E-04; EX(F22 )=   7.579E-04
 EX(F23 )=   7.774E-04; EX(F24 )=   7.975E-04; EX(F25 )=   8.183E-04
 EX(F26 )=   8.398E-04; EX(F27 )=   8.620E-04; EX(F28 )=   8.849E-04
 EX(F29 )=   9.085E-04; EX(F30 )=   9.329E-04; EX(F31 )=   9.580E-04
 EX(F32 )=   9.840E-04; EX(F33 )=   1.011E-03; EX(F34 )=   1.038E-03
 EX(F35 )=   1.067E-03; EX(F36 )=   1.096E-03; EX(F37 )=   1.126E-03
 EX(F38 )=   1.157E-03; EX(F39 )=   1.189E-03; EX(F40 )=   1.222E-03
 EX(F41 )=   1.256E-03; EX(F42 )=   1.292E-03; EX(F43 )=   1.328E-03
 EX(F44 )=   1.365E-03; EX(F45 )=   1.404E-03; EX(F46 )=   1.444E-03
 EX(F47 )=   1.485E-03; EX(F48 )=   1.528E-03; EX(F49 )=   1.572E-03
 EX(F50 )=   1.618E-03; EX(F51 )=   1.666E-03; EX(F52 )=   1.715E-03
 EX(F53 )=   1.767E-03; EX(F54 )=   1.820E-03; EX(F55 )=   1.876E-03
 EX(F56 )=   1.934E-03; EX(F57 )=   1.995E-03; EX(F58 )=   2.059E-03
 EX(F59 )=   2.126E-03; EX(F60 )=   2.196E-03; EX(F61 )=   2.269E-03
 EX(F62 )=   2.347E-03; EX(F63 )=   2.429E-03; EX(F64 )=   2.516E-03
 EX(F65 )=   2.608E-03; EX(F66 )=   2.706E-03; EX(F67 )=   2.810E-03
 EX(F68 )=   2.921E-03; EX(F69 )=   3.040E-03; EX(F70 )=   3.167E-03
 EX(F71 )=   3.305E-03; EX(F72 )=   3.453E-03; EX(F73 )=   3.613E-03
 EX(F74 )=   3.788E-03; EX(F75 )=   3.978E-03; EX(F76 )=   4.187E-03
 EX(F77 )=   4.416E-03; EX(F78 )=   4.669E-03; EX(F79 )=   4.950E-03
 EX(F80 )=   5.263E-03; EX(F81 )=   5.614E-03; EX(F82 )=   6.011E-03
 EX(F83 )=   6.462E-03; EX(F84 )=   6.978E-03; EX(F85 )=   7.575E-03
 EX(F86 )=   8.272E-03; EX(F87 )=   9.093E-03; EX(F88 )=   1.007E-02
 EX(F89 )=   1.126E-02; EX(F90 )=   1.273E-02; EX(F91 )=   1.458E-02
 EX(F92 )=   1.696E-02; EX(F93 )=   2.012E-02; EX(F94 )=   2.451E-02
 EX(F95 )=   3.090E-02; EX(F96 )=   4.093E-02; EX(F97 )=   5.854E-02
 EX(F98 )=   9.591E-02; EX(F99 )=   1.887E-01; EX(F100)=   2.724E-01
 EX(MNSQ)=   2.086E-01; EX(AVER)=   8.947E-01; EX(RATE)=   1.000E+00