243
244 class(MethodCellPollockQuadType), intent(inout) :: this
245 type(ParticleType), pointer, intent(inout) :: particle
246 class(SubcellRectType), intent(inout) :: subcell
247
248 real(DP) :: dx, dy, dz, areax, areay, areaz
249 real(DP) :: dxprel, dyprel
250 integer(I4B) :: isc, npolyverts, m1, m2
251 real(DP) :: qextl1, qextl2, qintl1, qintl2
252 real(DP) :: factor, term
253
254 select type (cell => this%cell)
255 type is (cellrectquadtype)
256 factor = done / cell%defn%retfactor
257 factor = factor / cell%defn%porosity
258 npolyverts = cell%defn%npolyverts
259
260 isc = particle%itrdomain(level_subfeature)
261
262
263
264 dx = cell%dx
265 dy = cell%dy
266
267 if (isc .le. 0) then
268 dxprel = particle%x / dx
269 dyprel = particle%y / dy
270
271 if (dyprel .ge. 5d-1) then
272 if (dxprel .le. 5d-1) then
273 isc = 4
274 else
275 isc = 1
276 end if
277 else
278 if (dxprel .le. 5d-1) then
279 isc = 3
280 else
281 isc = 2
282 end if
283 end if
284
285 subcell%isubcell = isc
286 particle%itrdomain(level_subfeature) = isc
287 end if
288 dx = 5d-1 * dx
289 dy = 5d-1 * dy
290 dz = cell%defn%top - &
291 cell%defn%bot
292 areax = dy * dz
293 areay = dx * dz
294 areaz = dx * dy
295 qintl1 = cell%qintl(isc)
296
297 qintl2 = cell%qintl(isc + 1)
298 qextl1 = cell%qextl1(isc)
299 qextl2 = cell%qextl2(isc)
300
301 subcell%dx = dx
302 subcell%dy = dy
303 subcell%dz = dz
304 subcell%sinrot = dzero
305 subcell%cosrot = done
306 subcell%zOrigin = dzero
307 select case (isc)
308 case (1)
309 subcell%xOrigin = dx
310 subcell%yOrigin = dy
311 term = factor / areax
312 subcell%vx1 = qintl1 * term
313 subcell%vx2 = -qextl2 * term
314 term = factor / areay
315 subcell%vy1 = -qintl2 * term
316 subcell%vy2 = -qextl1 * term
317 case (2)
318 subcell%xOrigin = dx
319 subcell%yOrigin = dzero
320 term = factor / areax
321 subcell%vx1 = -qintl2 * term
322 subcell%vx2 = -qextl1 * term
323 term = factor / areay
324 subcell%vy1 = qextl2 * term
325 subcell%vy2 = -qintl1 * term
326 case (3)
327 subcell%xOrigin = dzero
328 subcell%yOrigin = dzero
329 term = factor / areax
330 subcell%vx1 = qextl2 * term
331 subcell%vx2 = -qintl1 * term
332 term = factor / areay
333 subcell%vy1 = qextl1 * term
334 subcell%vy2 = qintl2 * term
335 case (4)
336 subcell%xOrigin = dzero
337 subcell%yOrigin = dy
338 term = factor / areax
339 subcell%vx1 = qextl1 * term
340 subcell%vx2 = qintl2 * term
341 term = factor / areay
342 subcell%vy1 = qintl1 * term
343 subcell%vy2 = -qextl2 * term
344 end select
345 m1 = npolyverts + 2
346 m2 = m1 + 1
347 term = factor / areaz
348 subcell%vz1 = 2.5d-1 * cell%defn%faceflow(m1) * term
349 subcell%vz2 = -2.5d-1 * cell%defn%faceflow(m2) * term
350 end select