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

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

   As a problem is considered heat transfer in a plane channel. 

                                   
             //////////////////// North Wall ///////////////////////
  Constant   -------------------------------------------------------
  specified -->                                                  ->
  mass-flux -->                                                  -->
  velocity  -->                                                  ->
  and           ----------------------------------------------------
  temperature//////////////////// South Wall ///////////////////////
              ^ y
              |-------> x-direction


  The inlet flow has a uniform structure.
  The coefficient of outlet boundary condition is set as uniform.
  North and south walls are immobile and have the uniform
  temperature.

  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.
  South wall boundary condition use PATCH command with SWALL
  type. Accordingly wall velocity is set by In-Form statement
  without special flags.
  NOTE: Special flags can not be used together with coval
  function.

  If the boundary conditions on north and south walls are
  identical the results of calculation should be symmetric.

  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,UMOV,HMOV,POUT,PCOF)
UINL=0.1    ! Inlet X velocity
VINL=0.0    ! Inlet Y velocity
HINL=0.0    ! Inlet enthalpy
UMOV=0.0    ! Moving wall velocity
HMOV=1.0    ! Moving wall enthalpy
POUT=0.0    ! Outlet pressure
PCOF=10000. ! 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,V1,U1,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 11. Initialization of variable or porosity fields
FIINIT(U1)=UINL
 
    GROUP 13. Boundary conditions and special sources

  
  Inlets
PATCH(IN,WEST,1,1,1,NY,1,1,1,1)
(SOURCE of P1 at IN is rho1*UINL)
(SOURCE of U1 at IN is UINL with ONLYMS)
(SOURCE of V1 at IN is VINL with ONLYMS)
(SOURCE of H1 at IN is HINL with ONLYMS)

PATCH(IN2,WEST,1,1,1,NY,2,2,1,1)
(SOURCE of P1 at IN2 is coval(fixflu,rho1*UINL))
(SOURCE of U1 at IN2 is coval(onlyms,UINL))
(SOURCE of V1 at IN2 is coval(onlyms,VINL))
(SOURCE of H1 at IN2 is coval(onlyms,HINL))

 
  
  Walls
PATCH(SW,SWALL,1,NX,1,1,1,1,1,1)
(SOURCE of U1 at SW is UMOV)
(SOURCE of H1 at SW is HMOV)

PATCH(SW2,SWALL,1,NX,1,1,2,2,1,1)
(SOURCE of U1 at SW2 is coval(1.,UMOV))
(SOURCE of H1 at SW2 is coval(1.,HMOV))

  
PATCH(NW,NORTH,1,NX,NY,NY,1,1,1,1)
(SOURCE of U1 at NW is UMOV with LAMWALL)
(SOURCE of H1 at NW is HMOV with LAMWALL)

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


  Outlets
PATCH(OUT,EAST,NX,NX,1,NY,1,1,1,1)
(SOURCE of P1 at OUT is PCOF*(POUT-P1) with line)

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

distil=t
EX(P1)=1.161E-02; EX(U1)=1.000E-01; EX(V1)=3.420E-04
EX(W1)=6.098E-06; EX(H1)=7.138E-01
STOP