MB-FGE Test: Lid driven flow in a cavern. ************************************************************** DISPLAY Lid Driven Cavity Flow Problem (Chris J.Weire 16/3/94) Moving Wall > 1m/s Fine Grids ^ 1.0 v <> 1.0 This case demonstrates the use of 4 zones of Fine Grid Embedding in the corners of the cavity, where large velocity & pressure gradients occur. Use of the FGE zones enables recirculations to be detected without an excessively large mesh. The dimensions of the main mesh are set through NX1,NY1, and the power law exponent in POWER in this Q1. Likewise, MBFGE refinement factors are set through IFICX, IFICY. Setting these to 1 creates the equivalent of a normal power law mesh. Q1-file contains Photon Use information. --------------------------------------------------------- ENDDIS L(PAUSE ************************************************************** PHOTON USE p ; ; ; ; ; mgrid 1 k 1 mgrid 2 k 1 col 2 mgrid 3 k 1 col 3 mgrid 4 k 1 col 4 mgrid 5 k 1 col 5 msg This is the grid, press return to continue... pause set vec av off mvec 1 k 1 sh mvec 2 k 1 sh mvec 3 k 1 sh mvec 4 k 1 sh mvec 5 k 1 sh msg Velocity Vectors, press return to continue... pause set con scale range on set con fi depth 4 mcon 1 p1 k 1 fi 0 0.02 mcon 2 p1 k 1 fi 0 0.02 mcon 3 p1 k 1 fi 0 0.02 mcon 4 p1 k 1 fi 0 0.02 mcon 5 p1 k 1 fi 0 0.02 msg Enter e to end, or any Photon command to continue... ENDUSE GROUP 1. Run title and other preliminaries TEXT(MBFGE: Flow in cavity (5 blocks). TITLE INTEGER(NX1,NY1,NX2,NY2,NX3,NY3,NX4,NY4,NX5,NY5,IFICX,IFICY,II,JJ) REAL(POWER,TEMPX,TEMPY,P1X,P1Y,P2X,P2Y,P3X,P3Y,P4X,P4Y) REAL(REYNO,UIN) REYNO= 10000.; UIN= 1.0; ENUL= UIN/REYNO POWER= 1.4; NX1= 16; NY1 = 16; IFICX= 2; IFICY= 2 MESG( Enter the number of cells in the X-direction (DIV BY 4) (16) READVDU(NX1,INT,16) MESG( Enter the number of cells in the Y-direction (DIV BY 4) (16) READVDU(NY1,INT,16) MESG( Enter the Grid power (1.4) READVDU(POWER,REAL,1.4) MESG( Enter the FGEM refinement X-factor (2) READVDU(IFICX,INT,2) MESG( Enter the FGEM refinement Y-factor (2) READVDU(IFICY,INT,2) MESG( Re is currently set to :REYNO:, MESG( Enter another or press return to accept: READVDU(REYNO,REAL,REYNO) GROUP 6. Body-fitted coordinates or grid distortion >> NOTE: The fine grids occupy regions in the coarse grid spanning one quarter of the cells in each direction, and have IFICX:1, IFICY:1 mesh ratios **** 2nd Domain (Bottom left, fine) NX2= IFICX*NX1/4; NY2= IFICY*NY1/4 **** 3rd Domain (Bottom right, fine) NX3= IFICX*NX1/4; NY3= IFICY*NY1/4 **** 4th Domain (Top right, fine) NX4= IFICX*NX1/4; NY4= IFICY*NY1/4 **** 5th Domain (Top left, fine) NX5= IFICX*NX1/4; NY5= IFICY*NY1/4 ** Main Mesh 1 NZ = 1; BFC= T; GSET(D,NX1,NY1,NZ) GSET(P,P1,0.0,0.0,0.0); GSET(P,P2,1.0,0.0,0.0) GSET(P,P3,1.0,1.0,0.0); GSET(P,P4,0.0,1.0,0.0) GSET(L,L12,P1,P2,NX1,S:POWER:); GSET(L,L23,P2,P3,NY1,S:POWER:) GSET(L,L34,P3,P4,NX1,S:POWER:); GSET(L,L41,P4,P1,NY1,S:POWER:) GSET(F,F1,P1,-,P2,-,P3,-,P4,-); GSET(M,F1,+I+J,1,1,1,TRANS) GSET(C,K:NZ+1:,F,K1,+,0.0,0.0,0.1) DUMPC(MBGR1) ** Sub Mesh 2 GSET(D,NX2,NY2,NZ); P1X=0.5*(0.5**POWER); P1Y=0.5*(0.5**POWER) GSET(P,P1A,P1X,0.0,0.);GSET(P,P1B,P1X,P1Y,0.) GSET(P,P1C,0.0,P1Y,0.) GSET(L,L11A, P1, P1A,NX2,:POWER:) GSET(L,L1A1B,P1A,P1B,NY2,:POWER:) GSET(L,L1B1C,P1B,P1C,NX2,-:POWER:) GSET(L,L1C1, P1C,P1, NY2,-:POWER:) GSET(F,F2,P1,-,P1A,-,P1B,-,P1C,-); GSET(M,F2,+I+J,1,1,1,TRANS) GSET(C,K:NZ+1:,F,K1,+,0.,0.,0.1) DUMPC(MBGR2) ** Sub Mesh 3 GSET(D,NX3,NY3,NZ); P2X= 1.-P1X; P2Y= P1Y GSET(P,P2A,1.0,P2Y,0.0); GSET(P,P2B,P2X,P2Y,0.0) GSET(P,P2C,P2X,0.0,0.0) GSET(L,L22A, P2, P2A,NY2,:POWER:) GSET(L,L2A2B,P2A,P2B,NX2,:POWER:) GSET(L,L2B2C,P2B,P2C,NY2,-:POWER:) GSET(L,L2C2, P2C,P2, NX2,-:POWER:) GSET(F,F3,P2C,-,P2,-,P2A,-,P2B,-); GSET(M,F3,+I+J,1,1,1,TRANS) GSET(C,K:NZ+1:,F,K1,+,0.,0.,0.1) DUMPC(MBGR3) ** Sub Mesh 4 GSET(D,NX4,NY4,NZ); P3X= P2X; P3Y= 1.-P1Y GSET(P,P3A,P3X,1.0,0.0); GSET(P,P3B,P3X,P3Y,0.0) GSET(P,P3C,1.0,P3Y,0.0) GSET(L,L33A, P3, P3A,NX3,:POWER:) GSET(L,L3A3B,P3A,P3B,NY3,:POWER:) GSET(L,L3B3C,P3B,P3C,NX3,-:POWER:) GSET(L,L3C3, P3C,P3, NY3,-:POWER:) GSET(F,F4,P3B,-,P3C,-,P3,-,P3A,-); GSET(M,F4,+I+J,1,1,1,TRANS) GSET(C,K:NZ+1:,F,K1,+,0.,0.,0.1) DUMPC(MBGR4) ** Sub Mesh 5 GSET(D,NX5,NY5,NZ); P4X= P1X; P4Y= P3Y GSET(P,P4A,0.0,P4Y,0.0); GSET(P,P4B,P4X,P4Y,0.0) GSET(P,P4C,P4X,1.0,0.0) GSET(L,L44A, P4, P4A,NY4,:POWER:) GSET(L,L4A4B,P4A,P4B,NX4,:POWER:) GSET(L,L4B4C,P4B,P4C,NY4,-:POWER:) GSET(L,L4C4, P4C,P4, NX4,-:POWER:) GSET(F,F5,P4A,-,P4B,-,P4C,-,P4,-); GSET(M,F5,+I+J,1,1,1,TRANS) GSET(C,K:NZ+1:,F,K1,+,0.,0.,0.1) DUMPC(MBGR5) >> NOTE: The Blocks have all been written to disk, and now they are retrieved. First the number of blocks is set via the numblk variable, then READCO(xxxx+) instructs satellite to read the grids from the files xxxx1, xxxx2 etc, and they are arranged in a single computational space. If all blocks have natural connections, you can use parameter L(l) in READCO(....+L) command to set up all LINKS. Alternatively you can use MBLINK commands (see below). NUMBLK= 5; READCO(MBGR+) GVIEW(Z); VIEW >> NOTE: Fine grid embedding of the fine grids (2-5) within the coarse grid (1) is achieved with the MBLINK command MBLINK(2,IN,1); MBLINK(3,IN,1); MBLINK(4,IN,1); MBLINK(5,IN,1) GROUP 7. Variables stored, solved & named STORE(VPOR); SOLVE(P1,U1,V1) L($F150) GROUP 13. Boundary conditions and special sources *Fix pressure near centre to 0 PATCH(FIXPRS,CELL,NX1/2,NX1/2,NY1/2,NY1/2,1,1,1,LSTEP) COVAL(FIXPRS,P1,FIXP,0.0) >> NOTE: MPATCH is used to set patches within the various blocks. The first argument is the block number. INLET and OUTLET should not be used as they set commands for U1 etc so it is necessary to provide COVAL statements for UC1 etc *North moving wall MPATCH(5,WN5,NWALL,1,NX5,NY5,NY5,1,1,1,LSTEP) COVAL(WN5,UC1,1.0,UIN); COVAL(WN5,VC1,1.0,0.0) II= NX1/4+1; JJ= 3*NX1/4 MPATCH(1,WN1,NWALL,II,JJ,NY1,NY1,1,1,1,LSTEP) COVAL(WN1,UC1,1.0,UIN); COVAL(WN1,VC1,1.0,0.0) MPATCH(4,WN4,NWALL,1,NX4,NY4,NY4,1,1,1,LSTEP) COVAL(WN4,UC1,1.0,UIN); COVAL(WN4,VC1,1.0,0.0) *West Wall MPATCH(5,WW5,WWALL,1,1,1,NY5,1,1,1,LSTEP) COVAL(WW5,UC1,1.0,0.0); COVAL(WW5,VC1,1.0,0.0) II= NY1/4+1; JJ= 3*NY1/4 MPATCH(1,WW1,WWALL,1,1,II,JJ,1,1,1,LSTEP) COVAL(WW1,UC1,1.0,0.0); COVAL(WW1,VC1,1.0,0.0) MPATCH(2,WW2,WWALL,1,1,1,NY2,1,1,1,LSTEP) COVAL(WW2,UC1,1.0,0.0); COVAL(WW2,VC1,1.0,0.0) *East Wall MPATCH(4,WE4,EWALL,NX4,NX4,1,NY4,1,1,1,LSTEP) COVAL(WE4,UC1,1.0,0.0); COVAL(WE4,VC1,1.0,0.0) II= NY1/4+1; JJ= 3*NY1/4 MPATCH(1,WE1,EWALL,NX1,NX1,II,JJ,1,1,1,LSTEP) COVAL(WE1,UC1,1.0,0.0); COVAL(WE1,VC1,1.0,0.0) MPATCH(3,WE3,EWALL,NX3,NX3,1,NY3,1,1,1,LSTEP) COVAL(WE3,UC1,1.0,0.0); COVAL(WE3,VC1,1.0,0.0) *South Wall MPATCH(2,WS2,SWALL,1,NX2,1,1,1,1,1,LSTEP) COVAL(WS2,UC1,1.0,0.0); COVAL(WS2,VC1,1.0,0.0) II= NX1/4+1; JJ= 3*NX1/4 MPATCH(1,WS1,SWALL,II,JJ,1,1,1,1,1,LSTEP) COVAL(WS1,UC1,1.0,0.0); COVAL(WS1,VC1,1.0,0.0) MPATCH(3,WS3,SWALL,1,NX3,1,1,1,1,1,LSTEP) COVAL(WS3,UC1,1.0,0.0); COVAL(WS3,VC1,1.0,0.0) GROUP 15. Termination of sweeps LSWEEP= 200; TSTSWP=-1 GROUP 16. Termination of iterations SELREF = T; RESFAC = 1.E-3 GROUP 17. Under-relaxation devices RELAX(P1,LINRLX,0.5) GROUP 19. Data communicated by satellite to GROUND CSG3= LCRU GROUP 22. Spot-value print-out IXMON= NX1/2; IYMON= NY1/2; IZMON= 1