68 TYPE(t_region
) :: region
69 INTEGER :: ilev, ibegv, iendv, ibegg, iendg
70 REAL(RFREAL),
POINTER :: var(:,:),
gradi(:,:),
gradj(:,:),gradk(:,:)
73 INTEGER ::
i,
j,
k, l, lx, ly, lz
76 INTEGER :: inbeg, inend, jnbeg, jnend, knbeg, knend
77 INTEGER :: icoff, ijcoff, inoff, ijnoff
78 INTEGER :: ijkc, im1jkc, ijm1kc, ijkm1c, im1jm1kc, im1jkm1c, ijm1km1c
79 INTEGER :: ijkn, im1jkn, ijm1kn, ijkm1n
82 REAL(RFREAL) :: rvol, fnx, fny, fnz, fface(ibegv:iendv)
83 REAL(RFREAL),
POINTER :: aci(:,:), acj(:,:), ack(:,:)
84 REAL(RFREAL),
POINTER :: si(:,:), sj(:,:), sk(:,:), vol(:)
89 'RFLO_CalcGradFaces.F90' )
93 nvar = iendv - ibegv + 1
95 aci => region%levels(ilev)%grid%c2eCoI
96 acj => region%levels(ilev)%grid%c2eCoJ
97 ack => region%levels(ilev)%grid%c2eCoK
98 si => region%levels(ilev)%grid%si
99 sj => region%levels(ilev)%grid%sj
100 sk => region%levels(ilev)%grid%sk
101 vol => region%levels(ilev)%grid%vol
106 jnbeg,jnend,knbeg,knend )
112 gradi(ibegg:iendg,:) = 0.0_rfreal
113 gradj(ibegg:iendg,:) = 0.0_rfreal
114 gradk(ibegg:iendg,:) = 0.0_rfreal
122 ijkc = indijk(
i ,
j ,
k ,icoff,ijcoff)
126 im1jm1kc= im1jkc-icoff
127 im1jkm1c= im1jkc-ijcoff
128 ijm1km1c= ijm1kc-ijcoff
129 ijkn = indijk(
i ,
j ,
k ,inoff,ijnoff)
138 fnx = .5_rfreal*(si(xcoord,ijkn)+si(xcoord,im1jkn))
139 fny = .5_rfreal*(si(ycoord,ijkn)+si(ycoord,im1jkn))
140 fnz = .5_rfreal*(si(zcoord,ijkn)+si(zcoord,im1jkn))
146 gradi(lx,im1jkn) =
gradi(lx,im1jkn) - fnx*var(l,im1jkc)
147 gradi(ly,im1jkn) =
gradi(ly,im1jkn) - fny*var(l,im1jkc)
148 gradi(lz,im1jkn) =
gradi(lz,im1jkn) - fnz*var(l,im1jkc)
150 gradi(lx,ijkn) =
gradi(lx,ijkn) + fnx*var(l,im1jkc)
151 gradi(ly,ijkn) =
gradi(ly,ijkn) + fny*var(l,im1jkc)
152 gradi(lz,ijkn) =
gradi(lz,ijkn) + fnz*var(l,im1jkc)
157 fnx = .5_rfreal*(sj(xcoord,ijkn)+sj(xcoord,im1jkn))
158 fny = .5_rfreal*(sj(ycoord,ijkn)+sj(ycoord,im1jkn))
159 fnz = .5_rfreal*(sj(zcoord,ijkn)+sj(zcoord,im1jkn))
168 fface(l) = ack(1,ijkn)*var(l,im1jm1kc)+ack(2,ijkn)*var(l,ijm1kc)+ &
169 ack(3,ijkn)*var(l,ijkc)+ack(4,ijkn)*var(l,im1jkc)
171 gradi(lx,ijm1kn) =
gradi(lx,ijm1kn) - fnx*fface(l)
172 gradi(ly,ijm1kn) =
gradi(ly,ijm1kn) - fny*fface(l)
173 gradi(lz,ijm1kn) =
gradi(lz,ijm1kn) - fnz*fface(l)
175 gradi(lx,ijkn) =
gradi(lx,ijkn) + fnx*fface(l)
176 gradi(ly,ijkn) =
gradi(ly,ijkn) + fny*fface(l)
177 gradi(lz,ijkn) =
gradi(lz,ijkn) + fnz*fface(l)
182 fnx = .5_rfreal*(sk(xcoord,im1jkn)+sk(xcoord,ijkn))
183 fny = .5_rfreal*(sk(ycoord,im1jkn)+sk(ycoord,ijkn))
184 fnz = .5_rfreal*(sk(zcoord,im1jkn)+sk(zcoord,ijkn))
193 fface(l) = acj(1,ijkn)*var(l,im1jkm1c)+acj(2,ijkn)*var(l,im1jkc)+ &
194 acj(3,ijkn)*var(l,ijkc)+acj(4,ijkn)*var(l,ijkm1c)
196 gradi(lx,ijkm1n) =
gradi(lx,ijkm1n) - fnx*fface(l)
197 gradi(ly,ijkm1n) =
gradi(ly,ijkm1n) - fny*fface(l)
198 gradi(lz,ijkm1n) =
gradi(lz,ijkm1n) - fnz*fface(l)
200 gradi(lx,ijkn) =
gradi(lx,ijkn) + fnx*fface(l)
201 gradi(ly,ijkn) =
gradi(ly,ijkn) + fny*fface(l)
202 gradi(lz,ijkn) =
gradi(lz,ijkn) + fnz*fface(l)
209 fnx = .5_rfreal*(sj(xcoord,ijkn)+sj(xcoord,ijm1kn))
210 fny = .5_rfreal*(sj(ycoord,ijkn)+sj(ycoord,ijm1kn))
211 fnz = .5_rfreal*(sj(zcoord,ijkn)+sj(zcoord,ijm1kn))
217 gradj(lx,ijm1kn) =
gradj(lx,ijm1kn) - fnx*var(l,ijm1kc)
218 gradj(ly,ijm1kn) =
gradj(ly,ijm1kn) - fny*var(l,ijm1kc)
219 gradj(lz,ijm1kn) =
gradj(lz,ijm1kn) - fnz*var(l,ijm1kc)
221 gradj(lx,ijkn) =
gradj(lx,ijkn) + fnx*var(l,ijm1kc)
222 gradj(ly,ijkn) =
gradj(ly,ijkn) + fny*var(l,ijm1kc)
223 gradj(lz,ijkn) =
gradj(lz,ijkn) + fnz*var(l,ijm1kc)
228 fnx = .5_rfreal*(si(xcoord,ijkn)+si(xcoord,ijm1kn))
229 fny = .5_rfreal*(si(ycoord,ijkn)+si(ycoord,ijm1kn))
230 fnz = .5_rfreal*(si(zcoord,ijkn)+si(zcoord,ijm1kn))
239 fface(l) = ack(1,ijkn)*var(l,im1jm1kc)+ack(2,ijkn)*var(l,ijm1kc)+ &
240 ack(3,ijkn)*var(l,ijkc)+ack(4,ijkn)*var(l,im1jkc)
242 gradj(lx,im1jkn) =
gradj(lx,im1jkn) - fnx*fface(l)
243 gradj(ly,im1jkn) =
gradj(ly,im1jkn) - fny*fface(l)
244 gradj(lz,im1jkn) =
gradj(lz,im1jkn) - fnz*fface(l)
246 gradj(lx,ijkn) =
gradj(lx,ijkn) + fnx*fface(l)
247 gradj(ly,ijkn) =
gradj(ly,ijkn) + fny*fface(l)
248 gradj(lz,ijkn) =
gradj(lz,ijkn) + fnz*fface(l)
253 fnx = .5_rfreal*(sk(xcoord,ijm1kn)+sk(xcoord,ijkn))
254 fny = .5_rfreal*(sk(ycoord,ijm1kn)+sk(ycoord,ijkn))
255 fnz = .5_rfreal*(sk(zcoord,ijm1kn)+sk(zcoord,ijkn))
264 fface(l) = aci(1,ijkn)*var(l,ijm1km1c)+aci(2,ijkn)*var(l,ijkm1c)+ &
265 aci(3,ijkn)*var(l,ijkc)+aci(4,ijkn)*var(l,ijm1kc)
267 gradj(lx,ijkm1n) =
gradj(lx,ijkm1n) - fnx*fface(l)
268 gradj(ly,ijkm1n) =
gradj(ly,ijkm1n) - fny*fface(l)
269 gradj(lz,ijkm1n) =
gradj(lz,ijkm1n) - fnz*fface(l)
271 gradj(lx,ijkn) =
gradj(lx,ijkn) + fnx*fface(l)
272 gradj(ly,ijkn) =
gradj(ly,ijkn) + fny*fface(l)
273 gradj(lz,ijkn) =
gradj(lz,ijkn) + fnz*fface(l)
280 fnx = .5_rfreal*(sk(xcoord,ijkn)+sk(xcoord,ijkm1n))
281 fny = .5_rfreal*(sk(ycoord,ijkn)+sk(ycoord,ijkm1n))
282 fnz = .5_rfreal*(sk(zcoord,ijkn)+sk(zcoord,ijkm1n))
288 gradk(lx,ijkm1n) = gradk(lx,ijkm1n) - fnx*var(l,ijkm1c)
289 gradk(ly,ijkm1n) = gradk(ly,ijkm1n) - fny*var(l,ijkm1c)
290 gradk(lz,ijkm1n) = gradk(lz,ijkm1n) - fnz*var(l,ijkm1c)
292 gradk(lx,ijkn) = gradk(lx,ijkn) + fnx*var(l,ijkm1c)
293 gradk(ly,ijkn) = gradk(ly,ijkn) + fny*var(l,ijkm1c)
294 gradk(lz,ijkn) = gradk(lz,ijkn) + fnz*var(l,ijkm1c)
299 fnx = .5_rfreal*(sj(xcoord,ijkn)+sj(xcoord,ijkm1n))
300 fny = .5_rfreal*(sj(ycoord,ijkn)+sj(ycoord,ijkm1n))
301 fnz = .5_rfreal*(sj(zcoord,ijkn)+sj(zcoord,ijkm1n))
310 fface(l) = aci(1,ijkn)*var(l,ijm1km1c)+aci(2,ijkn)*var(l,ijkm1c)+ &
311 aci(3,ijkn)*var(l,ijkc)+aci(4,ijkn)*var(l,ijm1kc)
313 gradk(lx,ijm1kn) = gradk(lx,ijm1kn) - fnx*fface(l)
314 gradk(ly,ijm1kn) = gradk(ly,ijm1kn) - fny*fface(l)
315 gradk(lz,ijm1kn) = gradk(lz,ijm1kn) - fnz*fface(l)
317 gradk(lx,ijkn) = gradk(lx,ijkn) + fnx*fface(l)
318 gradk(ly,ijkn) = gradk(ly,ijkn) + fny*fface(l)
319 gradk(lz,ijkn) = gradk(lz,ijkn) + fnz*fface(l)
324 fnx = .5_rfreal*(si(xcoord,ijkm1n)+si(xcoord,ijkn))
325 fny = .5_rfreal*(si(ycoord,ijkm1n)+si(ycoord,ijkn))
326 fnz = .5_rfreal*(si(zcoord,ijkm1n)+si(zcoord,ijkn))
335 fface(l) = acj(1,ijkn)*var(l,im1jkm1c)+acj(2,ijkn)*var(l,im1jkc)+ &
336 acj(3,ijkn)*var(l,ijkc)+acj(4,ijkn)*var(l,ijkm1c)
338 gradk(lx,im1jkn) = gradk(lx,im1jkn) - fnx*fface(l)
339 gradk(ly,im1jkn) = gradk(ly,im1jkn) - fny*fface(l)
340 gradk(lz,im1jkn) = gradk(lz,im1jkn) - fnz*fface(l)
342 gradk(lx,ijkn) = gradk(lx,ijkn) + fnx*fface(l)
343 gradk(ly,ijkn) = gradk(ly,ijkn) + fny*fface(l)
344 gradk(lz,ijkn) = gradk(lz,ijkn) + fnz*fface(l)
357 ijkc = indijk(
i ,
j ,
k ,icoff,ijcoff)
361 ijkn = indijk(
i ,
j ,
k ,inoff,ijnoff)
363 rvol = 2.0_rfreal/(vol(im1jkc)+vol(ijkc))
368 rvol = 2.0_rfreal/(vol(ijm1kc)+vol(ijkc))
373 rvol = 2.0_rfreal/(vol(ijkm1c)+vol(ijkc))
375 gradk(l,ijkn) = gradk(l,ijkn)*rvol
418 ijkn = indijk(
i ,jnbeg ,
k,inoff,ijnoff)
421 ijkn = indijk(
i ,jnend ,
k,inoff,ijnoff)
426 ijkn = indijk(
i ,
j,knbeg ,inoff,ijnoff)
428 gradk(:,ijkn)=gradk(:,ijkn1)
429 ijkn = indijk(
i ,
j,knend ,inoff,ijnoff)
431 gradk(:,ijkn)=gradk(:,ijkn1)
438 ijkn = indijk(inbeg ,
j ,
k,inoff,ijnoff)
441 ijkn = indijk(inend ,
j ,
k,inoff,ijnoff)
446 ijkn = indijk(
i,
j ,knbeg ,inoff,ijnoff)
448 gradk(:,ijkn)=gradk(:,ijkn1)
449 ijkn = indijk(
i,
j ,knend ,inoff,ijnoff)
451 gradk(:,ijkn)=gradk(:,ijkn1)
458 ijkn = indijk(
i,jnbeg ,
k ,inoff,ijnoff)
461 ijkn = indijk(
i,jnend ,
k ,inoff,ijnoff)
466 ijkn = indijk(inbeg ,
j,
k ,inoff,ijnoff)
469 ijkn = indijk(inend ,
j,
k ,inoff,ijnoff)
subroutine registerfunction(global, funName, fileName)
subroutine rflo_getnodeoffset(region, iLev, iNodeOffset, ijNodeOffset)
subroutine rflo_copyedgegrad
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE iEndG gradi(:,:)
subroutine rflo_getdimensphysnodes(region, iLev, ipnbeg, ipnend, jpnbeg, jpnend, kpnbeg, kpnend)
subroutine deregisterfunction(global)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE iEndG gradj(:,:)
subroutine rflo_calcgradfaces(region, ilev, iBegV, iEndV, iBegG, iEndG, var, gradi, gradj, gradk)