Changeset 75 for palm/trunk/SOURCE/pres.f90
 Timestamp:
 Mar 22, 2007 9:54:05 AM (15 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

palm/trunk/SOURCE/pres.f90
r73 r75 4 4 ! Actual revisions: 5 5 !  6 ! 6 ! Volume flow control for noncyclic boundary conditions added (currently only 7 ! for the north boundary!!), 2nd+3rd argument removed from exchange horiz 7 8 ! 8 9 ! Former revisions: … … 54 55 ALLOCATE( d(nzb:nzt+1,nys1:nyn+1,nxl1:nxr+1) ) 55 56 ENDIF 57 58 ! 59 ! Conserve the volume flow at the outflow in case of noncyclic lateral 60 ! boundary conditions 61 IF ( conserve_volume_flow .AND. bc_ns == 'radiation/dirichlet') THEN 62 63 volume_flow(2) = 0.0 64 volume_flow_l(2) = 0.0 65 66 IF ( nyn == ny ) THEN 67 j = ny+1 68 DO i = nxl, nxr 69 ! 70 ! Sum up the volume flow through the north boundary 71 DO k = nzb_2d(j,i) + 1, nzt 72 volume_flow_l(2) = volume_flow_l(2) + v(k,j,i) * dzu(k) 73 ENDDO 74 ENDDO 75 ENDIF 76 #if defined( __parallel ) 77 CALL MPI_ALLREDUCE( volume_flow_l(2), volume_flow(2), 1, MPI_REAL, & 78 MPI_SUM, comm1dx, ierr ) 79 #else 80 volume_flow = volume_flow_l 81 #endif 82 volume_flow_offset(2) = ( volume_flow_initial(2)  volume_flow(2) ) & 83 / volume_flow_area(2) 84 85 IF ( outflow_n ) THEN 86 j = nyn+1 87 DO i = nxl, nxr 88 DO k = nzb_v_inner(j,i) + 1, nzt 89 v(k,j,i) = v(k,j,i) + volume_flow_offset(2) 90 ENDDO 91 ENDDO 92 ENDIF 93 94 CALL exchange_horiz( v ) 95 96 ENDIF 97 56 98 57 99 ! … … 322 364 ! 323 365 ! Exchange boundaries for p 324 CALL exchange_horiz( tend , 0, 0)366 CALL exchange_horiz( tend ) 325 367 326 368 ELSEIF ( psolver == 'sor' ) THEN … … 365 407 ! Correction of the provisional velocities with the current perturbation 366 408 ! pressure just computed 367 IF ( bc_lr /= 'cyclic' .OR. bc_ns /= 'cyclic' ) uvmean_outflow_l = 0.0368 IF ( conserve_volume_flow) THEN409 IF ( conserve_volume_flow .AND. & 410 ( bc_lr == 'cyclic' .OR. bc_ns == 'cyclic' ) ) THEN 369 411 volume_flow_l(1) = 0.0 370 412 volume_flow_l(2) = 0.0 … … 393 435 394 436 ! 395 ! Sum up the horizontal velocity along the outflow plane (in case396 ! of noncyclic boundary conditions). The respective mean velocity397 ! is calculated from this in routine boundary_conds.398 ! IF ( outflow_l .AND. i == nxl ) THEN399 ! !$OMP CRITICAL400 ! DO k = nzb, nzt+1401 ! uvmean_outflow_l(k) = uvmean_outflow_l(k) + v(k,j,nxl)402 ! ENDDO403 ! !$OMP END CRITICAL404 ! ELSEIF ( outflow_r .AND. i == nxr ) THEN405 ! !$OMP CRITICAL406 ! DO k = nzb, nzt+1407 ! uvmean_outflow_l(k) = uvmean_outflow_l(k) + v(k,j,nxr)408 ! ENDDO409 ! !$OMP END CRITICAL410 ! ELSEIF ( outflow_s .AND. j == nys ) THEN411 ! !$OMP CRITICAL412 ! DO k = nzb, nzt+1413 ! uvmean_outflow_l(k) = uvmean_outflow_l(k) + u(k,nys,i)414 ! ENDDO415 ! !$OMP END CRITICAL416 ! ELSEIF ( outflow_n .AND. j == nyn ) THEN417 ! !$OMP CRITICAL418 ! DO k = nzb, nzt+1419 ! uvmean_outflow_l(k) = uvmean_outflow_l(k) + u(k,nyn,i)420 ! ENDDO421 ! !$OMP END CRITICAL422 ! ENDIF423 424 !425 437 ! Sum up the volume flow through the right and north boundary 426 IF ( conserve_volume_flow .AND. i == nx ) THEN 438 IF ( conserve_volume_flow .AND. bc_lr == 'cyclic' .AND. & 439 i == nx ) THEN 427 440 !$OMP CRITICAL 428 441 DO k = nzb_2d(j,i) + 1, nzt … … 431 444 !$OMP END CRITICAL 432 445 ENDIF 433 IF ( conserve_volume_flow .AND. j == ny ) THEN 446 IF ( conserve_volume_flow .AND. bc_ns == 'cyclic' .AND. & 447 j == ny ) THEN 434 448 !$OMP CRITICAL 435 449 DO k = nzb_2d(j,i) + 1, nzt … … 445 459 ! 446 460 ! Conserve the volume flow 447 IF ( conserve_volume_flow ) THEN 461 IF ( conserve_volume_flow .AND. & 462 ( bc_lr == 'cyclic' .OR. bc_ns == 'cyclic' ) ) THEN 448 463 449 464 #if defined( __parallel ) … … 461 476 DO i = nxl, nxr 462 477 DO j = nys, nyn 463 DO k = nzb_u_inner(j,i) + 1, nzt 464 u(k,j,i) = u(k,j,i) + volume_flow_offset(1) 465 ENDDO 466 DO k = nzb_v_inner(j,i) + 1, nzt 467 v(k,j,i) = v(k,j,i) + volume_flow_offset(2) 468 ENDDO 478 IF ( bc_lr == 'cyclic' ) THEN 479 DO k = nzb_u_inner(j,i) + 1, nzt 480 u(k,j,i) = u(k,j,i) + volume_flow_offset(1) 481 ENDDO 482 ENDIF 483 IF ( bc_ns == 'cyclic' ) THEN 484 DO k = nzb_v_inner(j,i) + 1, nzt 485 v(k,j,i) = v(k,j,i) + volume_flow_offset(2) 486 ENDDO 487 ENDIF 469 488 ENDDO 470 489 ENDDO … … 475 494 ! 476 495 ! Exchange of boundaries for the velocities 477 CALL exchange_horiz( u , uxrp, 0)478 CALL exchange_horiz( v , 0, vynp)479 CALL exchange_horiz( w , 0, 0)496 CALL exchange_horiz( u ) 497 CALL exchange_horiz( v ) 498 CALL exchange_horiz( w ) 480 499 481 500 !
Note: See TracChangeset
for help on using the changeset viewer.