TEXT(GXTIM Example                     
TITLE
  DISPLAY
    This case demonstrates the use of GXTIM to provide 3 types of
    periodic sources (in this case for pressure)
 
    Gas enters the domain at 'top', with a variable pressure based
    on the settings of CASENO and PTYPE defined below.
 
                                top
     __________________________/\___________________________
    /______ ______ ______ ______ ______ ______ ______ ______\
    |      |      |      |      |      |      |      |      |
    |      | pfix |      |      |      |      |      |      |
    |______|______|______|______|______|______|______|______|
 
    IY -->                                              NY=20
  ENDDIS
 
    CASENO  Selects flow type.
 
    0       Gas moving with constant velocity, no entry from top.
    1       Gas at rest, sudden sustained entry from top (over all
            5 seconds)
    2       Gas at rest, intermittent entry from top. (from 1.25
            seconds onwards)
    3       As for 2, with pressure=press0 at NY/4.
INTEGER(CASENO);CASENO=3
 
    PTYPE   Selects the way in which the pressure (at top) behaves
            over time. It is only relevant for CASENO = 2 or 3.
                           _   _   _
    1       Battlement, ie  |_| |_| |_
    2       Saw-tooth, ie \/\/\/\/\/\
    3       Sine curve.
INTEGER(PTYPE);PTYPE=3
 
    TIMA  = Wave amplitude
    ITIMA = number of time steps for a complete cycle
    ITIMB = first time step at which the patch is active
    ITIMC = last time step at which the patch is active
 
    Other model constants.
REAL(VIN,WIN,TIN,PIN,GASCONST,HIN,CP,CV,GAMMA,FLOIN)
GASCONST=1.0;GAMMA=1.4;CV=GASCONST/(GAMMA-1.0);CP=CV*GAMMA
VIN=0.0;TIN=1.0;HIN=CP*TIN;PIN=0.0
 
    For CASENO=0, set the gas velocity.
IF(CASENO.EQ.0) THEN
+  VIN=0.5
ENDIF
 
   GROUP 4. Y-direction grid specification
GRDPWR(Y,20,1.0,1.0)
 
    GROUP 5. Z-direction grid specification
STEADY=F;LSTEP=500;GRDPWR(T,LSTEP,5.0,1.0)
 
    GROUP 7. Variables stored, solved & named
SOLVE(P1,V1,H1)
 
    GROUP 9. Properties of the medium (or media)
RHO1=IDEALGAS;RHO1A=0.0;RHO1B=1.0;PRESS0=1.0;RHO1C=0.0
DRH1DP=RHO1B;TMP1=LINH;TMP1B=1.0/CP;CP1=CP
 
    GROUP 11. Initialization of variable or porosity fields
FIINIT(P1)=PIN;FIINIT(V1)=VIN;FIINIT(H1)=HIN
 
    GROUP 13. Boundary conditions and special sources
 
    Initially set the wave to act over all time steps
ITIMB=0;ITIMC=LSTEP
 
    For CASENO=1, there is a sudden sustained entry of gas from
    the top
IF(CASENO.EQ.1) THEN
+  FLOIN=0.5
+  PATCH(TIMTOP,NORTH,1,1,NY,NY,1,1,1,LSTEP)
+  COVAL(TIMTOP,P1,FIXFLU,GRND1)
+  COVAL(TIMTOP,V1,ONLYMS,-FLOIN)
+  COVAL(TIMTOP,H1,ONLYMS,4*HIN)
+  TIMA=FLOIN;ITIMA=2*LSTEP
ENDIF
 
    For CASENO=2 or 3, there is a variable entry of gas from
    the top (dependent on the value of PTYPE) over all time
    steps.
IF((CASENO.EQ.2).OR.(CASENO.EQ.3)) THEN
+  FLOIN=0.1
+  REAL(ARG)
+  CASE PTYPE OF
+  WHEN 1
     Battlement
+    ARG=GRND1
+  WHEN 2
     Saw-tooth
+    ARG=GRND2
+  WHEN 3
     Sine wave
+    ARG=GRND3
+  ORELSE
     Battlement
+    ARG=GRND1
+  ENDCASE
+  PATCH(TIMTOP,NORTH,1,1,NY,NY,1,1,1,LSTEP)
+  COVAL(TIMTOP,P1,FIXFLU,ARG)
+  COVAL(TIMTOP,V1,ONLYMS,-FLOIN)
+  COVAL(TIMTOP,H1,ONLYMS,4*HIN)
+  TIMA=FLOIN;ITIMA=LSTEP/4
ENDIF
 
    For CASENO=3, set the pressure at NY/4
IF(CASENO.EQ.3) THEN
+  PATCH(PFIX,CELL,1,1,NY/4,NY/4,1,NZ,1,1)
+  COVAL(PFIX,P1,7.5E-4,0.0)
+  COVAL(PFIX,V1,ONLYMS,VIN)
+  COVAL(PFIX,H1,ONLYMS,HIN)
ENDIF
 
    GROUP 16. Termination of iterations
LSWEEP=10;SELREF=T;RESFAC=1.E-2;VARMIN(H1)=0.5
 
    GROUP 19. Data communicated by satellite to GROUND
 
    GROUP 22. Spot-value print-out
IXMON=1;IYMON=1
 
    GROUP 23. Field print-out and plot control
TSTSWP=LSWEEP;ITABL=1;NYPRIN=1;NTPRIN=LSTEP/4
IDISPA=10;IDISPB=1;IDISPC=LSTEP
 
PATCH(PROFILES,PROFIL,1,1,1,NY,1,NZ,1,1)
PLOT(PROFILES,P1,0.0,0.0);PLOT(PROFILES,V1,0.0,0.0)
PLOT(PROFILES,H1,0.0,0.0)