USTRBEGIN NAMPLT MAP NAMVAR U1 USTREND GROUP 1. Run title and other preliminaries TEXT(Square Cavity With Moving Lid #cls TITLE DISPLAY This run analyses the flow in a cavity, the top wall of which moves with a constant velocity. The stationary walls are at one temperature, the moving wall is at a different temperature. Interesting variants include: changes to the velocity and temperature of the moving wall; changes to the aspect ratio of the cavity; and changes to the temperatures of the walls at rest. The USTEER feature is activated by UWATCH=T;USTEER=T and by the statements between USRTBEGIN and USTREND at the top of the Q1 file. In-Form statements are introduced which enable the residuals of and corrections to the temperature variable H1, namely HRES and HCOR, to be printed, and viewed via PHOTON. ENDDIS #pause GROUP 3. X-direction grid specification ** Set a symmetrical grid, consisting of power-law grids (varying with IX**2.0), which start from each edge and meet in the middle. IREGX=1; GRDPWR(X,-10,0.1,2.0) GROUP 4. Y-direction grid specification ** Set a symmetrical grid as in GROUP 3. IREGY=1; GRDPWR(Y,-10,0.1,2.0) GROUP 7. Variables stored, solved & named SOLVE(P1,U1,V1,H1) provide for storage and calculation of residuals and corrections by way of In-Form Inform7begin (STORED OF HRES IS RESI(H1)) (STORED OF HCOR IS CORR(H1)) Inform7end GROUP 8. Terms (in differential equations) & devices 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 ** South wall, at rest WALL (SOUTH,SOUTH,#1,#NREGX,#1,#1,#1,#1,1,1) COVAL(SOUTH,U1,1.0,0.0) COVAL(SOUTH,H1,1.0,0.0) ** North wall, moving WALL (MOVE,NORTH,#1,#NREGX,#NREGY,#NREGY,#1,#1,1,1) COVAL(MOVE,U1,1.0,1.0) COVAL(MOVE,H1,1.0,1.0) ** West wall, at rest WALL (WEST,WEST,#1,#1,#1,#NREGY,#1,#1,1,1) COVAL(WEST,V1,1.0,0.0) COVAL(WEST,H1,1.0,0.0) ** East wall, at rest WALL (EAST,EAST,#NREGX,#NREGX,#1,#NREGY,#1,#1,1,1) COVAL(EAST,V1,1.0,0.0) COVAL(EAST,H1,1.0,0.0) ** Pressure relief PATCH(FIXPRESS,CELL,NX/2,NX/2,NY/2,NY/2,1,1,1,1) COVAL(FIXPRESS,P1,FIXP,0.0) COVAL(FIXPRESS,U1,ONLYMS,0.0) COVAL(FIXPRESS,V1,ONLYMS,0.0) GROUP 15. Termination of sweeps LSWEEP=500; ISWC1=LSWEEP-20 GROUP 17. Under-relaxation devices RELAX(U1,FALSDT,0.1); RELAX(V1,FALSDT,0.1) GROUP 22. Spot-value print-out IXMON=NX/2; IYMON=NY-1; UWATCH=T; USTEER=T; TSTSWP=5 NPRINT=20 GROUP 23. Field print-out and plot control PATCH(MIDX,PROFIL,NX/2,NX/2,1,NY,1,1,1,1) PLOT(MIDX,U1,-1.0,1.0); PLOT(MIDX,H1,0.0,1.0) PATCH(MAP,CONTUR,1,NX,1,NY,1,1,1,1) PLOT(MAP,U1,0.0,10); PLOT(MAP,V1,0.0,10) PLOT(MAP,H1,0.0,10) PHOTON USE p;;;; con h1 z 1 fi;0.001 msg contours of temperature (h1) pause con hres z 1 fi;0.001 msg contours of temperature residuals (hres) pause con hcor z 1 fi;0.001 msg contours of temperature corrections (hcor) pause; con off; red vec z 1 fi;0.001 msg velocity vectors (h1) pause gr z 1 msg the computational grid ENDUSE