1
2
3
4
5
6
7
8
9
10
CHAPTER H: HYBRID GRID ELEMENTS - TEST CASES
Shortcuts:
H.101 Triangular Grid - Uni-direction Linear Conduction
H.102 Triangular Grid - Uni-dir Conduction + Specified Convection
H.103: Mixed Quad & Triangular Grid - X-dir Linear Conduction
H.104 Mixed Hex and Quad Based Pyramid - Linear X Conduction
H.105: Laminar Developing Flow in a Channel
H.106 Square Cavity with Moving Grid (Triangular & Quad Grids)
H107: Backward Facing Step. Re = 2.7 x 10^4.
************************************************************************ TITLE T.101 Triangular Grid - Uni-direction Linear Conduction ************************************************************************
// Illustrates the use of grids with triangular elements
//
GRID UNSTructured 12 elements
COORdinate x y from 'ANST101.XYZ'
CONNectivity HYBRId 'ANST101.CNC'
/
LOCATE ID=XMINUS PAIR (1,1) (7,1)
LOCATE ID=XPLUS PAIR (6,2) (12,3)
LOCATE ID=YMINUS PAIR (1,2) (4,2) (5,2)
LOCATE ID=YPLUS PAIR (7,3) (10,3) (11,3)
DENSity 1.0
VISCosity 0.1
****> For x-direction conduction these are active
/
BOUNdary T ID=XMINUS X- VALUE = 0.
BOUNdary T ID=XPLUS X- VALUE = 3.
BOUNdary T ID=YMINUS X- flux = 0.
BOUNdary T ID=YPLUS X- flux = 0.
****> For y-direction conduction these are active
/
/BOUNdary T ID=XMINUS X- flux = 0.
/BOUNdary T ID=XPLUS X- flux = 0.
/BOUNdary T ID=YMINUS X- value = 0.
/BOUNdary T ID=YPLUS X- value = 2.
/
DIAGnostic element 12 print T RT every 10 steps
OUTPUT TABLES X Y T
/
MATRIX T COOR redblack
/
SOLVE T STEADY 1000 steps
/
SAVE OFF T 'T101_SAV.TMP'
/
END
/
/
-Back To Top
************************************************************************
TITLE T.102 Triangular Grid - Uni-dir Conduction + Specified
Convection
************************************************************************
/
GRID UNSTructured 12 elements
/
COORdinate x y from 'ANST101.xyz'
CONNectivity HYBRId 'ANST101.cnc'
WRITE CORNERS
/
LOCATE ID=XMINUS PAIR (1,1) (7,1)
LOCATE ID=XPLUS PAIR (6,2) (12,3)
LOCATE ID=YMINUS PAIR (1,2) (4,2) (5,2)
LOCATE ID=YPLUS PAIR (7,3) (10,3) (11,3)
DENSity 1.0
VISCosity 0.1
****> For x-direction conduction these are active
SET U = 0.1
BOUNdary T ID=XMINUS X- VALUE = 0.
BOUNdary T ID=XPLUS X- VALUE = 3.
BOUNdary T ID=YMINUS X- flux = 0.
BOUNdary T ID=YPLUS X- flux = 0.
****> For y-direction conduction these are active
/SET V = 0.1
/BOUNdary T ID=XMINUS X- flux = 0.
/BOUNdary T ID=XPLUS X- flux = 0.
/BOUNdary T ID=YMINUS X- value = 0.
/BOUNdary T ID=YPLUS X- value = 2.
/
DIAGnostic element 12 print T RT every 10 steps
OUTPUT OFF
OUTPUT TABLES X Y T
/
MATRIX T COOR redblack
/
SOLVE T STEADY 1000 steps
/
SAVE OFF T 'T102_SAV.TMP'
/
END
/
/
-Back To Top
************************************************************************
TITLE T.103: Mixed Quad & Triangular Grid - X-dir Linear
Conduction
************************************************************************
/
GRID UNSTructured 5 elements
COORdinates from 'ANST103.XYZ'
CONNectivity HYBRid 'ANST103.CNC'
/
LOCATE ID=XMINUS1 PAIR (5,3)
LOCATE ID=XMINUS2 PAIR (2,2)
LOCATE ID=XPLUS1 PAIR (3,3)
LOCATE ID=XPLUS2 PAIR (4,2)
LOCATE ID=YMINUS1 PAIR (2,3)
LOCATE ID=YMINUS2 PAIR (3,2)
LOCATE ID=YPLUS1 PAIR (4,3)
LOCATE ID=YPLUS2 PAIR (5,2)
/
LIMIT T MINIMUM -1.E30 MAX 1.E30
/
**** ===> AKR: Note
**** ===> bc's can be set explicitly or SET used or both; same
results
/
/BOUNdary T LOCATE ID=XMINUS1 VALUE =-50.
/BOUNdary T LOCATE ID=XMINUS2 VALUE = 0.0
/BOUNdary T LOCATE ID=XPLUS1 VALUE = 150.
/BOUNdary T LOCATE ID=XPLUS2 VALUE = 100.
/BOUNdary T LOCATE ID=YMINUS1 VALUE = 50.
/BOUNdary T LOCATE ID=YMINUS2 VALUE = 150
/BOUNdary T LOCATE ID=YPLUS1 VALUE = 50.
/BOUNdary T LOCATE ID=YPLUS2 VALUE =-50.
/
SET T LINEAR 0. +100 * X
/
**** ===> AKR: Note
**** ===> If Diff Skew not used error a little higher; still
pretty good
/DIFFUSTION SKEW SECOND ORDER
/
/INLET ID=XMINUS X-
/OUTLET ID=XPLUS X-
/SYMMetry ID=YPLUS X-
/WALL ID=YMINUS X-
DENSity 1.0
VISCosity 0.1
/BOUNdary T ID=XMINUS X- VALUE = 0.
/BOUNdary T ID=XPLUS X- VALUE = 3.
/BOUNdary T ID=YMINUS X- flux = 0.
/BOUNdary T ID=YPLUS X- flux = 0.
DIAGnostic element 1 print T RT every 10 steps
OUTPUT OFF
OUTPUT TABLES X Y T
/
MATRIX T redblack !face
/
SOLVE T STEADY 100 steps
/
SAVE T 'T103_SAV.TMP'
/
END
/
/
-Back To Top
************************************************************************
TITLE T.104 Mixed Hex and Quad Based Pyramid - Linear X Conduction
************************************************************************
/
GRID UNSTructured 7 elements THREED
COORdinate 'ANST104.XYZ'
CONNectivity HYBRid 'ANST104.CNC'
/
/LOCATE ID=XMINUS1 PAIR (5,3)
/LOCATE ID=XMINUS2 PAIR (2,2)
/LOCATE ID=XPLUS1 PAIR (3,3)
/LOCATE ID=XPLUS2 PAIR (4,2)
/LOCATE ID=YMINUS1 PAIR (2,3)
/LOCATE ID=YMINUS2 PAIR (3,2)
/LOCATE ID=YPLUS1 PAIR (4,3)
/LOCATE ID=YPLUS2 PAIR (5,2)
/
LIMIT T MINIMUM -1.E30 MAX 1.E30
/
**** ===> AKR: Note
**** ===> bc's can be set explicitly or SET used or both; same
results
/
/BOUNdary T LOCATE ID=XMINUS1 VALUE =-50.
/BOUNdary T LOCATE ID=XMINUS2 VALUE = 0.0
/BOUNdary T LOCATE ID=XPLUS1 VALUE = 150.
/BOUNdary T LOCATE ID=XPLUS2 VALUE = 100.
/BOUNdary T LOCATE ID=YMINUS1 VALUE = 50.
/BOUNdary T LOCATE ID=YMINUS2 VALUE = 150
/BOUNdary T LOCATE ID=YPLUS1 VALUE = 50.
/BOUNdary T LOCATE ID=YPLUS2 VALUE =-50.
/
SET T LINEAR 0. +100 * X
/
**** ===> AKR: Note
**** ===> If Diff Skew is not used error a little higher; still
pretty good
DIFFUSTION SKEW SECOND ORDER
/
/INLET ID=XMINUS X-
/OUTLET ID=XPLUS X-
/SYMMetry ID=YPLUS X-
/WALL ID=YMINUS X-
DENSity 1.0
VISCosity 0.1
/BOUNdary T ID=XMINUS X- VALUE = 0.
/BOUNdary T ID=XPLUS X- VALUE = 3.
/BOUNdary T ID=YMINUS X- flux = 0.
/BOUNdary T ID=YPLUS X- flux = 0.
DIAGnostic element 1 print T RT every 10 steps
OUTPUT OFF
OUTPUT TABLES X Y Z T
/
MATRIX T redblack !face
/
SOLVE T STEADY 100 steps
/
SAVE OFF T 'T104_SAV.TMP'
/
END
/
/
-Back To Top
************************************************************************
TITLE T.105: Laminar Developing Flow in a Channel
************************************************************************
**
DEFINE TYPE_ELEMENTS = TRIANGLES ! Change TRIANGLES to QUAD for
structured
IF( TYPE_ELEMENTS = QUAD ) THEN
**
==================================================================
**
** This Section Active only for Quad Grid
**
==================================================================
**
**
GRID NODEs 42 by 22
COOR X RANGE 10.0 1.05
COOR Y RANGE 0.5
LOCAte ID=INLET from ( 1,1) ( 1,999)
LOCAte ID=OUTLET from (999,1) (999,999)
LOCAte ID=SYMMETRY from (1,1) (999,1)
LOCAte ID=OUTFLD from (41,2) to (41,21)
DIAGnostic output U V P T RP at (41,2) EVERY 50
**
ELSE
**
==================================================================
**
** This Section Active only for Triangular Grid
**
==================================================================
**
**
GRID UNSTructured elements = 1600
CONNectivity HYBRid in file 'ANST105.CNC'
COORdinates X Y VERTices in file 'ANST105.XYZ'
/
LOCA ID=INLET PAIR
1 1 41 1 81 1 121 1 161 1 201 1 241 1 281 1 321 1 361 1
401 1 441 1 481 1 521 1 561 1 601 1 641 1 681 1 721 1 761 1
LoCAte ID=OUTLET PAIR
840 3 880 3 920 3 960 3 1000 3 1040 3 1080 3 1120 3 1160 3 1200 3
1240 3 1280 3 1320 3 1360 3 1400 3 1440 3 1480 3 1520 3 1560 3
1600 3
LOCAte ID=SYMMETRY PAIR
801 2 802 2 803 2 804 2 805 2 806 2 807 2 808 2 809 2 810 2
811 2 812 2 813 2 814 2 815 2 816 2 817 2 818 2 819 2 820 2
821 2 822 2 823 2 824 2 825 2 826 2 827 2 828 2 829 2 830 2
831 2 832 2 833 2 834 2 835 2 836 2 837 2 838 2 839 2 840 2
/
LOCAte ID=OUTFLD
840 880 920 960 1000 1040 1080 1120 1160 1200
1240 1280 1320 1360 1400 1440 1480 1520 1560 1600
/
DIFF SKEW U V P T
DIAGnostic output U V P T RP at ELEMENT 40 EVERY 50
**
ENDIF
**
==================================================================
**
** Common Section Active for both Quad and Triangular Grid
**
==================================================================
**
**
WALL at undefined outer boundaries
INLEt at ID=INLET X-
OUTLet at ID=OUTLET X+
SYMMetry at ID=SYMMETRY Y-
SET U at ID=INLET 100.0
SET T at ID=INLET 1.0
/
DENSity 1.0
VISC 1.0
SPEC 1.0
/
DEBUG GEOMERTY OFF
FLUX DEFAult output OFF
/
OUTPut OFF
/
PRAN EFFE 0.7
RELAX U=0.4
CONV GLOB 1.E-12
/
SOLVE U V P T STEADY 5000
/
SAVE TABLE U, V, P, T ID=OUTFLD 'T105_TBL.TMP'
/
END
/
/
-Back To Top
************************************************************************
TITLE T.106 Square Cavity with Moving Grid (Triangular & Quad
Grids)
************************************************************************
**
DEFINE TYPE_ELEMENTS = TRIANGLES ! Change TRIANGLES to QUAD for
structured
IF( TYPE_ELEMENTS = QUAD ) THEN
**
==================================================================
**
** This Section Active only for Quad Grid
**
==================================================================
**
**
GRID NODEs BY 22 BY 22
COORDINATE X RANGE 1
COORDINATE Y RANGE 1
LOCAte ID=TOP from (1,999) to (999,999)
DIAGNOSTIC NODE U V P RU RV AT ELEMENT (12,12) Every 20 STEPS
**
ELSE
**
==================================================================
**
** This Section Active only for Triangular Grid
**
==================================================================
**
**
GRID UNSTructured elements = 800
CONNectivity HYBRid in file 'ANST106.CNC'
COORdinates X Y VERTices in file 'ANST106.XYZ'
LOCAte PAIR LIST ID=TOP
381 3 382 3 383 3 384 3 385 3 386 3 387 3 388 3 389 3 390 3
391 3 392 3 393 3 394 3 395 3 396 3 397 3 398 3 399 3 800 3
LOCATE LIST ID = MID
10 30 50 70 90 110 130 150 170 190
210 230 250 270 290 310 330 350 370 390
DIAGNOSTIC NODE U V P RU RV AT ELEMENT 211 Every 20 STEPS
**
ENDIF
**
==================================================================
**
** Common Section Active for both Quad and Triangular Grid
**
==================================================================
**
**
WALL at all outer boundaries
BOUNdary U = 1 at ID=TOP Y+
LAMINAR flow
VISCOSITY 0.01
/
DEBUG GEOMERTY OFF
FLUX DEFAult output OFF
SAVE OFF
OUTPut OFF
/
CONVERGENCE REFERENCE for U in LOCAL mode 1.E-6
SOLVE FOR 1000 STEPS IN STEADY MODE
LOCAte ID=H_MID COORDINATE (0., 0.47) TO (1., 0.53)
LOCAte ID=V_MID COORDINATE (0.47, 0.) TO (0.53, 1.)
SAVE TABLE U V ID=H_MID 'H_MID.TMP' NOW
SAVE TABLE U V ID=V_MID 'V_MID.TMP' NOW
/
END
/
/
-Back To Top
************************************************************************
TITLE T107: Backward Facing Step. Re = 2.7 x 10^4.
!Driver and Seegmiller 1985, AIAA J., Vol. 23, No. 2, pp. 163 -
171
************************************************************************
**
DEFINE TYPE_ELEMENTS = TRIANGLES ! Change TRIANGLES to QUAD for
structured
IF( TYPE_ELEMENTS = QUAD ) THEN
** ========================================================== **
** This Section for Quad Elements
** ========================================================== **
**
GRID 74 by 52
COORdinate X CORNers
-4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5
1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 10.5
11.0 11.5 12.0 12.5 13.0 13.5 14.0 14.5 15.0 15.5
16.0 16.5 17.0 17.5 18.0 18.5 19.0 19.5 20.0 20.5
21.0 21.5 22.0 22.5 23.0 23.5 24.0 24.5 25.0 25.5
26.0 26.5 27.0 27.5 28.0 28.5 29.0 29.5 30.0 30.5
31.0 31.5 32.0
COORdinate Y CORNers
0.00 0.10 0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90
1.00 1.10 1.20 1.31 1.42 1.53 1.65 1.77 1.90 2.03
2.16 2.30 2.44 2.59 2.74 2.90 3.06 3.22 3.40 3.58
3.76 3.95 4.15 4.35 4.56 4.77 5.00 5.23 5.46 5.71
5.96 6.22 6.49 6.77 7.06 7.36 7.67 7.98 8.31 8.65
9.00
LOCATe ID=BLOCK ( 1, 2) to ( 9, 11)
LOCATe ID=INLET ( 1, 12) to ( 1,999)
LOCATE ID=OUTLET (999, 1) to (999,999)
DIAGNOSTIC NODE (20,2) print U,V,P,K,RP every 10 steps
ELSE
**
** ========================================================== **
** This Section for Triangular Elements
** ========================================================== **
**
GRID UNSTructured elements = 7200
CONNectivity HYBRid in file 'ANST107.CNC'
COORdinates X Y VERTices in file 'ANST107.XYZ'
/
LOCATE ID=BLOCK LIST
1 2 3 4 5 6 7 8 73 74
75 76 77 78 79 80 145 146 147 148
149 150 151 152 217 218 219 220 221 222
223 224 289 290 291 292 293 294 295 296
361 362 363 364 365 366 367 368 433 434
435 436 437 438 439 440 505 506 507 508
509 510 511 512 577 578 579 580 581 582
583 584 649 650 651 652 653 654 655 656
3601 3602 3603 3604 3605 3606 3607 3608 3673 3674
3675 3676 3677 3678 3679 3680 3745 3746 3747 3748
3749 3750 3751 3752 3817 3818 3819 3820 3821 3822
3823 3824 3889 3890 3891 3892 3893 3894 3895 3896
3961 3962 3963 3964 3965 3966 3967 3968 4033 4034
4035 4036 4037 4038 4039 4040 4105 4106 4107 4108
4109 4110 4111 4112 4177 4178 4179 4180 4181 4182
4183 4184 4249 4250 4251 4252 4253 4254 4255 4256
LOCATE ID = INLET LIST PAIR
721 1 793 1 865 1 937 1 1009 1 1081 1 1153 1 1225 1 1297 1 1369 1
1441 1 1513 1 1585 1 1657 1 1729 1 1801 1 1873 1 1945 1 2017 1
2089 1
2161 1 2233 1 2305 1 2377 1 2449 1 2521 1 2593 1 2665 1 2737 1
2809 1
2881 1 2953 1 3025 1 3097 1 3169 1 3241 1 3313 1 3385 1 3457 1
3529 1
LOCATE ID = OUTLET LIST PAIR
3672 3 3744 3 3816 3 3888 3 3960 3 4032 3 4104 3 4176 3 4248 3
4320 3
4392 3 4464 3 4536 3 4608 3 4680 3 4752 3 4824 3 4896 3 4968 3
5040 3
5112 3 5184 3 5256 3 5328 3 5400 3 5472 3 5544 3 5616 3 5688 3
5760 3
5832 3 5904 3 5976 3 6048 3 6120 3 6192 3 6264 3 6336 3 6408 3
6480 3
6552 3 6624 3 6696 3 6768 3 6840 3 6912 3 6984 3 7056 3 7128 3
7200 3
DIAGNOSTIC for ELEMENT 19 print U,V,P,K,RP every 10 steps
DIFF SKEW U V P K E
ENDIF
**
** ========================================================== **
** Common Section
** ========================================================== **
**
WALLs default
BLOCkage ID=BLOCK
INLET ID=INLET X- ! For triangular grid X- is ignored
OUTLET ID=OUTLET X+ ! For triangular grid X+ is ignored
SET RHO = 1.00 EVERYWHERE
SET L = 0.1 EVERYWHERE
SET U = 1.0
SET K = 0.01
VISCOSITY 0.0003
/Inlet values for U and K.
SET U ( Y ) at ID=INLET from TABLe of 20 values X-
0.90000E+01 0.00000E+00
0.82000E+01 0.94200E+00
0.75000E+01 0.99900E+00
0.60000E+01 0.99900E+00
0.50000E+01 0.99900E+00
0.40000E+01 0.10000E+01
0.36000E+01 0.99900E+00
0.32000E+01 0.10020E+01
0.28000E+01 0.10010E+01
0.24000E+01 0.98000E+00
0.20000E+01 0.92500E+00
0.17000E+01 0.86900E+00
0.15000E+01 0.81700E+00
0.14000E+01 0.78900E+00
0.13000E+01 0.75900E+00
0.12000E+01 0.71800E+00
0.11500E+01 0.69500E+00
0.11000E+01 0.65600E+00
0.10000E+01 0.00000E+00
0.00000E+00 0.00000E+00
SET K ( Y ) at ID=INLET from TABLe of 20 values X-
0.90000E+01 1.0E-07
0.82000E+01 0.21000E-02
0.75000E+01 0.50000E-03
0.60000E+01 0.50000E-03
0.50000E+01 0.50000E-03
0.40000E+01 0.50000E-03
0.36000E+01 0.50000E-03
0.32000E+01 0.50000E-03
0.28000E+01 0.50000E-03
0.24000E+01 0.10500E-02
0.20000E+01 0.21000E-02
0.17000E+01 0.29000E-02
0.15000E+01 0.35000E-02
0.14000E+01 0.38500E-02
0.13000E+01 0.42000E-02
0.12000E+01 0.45500E-02
0.11500E+01 0.48000E-02
0.11000E+01 0.52500E-02
0.10000E+01 1.0E-07
0.00000E+00 1.0E-07
SET L ( Y ) at ID=INLET from TABLe of 14 values X-
9.0000000 0.000000
8.506E+00 1.96E-03
8.213E+00 2.48E-03
8.044E+00 2.35E-03
7.708E+00 2.09E-03
7.458E+00 2.50E-03
6.042E+00 2.50E-03
2.866E+00 2.50E-03
2.279E+00 2.39E-03
1.479E+00 2.50E-03
1.103E+00 2.50E-03
1.034E+00 1.47E-03
9.785E-01 1.00E-07
0. 1.00E-07
MATRIX P = 24
CONVERGENCE by GLOBAL mode = 5.0E-11
RELAXation U=0.4
/
OUTPut OFF
LOCAte ID=BWAL COORdinates from (-100, 0.0) TO (100, 0.1)
LOCAte ID=XEQ4 COORdinates from ( 3.70, -100) TO (4.30, 100)
/
SOLVE U,V,P,K,E max 2000 min 100 STEPS in STEADY mode
SAVE TABLE U V MU K E ID=XEQ4 'T107_XEQ4.TMP' NOW
SAVE TABLE U V MU K E ID=BWAL 'T107_BWAL.TMP' NOW
END
/
/
-Back To Top
1
2
3
4
5
6
7
8
9
10
# Back to ANSWER EXAMPLES DATABASE TOC
Related Links:
# ANSWER Applications
# ANSWER Examples
# ANSWER Express
# ANSWER Publications
# ANSWER Users
# ANSWER Price List
# Request CFDStudio/ANSWER Demo
# CFDStudio/ANSWER Tutorials
# ANSWER Manual
|