You are on page 1of 5

8CC8AM CALL8kln

C 1hls program solves Lhe onedlmenslonal olsson equaLlon wlLh Lhe Calerkln meLhod as descrlbed ln
Lhe LexL

A8AML1L8 (n 99)
ulMLnSlCn 8(n)A(n)?(n)W(n)u(n)
C
l 40*A1An(10)
xL 10
P xL/(n+1)
u 20/P
L 10/P
80 l/P
81 10/P
C
C llnd Lhe elemenLs ln L and u
C
W(1) u
u(1) L/u
uC 100 l 2 n
W(l) uL*u(l1)
u(l) L/W(l)
100 CCn1lnuL
C
C Asslgn Lhe array 8
C
uC 200 l 1 n
xlM P*(l1)
xl P*l
xl P*(l+1)
8(l) 80*CCS(l*xu)*(xlM+xl20*xl)
* +81*(20*Sln(l*xl)Sln(l*xlM)Sln(l*xl))
200 CCn1lnuL
C
C llnd Lhe soluLlon
C
?(1) 8(1)/W(1)
uC 300 l 2 n
?(l) (8(l)L*?(l1))/W(l)
300 CCn1lnuL
C
A(n) ?(n)
uC 400 l n111
A(l) ?(l)u(l)*A(l+1)
400 CCn1lnuL
C
W8l1L (6 999) (l*P A(l) l 1 n)
S1C
999 lC8MA1(2l168)
Lnu

lmpllclL none
real kuh8er
real hLc

c CalculaLe an approxlmaLlon for heaL Lransfer coefflclenLs ln a 1 lnch plpe for several dlfferenL
8eynolds numbers
c h heaL Lransfer coefflclenL ( w/m**2/k)
c k conducLlvlLy ( w/m/k)
c u hydraullc dlameLer (m)
c 8e 8eynolds number
c
daLa kur/06170023410/
c
c CalculaLe and prlnL PeaL 1ransfer CoefflclenLs for several
c 8eynolds numbers
c
8e10
hhLc(8eukr)
call ouLpuL (8eh)
c
hhLc(100ukr)
call ouLpuL( 100 h)
c
call ouLpuL (1000hLc(1000ukr))
c
hhLc(1e4kur)
call ouLpuL(10e4h)
c
sLop
end
c

3
funcLlon hLc(8ePdkr)
c CalculaLe a heaL Lransfer coefflclenL based on Lhe maxlmum of Lhe Lamlnar and 1urbulenL
coefflclenLs 1he LurbulenL coefflclenL ls obLalned from a ulLLus8oelLer correlaLlon
c
lmpllclL none
real 8ekPdrhLcnulamnuLurb
c
c hLc heaL Lransfer coefflclenL ( w/m**2/k)
c nulam lamlnar nusselL number
c nuLurb 1urbulenL nusselL number (ulLLus8oelLer correlaLlon)
c k conducLlvlLy ( w/m/k)
c Pd hydraullc dlameLer (m)
c 8e 8eynolds number
c r randl number
c
daLa nulam / 40/
c
c Cne blg advanLage of lsolaLlng repeaLed operaLlons ln a slngle
c locaLlon ls LhaL you can change Lhlngs qulckly Pere lm golng
c Lo use whaL l know abouL Lhe ** operaLor Lo speed Lhe calculaLlon
c of nuLurb0023*8e**8*r**04
c
nuLurb0023*exp(log(8e)*08+log(r)*04)
c a name1fonL colorll0000
hLck/Pd*max(nulamnuLurb)
c /fonL
reLurn
end
c
subrouLlne ouLpuL ( 8e h)
c rlnL resulLs Lo Lhe screen
c
lmpllclL none
real 8e h
c
c 8e 8eynolds number
c h PeaL 1ransfer CoefflclenL
c
prlnL * lor 8eynolds number 8e
prlnL * PeaL 1ransfer CoefflclenL ls h w/m**2/k
reLurn
end

You might also like