Bonjour
dans mon code j'essaye de changer les condition aux limites pour la simulation d'ecoulement dans un canal mais malheureusement je trouve ce message d'erreur:
ecochancavM.for:263.8:

g(2,0,j)-geq(2,0,j)=g(4,0,j)-geq(4,0,j)
1
Error: Unclassifiable statement at (1)
ecochancavM.for:278.8:

g(2,i,m)-geq(2,i,m)=g(4,i,m)-geq(4,i,m)
1
Error: Unclassifiable statement at (1)
ci joint le code que j'utilise. merci bien pour vos aide et vos temps precieux. je compte beaucoup sur vos soutien.
merci.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
 
! ce programme tend a calculer les isothermes et les temp à differentes valeurs de i
 
        ! declaration de variables
 
        parameter (n=1000,m=40)
	real f(0:8,0:n,0:m)
	real feq(0:8,0:n,0:m),rho(0:n,0:m)
	real w(0:8), cx(0:8),cy(0:8)
	real u(0:n,0:m), v(0:n,0:m)
	real g(0:8,0:n,0:m), geq(0:8,0:n,0:m),th(0:n,0:m)
	integer i,j,k,kk
        character Saida*2910
 
        ! opening files
 
        Saida='results/vit50.dat'
	open(12,file=Saida)
        Saida='results/vit20.dat'
	open(13,file=Saida)
        Saida='results/temp50.dat'
	open(14,file=Saida)
        Saida='results/ligcour.dat'
        open(15,file=Saida)
        Saida='results/temp20.dat'
	open(16,file=Saida)
 
	!initialisations de variables
 
	cx(:)=(/0.0,1.0,0.0,-1.0,0.0,1.0,-1.0,-1.0,1.0/)
	cy(:)=(/0.0,0.0,1.0,0.0,-1.0,1.0,1.0,-1.0,-1.0/)
	w(:)=(/4./9.,1./9.,1./9.,1./9.,1./9.,1./36.,1./36.,1./36.,1./36./)
	uo=0.2
	!sumvelo=0.0
	rhoo=5.00
	dx=1.0
	dy=dx
	dt=1.0
	tw=1.0
	th=0.0
	g=0.0
	visco=0.02
 
	pr=0.71
	alpha=visco/pr
	Re=uo*m/alpha
	print *, 'Re=', Re
	omega=1.0/(3.*visco+0.5)
	omegat=1.0/(3.*alpha+0.5)
	mstep=20
	do j=0,m
	do i=0,n
	rho(i,j)=rhoo !! l'initialisation de rho se fait par la valeur rhoo egal 5 au lieu de 0?????? 
	u(i,j)=0.0
	v(i,j)=0.0
	end do
	end do
	do i=1,n-1
	u(i,m)=uo
	v(i,m)=0.0
	end do
	! main loop
 
!/////////////////programme principale//////////////////////////
 
	do kk=1,mstep
	call collesion(u,v,f,feq,rho,omega,w,cx,cy,n,m)
	call streaming(f,n,m)
	call sfbound(f,n,m,uo)
	call rhouv(f,rho,u,v,cx,cy,n,m)
 
	! collestion for scalar
	call collt(u,v,g,geq,th,omegat,w,cx,cy,n,m)
	! streaming for scalar
	call streaming(g,n,m)!!!!!!!!!!!! n'existe pas
	call gbound(g,geq,tw,w,n,m)
	call  tcalcu(g,th,n,m)
        END DO
	! end of the main loop
 
	call result(u,v,rho,th,uo,n,m)
	stop
	end
	! end of the main program
 
!/////////////////////les subroutines////////////////////////////
 
	!////////////collision////////////////
 
        subroutine collesion(u,v,f,feq,rho,omega,w,cx,cy,n,m)
	real f(0:8,0:n,0:m)
	real feq(0:8,0:n,0:m),rho(0:n,0:m)
	real w(0:8), cx(0:8),cy(0:8)
	real u(0:n,0:m), v(0:n,0:m)
	DO i=0,n
	DO j=0,m
	t1=(u(i,j)*u(i,j))+(v(i,j)*v(i,j))
	DO k=0,8
	t2=(u(i,j)*cx(k))+(v(i,j)*cy(k))
	feq(k,i,j)=rho(i,j)*w(k)*(1.0+3.0*t2+4.50*t2*t2-1.50*t1)
	f(k,i,j)=omega*feq(k,i,j)+(1.-omega)*f(k,i,j)
	END DO
	END DO
	END DO
	return
	end
 
        !///////////////////collt////////////////
 
	subroutine collt(u,v,g,geq,th,omegat,w,cx,cy,n,m)
	real g(0:8,0:n,0:m),geq(0:8,0:n,0:m),th(0:n,0:m)
	real w(0:8),cx(0:8),cy(0:8)
	real u(0:n,0:m),v(0:n,0:m)
	do i=0,n
	do j=0,m
	do k=0,8
	geq(k,i,j)=th(i,j)*w(k)*(1.0+3.0*(u(i,j)*cx(k)+v(i,j)*cy(k)))
	g(k,i,j)=omegat*geq(k,i,j)+(1.0-omegat)*g(k,i,j)
	!print*, g(k,i,j)
        end do
	end do
	end do
	return
	end
 
        !///////////////////propagation///////////////
 
	subroutine streaming(f,n,m)
 
	 real f(0:8,0:n,0:m)
 
	  do j=0,m
	  do i=n,1,-1
	  f(1,i,j)=f(1,i-1,j)
	  end do
	  do i=0,n-1
          f(3,i,j)=f(3,i+1,j)
	  end do
	  end do
 
	   do j=m,1,-1
	   do i=0,n
	   f(2,i,j)=f(2,i,j-1)
	   end do
	   do i=n,1,-1
	    f(5,i,j)=f(5,i-1,j-1)
	   end do
	   do i=0,n-1
	    f(6,i,j)=f(6,i+1,j-1)
	    end do
	    end do
 
	     do j=0,m-1
	     do i=0,n
	      f(4,i,j)=f(4,i,j+1)
	      end do
	      do i=0,n-1
	      f(7,i,j)=f(7,i+1,j+1)
	      end do
	     do i=n,1,-1
	      f(8,i,j)=f(8,i-1,j+1)
	      end do
	      end do
 
	     return
	     end
 
        !//////////////conditions aux limites////////////////
         subroutine sfbound(f,n,m,uo)
 
	 real f(0:8,0:n,0:m)
 
	 do j=0,m
	!bounce back on west boundary!
	  rhow=(f(0,0,j)+f(2,0,j)+f(4,0,j)
     & +2.*(f(3,0,j)+f(6,0,j)+f(7,0,j)))/(1.-uo)
	  f(1,0,j)=f(3,0,j)+ 2.*rhow*uo/3.
	  f(5,0,j)=f(7,0,j)+rhow*uo/6.
	  f(8,0,j)=f(6,0,j)+rhow*uo/6.
 
	 end do
 
	!bounce back on south boundary!
	 do i=0,n
	   f(2,i,0)=f(4,i,0)
	   f(5,i,0)=f(7,i,0)
	   f(6,i,0)=f(8,i,0)
	 end do
 
	!bounce back, north boundary
	 do i=0,n
	   f(4,i,m)=f(2,i,m)
	   f(8,i,m)=f(6,i,m)
	   f(7,i,m)=f(5,i,m)
	 end do
 
	 ! accont for open boundary condition at the outlet
	  do j=0,m
	    f(1,n,j)=2.*f(1,n-1,j)-f(1,n-2,j)
	    f(5,n,j)=2.*f(5,n-1,j)-f(5,n-2,j)
	    f(8,n,j)=2.*f(8,n-1,j)-f(8,n-2,j)
           end do 
 
	   return
	   end
	!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
       subroutine rhouv(f,rho,u,v,cx,cy,n,m)
 
	 real f(0:8,0:n,0:m),rho(0:n,0:m)
	 real u(0:n,0:m),v(0:n,0:m)
	 real cx(0:8),cy(0:8)
 
	  do j=0,m
	  do i=0,n
	  ssum=0.0
	  do k=0,8
	  ssum=ssum+f(k,i,j)
	  end do
	  rho(i,j)=ssum
	   end do
	   end do
 
	    do i=1,n
	    rho(i,m)=f(0,i,m)+f(1,i,m)+f(3,i,m)+
     & 2.*(f(2,i,m)+f(6,i,m)+f(5,i,m))
	 end do
 
	      do i=1,n
	      do j=1,m
	      usum=0.0
	      vsum=0.0
	      do k=0,8
	      usum=usum+f(k,i,j)*cx(k)
	      vsum=vsum+f(k,i,j)*cy(k)
	      end do
	       u(i,j)=usum/rho(i,j)
	       v(i,j)=vsum/rho(i,j)
	       end do
	       end do
 
	      do j=1,m
	      v(n,j)=0.0
	      end do
              do i=1,n
               u(i,m)=0.0
               u(i,0)=0.0
               end do
	      return
	      end
 
       !/////////// cond aux limites sur g/////////////
 
	subroutine gbound(g,geq,tw,w,n,m)
	real g(0:8,0:n,0:m),geq(0:8,0:n,0:m)
	real w(0:8)
	! Boundary conditions
	! West boundary condition, T=1.
	do j=0,m
	g(1,0,j)=tw*(w(1)+w(3))-g(3,0,j)
	g(5,0,j)=tw*(w(5)+w(7))-g(7,0,j)
	g(8,0,j)=tw*(w(8)+w(6))-g(6,0,j)
        g(2,0,j)-geq(2,0,j)=g(4,0,j)-geq(4,0,j) 
	end do
	! East boundary condition, T=0.
	do j=0,m
	g(1,n,j)=2*g(1,n-1,j)-g(1,n-2,j)
	g(5,n,j)=2*g(5,n-1,j)-g(5,n-2,j)
	g(8,n,j)=2*g(8,n-1,j)-g(8,n-2,j)
 
	end do
	! Top boundary conditions, 
	do i=0,n
	g(8,i,m)=-g(6,i,m)
	g(7,i,m)=-g(5,i,m)
	g(4,i,m)=-g(2,i,m)
	g(1,i,m)=-g(3,i,m)
        g(2,i,m)-geq(2,i,m)=g(4,i,m)-geq(4,i,m)
	end do
	!Bottom boundary conditions, 
 
	do i=0,n
 
	g(2,i,0)=-g(2,i,1)
	g(1,i,0)=-g(3,i,1)
	g(5,i,0)=-g(5,i,1)
	g(6,i,0)=-g(6,i,1)
 
	end do
	return
	end
 
!/////////calcul de la temperature///////////
 
	subroutine tcalcu(g,th,n,m)
	real g(0:8,0:n,0:m),th(0:n,0:m)
	do j=1,m-1
	do i=1,n-1
	ssumt=0.0
	do k=0,8
	ssumt=ssumt+g(k,i,j)
	end do
	th(i,j)=ssumt
	end do
	end do
	return
	end
 
 
 
!////////////////calcul de lignes de courant et de resultat/////////////////
 
	subroutine result(u,v,rho,th,uo,n,m)
	real u(0:n,0:m),v(0:n,0:m),th(0:n,0:m)
	real rho(0:n,0:m),strf(0:n,0:m)
 
	! streamfunction calculations
	strf(0,0)=0.
	do i=0,n
	rhoav=0.5*(rho(i-1,0)+rho(i,0))
	if(i.ne.0) strf(i,0)=strf(i-1,0)-rhoav*0.5*(v(i-1,0)+v(i,0))
	do j=1,m
	rhom=0.5*(rho(i,j)+rho(i,j-1))
	strf(i,j)=strf(i,j-1)+rhom*0.5*(u(i,j-1)+u(i,j))
	end do
	end do
 
       ! enregistrement de resultat	
 
        !
        do j=0,m
	write(12,*)j/float(m),u(int(n/2),j)/uo
	print*, u(int(n/2),j)/uo
        end do
 
 
        do j=0,m
	write(13,*)j/float(m),u(int(n/5),j)/uo
        end do
 
        do j=0,m
 
        write(14,*)j/float(m),th(int(n/2),j)
	print*,th(int(n/2),j)
        end do
 
 
	do j=0,m
        do i=0,n
	write(15,*)i,j,strf(i,j)
	end do
        end do
 
        do j=0,m
        write(16,*)j/float(m),th(n/5,j)
	end do
 
 
 
	return
	end