Lab_12
Lab_12
1.20
1.00
0.80
0.60
T
0.40
0.20
0.00
0.00 1.00 2.00 3.00 4.00 5.00 6.00
x
Analytical Solution
1.20
1.00
0.80
0.60 Analytical
T
0.40 Analytical
0.20 Analytical
0.00
0.00 2.00 4.00 6.00
x
2. Now redo the same problem with first order upwind scheme for the same values of the
parameters.
3. Finally, repeater the same problem with Lax Wendroff Scheme
Code
$DEBUG
PROGRAM MAIN
implicit double precision(a-h,o-z)
Dimension x(200),xx(200),T0(200),T(200),T_ana(200)
Open(unit=11,file='Conv_Eq.in')
Open(unit=12,file='Conv_Eq.out')
Open(unit=13,file='Conv_Eq.Txt')
Read (11,*) Tin, Cee,Tmax,Inc,dInc
Read (11,*) TLeft,TRight,U
Read (11,*) Nodes,el
write (12,*)'Tin, Cee,Tmax,Inc,dInc',Tin, Cee,Tmax,Inc,dInc
write (12,*)'TLeft,TRight,U',TLeft,TRight,U
write (12,*) 'Nodes,el',Nodes,el
DO I=1,Nodes
If(x(i).le.1.0) Then
T0(i)=x(I)
T_ana(i)=T0(I)
Elseif (x(i).le.2.0) Then
T0(i)=2.0-x(I)
T_ana(i)=T0(I)
Else
T0(i)=0.
T_ana(i)=T0(I)
Endif
write(13,20)x(i),T0(I),T_ana(I)
EndDo
T(1)=0.
T(nodes)=0.
delt=Cee*delx/U
tt=Tin+delt
Iprint=0
NN=0
If(Iprint.eq.Inc) then
write(13,*)tt