Algebraic grid generation
A. A simple, algebraic grid. Grid is a set of points connected by lines (Mesh is the set of
t t t t t t
points joined into cells.) GRID MESH
t t t t t t
General idea: mesh surface, propagate into interior -- sometimes by solving elliptic
boundary value problem for x(i,j).
· · · ·
x x
x x
· · · ·
x x x x
Choose points on wall, connect them, place tic marks along connecting line = grid;
i.e., define surfaces by ( xin(i),yin(i) )
Specify x,y inner and outer then: x(s) = xin + ( xout - xin ) s (0≤ s ≤1)
DO i=1,I
DO j=1,J
x(i,j) = xin(i) + (xout(i)-xin(i))*(j-1)/(J-1)
y(i,j) = yin(i) + (yout(i)-yin(i))*(j-1)/(J-1)
ENDDO
ENDDO
This is the two-surface method. Could add a line inside the domain and make it 3 surface.
This study source was downloaded by 100000899610689 from CourseHero.com on 09-06-2025 01:25:57 GMT -05:00
1
https://www.coursehero.com/file/33324900/Lecture14pdf/
, AerE 546 " Lecture 14
O-grid for cylinder by same method:
DO it = 1,NTH ! grid walls
th = 2ᴨ (it-1)/float(NTH-1) !1=NTH
xo = 10 cos(th)
yo = 10 sin(th)
xi = cos(th)
yi = sin(th)
DO ir=1,NR ! grid interior
xx(it,ir)=xi+(xo-xi)*(ir-1)/(NR-1)
yy(it,ir)=yi+(yo-yi)*(ir-1)(NR-1)
ENDDO
ENDDO
5 5
0
Y
0
Y
-5
-5
-5 0 5 10
X -5 0 5 10
X
B. Grid stretching: change to (0 < S < 1): either S(j) is non-linear or ∆S(j) is specified.
DO i=1,I
DO j=1,J
x(i,j) = xin(i) + (xout(i)-xin(i))*S(j)
y(i,j) = yin(i) + (yout(i)-yin(i))*S(j)
ENDDO
ENDDO
J 1 J 1 J 1
where 0 ≤ S(j) ≤ 1 is non-uniformly spaced.
S(j + 1) = S(j) + r j S1
1. ∆S method: Compound interest grid: 1 1 1
S(j+1) = S(j)+ rj∆S1, j >1 with S(1)=0 J 1
rJ
1
S(J) = S(1) + S1 rj = S1 =1
r is expansion ratio of grid spacing. 1
r 1
r 1
S1 =
r = 1.05, J = 100 gives ΔS1 = 4 10-4 rJ 1
r = .95, J = 100 gives ΔS1 = 0.05
This study source was downloaded by 100000899610689 from CourseHero.com on 09-06-2025 01:25:57 GMT -05:00
2
https://www.coursehero.com/file/33324900/Lecture14pdf/