tecplot pc 在工程上應用 -...
TRANSCRIPT
-
1 TECPLOT
September 2012
PC
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
Numerical Strategy
A Domain (Geometry)
B Governing equations (O.D.E., P.D.E.) and B.C.s
C Difference equations (Discretization) and B.C.s
D Finite difference / Finite element or other methods * Importance of boundary conditions and initial conditions
1If not exist, only general solutions can be obtained.
2For practical applications, they are necessary.
* Types of problems:
1Elliptice.g.
0yx 22
2
2
(Laplace equation)
2Parabolicboundary-layer flows (upstream-dominant)
3Hyperbolic
2
2
2
2
yC
xCk
tC
* Uniqueness and existence of particular solution.
* Types of boundary conditions
IDirichlet Problemsgiven values at boundaries IINeumann Problemsgiven normal derivatives at boundaries
-
19Finite Difference Method in Solving Differential Equations
To represent the quantity of xF
x xx
AForward (downwind) difference
xFF
xF i1i
i
* By Taylors expansion
xxFF 1j
......!3
xxF
!2)x(
xFx
xFxF
3
x3
32
x2
2
x
1
xOx
xFxxFxF
]x[OxFxxFxxF
x
2
x
BBackward (upwind) difference
xFF
xF 1ii
i
* By Taylors expansion
-
20
)xx(FF 1i
......!3x
xF
!2x
xFx
xFxF
3
3
32
x2
2
x
2
xOx
xxFxFxF
]x[OxxFxFxxF
x
2
x
CCentral Difference
x2FF
xF 1i1i
i
* 1 2
]x[Ox2
xxFxxFxF
]x[Ox2xFxxFxxF
2
x
3
x
Comments
(i) Better accuracy
(ii) Worse space resolution
(iii) Gradient independency of local values
-
21* Example 1 Dirichlet Type
0yx 22
2
2
0
1
1x
50
40
0
100y
B F
j+1
i+1ii-1
j
j-1
xxx
x
BF
j,i2
2
=> xx
j,ij,1iF
j,i
xxj,1ij,i
B
j,i
2
j,1ij,ij,1i
x2
Similarly, 21j,ij,i1j,i
j,i2
2
y2
y
= 0 40
= 40 80
= 0 80
= 0
-
22Substitution into the ordinary differential equation leads to
equation) e(differenc0y
2x
22
j,1ij,ij,1i2
j,1ij,ij,1i
If one takes ,yx then
)(41 n
1j,in
1j,in
j1in
j,1i1n
j,i
j+1
i+1ii-1
j
j-1
Procedure
(1) Make initial guesses at all interior points.
(2) Iterate until convergence is reached.
* Example 2Dirichlet + Neumann 0yx 22
2
2
0
1
1x
0
x
0
x
0
100y
= 0
= 40 100
= 0 100 100 0
-
23Image conditions at phantom points
0
x
Noted that at i = 0 , are unknowns.
n 1j,0n 1j,0n j,1n j,11n j,0 41
nj,1
nj1,- take, 0iat 0x
Finally, n 1j,0n 1j,0n j,11n j,0 241
0
1
11000
8020
0x
200
y
-
24
-
25
( 22 1010 FORTRAN )
1X, Y, , .
dimension x(0:10,0:10), y(0:10,0:10), phi(0:10,0:10), oldphi(0:10,0:10)
2
do 100 i=0,10 do 100 j=0,10
100 x(i,j)=0.1*float(i)
do 200 i=0,10 do 200 j=0,10
200 y(i,j)=0.1*float(j)
3
do 300 i=0,10 phi(i,0)=0. () 300 phi(i,10)=40.+0.4*float(i) ()
do 400 j=0,10 phi(0,j)= 0.4*float(i) () 400 phi(10,j)= 0.8*float(i) ()
4
do 500 i=1,9 do 500 j=1,9
500 phi(i,j)= 0.
5 ( DO loop)
do 500 j=1,9 (Gauss-Seidel method) do 500 i=1,9
500 phi(i,j)=(phi(i-1,j)+ phi(i+1,j)+phi(i,j-1)+ phi(i,j+1))/4.
-
26do 500 j=1,9 do 500 i=1,9 (Jacobi method)
500 oldphi(i.j)=phi(i,j) do 600 j=1,9 do 600 i=1,9
600 phi(i,j)=(oldphi(i-1,j)+ phi(i+1,j)+oldphi(i,j-1)+ phi(i,j+1))/4.
6( tecplot )
5nj,i
1nj,i 101max
10,0j10,0i
32nj,i
1nj,i 10
-
27TECPLOT 9.0
1. Laplace equation R001R002
2. Tecplot macro
3. Tecplot play macro
Macro
1. Layout R001
2.
3. macro File -> macro -> record
macro recorder macro
File -> load datafile -> replace dataset and retain frame style R001
R002 R003 stop recording
-
28 .mcr macro
#!MC 900 $!VarSet |MFBD| = 'C:\tecplot avi'
C
$!READDATASET '"|MFBD|\R001" ' READDATAOPTION = NEW RESETSTYLE = NO INCLUDETEXT = NO INCLUDEGEOM = NO INCLUDECUSTOMLABELS = NO VARLOADMODE = BYNAME VARNAMELIST = '"X" "Y" "H"'
C
$!READDATASET '"|MFBD|\R002" ' READDATAOPTION = NEW RESETSTYLE = NO INCLUDETEXT = NO INCLUDEGEOM = NO INCLUDECUSTOMLABELS = NO VARLOADMODE = BYNAME VARNAMELIST = '"X" "Y" "H"'
C
$!READDATASET '"|MFBD|\R003" ' READDATAOPTION = NEW RESETSTYLE = NO INCLUDETEXT = NO INCLUDEGEOM = NO INCLUDECUSTOMLABELS = NO VARLOADMODE = BYNAME VARNAMELIST = '"X" "Y" "H"' $!RemoveVar |MFBD|
-
294. macro ()
macro output macro
macro
#!MC 900 $!VarSet |MFBD| = ' C:\tecplot avi '
$!EXPORTSETUP EXPORTFORMAT = AVI AVI
$!EXPORTSETUP ANIMATIONSPEED = 10
$!EXPORTSETUP IMAGEWIDTH = 600
$!EXPORTSETUP EXPORTFNAME = 'C:\tecplot avi\export.avi'
$!EXPORTSTART
$!READDATASET '"|MFBD|\R001" ' READDATAOPTION = NEW RESETSTYLE = NO INCLUDETEXT = NO INCLUDEGEOM = NO INCLUDECUSTOMLABELS = NO VARLOADMODE = BYNAME VARNAMELIST = '"X" "Y" "H"'
$!EXPORTNEXTFRAME
$!READDATASET '"|MFBD|\R002" ' READDATAOPTION = NEW RESETSTYLE = NO INCLUDETEXT = NO INCLUDEGEOM = NO INCLUDECUSTOMLABELS = NO VARLOADMODE = BYNAME VARNAMELIST = '"X" "Y" "H"'
$!EXPORTNEXTFRAME
-
30 $!READDATASET '"|MFBD|\R100" ' READDATAOPTION = NEW RESETSTYLE = NO INCLUDETEXT = NO INCLUDEGEOM = NO INCLUDECUSTOMLABELS = NO VARLOADMODE = BYNAME VARNAMELIST = '"X" "Y" "H"'
$!EXPORTFINISH
$!RemoveVar |MFBD|
5. macro 100
export.avi 10 600 File -> macro -> play
macro TEST1.mcr