GROUP 1. Run title and other preliminaries
TEXT(Injection In Channel By In-Form.
TITLE
  DISPLAY

   This example illustrates a use of In-Form for the introduction
   of input, wall and outlet boundary conditions for laminar flow.

   As a problem is considered injection into a plane flow.

                                                           ! 
                                     !                     ! 
               \!/                  \!/   Wall            \!/
             ///////////////////////////////////////////////////////
  Constant   -------------------------------------------------------
  specified ->                                                  ->
  mass-flux -->                                                 -->
  and       --->                                                --->
  velocity    - - - - - - - - - - -Symmetry plane - - - - - - - - -
              ^ y
              |-------> x-direction


  The inlet flow has a parabolic structure.
  The injection rate through the wall increases in proportion to x.
  The coefficient of outlet boundary condition is proportionally
  to y.

  There are two cells in Z direction. First cell is used for
  sources setting by one formula. Sources at second cell are
  set by coval function with two formulas for coefficient and
  value.

  Application of special flags.
  North wall boundary condition use PATCH command with NORTH
  type. Therefore wall velocity is set by In-Form statement
  with LAMWALL flag.
  NOTE: Special flags can not be used together with coval
  function.

  The fields of dependent variables at first and second
  IZ cells should be edual.

  The Q1 contains PHOTON USE commands
  ENDDIS
  PHOTON USE
  p
  phi
  1 8 1
  
 
  vi z
  msg picture is enlarged 8 times in y direction
  gr ou z 1
  msg contours of H1 with Pr = 0.7
  con h1 z 1 fi;0.001;upause 2
  msg velocity vectors
  vec z 1
  upause 5
  msg contours of H1 calculated by coval function
  con h1 z 2 fi;0.001;upause 2
  msg velocity vectors by coval function
  vec z 2
  enduse

  Problem data
REAL(UINL,VINL,HINL,VINJ,HINJ,UMOV,POUT,PCOF)
UINL=0.5  ! Inlet X velocity
VINL=0.0  ! Inlet Y velocity
HINL=0.0  ! Inlet enthalpy
VINJ=0.1  ! Injection velocity
HINJ=1.0  ! Injection enthalpy
UMOV=0.0  ! Moving wall velocity
POUT=0.0  ! Outlet pressure
PCOF=1.0  ! Outlet pressure coefficient

  GROUP 3. X-direction grid specification
GRDPWR(X,20,0.2,1.0)
 
    GROUP 4. Y-direction grid specification
GRDPWR(Y,20,0.01,1.0)
 
    GROUP 5. Z-direction grid specification
GRDPWR(Z,2,2.,1.0)
 
    GROUP 7. Variables stored, solved & named
  ** Solve three extra variables as temperatures with
     different Prandtl numbers.
SOLVE(P1,U1,V1,W1,H1)
 
    GROUP 8. Terms (in differential equations) & devices
  ** De-activate the built-in source term
TERMS(H1,N,Y,Y,Y,Y,Y)
 
    GROUP 9. Properties of the medium (or media)
ENUL=1.E-5; PRNDTL(H1)=0.7
 
    GROUP 13. Boundary conditions and special sources

  Inlets   !
PATCH(INL,WEST,1,1,1,NY,1,1,1,1)
(SOURCE of P1 at INL is :RHO1:*UINL*(1.-(YG/YVLAST)^2))
(SOURCE of U1 at INL is UINL*(1.-(YG/YVLAST)^2) with ONLYMS)
(SOURCE of V1 at INL is VINL with ONLYMS)
(SOURCE of H1 at INL is HINL with ONLYMS)
  
PATCH(INL2,WEST,1,1,1,NY,2,2,1,1)
(SOURCE of P1 at INL2 is coval(fixflu,:RHO1:*UINL*(1.-(YG/YVLAST)^2$
)))
(SOURCE of U1 at INL2 is coval(onlyms,UINL*(1.0-(YG/YVLAST)^2)))
(SOURCE of V1 at INL2 is coval(onlyms,VINL))
(SOURCE of H1 at INL2 is coval(onlyms,HINL))

  Injection
PATCH(NINJ,NORTH,1,NX,NY,NY,1,1,1,1)
(SOURCE of P1 at NINJ is :RHO1:*VINJ*XG/XULAST)
(SOURCE of V1 at NINJ is -VINJ*XG/XULAST with ONLYMS)
(SOURCE of H1 at NINJ is HINJ with ONLYMS)

PATCH(NINJ2,NORTH,1,NX,NY,NY,2,2,1,1)
(SOURCE of P1 at NINJ2 is coval(fixflu,:RHO1:*VINJ*XG/XULAST))
(SOURCE of V1 at NINJ2 is coval(onlyms,-VINJ*XG/XULAST))
(SOURCE of H1 at NINJ2 is coval(onlyms,HINJ))
 
  Wall
PATCH(NW,NORTH,1,NX,NY,NY,1,1,1,1)
(SOURCE of U1 at NW is UMOV with LAMWALL)

PATCH(NW2,NWALL,1,NX,NY,NY,2,2,1,1)
(SOURCE of U1 at NW2 is coval(1.,UMOV))

  Outlet    !
PATCH(OUT,EAST,NX,NX,1,NY,1,1,1,1)
(SOURCE of P1 at OUT is PCOF*(YG/YVLAST)^2*(POUT-P1) with LINE)

PATCH(OUT2,EAST,NX,NX,1,NY,2,2,1,1)
(SOURCE of P1 at OUT2 is coval(PCOF*(YG/YVLAST)^2,POUT))
 
    GROUP 15. Termination of sweeps
LSWEEP=100
SELREF=T; RESFAC=0.1
    GROUP 17. Under-relaxation devices
RELAX(U1,FALSDT,0.1); RELAX(V1,FALSDT,0.1); RELAX(W1,FALSDT,0.1)
    GROUP 22. Spot-value print-out
IYMON=19; IXMON=10; TSTSWP=-1

distil=t
EX(P1)=5.024E+00; EX(U1)=6.584E-01; EX(V1)=4.763E-02
EX(W1)=1.657E-04; EX(H1)=5.278E-01
STOP