PHOTON USE
  p
 
 
 
 
  gr ou y 1
  MSG Velocity vectors
  vec y 1 sh
  msg
  msg Press return to plot pressure contours
  pause
  cont p1 y 1 fil;.01
  msg
  msg Type e to End
  ENDUSE
 
    GROUP 1. Run title
TEXT(TRANSONIC FLOW THRU A NOZZLE: B522
TITLE
  DISPLAY
      This case concerns plane, transonic, isentropic flow
    through a convergent-divergent nozzle operating under
    design conditions. The calculation is made using the
    BFC system, and the nozzle geometry corresponds to a
    linear Mach-number distribution, as predicted by one-
    dimensional gas-dynamic theory. The geometry is
    sketched out in the following diagram.
 
      ///////                                   //////
      *******///                          /////     **
              * ///                   ///    *
                 * //  wall    //////  *         --->   zero
       --->        * ////////   *                       pressure
                       *   *
 
       --->        --------->                    --->
 
       --->        --------->                    --->
 
    ^  ************************************************
   x|  ////////////////////////////////////////////////
    |--->                  wall
      z
CHAR(ANSW)
mesg(Press return to continue
readvdu(answ,char,y)
 
      The inlet conditions are prescribed total pressure and
    total temperature at a Mach Number of 0.5. The design
    outlet Mach number is 2.0 for which Pex/Po,in = .1278.
    The exit boundary condition corresponds to a fixed pressure
    at the expected nodal Mach number.
      A system of units is chosen whereby the flow variables
    can be interpreted as: P/Po,in ; RHO/RHOo,in ; T/To,in ;
    and U*SQRT(GAMMA)/Ao. Here, Ao is the acoustic velocity
    at the stagnation temperature.
  ENDDIS
REAL(GASCON,GAMMA,PTOTAL,TTOTAL,RHOTOT,MACHI,AGAM1,RGAM)
REAL(MACHO,PIN,TIN,POWER,WIN,RHOIN,PEXIT,WEXIT,RHOOUT,GZLE)
REAL(CHORD,THROAT,GRADP,GRADW,GRADR,CMASS,VMASS)
GASCON=1.0;GAMMA=1.4;PTOTAL=1.0;TTOTAL=1.0;RHOTOT=1.0;MACHI=0.5
GZLE=0.4;CHORD=3.0;THROAT=0.5;MACHO=2.0
INTEGER(IZLE,IZTE);IZLE=2;IZTE=17
  ** Calculation of inlet velocity
AGAM1=GAMMA-1.; RGAM=1./GAMMA;POWER=GAMMA/AGAM1
PIN=PTOTAL/(1.+AGAM1*MACHI*MACHI/2.)**POWER
RHOIN=RHOTOT/(PTOTAL/PIN)**RGAM
WIN=MACHI*(GAMMA*PIN/RHOIN)**0.5
TIN=PIN/(GASCON*RHOIN)
PEXIT=PTOTAL/(1.+AGAM1*MACHO*MACHO/2.)**POWER
RHOOUT=RHOTOT/(PTOTAL/PEXIT)**RGAM
WEXIT=MACHO*(GAMMA*PEXIT/RHOOUT)**0.5
    GROUP 6. Body-fitted coordinates or grid distortion
BFC=T;NONORT=T
GSET(D,5,1,17,0.3350,1.0,CHORD+GZLE)
IZTE=NZ
   ** Obtain constants for A/A* expression
REAL(G5,G6,AAA,BBB,AAT,AT,MMO)
G5=GAMMA+1.0;G6=G5/(2.0*AGAM1)
AAA=2.0/G5;BBB=AGAM1/G5
AAT=((AAA+BBB*MACHI*MACHI)**G6)/MACHI
AT=XULAST/AAT
MMO=MACHO-MACHI
REAL(XX,XNK)
DO II=NZ,IZLE,-1
XNK=(II-IZLE)/(NZ-IZLE)
XX=AT/(MACHI+MMO*XNK)*(AAA+BBB*(MACHI+MMO*XNK)**2)**G6
GSET(C,I:NX+1:,F,I1,1,NY,:II:,:II:,+,XX,0.0,0.0,INC,1.0)
ENDDO
    GROUP 7. Variables stored, solved & named
SOLVE(P1,U1,W1);STORE(RHO1);SOLUTN(P1,Y,Y,Y,N,N,N)
    GROUP 9. Properties of the medium (or media)
TERMS(U1,Y,Y,N,N,Y,N);TERMS(W1,Y,Y,N,N,Y,N)
  ** Use Isentropic Density Law
RHO1=COMPRESS; RHO1A=RHOTOT/PTOTAL**RGAM; RHO1B=RGAM;RHO1C=0.
PRESS0=0.0;DRH1DP=COMPRESS
    GROUP 11. Initialization of variable or porosity fields
FIINIT(W1)=0.5*(WIN+WEXIT);FIINIT(RHO1)=0.5*(RHOIN+RHOOUT)
    GROUP 13. Boundary conditions and special sources
PATCH(INLET,LOW,1,NX,1,1,1,1,1,1)
VMASS=RHOIN*PTOTAL/RHOTOT;CMASS=2.*POWER/WIN
COVAL(INLET,P1,CMASS,VMASS);COVAL(INLET,W1,ONLYMS,WIN)
PATCH(OUTLET,HIGH,1,NX,1,1,NZ,NZ,1,1)
COVAL(OUTLET,P1,1.0E5,PEXIT)
COVAL(OUTLET,U1,ONLYMS,0.0);COVAL(OUTLET,W1,ONLYMS,0.0)
    GROUP 15. Termination of sweeps
LSWEEP=50
    GROUP 16. Termination of iterations
OVRRLX=1.7;LITER(P1)=15
    GROUP 17. Under-relaxation devices
RELAX(P1,LINRLX,0.5)
RELAX(W1,FALSDT,ZWLAST/(WIN*NZ))
RELAX(U1,FALSDT,ZWLAST/(WIN*NZ))
    GROUP 18. Limits on variables or increments to them
VARMIN(U1)=-50.;VARMIN(W1)=-50.;VARMAX(U1)=50.;VARMAX(W1)=50.
VARMIN(RHO1)=0.1*RHOIN;VARMAX(RHO1)=RHOTOT
VARMIN(P1)=0.01*PIN;VARMAX(P1)=PTOTAL
    GROUP 21. Print-out of variables
OUTPUT(RHO1,Y,N,N,N,Y,Y)
    GROUP 22. Spot-value print-out
IXMON=2;IZMON=15
SELREF=T; RESFAC=0.01
    GROUP 23. Field print-out and plot control
NPRINT=LSWEEP;TSTSWP=-1
    GROUP 23. Field print-out and plot control
PATCH(XZ,CONTUR,1,NX,1,1,1,NZ,1,1)
PLOT(XZ,P1,0.0,20.0);PLOT(XZ,W1,0.0,20.0)
PATCH(CENTRE,PROFIL,1,1,1,1,1,NZ,1,1)
PLOT(CENTRE,P1,0.0,0.0);PLOT(CENTRE,W1,0.0,0.0)
NZPRIN=2;NCRT=1
OUTPUT(WCRT,Y,N,N,N,N,N)
OUTPUT(UCRT,Y,N,N,N,N,N)