TALK=T;RUN(1,1) L230

  
  DISPLAY
  A hydrocarbon fuel enters steadily a duct of uniform cross-
  section steadily, through the porous wall of which is supplied a 
  steady stream of air, at a low rate for the first 3/4 of the
  length, and at an increased rate over the last 1/4 .
  
  The air and fuel are supposed to react in a mixed-is-burned 
  manner; but smoke is presumed to be generated at a rate which is 
  proportional to the concentration of unburned fuel times the 
  absolute temperature raised to the power SMOEXP.
  
  The multi-fuel model of turbulence is used, but with  
  arbitrarily chosen values of the micro-mixing rate, CONMIX * RATE.
  
  The situation is discussed in the 
  
  report by DB Spalding, dated 1998

  
  
  
  ENDDIS

 ************************************************************
  PHOTON USE
  AUTOPLOT
  file; phi 5
 
  cl; da 1; prod; da 1; oxid; da 1; fuel; scale; cola 1; col3 2
  colf 3
  msg  mass fractions of prod - yellow, oxid - blue, free fuel -red
  msg
  msg  flow is from left to right
  pause
  
  cl; da 1; smos; da 1; smom;  f11; scale; cola 1; col3 2; 
  msg  mass fractions of smoke according to:
  msg 
  msg  single-fluid - yellow;                   multi-fluid - blue
  pause
  
  cl; da 1; f1; da 1; f10; da 1; f20; scale; cola 1; col3 2; colf 3
  msg  mass fractions of f1 - yellow, f10 - blue, f20 - red
  pause
  
  cl; da 1; f1; da 1; f3; da 1; f5; da 1; f7; da 1; f9; da 1; f11; 
      da 1; f13; da 1; f15; da 1; f17; da 1; f19; da 1; f20; scale;
      cola 1; col1 2; col1 3; col1 4; col1 5; col3 6; col1 7; 
      col1 8; col1 9; col1 10; colf 11
  msg mass fractions of some intermediate fluids also
  pause
  
  cl; da 1; mnsq; cola 1 
  msg root-mean-square fluctuations
  pause
  
  cl; da 1; tmp1; cola 1 ; da 1; tmpm; col3 2
  msg temperatures: single fluid - yellow; multi-fluid - blue
  pause
  
  cl; da 1; fuel; cola 1; da 1; frfm; col3 2;
  msg free fuel from single- (yellow) and multi-fluid models (blue)
  pause
  enduse
 

TEXT(1D Smoke-Generation with MFM
TITLE                             
NX=50; XULAST=1; YVLAST=0.1
  nx=4
#unigrid
 
  Declarations of non-standard variables
REAL(WAIR,WFU,WPR,STOIC,FSTOI,CPAIR,CPPR,CPFU,HFU,TOXID,TFUEL)
REAL(HFUIN,UINF,RHAIN,RHFIN,FINF,HAIRIN,TSTOIC)
  
  Settings of these and other variables
WAIR=29.0; WFU=16.0; WPR=28.0        ! molecular weights
STOIC=17.24                          ! stoichiometric air/fuel ratio
FSTOI=1./(1.+ STOIC)                 ! stoichiometric mixture fract. 
CPAIR=1.5E3; CPPR=1.5E3; CPFU=1.5E3  ! specific heats
HFU=4.9E7                            ! heat of reaction
TOXID=773.0; TFUEL=773.0             ! inflow-stream temperatures
HAIRIN=CPAIR*TOXID                   ! & resulting enthalpy
UINF=2.0                             ! fuel-inflow velocity  m/s
FINF=1.0                             !  and fuel mass fraction
                                     !  in fuel-bearing stream
RHAIN=1.0 * 273.0 / TOXID            ! densities of inflow
RHFIN = RHAIN * WFU / WAIR           !  streams
PRESS0=1.0E5                         ! pressure is 1 atmosphere
  
  Group 7: variables to be solved and stored
SOLVE(P1,U1,H1,MIXF)  ! FUEL need not be solved, because deduced
STORE(RATE,FUEL,OXID,PROD,TMP1,RHO1,SPH1) ! from MIXF .. see SCRSEQ
 
    GROUP 8. Terms (in differential equations) & devices
TERMS(H1,N,Y,Y,N,Y,N)     ! switch off kinetic heat source
DENPCO=T
 
  Group 9: other property settings
  data settings relating to density, temperature & specific heat

RHO1=3GASES ! select density to be computed in gxdens; igrnd=6
 RHO1A=WFU; RHO1B=WAIR; RHO1C=WPR    ! transmit necessary constants

TMP1=SCRSEQ ! select density to be computed in gxtempr; igrnd=7
            ! fixes concentrations to fit thermodynamic equilib.
 TMP1A=CPFU; TMP1B=CPPR; TMP1C=CPAIR ! transmit necessary constants

CP1=GRND10  ! select sp. heat to be computed in gxspehe; igrnd=10
 CP1A=CPFU; CP1B=CPAIR; CP1C=CPPR    ! transmit necessary constants
  
HFUIN=CPFU*TFUEL + HFU * (FINF-FSTOI) /(1.0 - FSTOI) ! & resulting
TSTOIC = TOXID + (FSTOI/FINF) * HFUIN / CPAIR         ! values
TMP2A=FSTOI; TMP2B=HFU ; TMP2C=FINF  ! transmit necessary constants
 
  GROUP 11: Initial values
FIINIT(RHO1)=RHAIN; FIINIT(H1)=HAIRIN; FIINIT(MIXF)=FINF
FIINIT(FUEL)=FINF; FIINIT(U1)=UINF
 
    GROUP 13. Boundary conditions and special sources
   ** Fuel inlet
PATCH(FUIN,WEST,1,1,1,1,1,1,1,1)
COVAL(FUIN,P1,FIXFLU,RHFIN*UINF)
COVAL(FUIN,U1,ONLYMS,UINF)
COVAL(FUIN,MIXF,ONLYMS,1.0)  ! stream is pure fuel, hence the 1.0
COVAL(FUIN,H1,ONLYMS,HFUIN)
   
   ** Outlet Boundary
PATCH(OUTLET,EAST,NX,NX,1,1,1,1,1,1)
COVAL(OUTLET,P1, 1.0, 0.0)

   ** Air inlet
PATCH(AIRIN,NORTH,1,NX,1,1,1,1,1,1)
COVAL(AIRIN,P1,FIXFLU,1.4*RHAIN*UINF)
COVAL(AIRIN,H1,ONLYMS,HAIRIN)
  
  ** second air inlet  
PATCH(AIRIN2,NORTH,3*NX/4,NX,1,1,1,1,1,1)
COVAL(AIRIN2,P1,FIXFLU,40*RHAIN*UINF)
COVAL(AIRIN2,H1,ONLYMS,HAIRIN)
    
    GROUP 15. Termination of sweeps
LSWEEP=1000

    GROUP 16. Termination of iterations
LITER(P1)=20; LITER(U1)=20; LITER(V1)=20; LITER(W1)=20
    
    GROUP 17. Under-relaxation devices
RELAX(RHO1,LINRLX,0.1); RELAX(P1,LINRLX,0.5)
    
    GROUP 18. Limits on variables or increments to them
VARMIN(TMP1)=TOXID
VARMIN(RHO1)=0.1*RHAIN
VARMAX(RHO1)=2.0*RHAIN

    GROUP 19. Data communicated by satellite to GROUND
TMP2A=FSTOI; TMP2B=HFU
    
    GROUP 21. Print-out of variables
NPRINT=LSWEEP
    
    GROUP 22. Spot-value print-out
IXMON=3*NX/4
    GROUP 23. Field print-out and plot control
NPLT=5; IPLTF=2; IPLTL=LSWEEP

NROWCO=40; ORSIZ=0.4


PATCH(LONGPLOT,PROFIL,1,NX,1,1,1,1,1,LSTEP)
COVAL(LONGPLOT,MIXF,0.0,1.0)
COVAL(LONGPLOT,OXID,0.0,1.0)
COVAL(LONGPLOT,PROD,0.0,1.0)
COVAL(LONGPLOT,FUEL,0.0,1.0)

PATCH(LONGPLT2,PROFIL,1,NX,1,1,1,1,1,LSTEP)
COVAL(LONGPLT2,TMP1,0.0,0.0)
COVAL(LONGPLT2,U1,0.0,0.0)
COVAL(LONGPLT2,P1,0.0,0.0)
    
    *************************************** MFM data
#mfm 
 
NFLR=1; NFLF= 20   ! 20 fluids, distinguished by mixture fraction
  nflf=3
 
  The population-defining attribute is "mixture fraction", ie mass
  of material derived from the inlet stream containing fuel (and
  oxidant) per unit mass of local mixture.
MFMMOD=SCRS   ! activate calculation of fluid temperature and
              ! other quantities in gxmfm
SPEDAT( MFM, FFUIN,  R, 1.0)
SPEDAT( MFM, TAIRIN, R, TOXID )
SPEDAT( MFM, TFUIN , R, TFUEL)
SPEDAT( MFM, TSTOIC, R, TSTOIC)
SPEDAT( MFM, FACST , R, FSTOI)    ! i.e. tmp2a
SPEDAT( MFM, GASCON, R, 8314.)
SPEDAT( MFM, SPVLMX, R, 100.0)
SPEDAT( MFM, SPVLMN, R, 0.01 )
SPEDAT( MFM, SMOCON, R, 1.0)
SPEDAT( MFM, SMOEXP, R, 7.0  )
  SPEDAT( MFM, SMOEXP, R, 0.01 )    ! use to nullify temperature effect

   the micromixing constant: conmix
   conrea is set to zero, as not being relevant to this case
CONMIX=5.0; CONREA=0.0
TEXT(MFM; 1dsmoke; conmix=:conmix:
TITLE
#mfm1 
  ** Initial conditions
REAL(REALNFL,INIFL); REALNFL=:NFLUIDS:
FIINIT(RATE)=100.0
INIFL=1./REALNFL
DO II = 1,NFLUIDS
 FIINIT(F:II:)=INIFL
 RELAX(F:II:,LINRLX,0.25)
 COVAL(OUTLET,F:II:,ONLYMS,SAME)
ENDDO
  ** Boundary conditions
     Fuel inlet
COVAL(FUIN,F:NFLUIDS:,ONLYMS,1.0)  ! only fluid 20 enters here
 
   ** Oxidant inlet
COVAL(AIRIN,F1,ONLYMS,1.0)         ! only fluid 1 enters here
COVAL(AIRIN2,F1,ONLYMS,1.0)        !              and here
 
RELAX(H1,FALSDT,10.0)
  Solve for SMOM, ie smoke according to multi-fluid model,
        and SMOS, ie smoke according to single-fluid model.
SOLVE(SMOM,SMOS)
FIINIT(SMOM)=0.0; FIINIT(SMOS)=0.0
COVAL(OUTLET,SMOM,ONLYMS,SAME); COVAL(OUTLET,SMOS,ONLYMS,SAME)
  
  The patch called smoke activates the coding for smoke
  generation according to both the single- and multi-fluid models
PATCH(SMOKE,PHASEM,1,NX,1,NY,1,NZ,1,LSTEP)
COVAL(SMOKE,SMOM,FIXFLU,GRND); COVAL(SMOKE,SMOS,FIXFLU,GRND)
STORE(TMPM,FRFM,OXDM,PRDM)
 

CHAR(NAMPROF)                     ! line-printer plots
ORSIZ=0.2
DO II=1,NFLUIDS
 NAMPROF=FPROF:II:
 PATCH(:NAMPROF:,PROFIL,1,NX,1,1,1,1,1,1)
 COVAL(:NAMPROF:,F:II:,0.0,0.0)
ENDDO



 
TSTSWP=-1; UWATCH=T; USTEER=T; NYPRIN=1; RESFAC=1.E-3
distil=t
  expected values
EX(P1  )=   1.425E+04; EX(P1  )=   3.786E+04  
EX(U1  )=   4.948E+01; EX(U1  )=   7.707E+01  
EX(H1  )=   6.590E+06; EX(H1  )=   9.408E+06  
EX(PRDM)=   4.451E-01; EX(PRDM)=   3.831E-01  
                     ; EX(OXDM)=   4.773E-01
EX(FRFM)=   8.193E-02; EX(FRFM)=   1.397E-01  
EX(TMPM)=   1.580E+03; EX(TMPM)=   1.460E+03  
EX(SMOS)=   4.530E-04; EX(SMOS)=   3.547E-04  
EX(SMOM)=   2.564E-04; EX(SMOM)=   1.579E-04  


                     ; EX(F1  )=   4.727E-01
EX(F2  )=   1.867E-01; EX(F2  )=   1.142E-01  
EX(F3  )=   1.088E-01; EX(F3  )=   7.434E-02  
EX(F4  )=   6.151E-02; EX(F4  )=   5.543E-02  
EX(F5  )=   3.851E-02; EX(F5  )=   4.300E-02  
EX(F6  )=   2.639E-02; EX(F6  )=   3.415E-02  
EX(F7  )=   1.926E-02; EX(F7  )=   2.767E-02  
EX(F8  )=   1.471E-02; EX(F8  )=   2.282E-02  
EX(F9  )=   1.164E-02; EX(F9  )=   1.912E-02  
EX(F10 )=   9.470E-03; EX(F10 )=   1.626E-02  
EX(F11 )=   7.886E-03; EX(F11 )=   1.401E-02  
EX(F12 )=   6.699E-03; EX(F12 )=   1.224E-02  
EX(F13 )=   5.791E-03; EX(F13 )=   1.083E-02  
EX(F14 )=   5.090E-03; EX(F14 )=   9.705E-03  
EX(F15 )=   4.548E-03; EX(F15 )=   8.832E-03  
EX(F16 )=   4.138E-03; EX(F16 )=   8.191E-03  
EX(F17 )=   3.858E-03; EX(F17 )=   7.813E-03  
EX(F18 )=   3.762E-03; EX(F18 )=   7.901E-03  
EX(F19 )=   4.392E-03; EX(F19 )=   1.022E-02  
EX(F20 )=   1.133E-02; EX(F20 )=   3.056E-02  
EX(MNSQ)=   1.137E-01; EX(MNSQ)=   1.773E-01  
EX(AVEF)=   1.108E-01; EX(AVEF)=   1.683E-01  
EX(RHO1)=   2.099E-01; EX(RHO1)=   2.311E-01     
EX(PROD)=   6.985E-01; EX(PROD)=   6.835E-01   
EX(OXID)=   2.289E-01; EX(SPH1)=   1.500E+03  
EX(MIXF)=   1.108E-01; EX(MIXF)=   1.683E-01
EX(FUEL)=   7.253E-02; EX(FUEL)=   1.309E-01  
EX(TMP1)=   1.997E+03; EX(OXID)=   1.856E-01  
EX(RATE)=   1.000E+02 
 lsweep=500
 STOP