/* GEN_FLOW_ARROWS.AML /* Aml to take horizontal fluxes (in info files FBKF, FRIF, FFTF, FLTF), /* calculate flux per unit width across face, and calculate flow- /* direction arrows. These are uniformly-sized arrows and are NOT /* adjusted proportially to flux rate /* &data arc info arc SEL TULA_POL.PAT RELATE FBKF BY SEQNUM ORDERED RELATE 2 FRIF BY SEQNUM ORDERED RELATE 3 FFTF BY SEQNUM ORDERED RELATE 4 FLTF BY SEQNUM ORDERED RELATE 5 TULA_PTS.PAT BY SEQNUM CALC $COMMA-SWITCH = -1 &do lay := 1 &to 6 ASEL CALC ACTIVE = 1 CALC DONE = 0 RESEL AREA LT 0 CALC ACTIVE = 0 NSEL CALC WORK1 = $1FBKFL%lay% CALC WORK2 = $2FRIFL%lay% CALC WORK3 = $3FFTFL%lay% CALC WORK4 = $4FLTFL%lay% REM Find inactive cells (no horizontal flow-- > -0.00001 & < 0.00001) RESEL WORK1 lt .00001 and WORK2 lt .00001 and WORK3 lt .00001 and WORK4 lt .00001 RESEL WORK1 gt -.00001 and WORK2 gt -.00001 and WORK3 gt -.00001 and WORK4 gt -.00001 CALC ACTIVE = 0 ASEL REM Find cells where both front and back flow are out of cell RESEL ACTIVE = 1 AND WORK1 gt 0 and WORK3 gt 0 CALC WORK1 = WORK1 - WORK3 CALC WORK3 = 0 REM If back flow is negitive, it is positive the other way RESEL WORK1 LT 0 CALC WORK3 = 0 - WORK1 CALC WORK1 = 0 REM Now find cells where both right and left flow are out of cell ASEL RESEL ACTIVE = 1 AND WORK2 gt 0 and WORK4 gt 0 CALC WORK2 = WORK2 - WORK4 CALC WORK4 = 0 REM If back flow is negitive, it is positive the other way RESEL WORK2 LT 0 CALC WORK4 = 0 - WORK2 CALC WORK2 = 0 REM REM lets eliminate negitive flows now so we only look at flow out of cells ASEL RESEL ACTIVE = 1 AND WORK1 LT 0 CALC WORK1 = 0 ASEL RESEL ACTIVE = 1 AND WORK2 LT 0 CALC WORK2 = 0 ASEL RESEL ACTIVE = 1 AND WORK3 LT 0 CALC WORK3 = 0 ASEL RESEL ACTIVE = 1 AND WORK4 LT 0 CALC WORK4 = 0 REM Now we can calculate vector components because the values are either REM pos or zero, and - will be left or front & + will be right or back ASEL RESEL ACTIVE = 1 REM Now divide by row & column spacing, and since the flow arrows represent REM directions and not magnitude, let’s uniformly apply an adjustment factor REM to width so the numbers don’t get too small. REM WORK2 now becomes x & WORK1 now becomes y CALC WORK2 = ( WORK2 - WORK4 ) / ( ROWSPACING / 750 ) CALC WORK1 = ( WORK1 - WORK3 ) / ( COLSPACING / 750 ) REM WORK3 is slope of line defining arrow RESEL WORK2 NE 0 CALC WORK3 = WORK1 / WORK2 ASEL RESEL ACTIVE = 1 OUTPUT ../TMPOUT%lay% INIT PRINT ROW,COL,SEQNUM,$5X-COORD,$5Y-COORD,WORK2,WORK1,WORK3 &end q stop &end /* compile and run the fortran program GEN_FLOW_ARROWS &sys g77 –o gen_flow_arrows gen_flow_arrows.f &sys gen_flow_arrows &do lay := 1 &to 6 &if [exists arrows_%lay% -cover] &then kill arrows_%lay% /* this generates the arc cover for the arrows &data arc generate arrows_%lay% input genin%lay% lines Q &end build arrows_%lay% line additem arrows_%lay%.aat arrows_%lay%.aat row 4 4 i additem arrows_%lay%.aat arrows_%lay%.aat col 4 4 i additem arrows_%lay%.aat arrows_%lay%.aat SEQNUM 10 10 i &if [exists nooutf_%lay% -cover] &then kill nooutf_%lay% /* this generates the point cover for active cells without outflow &data arc generate nooutf_%lay% input noout%lay% points Q &end build nooutf_%lay% point additem nooutf_%lay%.pat nooutf_%lay%.pat row 4 4 i additem nooutf_%lay%.pat nooutf_%lay%.pat col 4 4 i additem nooutf_%lay%.pat nooutf_%lay%.pat SEQNUM 10 10 i &end &data arc info arc &do lay := 1 &to 6 SEL ARROWS_%lay%.AAT CALC SEQNUM = ARROWS_%lay%-ID RELATE TULA_PTS.PAT BY SEQNUM CALC ROW = $1ROW CALC COL = $1COL SEL NOOUTF_%lay%.PAT CALC SEQNUM = NOOUTF_%lay%-ID RELATE TULA_PTS.PAT BY SEQNUM CALC ROW = $1ROW CALC COL = $1COL &end Q stop &end &return