#cls 
TEXT(Three examples of initialization :758
title
libref=758
  DISPLAY
    
    
    This case  exemplifies  some  of  the  basic  techniques
    available in In-Form for field initialisations.
 
    Three examples are provided, each for a different xy-plane
    in a single 3D box.  
    
    Example 1: Initialization of stagnation-point flow on IZ=1
               ===============================================
               
  PATCH(INI1,INIVAL,1,NX,1,NY,1,1,1,1)
  (INITIAL of U1 at INI1 is XU-10.)
  (INITIAL of V1 at INI1 is -(YV-10.))
 
    Example 2: Solid-body rotation flow on IZ=2
               ================================
               
  PATCH(INI2,INIVAL,1,NX,1,NY,2,2,1,1)
  (INITIAL of U1 at INI2 is YG-10.)
  (INITIAL of V1 at INI2 is -(XG-10.))
 
    Example 3:  The values on IZ=1 and IZ=2 are added together
                and placed on IZ=3
                ==============================================
                
  PATCH(INI3,INIVAL,1,NX,1,NY,3,3,1,1)
  (INITIAL of U1 at INI3 is -U1[&&-1]+U1[&&1])
  (INITIAL of V1 at INI3 is -V1[&&2]+V1[&&-2])
 
  The Q1 contains PHOTON USE commands
  ENDDIS 
  PHOTON USE
  p
 
 
 
  msg
  msg
  msg   All examples which follow are assembled as different slabs
  msg   and number of slabs of one 3D domain called
  msg
  msg                INITBOX.
  msg
  msg   The series of PHOTON plots will follow.
  msg
  msg   They illustrate some of the existing initialisation
  msg   techniques available via In-Form.
  msg
  msg   The presentation covers:
  msg
  msg   * Flow field initialistions by formulae
  msg   * Manipulating with initial fields
  msg   * MARKing sub-domains to create arbitrary initial fields
  msg   * Geometry initialisations
  msg
  msg   Hit enter to proceed to 1st slab.
  msg
  pause
  clear
  vi z
  gr ou z 1
  set vec ref 25
  vec z 1 sh
  msg
  msg
  msg   The 1st slab of the box is initialised by stagnation
  msg   point flow
  msg   Hit enter to proceed to 2nd slab.
  pause
  vec off;red
  vec z 2 sh
  msg
  msg
  msg   The 2nd slab is initialised by solid body rotation flow
  msg
  msg   Hit enter to proceed to 3rd slab.
  pause
  vec off;red
  vec z 3 sh
  msg
  msg   The flow in the 3rd slab is constructed by adding the
  msg   velocity distributions of 1st and 2nd slabs.
  msg
  msg   Hit E to finish.
  ENDUSE
    GROUP 1. Run title and other preliminaries
TEXT(Three examples of initialization :758
    GROUP 3. X-direction grid specification
GRDPWR(X,40,20.,1.0)
    GROUP 4. Y-direction grid specification
GRDPWR(Y,40,20.,1.0)
    GROUP 5. Z-direction grid specification
GRDPWR(Z,3,0.5,1.0)
    GROUP 7. Variables stored, solved & named
STORE(U1,V1)
    GROUP 11. Initialization of variable or porosity fields
INIADD=F 

  INFORM11BEGIN
    
    Example 1: Initialization of stagnation point flow
               =======================================
PATCH(INI1,INIVAL,1,NX,1,NY,1,1,1,1)
(INITIAL of U1 at INI1 is XU-10.)
(INITIAL of V1 at INI1 is -(YV-10.))
    
    Example 2: Solid-body rotation flow
               ========================
PATCH(INI2,INIVAL,1,NX,1,NY,2,2,1,1)
(INITIAL of U1 at INI2 is YG-10.)
(INITIAL of V1 at INI2 is -(XG-10.))
   
  
    Example 3:  Flow superposition 
                ==================
PATCH(INI3,INIVAL,1,NX,1,NY,3,3,1,1)
(INITIAL of U1 at INI3 is -U1[&&-1]+U1[&&1])
(INITIAL of V1 at INI3 is -V1[&&2]+V1[&&-2])

  INFORM11END
 
    GROUP 15. Termination of sweeps
LSWEEP=1

DISTIL=T
EX(U1)=5.485E+00; EX(V1)=5.485E+00
STOP