81 TYPE(t_region
),
DIMENSION(:),
POINTER :: regions
87 CHARACTER(CHRLEN) :: rcsidentstring
88 INTEGER :: errorflag,
ic,ie,ipatch,ireg,it,iv,ivg,niter,patchcheckcounter, &
90 REAL(RFREAL) :: nx,ny,nz,sfact,
term,x1,x2,y1,y2,z1,z2
91 REAL(RFREAL) :: ddisp(xcoord:zcoord)
92 REAL(RFREAL),
DIMENSION(:,:),
POINTER :: pdisp,prhs,pxyz
94 TYPE(t_grid),
POINTER :: pgrid,pgridold
95 TYPE(t_patch),
POINTER :: ppatch
96 TYPE(t_region
),
POINTER :: pregion
102 rcsidentstring =
'$RCSfile: RFLU_MoveGridDisp.F90,v $ $Revision: 1.11 $'
104 global => regions(1)%global
107 'RFLU_MoveGridDisp.F90')
109 IF ( global%myProcid == masterproc .AND. &
110 global%verbLevel /= verbose_low )
THEN
111 WRITE(stdout,
'(A,1X,A)') solver_name, &
112 'Moving grid based on displacements...'
119 niter = regions(1)%mixtInput%moveGridNIter
120 sfact = regions(1)%mixtInput%moveGridSFact
131 DO ireg = 1,global%nRegionsLocal
132 pgrid => regions(ireg)%grid
133 pgridold => regions(ireg)%gridOld
135 DO ic = 1,pgrid%nCellsTot
136 pgridold%vol(
ic) = pgrid%vol(
ic)
139 DO iv = 1,pgrid%nVertTot
140 pgridold%xyz(xcoord,iv) = pgrid%xyz(xcoord,iv)
141 pgridold%xyz(ycoord,iv) = pgrid%xyz(ycoord,iv)
142 pgridold%xyz(zcoord,iv) = pgrid%xyz(zcoord,iv)
150 IF ( niter > 0 )
THEN
151 DO ireg = 1,global%nRegionsLocal
152 pgrid => regions(ireg)%grid
154 ALLOCATE(pgrid%gmEdgeWght(pgrid%nEdgesTot),stat=errorflag)
155 global%error = errorflag
156 IF ( global%error /= err_none )
THEN
157 CALL
errorstop(global,err_allocate,__line__,
'pGrid%gmEdgeWght')
160 ALLOCATE(pgrid%gmVertWght(pgrid%nVertTot),stat=errorflag)
161 global%error = errorflag
162 IF ( global%error /= err_none )
THEN
163 CALL
errorstop(global,err_allocate,__line__,
'pGrid%gmVertWght')
167 DO ireg = 1,global%nRegionsLocal
168 pgrid => regions(ireg)%grid
170 DO iv = 1,pgrid%nVertTot
171 pgrid%gmVertWght(iv) = 0.0_rfreal
174 DO ie = 1,pgrid%nEdgesTot
178 x1 = pgrid%xyz(xcoord,v1)
179 y1 = pgrid%xyz(ycoord,v1)
180 z1 = pgrid%xyz(zcoord,v1)
182 x2 = pgrid%xyz(xcoord,v2)
183 y2 = pgrid%xyz(ycoord,v2)
184 z2 = pgrid%xyz(zcoord,v2)
186 term = 1.0_rfreal/
sqrt((x2 - x1)**2 + (y2 - y1)**2 + (z2 - z1)**2)
188 pgrid%gmEdgeWght(ie) =
term
190 pgrid%gmVertWght(v1) = pgrid%gmVertWght(v1) +
term
191 pgrid%gmVertWght(v2) = pgrid%gmVertWght(v2) +
term
202 DO ireg = 1,global%nRegionsLocal
203 pgrid => regions(ireg)%grid
206 DO iv = 1,pgrid%nVertTot
207 pdisp(xcoord,iv) = 0.0_rfreal
208 pdisp(ycoord,iv) = 0.0_rfreal
209 pdisp(zcoord,iv) = 0.0_rfreal
212 DO ipatch = 1,pgrid%nPatches
213 ppatch => regions(ireg)%patches(ipatch)
215 IF ( ppatch%movePatchDir /= movepatch_dir_none )
THEN
216 DO iv = 1,ppatch%nBVert
219 pdisp(xcoord,ivg) = ppatch%dXyz(xcoord,iv)
220 pdisp(ycoord,ivg) = ppatch%dXyz(ycoord,iv)
221 pdisp(zcoord,ivg) = ppatch%dXyz(zcoord,iv)
237 DO ireg = 1,global%nRegionsLocal
238 pgrid => regions(ireg)%grid
242 DO iv = 1,pgrid%nVert
243 prhs(xcoord,iv) = 0.0_rfreal
244 prhs(ycoord,iv) = 0.0_rfreal
245 prhs(zcoord,iv) = 0.0_rfreal
254 DO ipatch = 1,pgrid%nPatches
255 ppatch => regions(ireg)%patches(ipatch)
257 IF ( ppatch%movePatchDir /= movepatch_dir_none )
THEN
258 DO iv = 1,ppatch%nBVert
261 pdisp(xcoord,ivg) = ppatch%dXyz(xcoord,iv)
262 pdisp(ycoord,ivg) = ppatch%dXyz(ycoord,iv)
263 pdisp(zcoord,ivg) = ppatch%dXyz(zcoord,iv)
274 DO ie = 1,pgrid%nEdges
278 term = sfact*pgrid%gmEdgeWght(ie)/(
REAL(pGrid%e2rDegr(ie),kind=rfreal))
280 ddisp(xcoord) =
term*(pdisp(xcoord,v2) - pdisp(xcoord,v1))
281 ddisp(ycoord) =
term*(pdisp(ycoord,v2) - pdisp(ycoord,v1))
282 ddisp(zcoord) =
term*(pdisp(zcoord,v2) - pdisp(zcoord,v1))
284 prhs(xcoord,v1) = prhs(xcoord,v1) + ddisp(xcoord)
285 prhs(ycoord,v1) = prhs(ycoord,v1) + ddisp(ycoord)
286 prhs(zcoord,v1) = prhs(zcoord,v1) + ddisp(zcoord)
288 prhs(xcoord,v2) = prhs(xcoord,v2) - ddisp(xcoord)
289 prhs(ycoord,v2) = prhs(ycoord,v2) - ddisp(ycoord)
290 prhs(zcoord,v2) = prhs(zcoord,v2) - ddisp(zcoord)
297 patchcheckcounter = 0
301 DO ipatch = 1,pgrid%nPatches
302 ppatch => regions(ireg)%patches(ipatch)
304 IF ( ppatch%movePatchDir /= movepatch_dir_none )
THEN
305 patchcheckcounter = patchcheckcounter + 1
307 DO iv = 1,ppatch%nBVert
310 prhs(xcoord,ivg) = 0.0_rfreal
311 prhs(ycoord,ivg) = 0.0_rfreal
312 prhs(zcoord,ivg) = 0.0_rfreal
319 DO ipatch = 1,pgrid%nPatches
320 ppatch => regions(ireg)%patches(ipatch)
322 IF ( ppatch%movePatchDir == movepatch_dir_none )
THEN
323 patchcheckcounter = patchcheckcounter + 1
325 SELECT CASE ( ppatch%moveBcType )
329 CASE ( movegrid_bctype_neumann )
330 DO iv = 1,ppatch%nBVert
333 nx = ppatch%bvn(xcoord,iv)
334 ny = ppatch%bvn(ycoord,iv)
335 nz = ppatch%bvn(zcoord,iv)
337 term = prhs(xcoord,ivg)*nx &
338 + prhs(ycoord,ivg)*ny &
339 + prhs(zcoord,ivg)*nz
341 prhs(xcoord,ivg) = prhs(xcoord,ivg) -
term*nx
342 prhs(ycoord,ivg) = prhs(ycoord,ivg) -
term*ny
343 prhs(zcoord,ivg) = prhs(zcoord,ivg) -
term*nz
348 CASE ( movegrid_bctype_dirichx, &
349 movegrid_bctype_dirichy, &
350 movegrid_bctype_dirichz )
351 DO iv = 1,ppatch%nBVert
354 prhs(ppatch%moveBcType,ivg) = 0.0_rfreal
359 CASE ( movegrid_bctype_none )
360 IF ( ppatch%smoothGrid .EQV. .false. )
THEN
361 DO iv = 1,ppatch%nBVert
364 prhs(xcoord,ivg) = 0.0_rfreal
365 prhs(ycoord,ivg) = 0.0_rfreal
366 prhs(zcoord,ivg) = 0.0_rfreal
369 CALL
errorstop(global,err_reached_default,__line__)
373 CALL
errorstop(global,err_reached_default,__line__)
386 IF ( patchcheckcounter /= pgrid%nPatches )
THEN
387 CALL
errorstop(global,err_movepatch_bc_notset,__line__)
398 DO ireg = 1,global%nRegionsLocal
399 pgrid => regions(ireg)%grid
403 DO iv = 1,pgrid%nVertTot
404 term = 1.0_rfreal/
REAL(pGrid%gmVertWght(iv),RFREAL)
406 pdisp(xcoord,iv) = pdisp(xcoord,iv) +
term*prhs(xcoord,iv)
407 pdisp(ycoord,iv) = pdisp(ycoord,iv) +
term*prhs(ycoord,iv)
408 pdisp(zcoord,iv) = pdisp(zcoord,iv) +
term*prhs(zcoord,iv)
421 IF ( niter > 0 )
THEN
422 DO ireg = 1,global%nRegionsLocal
423 pgrid => regions(ireg)%grid
427 DO iv = 1,pgrid%nVertTot
428 pxyz(xcoord,iv) = pxyz(xcoord,iv) + pdisp(xcoord,iv)
429 pxyz(ycoord,iv) = pxyz(ycoord,iv) + pdisp(ycoord,iv)
430 pxyz(zcoord,iv) = pxyz(zcoord,iv) + pdisp(zcoord,iv)
439 IF ( niter > 0 )
THEN
440 DO ireg = 1,global%nRegionsLocal
441 pgrid => regions(ireg)%grid
443 DEALLOCATE(pgrid%gmEdgeWght,stat=errorflag)
444 global%error = errorflag
445 IF ( global%error /= err_none )
THEN
446 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%gmEdgeWght')
449 DEALLOCATE(pgrid%gmVertWght,stat=errorflag)
450 global%error = errorflag
451 IF ( global%error /= err_none )
THEN
452 CALL
errorstop(global,err_deallocate,__line__,
'pGrid%gmVertWght')
461 IF ( global%myProcid == masterproc .AND. &
462 global%verbLevel /= verbose_low )
THEN
463 WRITE(stdout,
'(A,1X,A)') solver_name, &
464 'Moving grid based on displacements done.'
subroutine rflu_movegriddisp(regions)
subroutine registerfunction(global, funName, fileName)
**********************************************************************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 ic
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)