#immersol)
#declare
#cls
  DISPLAY
  
  
   IMMERSOL  2D, H1, SCRS, WALL
             Radiative heat exchange in a model burner.
             IMMERSOL-SCRS-WALL treatment.
   
   The emissivity and scattering coefficient are set by way of
   the whole-field stored variables EMIS and SCAT, the values
   of which are caused to vary with product composition by means of
   In-Form.
   
             
  ENDDIS           
#pause             
BOOLEAN(LTURB); LTURB= T
  **************************************************************
  PHOTON USE
   p ; ; ; ; ;
 
   set prop off
   msg Computational Domain:
   gr i 1
   use patgeo
   msg Press Any Key to Continue...
   pause
   cl
   set vec av off
   msg Velocity Vectors:
   vec i 1 sh
   msg Press Any Key to Continue...
   pause
   cl
   msg Contours of Pressure:
   con p1 i 1 fi;0.005
   pause
   cl
   msg Contours of: tmp1
   con tmp1 i 1 fi;0.005
   pause
   cl
   msg Contours of t3:
   con t3 i 1 fi;0.005
   pause
   cl
   msg Contours of: emis
   con emis i 1 fi;0.005
   pause
   cl
   msg Contours of scat
   con scat i 1 fi;0.005
   pause
   cl
   msg Contours of qrz:
   con qrz i 1 fi;0.005
   pause
   cl
   msg Contours of qry:
   con qry i 1 fi;0.005
   msg Press E  to exit PHOTON ...
  ENDUSE
  **************************************************************
TEXT(IMMERSOL-SCRS 2D model of burner    :212
TITLE
REAL(RINT,DEL,REXT,LEZ1,LEZ2,LEZ3,LEZ4,EPSI1,TKEI2,EPSI2)
REAL(WINF,VIN,SECIN)
REAL(EMISOL,EMIW1,EMIW2,EMIW3)
RINT= 0.015;  DEL  = 0.01;   REXT = 0.065
LEZ1= 0.03;   LEZ2 = 0.01;   LEZ3 = 0.03;  LEZ4 = 0.175
TOXY= 773.0;  TFUEL= 773.0;  TWALL= 773.;  CP111= 473.
  *** Settings for IMMERSOL:
EMISS = 1.0; SCATT = 0.0
EMISOL= 0.9; EMIW1=0.9; EMIW2=0.9; EMIW3=0.9
  *** Settings for SCRS:
GRHO= 3.606;  SECIN= 0.008157;  ENUL= 3.6E-5/GRHO
    * Molecular weights:
WAIR= 29.0;  WFU= 16.0;  WPR= 28.0
    * Stoichiometric ratio:
STOIC= 17.24;  FSTOI= 1./(1.+STOIC)
    * Specific heats:
CPAIR= 1.5E3;  CPPR= 1.5E3;  CPFU= 1.5E3
    * Heat of reaction:
HFU= 4.9E7
    * INLET values:
HAIRIN= CPAIR*TOXY;  FINF= FSTOI;  HINF= CPFU*TFUEL+FINF*HFU
IF(LTURB) THEN
+WINF = 100.;  VIN= 40.
+TKEI1= 2.5E-5*WINF*WINF;   EPSI1= 0.09*TKEI1**2/(9.59*ENUL)
+TKEI2= 7.6875E-5*VIN*VIN;  EPSI2= 0.09*TKEI2**2/(16.18*ENUL)
ELSE
+WINF = 0.5;   VIN= 0.4*WINF
ENDIF
    GROUP 3. X-direction grid specification
CARTES= F;  XULAST= 0.03
    GROUP 4. Y-direction grid specification
NREGY= 2; IREGY= 1; GRDPWR(Y,5,RINT,1.0)
IREGY= 2; GRDPWR(Y,10,REXT-RINT,1.0)
    GROUP 5. Z-direction grid specification
NREGZ= 5; IREGZ= 1; GRDPWR(Z,6,LEZ1,1.0)
IREGZ= 2; GRDPWR(Z, 3,LEZ2,1.0)
IREGZ= 3; GRDPWR(Z, 5,LEZ3,1.0)
IREGZ= 4; GRDPWR(Z, 3, DEL,1.0)
IREGZ= 5; GRDPWR(Z, 8,LEZ4,1.0)
    GROUP 7. Variables stored, solved & named
NAME(C1)= MIXF;  SOLVE(P1,V1,W1,H1,FUEL,MIXF)
STORE(PRPS,OXID,PROD,TMP1,RHO1,SPH1)
#radflux
SOLUTN(P1,Y,Y,Y,P,P,P);  SOLUTN(H1,Y,Y,Y,P,P,P)
SOLUTN(T3,Y,Y,Y,P,P,P);  WALLCO= 1.0
IF(LTURB) THEN
+TURMOD(KEMODL); STORE(GEN1,ENUT)
+SOLUTN(KE,Y,Y,Y,P,P,P); SOLUTN(EP,Y,Y,Y,P,P,P)
+WALLCO= GRND2;  EGWF= T;  WALPRN= T
ENDIF
    GROUP 8. Terms (in differential equations) & devices
TERMS(H1,N,Y,Y,P,P,P)
    GROUP 9. Properties of the medium (or media)
TMP1= SCRSNONEQ;  TMP1A= CPFU;   TMP1B= CPPR;  TMP1C= CPAIR
TMP2A= FSTOI;  TMP2B= HFU;  PRESS0= 8.0E5
    GROUP 11. Initialization of variable or porosity fields
INIADD= F; FIINIT(PRPS)= 30.; FIINIT(W1)= 0.1*WINF
FIINIT(EMIS) = EMISS 
FIINIT(SCAT) = SCATT
FIINIT(H1)= HAIRIN;  FIINIT(MIXF)= FINF;  FIINIT(FUEL)= FINF
IF(LTURB) THEN
+ FIINIT(KE)= 0.1125*FIINIT(W1)*FIINIT(W1)
+ FIINIT(EP)= 0.1643*FIINIT(KE)**1.5/(0.27*REXT)
ENDIF
    *** Solid obstacle:
PATCH(SOL1,INIVAL,1,NX,#1,#1,#2,#2,1,LSTEP)
 INIT(SOL1,PRPS,0.0,111.); INIT(SOL1,H1,0.0,CP111*TWALL)
 INIT(SOL1,EMIS,0.0,EMISOL)
    GROUP 13. Boundary conditions and special sources
    *** Inlets:
      * Fuel/Oxidant inlet:
PATCH(IN1,LOW,1,NX,#1,#1,1,1,1,LSTEP)
 COVAL(IN1,  P1,FIXFLU,GRHO*WINF); COVAL(IN1,H1,ONLYMS,HINF)
 COVAL(IN1,  W1,ONLYMS,WINF);  COVAL(IN1,  V1,ONLYMS, 0.0)
 COVAL(IN1,MIXF,ONLYMS,FINF);  COVAL(IN1,FUEL,ONLYMS,FINF)
      * Oxidant inlet:
PATCH(IN2,NORTH,1,NX,NY,NY,#4,#4,1,LSTEP)
 COVAL(IN2,P1,FIXFLU,SECIN); COVAL(IN2,H1,ONLYMS,HAIRIN)
 COVAL(IN2,W1,ONLYMS,0.0); COVAL(IN2,V1,ONLYMS,-VIN)
    *** Outlet:
PATCH(OUT,HIGH,1,NX,#1,#2,NZ,NZ,1,LSTEP)
 COVAL(OUT,P1,1000.,0.0)
IF(LTURB) THEN
+COVAL(IN1,KE,ONLYMS,TKEI1); COVAL(IN1,EP,ONLYMS,EPSI1)
+COVAL(IN2,KE,ONLYMS,TKEI2); COVAL(IN2,EP,ONLYMS,EPSI2)
+COVAL(OUT,KE,ONLYMS, SAME); COVAL(OUT,EP,ONLYMS, SAME)
    *** Eddy-breakup reaction-rate source:
+PATCH(CHSOTB,PHASEM,1,NX,1,NY,1,NZ,1,LSTEP)
+ COVAL(CHSOTB,FUEL,GRND9,GRND9)
+ CHSOA= FSTOI;  CHSOB= 1.0
ELSE
    *** Power low temperature dependent reaction-rate source:
+PATCH(CHSOLM,PHASEM,1,NX,1,NY,1,NZ,1,LSTEP)
+ COVAL(CHSOLM,FUEL,GRND5,0.0)
+ CHSOA= 1.0;  CHSOB= -1./FSTOI;  CHSOC= 1./FSTOI-1.
+ CHSOE= 1.0;  CHSOB= 1.0
ENDIF
    *** IMMERSOL-WALL settings (CO=GRND4 for T3; VAL=GRND4 for H1):
PATCH(IMSWL1,LWALL,1,NX,#2,#NREGY,1,1,1,LSTEP)
 SPEDAT(SET,EMISSIVITY,OF IMSWL1,R,EMIW1)
 COVAL(IMSWL1,H1,WALLCO,GRND4); COVAL(IMSWL1,T3,GRND4,TWALL)
 COVAL(IMSWL1,V1,GRND2,0)
 COVAL(IMSWL1,KE,GRND2,GRND2);COVAL(IMSWL1,EP,GRND2,GRND2)
PATCH(IMSWL2,NWALL,1,NX,NY,NY,#1,#3,1,LSTEP)
   SPEDAT(SET,EMISSIVITY,OF IMSWL2,R,EMIW2)
 COVAL(IMSWL2,H1,WALLCO,GRND4); COVAL(IMSWL2,T3,GRND4,TWALL)
 COVAL(IMSWL2,W1,GRND2,0)
 COVAL(IMSWL2,KE,GRND2,GRND2);COVAL(IMSWL2,EP,GRND2,GRND2)
PATCH(IMSWL3,NWALL,1,NX,NY,NY,#5,#NREGZ,1,LSTEP)
 SPEDAT(SET,EMISSIVITY,OF IMSWL3,R,EMIW3)
 COVAL(IMSWL3,H1,WALLCO,GRND4); COVAL(IMSWL3,T3,GRND4,TWALL)
 COVAL(IMSWL3,W1,GRND2,0)
 COVAL(IMSWL3,KE,GRND2,GRND2);COVAL(IMSWL3,EP,GRND2,GRND2)
    GROUP 15. Termination of sweeps
LSWEEP= 500;  TSTSWP= -1
    GROUP 16. Termination of iterations
SELREF=T; RESFAC= 0.0001
    GROUP 17. Under-relaxation devices
DTF= 20.*YVLAST/WINF/NY; RELAX(P1,LINRLX,0.5)
RELAX(V1,FALSDT,DTF); RELAX(W1,FALSDT,DTF)
RELAX(H1,LINRLX,0.5); RELAX(T3,LINRLX,0.5)
IF(LTURB) THEN
+ KELIN= 3; RELAX(KE,LINRLX,0.5); RELAX(EP,LINRLX,0.5)
ENDIF
    GROUP 18. Limits on variables or increments to them

VARMIN(TMP1)= TWALL;VARMAX(TMP1)=TWALL*10.0
VARMIN(T3)= TWALL;VARMAX(T3)=TWALL*10.0

    GROUP 22. Spot-value print-out
IXMON= NX/2+1;  IYMON= NY/2+1;  IZMON= NZ/2+1;
    *** Ideal gas Law for mixture of 3 gases (ENUL=3.6E-5/GRHO):
CSG10= Q1
  MATFLG=T;NMAT=1
  30     GRND6    9.983E-6    GRND10    0.0263   3.33E-3   3.41E-3
  16.0   29.0     28.0
  1.5E3  1.5E3    1.5E3
  The following In-Form settings make emissivity and scattering 
  depend on product concentration
  INFORM7BEGIN
(STORED VAR EMIS IS 0.1 + 2.0*PROD WITH IMAT<100)
(STORED VAR SCAT IS 0.5 * EMIS)
  INFORM7END