00001 module model
00002
00003
00004
00005 use global
00006
00007 use myFunctions
00008
00009 implicit none
00010
00011
00012 contains
00013
00014
00015 function discrete(a)
00016
00017
00018 real(8) discrete(globalCurrentSetLength)
00019
00020 integer i,j,t
00021
00022 integer a
00023
00024 integer myI,myJ,myT,myBC,myUnk
00025
00026 integer myP,myD
00027
00028 integer,pointer :: IM(:,:,:,:)
00029
00030 integer,pointer :: IM2(:,:,:,:)
00031
00032 integer,pointer :: maxI,maxJ,maxT
00033
00034 integer,pointer :: iVec(:),jVec(:),bcVec(:),tVec(:)
00035
00036 integer,pointer :: endIndex(:)
00037
00038 integer modelPhysics
00039 integer modelDomain
00040
00041 real(8), allocatable :: RHS(:)
00042
00043 integer,pointer :: dof
00044
00045 integer,pointer :: nx,ny
00046
00047
00048
00049
00050
00051
00052 real(8) STFc,STFw,STFe,STFs,STFn,stfcpto
00053 real(8) VORc,VORw,VORe,VORs,VORn,vorcpto
00054
00055 real(8) VORCOREAL
00056
00057 real(8) dSTFdX,dSTFdY
00058 real(8) dVORdX,dVORdY
00059 real(8) d2STFdX2,d2STFdY2
00060 real(8) d2VORdX2,d2VORdY2
00061
00062 real(8) dvordtau,dstfdtau
00063
00064
00065 real(8) UdVORdX,VdVORdY
00066
00067
00068
00069
00070 real(8) upu,upv
00071
00072 real(8) myU,myV
00073
00074
00075
00076 real(8) sourceT
00077 real(8) sourceU
00078
00079 real(8),pointer :: lambda
00080
00081 real(8) dx,dy
00082
00083 real(8),pointer :: myLx,myLy
00084
00085 real(8),pointer :: Re
00086
00087
00088
00089
00090
00091 do i=1,a
00092 discreteY=>tempy
00093 end do
00094
00095
00096
00097
00098
00099
00100
00101
00102 discrete=0.d0
00103
00104
00105 x=>discreteY
00106
00107 xPTO=>yPTO
00108
00109
00110 discrete=x(setVEc)
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158 modelPhysics=1
00159
00160
00161
00162
00163
00164
00165
00166
00167 lambda=>myModel%physics(modelPhysics)%physicalParameters(1)
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186 dof=>myModel%physics(modelPhysics)%dof
00187
00188
00189
00190
00191 allocate(RHS(dof))
00192 RHS=0.d0
00193
00194
00195
00196
00197
00198 do myP=1,myModel%endIndex(modelPhysics)
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212 modelDomain=1
00213
00214 IM=>myModel%physics(modelPhysics)%domain(modelDomain)%dofMatrix
00215
00216 myLx=>myModel%physics(modelPhysics)%domain(modelDomain)%Lx
00217 myLy=>myModel%physics(modelPhysics)%domain(modelDomain)%Ly
00218
00219 dx=myLx/(myModel%physics(modelPhysics)%domain(modelDomain)%maxI-myModel%physics(modelPhysics)%domain(modelDomain)%minI)
00220 dy=myLy/(myModel%physics(modelPhysics)%domain(modelDomain)%maxJ-myModel%physics(modelPhysics)%domain(modelDomain)%minJ)
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231 do myD=1,myModel%physics(modelPhysics)%endIndex(modelDomain)
00232
00233
00234
00235
00236
00237
00238
00239 myBC=2
00240
00241 maxJ=>myModel%physics(modelPhysics)%domain(modelDomain)%set%bc(myBC)%maxJ
00242 jVec=>myModel%physics(modelPhysics)%domain(modelDomain)%set%bc(myBC)%jVec
00243
00244
00245 do myJ=1,maxJ
00246
00247 j=jVec(myJ)
00248 maxI=>myModel%physics(modelPhysics)%domain(modelDomain)%set%bc(myBC)%j(myJ)%maxI
00249 iVec=>myModel%physics(modelPhysics)%domain(modelDomain)%set%bc(myBC)%j(myJ)%iVec
00250
00251 RHS=0.d0
00252 do myI=1,maxI
00253
00254 i=iVec(myI)
00255
00256 maxT=>myModel%physics(modelPhysics)%domain(modelDomain)%set%bc(myBC)%j(myJ)%i(myI)%maxT
00257 tVec=>myModel%physics(modelPhysics)%domain(modelDomain)%set%bc(myBC)%j(myJ)%i(myI)%tVec
00258 endIndex=>myModel%physics(modelPhysics)%domain(modelDomain)%set%bc(myBC)%j(myJ)%i(myI)%endIndex
00259
00260
00261 t=1
00262 do myT=1,endIndex(t)
00263
00264
00265 STFC=x(IM(i,j,t,absolute))
00266
00267
00268
00269 RHS(t)=STFC-0.d0
00270
00271 end do
00272
00273
00274
00275
00276 do myT=1,maxT
00277
00278 t=tVec(myT)
00279
00280
00281
00282 discrete(IM(i,j,t,relative))=rhs(t)
00283
00284 end do
00285
00286 end do
00287
00288
00289
00290 end do
00291
00292
00293
00294
00295
00296 myBC=1
00297
00298 maxJ=>myModel%physics(modelPhysics)%domain(modelDomain)%set%bc(myBC)%maxJ
00299 jVec=>myModel%physics(modelPhysics)%domain(modelDomain)%set%bc(myBC)%jVec
00300
00301 do myJ=1,maxJ
00302
00303 j=jVec(myJ)
00304 maxI=>myModel%physics(modelPhysics)%domain(modelDomain)%set%bc(myBC)%j(myJ)%maxI
00305 iVec=>myModel%physics(modelPhysics)%domain(modelDomain)%set%bc(myBC)%j(myJ)%iVec
00306
00307 RHS=0.d0
00308 do myI=1,maxI
00309
00310 i=iVec(myI)
00311
00312 maxT=>myModel%physics(modelPhysics)%domain(modelDomain)%set%bc(myBC)%j(myJ)%i(myI)%maxT
00313 tVec=>myModel%physics(modelPhysics)%domain(modelDomain)%set%bc(myBC)%j(myJ)%i(myI)%tVec
00314 endIndex=>myModel%physics(modelPhysics)%domain(modelDomain)%set%bc(myBC)%j(myJ)%i(myI)%endIndex
00315
00316
00317 t=1
00318 do myT=1,endIndex(t)
00319
00320
00321 STFC=x(IM(i,j,t,absolute))
00322 STFW=x(IM(i-1,j,t,absolute))
00323 STFE=x(IM(i+1,j,t,absolute))
00324 STFS=x(IM(i,j-1,t,absolute))
00325 STFN=x(IM(i,j+1,t,absolute))
00326
00327 d2STFdX2=(STFW+STFE-2.d0*STFC)/(dx**2.d0)
00328
00329 d2STFdY2=(STFN+STFS-2.d0*STFC)/(dy**2.d0)
00330
00331 RHS(t)=d2STFdX2+d2STFdY2+lambda*dexp(STFC)
00332
00333
00334
00335
00336
00337 end do
00338
00339
00340
00341
00342 do myT=1,maxT
00343
00344 t=tVec(myT)
00345
00346
00347
00348 discrete(IM(i,j,t,relative))=rhs(t)
00349
00350 end do
00351
00352 end do
00353
00354
00355 end do
00356
00357
00358 end do
00359
00360
00361
00362
00363 end do
00364
00365
00366
00367
00368 deallocate(RHS)
00369
00370
00371
00372
00373
00374
00375
00376 discreteY=>y
00377
00378 end function discrete
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391 end module model