]> SALOME platform Git repositories - samples/dsccode.git/blob - src/FLUIDE/fluide.f
Salome HOME
CCAR: small bug
[samples/dsccode.git] / src / FLUIDE / fluide.f
1       subroutine transit(compo,dt0)
2
3       include "calcium.hf"
4       dimension                 tn(7),t(7),rf(7)
5       dimension                 tparoi(7),rparoi(7)
6       dimension                 maille(2),tflu(2,7)
7       double precision dt0
8       integer compo
9
10       dt=4.5*dt0
11
12       r=1.
13       ro=1.
14       rext=0.5
15       te=10.
16       deb=10.
17
18        maille(1)=2
19        maille(2)=7
20
21       ti=0.
22
23       do i=1,7
24       t(i)=100.
25       tn(i)=100.
26       rf(i)=0.5
27       enddo
28 c
29 c  initialisation de temperature fluide a t=0
30 c
31         CALL cpeRE(compo,CP_TEMPS, ti, npas+1, 'tfluide', 6,
32      &            t(2) , info)
33             IF( info.NE. CPOK  )GO TO 9000
34 c
35 c  initialisation de la resistance thermique fluide a t=0
36 c
37         CALL cpeRE(compo,CP_TEMPS, ti, npas+1, 'rfluide', 6,
38      &            rf(2) , info)
39             IF( info.NE. CPOK  )GO TO 9000
40 c
41 c  boucle temporelle jusqu'a 100.
42 c
43       do while( ti.lT.100. )
44       tf=ti+dt
45 c
46 c   lecture de la temperature de paroi entre ti et tf
47 c
48         CALL cplRE(compo,CP_TEMPS,ti, tf, npas+1,'tparoi',  6,
49      &      nval, tparoi(2), info)
50             IF( info.NE. CPOK  )GO TO 9000
51 c
52 c   lecture de la resistance solide de bord entre ti et tf
53 c
54         CALL cplRE(compo,CP_TEMPS,ti, tf, npas+1, 'rparoi', 6,
55      &      nval, rparoi(2), info)
56             IF( info.NE. CPOK  )GO TO 9000
57 c
58 c  calcul de la temperature a tf
59 c
60       do i=2,7
61       smb=ro/dt*tn(i)+deb*t(i-1)+tparoi(i)/(rparoi(i)+rf(i))
62       t(i)=smb/(ro/dt+deb+1./(rparoi(i)+rf(i)))
63       enddo
64
65       write(6,*)'FLUID:temps=',tf,' temperature de sortie canal=',t(7)
66       call flush(6)
67 c
68 c  ecriture de la temperature fluide a tf
69 c
70         CALL cpeRE(compo,CP_TEMPS, tf, npas+1, 'tfluide', 6,
71      &            t(2) , info)
72             IF( info.NE.CPOK )GO TO 9000
73 c
74 c  ecriture de la resistance thermique fluide a tf
75 c
76         CALL cpeRE(compo,CP_TEMPS, tf, npas+1, 'rfluide', 6,
77      &            rf(2) , info)
78             IF( info.NE.CPOK )GO TO 9000
79       do i=1,7
80       tflu(1,i)=t(i)
81       tflu(2,i)=t(i)
82       enddo
83
84       do i=1,7 
85       tn(i)=t(i)
86       enddo
87
88       ti=tf
89
90       enddo
91
92 9000  continue
93             CALL cpfin(compo,CP_ARRET,info)
94       end
95
96       subroutine perma(compo)
97       include "calcium.hf"
98       dimension t(7),rf(7)
99       dimension tparoi(7),rparoi(7)
100       integer compo
101  
102       deb=10.
103  
104       do i=1,7
105       t(i)=100.
106       rf(i)=0.5
107       rparoi(i)=0.5
108       enddo
109 c
110 c  initialisation de temperature fluide a i=0
111 c
112       iter=0
113       iconv=0
114         CALL cpeRE(compo,CP_ITERATION, ti, iter  , 'tfi', 6,
115      &            t(2) , info)
116             IF( info.NE. CPOK  )GO TO 9000
117 c
118 c  boucle temporelle jusqu'a 100.
119 c
120       do while( iconv .EQ. 0)
121 c
122 c   lecture de la temperature de paroi iteration iter
123 c
124         CALL cplRE(compo,CP_ITERATION,ti, tf, iter  , 'tpi', 6,
125      &      nval, tparoi(2), info)
126             IF( info.NE. CPOK  )GO TO 9000
127 c
128 c  calcul de la temperature 
129 c
130       do i=2,7
131       smb=deb*t(i-1)+tparoi(i)/(rparoi(i)+rf(i))
132       t(i)=smb/(deb+1./(rparoi(i)+rf(i)))
133       enddo
134 c
135 c  ecriture de la temperature fluide a iter+1
136 c
137         CALL cpeRE(compo,CP_ITERATION,ti,iter+1, 'tfi', 6,
138      &            t(2) , info)
139             IF( info.NE. CPOK  )GO TO 9000
140  
141       iter=iter+1
142       write(6,*)'iter  = ',iter,' temperature de sortie canal = ',t(7)
143 c
144 c   lecture du flag de convergence iconv
145 c
146         CALL cplEN(compo,CP_ITERATION,ti, tf, iter  , 'iconv', 1,
147      &      nval, iconv  , info)
148       write(6,*)"info:",info
149       write(6,*)"FLUIDE:",iter,iconv
150       call flush(6)
151
152       IF( info.NE. CPOK  )GO TO 9000
153  
154       if(iconv.eq.1)go to 9000
155
156       enddo
157  
158 9000  continue
159             CALL cpfin(compo,CP_ARRET,info)
160       end
161