0% found this document useful (0 votes)
77 views2 pages

TP Volume Fini

This document contains a Fortran program that models heat transfer through a 1D material using finite differences. It defines parameters like the length, thermal conductivity, and boundary temperatures. It discretizes the domain into a grid, applies the boundary conditions, and solves the system of equations to calculate the temperature at each point. It then outputs and compares the numerical solution to the analytical solution.

Uploaded by

Imad HanouAr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views2 pages

TP Volume Fini

This document contains a Fortran program that models heat transfer through a 1D material using finite differences. It defines parameters like the length, thermal conductivity, and boundary temperatures. It discretizes the domain into a grid, applies the boundary conditions, and solves the system of equations to calculate the temperature at each point. It then outputs and compares the numerical solution to the analytical solution.

Uploaded by

Imad HanouAr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

!

program TP1
parameter(n=500)
dimension aw(n),ap(n),ae(n),sc(n),sp(n),t(n),x(n),P(n),q(n),a(n)
+,b(n),c(n),d(n),tana(n)
real dx,L,TW,TE,lam,S
Donnes*********
TW=100. ! deg.C
TE=200. !deg.C
lam=0.5 !
w/m/k
L=0.02 !m
S=1.e6
ni=6
dx=L/(ni-1)
Maillage (1D)******
write(*,*)'dx',dx
x(1)=0
do i=2,ni
x(i)=x(i-1)+dx
enddo
Dscritisation***********
do i=2,ni-1
aw(i)=lam/dx
ae(i)=lam/dx
sc(i)=S
sp(i)=0
ap(i)=aw(i)+ae(i)-(sp(i)*dx)
enddo
Condition aux limites*********
aw(1)=0
ae(1)=0
sc(1)=TW
sp(1)=0
ap(1)=1
aw(ni)=0
ae(ni)=0
sc(ni)=TE
sp(ni)=0
ap(ni)=1
solution du programe
a(1)=-aw(1)
b(1)=ap(1)
c(1)=-ae(1)
d(1)=sc(1)
a(ni)=-aw(ni)
b(ni)=ap(ni)
c(ni)=-ae(ni)
d(ni)=sc(ni)
do i=2,ni-1
a(i)=-aw(i)
b(i)=ap(i)
c(i)=-ae(i)
d(i)=sc(i)*dx
enddo
q(1)=d(1)/b(1)
P(1)=c(1)/b(1)
do i=2,ni
P(i)=c(i)/(b(i)-a(i)*p(i-1))
q(i)=(d(i)-c(i)*q(i-1))/(b(i)-a(i)*p(i-1))
enddo
t(ni)=TE

do i=ni-1,1,-1
t(i)=q(i)-p(i)*t(i+1)
enddo
!
Solution analytique et affichage des resultats***************
do i=1,ni
tana(i)=(TE-TW)/L*x(i)+TW+S/(2*lam)*L*x(i)-(S/(2*lam)*x(i)*x(i))
write(*,*) 'i=',i, x(i),' t(i)=',t(i),' tana(i)=',tana(i)
enddo
end program

You might also like