Changeset 1159 for palm/trunk/SOURCE


Ignore:
Timestamp:
May 21, 2013 11:58:22 AM (11 years ago)
Author:
fricke
Message:

Bugfix: In case of non-cyclic lateral boundary conditions, Neumann boundary conditions for the velocity components at the outflow are in fact radiation boundary conditions using the maximum phase velocity that ensures numerical stability (CFL-condition).
Logical operator use_cmax is now used instead of bc_lr_dirneu/_neudir.

Location:
palm/trunk/SOURCE
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/boundary_conds.f90

    r1116 r1159  
    2020! Current revisions:
    2121! -----------------
     22! Bugfix: Neumann boundary conditions for the velocity components at the
     23! outflow are in fact radiation boundary conditions using the maximum phase
     24! velocity that ensures numerical stability (CFL-condition).
     25! Hence, logical operator use_cmax is now used instead of bc_lr_dirneu/_neudir.
     26! Bugfix: In case of use_cmax at the outflow, u, v, w are replaced by
     27! u_p, v_p, w_p 
    2228!
    2329
     
    96102! Description:
    97103! ------------
    98 ! Boundary conditions for the prognostic quantities (range='main').
    99 ! In case of non-cyclic lateral boundaries the conditions for velocities at
    100 ! the outflow are set after the pressure solver has been called (range=
    101 ! 'outflow_uvw').
     104! Boundary conditions for the prognostic quantities.
    102105! One additional bottom boundary condition is applied for the TKE (=(u*)**2)
    103106! in prandtl_fluxes. The cyclic lateral boundary conditions are implicitly
     
    334337
    335338!
    336 !-- Neumann or Radiation boundary condition for the velocities at the
    337 !-- respective outflow
     339!-- Radiation boundary conditions for the velocities at the respective outflow.
     340!-- The phase velocity is either assumed to the maximum phase velocity that
     341!-- ensures numerical stability (CFL-condition) or calculated after
     342!-- Orlanski(1976) and averaged along the outflow boundary.
    338343    IF ( outflow_s )  THEN
    339344
    340        IF ( bc_ns_dirneu )  THEN
    341           u(:,-1,:) = u(:,0,:)
    342           v(:,0,:)  = v(:,1,:)
    343           w(:,-1,:) = w(:,0,:)         
    344        ELSEIF ( bc_ns_dirrad )  THEN
     345       IF ( use_cmax )  THEN
     346          u_p(:,-1,:) = u(:,0,:)
     347          v_p(:,0,:)  = v(:,1,:)
     348          w_p(:,-1,:) = w(:,0,:)         
     349       ELSEIF ( .NOT. use_cmax )  THEN
    345350
    346351          c_max = dy / dt_3d
     
    477482    IF ( outflow_n )  THEN
    478483
    479        IF ( bc_ns_neudir )  THEN
    480           u(:,ny+1,:) = u(:,ny,:)
    481           v(:,ny+1,:) = v(:,ny,:)
    482           w(:,ny+1,:) = w(:,ny,:)         
    483        ELSEIF ( bc_ns_dirrad )  THEN
     484       IF ( use_cmax )  THEN
     485          u_p(:,ny+1,:) = u(:,ny,:)
     486          v_p(:,ny+1,:) = v(:,ny,:)
     487          w_p(:,ny+1,:) = w(:,ny,:)         
     488       ELSEIF ( .NOT. use_cmax )  THEN
    484489
    485490          c_max = dy / dt_3d
     
    616621    IF ( outflow_l )  THEN
    617622
    618        IF ( bc_lr_neudir )  THEN
    619           u(:,:,-1) = u(:,:,0)
    620           v(:,:,0)  = v(:,:,1)
    621           w(:,:,-1) = w(:,:,0)         
    622        ELSEIF ( bc_ns_dirrad )  THEN
     623       IF ( use_cmax )  THEN
     624          u_p(:,:,-1) = u(:,:,0)
     625          v_p(:,:,0)  = v(:,:,1)
     626          w_p(:,:,-1) = w(:,:,0)         
     627       ELSEIF ( .NOT. use_cmax )  THEN
    623628
    624629          c_max = dx / dt_3d
     
    755760    IF ( outflow_r )  THEN
    756761
    757        IF ( bc_lr_dirneu )  THEN
    758           u(:,:,nx+1) = u(:,:,nx)
    759           v(:,:,nx+1) = v(:,:,nx)
    760           w(:,:,nx+1) = w(:,:,nx)         
    761        ELSEIF ( bc_ns_dirrad )  THEN
     762       IF ( use_cmax )  THEN
     763          u_p(:,:,nx+1) = u(:,:,nx)
     764          v_p(:,:,nx+1) = v(:,:,nx)
     765          w_p(:,:,nx+1) = w(:,:,nx)         
     766       ELSEIF ( .NOT. use_cmax )  THEN
    762767
    763768          c_max = dx / dt_3d
  • palm/trunk/SOURCE/check_parameters.f90

    r1116 r1159  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! bc_lr/ns_dirneu/neudir removed
    2323!
    2424! Former revisions:
     
    14401440!-- Lateral boundary conditions
    14411441    IF ( bc_lr /= 'cyclic'  .AND.  bc_lr /= 'dirichlet/radiation'  .AND. &
    1442          bc_lr /= 'radiation/dirichlet' .AND. bc_lr /= 'dirichlet/neumann' &
    1443          .AND. bc_lr /= 'neumann/dirichlet' )  THEN
     1442         bc_lr /= 'radiation/dirichlet' )  THEN
    14441443       message_string = 'unknown boundary condition: bc_lr = "' // &
    14451444                        TRIM( bc_lr ) // '"'
     
    14471446    ENDIF
    14481447    IF ( bc_ns /= 'cyclic'  .AND.  bc_ns /= 'dirichlet/radiation'  .AND. &
    1449          bc_ns /= 'radiation/dirichlet' .AND. bc_ns /= 'dirichlet/neumann' &
    1450          .AND. bc_ns /= 'neumann/dirichlet' )  THEN
     1448         bc_ns /= 'radiation/dirichlet' )  THEN
    14511449       message_string = 'unknown boundary condition: bc_ns = "' // &
    14521450                        TRIM( bc_ns ) // '"'
     
    14591457    IF ( bc_lr == 'dirichlet/radiation' )  bc_lr_dirrad = .TRUE.
    14601458    IF ( bc_lr == 'radiation/dirichlet' )  bc_lr_raddir = .TRUE.
    1461     IF ( bc_lr == 'dirichlet/neumann' )    bc_lr_dirneu = .TRUE.
    1462     IF ( bc_lr == 'neumann/dirichlet' )    bc_lr_neudir = .TRUE.
    14631459    IF ( bc_ns /= 'cyclic' )               bc_ns_cyc    = .FALSE.
    14641460    IF ( bc_ns == 'dirichlet/radiation' )  bc_ns_dirrad = .TRUE.
    14651461    IF ( bc_ns == 'radiation/dirichlet' )  bc_ns_raddir = .TRUE.
    1466     IF ( bc_ns == 'dirichlet/neumann' )    bc_ns_dirneu = .TRUE.
    1467     IF ( bc_ns == 'neumann/dirichlet' )    bc_ns_neudir = .TRUE.
    14681462
    14691463!
     
    33063300    ENDIF
    33073301
    3308     IF ( bc_lr == 'radiation/dirichlet' .OR. bc_lr == 'neumann/dirichlet' )  THEN
     3302    IF ( bc_lr == 'radiation/dirichlet' )  THEN
    33093303       dist_nxr    = nx - inflow_disturbance_begin
    33103304       dist_nxl(1) = nx - inflow_disturbance_end
    3311     ELSEIF ( bc_lr == 'dirichlet/radiation' .OR. bc_lr == 'dirichlet/neumann' )  THEN
     3305    ELSEIF ( bc_lr == 'dirichlet/radiation' )  THEN
    33123306       dist_nxl    = inflow_disturbance_begin
    33133307       dist_nxr(1) = inflow_disturbance_end
    33143308    ENDIF
    3315     IF ( bc_ns == 'dirichlet/radiation' .OR. bc_ns == 'dirichlet/neumann' )  THEN
     3309    IF ( bc_ns == 'dirichlet/radiation' )  THEN
    33163310       dist_nyn    = ny - inflow_disturbance_begin
    33173311       dist_nys(1) = ny - inflow_disturbance_end
    3318     ELSEIF ( bc_ns == 'radiation/dirichlet' .OR. bc_ns == 'neumann/dirichlet' )  THEN
     3312    ELSEIF ( bc_ns == 'radiation/dirichlet' )  THEN
    33193313       dist_nys    = inflow_disturbance_begin
    33203314       dist_nyn(1) = inflow_disturbance_end
     
    33243318!-- A turbulent inflow requires Dirichlet conditions at the respective inflow
    33253319!-- boundary (so far, a turbulent inflow is realized from the left side only)
    3326     IF ( turbulent_inflow  .AND.  bc_lr /= 'dirichlet/radiation' .AND.  bc_lr /= 'dirichlet/neumann' )  THEN
     3320    IF ( turbulent_inflow  .AND.  bc_lr /= 'dirichlet/radiation' )  THEN
    33273321       message_string = 'turbulent_inflow = .T. requires a Dirichlet ' // &
    33283322                        'condition at the inflow boundary'
  • palm/trunk/SOURCE/header.f90

    r1116 r1159  
    2020! Current revisions:
    2121! -----------------
     22! +use_cmax
    2223!
    2324!
     
    742743    WRITE ( io, 317 )  bc_lr, bc_ns
    743744    IF ( .NOT. bc_lr_cyc  .OR.  .NOT. bc_ns_cyc )  THEN
    744        WRITE ( io, 318 )  pt_damping_width, pt_damping_factor       
     745       WRITE ( io, 318 )  use_cmax, pt_damping_width, pt_damping_factor       
    745746       IF ( turbulent_inflow )  THEN
    746747          WRITE ( io, 319 )  recycling_width, recycling_plane, &
     
    17811782            '       left/right:  ',A/    &
    17821783            '       north/south: ',A)
    1783 318 FORMAT (/'       pt damping layer width = ',F7.2,' m, pt ', &
     1784318 FORMAT (/'       use_cmax: ',L1 / &
     1785            '       pt damping layer width = ',F8.2,' m, pt ', &
    17841786                    'damping factor = ',F6.4)
    17851787319 FORMAT ('       turbulence recycling at inflow switched on'/ &
  • palm/trunk/SOURCE/init_3d_model.f90

    r1154 r1159  
    2323! Current revisions:
    2424! ------------------
     25! -bc_lr_dirneu, bc_lr_neudir, bc_ns_dirneu, bc_ns_neudir
    2526!
    2627!
     
    16951696    ptdf_x = 0.0
    16961697    ptdf_y = 0.0
    1697     IF ( bc_lr_dirrad  .OR.  bc_lr_dirneu )  THEN
     1698    IF ( bc_lr_dirrad )  THEN
    16981699       DO  i = nxl, nxr
    16991700          IF ( ( i * dx ) < pt_damping_width )  THEN
     
    17031704          ENDIF
    17041705       ENDDO
    1705     ELSEIF ( bc_lr_raddir  .OR.  bc_lr_neudir )  THEN
     1706    ELSEIF ( bc_lr_raddir )  THEN
    17061707       DO  i = nxl, nxr
    17071708          IF ( ( i * dx ) > ( nx * dx - pt_damping_width ) )  THEN
     
    17111712          ENDIF
    17121713       ENDDO
    1713     ELSEIF ( bc_ns_dirrad  .OR.  bc_ns_dirneu )  THEN
     1714    ELSEIF ( bc_ns_dirrad )  THEN
    17141715       DO  j = nys, nyn
    17151716          IF ( ( j * dy ) > ( ny * dy - pt_damping_width ) )  THEN
     
    17191720          ENDIF
    17201721       ENDDO
    1721     ELSEIF ( bc_ns_raddir  .OR.  bc_ns_neudir )  THEN
     1722    ELSEIF ( bc_ns_raddir )  THEN
    17221723       DO  j = nys, nyn
    17231724          IF ( ( j * dy ) < pt_damping_width )  THEN
  • palm/trunk/SOURCE/init_pegrid.f90

    r1140 r1159  
    2020! Current revisions:
    2121! -----------------
     22! dirichlet/neumann and neumann/dirichlet removed
    2223!
    2324!
     
    10511052!-- horizontal boundary conditions.
    10521053    IF ( pleft == MPI_PROC_NULL )  THEN
    1053        IF ( bc_lr == 'dirichlet/radiation' .OR. bc_lr == 'dirichlet/neumann' )  THEN
     1054       IF ( bc_lr == 'dirichlet/radiation' )  THEN
    10541055          inflow_l  = .TRUE.
    1055        ELSEIF ( bc_lr == 'radiation/dirichlet' .OR. bc_lr == 'neumann/dirichlet' )  THEN
     1056       ELSEIF ( bc_lr == 'radiation/dirichlet' )  THEN
    10561057          outflow_l = .TRUE.
    10571058       ENDIF
     
    10591060
    10601061    IF ( pright == MPI_PROC_NULL )  THEN
    1061        IF ( bc_lr == 'dirichlet/radiation' .OR. bc_lr == 'dirichlet/neumann' )  THEN
     1062       IF ( bc_lr == 'dirichlet/radiation' )  THEN
    10621063          outflow_r = .TRUE.
    1063        ELSEIF ( bc_lr == 'radiation/dirichlet' .OR. bc_lr == 'neumann/dirichlet' )  THEN
     1064       ELSEIF ( bc_lr == 'radiation/dirichlet' )  THEN
    10641065          inflow_r  = .TRUE.
    10651066       ENDIF
     
    10671068
    10681069    IF ( psouth == MPI_PROC_NULL )  THEN
    1069        IF ( bc_ns == 'dirichlet/radiation' .OR. bc_ns == 'dirichlet/neumann' )  THEN
     1070       IF ( bc_ns == 'dirichlet/radiation' )  THEN
    10701071          outflow_s = .TRUE.
    1071        ELSEIF ( bc_ns == 'radiation/dirichlet' .OR. bc_ns == 'neumann/dirichlet' )  THEN
     1072       ELSEIF ( bc_ns == 'radiation/dirichlet' )  THEN
    10721073          inflow_s  = .TRUE.
    10731074       ENDIF
     
    10751076
    10761077    IF ( pnorth == MPI_PROC_NULL )  THEN
    1077        IF ( bc_ns == 'dirichlet/radiation' .OR. bc_ns == 'dirichlet/neumann' )  THEN
     1078       IF ( bc_ns == 'dirichlet/radiation' )  THEN
    10781079          inflow_n  = .TRUE.
    1079        ELSEIF ( bc_ns == 'radiation/dirichlet' .OR. bc_ns == 'neumann/dirichlet' )  THEN
     1080       ELSEIF ( bc_ns == 'radiation/dirichlet' )  THEN
    10801081          outflow_n = .TRUE.
    10811082       ENDIF
     
    11071108
    11081109#elif ! defined ( __parallel )
    1109     IF ( bc_lr == 'dirichlet/radiation' .OR. bc_lr == 'dirichlet/neumann' )  THEN
     1110    IF ( bc_lr == 'dirichlet/radiation' )  THEN
    11101111       inflow_l  = .TRUE.
    11111112       outflow_r = .TRUE.
    1112     ELSEIF ( bc_lr == 'radiation/dirichlet' .OR. bc_lr == 'neumann/dirichlet' )  THEN
     1113    ELSEIF ( bc_lr == 'radiation/dirichlet' )  THEN
    11131114       outflow_l = .TRUE.
    11141115       inflow_r  = .TRUE.
    11151116    ENDIF
    11161117
    1117     IF ( bc_ns == 'dirichlet/radiation' .OR. bc_ns == 'dirichlet/neumann' )  THEN
     1118    IF ( bc_ns == 'dirichlet/radiation' )  THEN
    11181119       inflow_n  = .TRUE.
    11191120       outflow_s = .TRUE.
    1120     ELSEIF ( bc_ns == 'radiation/dirichlet' .OR. bc_ns == 'neumann/dirichlet' )  THEN
     1121    ELSEIF ( bc_ns == 'radiation/dirichlet' )  THEN
    11211122       outflow_n = .TRUE.
    11221123       inflow_s  = .TRUE.
  • palm/trunk/SOURCE/modules.f90

    r1132 r1159  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! -bc_lr_dirneu, bc_lr_neudir, bc_ns_dirneu, bc_ns_neudir
     23! +use_cmax
    2324!
    2425! Former revisions:
     
    730731
    731732    LOGICAL ::  avs_output = .FALSE., &
    732                 bc_lr_cyc =.TRUE., bc_lr_dirneu = .FALSE., &
    733                 bc_lr_dirrad = .FALSE., bc_lr_neudir = .FALSE., &
     733                bc_lr_cyc =.TRUE., bc_lr_dirrad = .FALSE., &
    734734                bc_lr_raddir = .FALSE., bc_ns_cyc = .TRUE., &
    735                 bc_ns_dirneu = .FALSE., bc_ns_dirrad = .FALSE., &
    736                 bc_ns_neudir = .FALSE., bc_ns_raddir = .FALSE., &
     735                bc_ns_dirrad = .FALSE., bc_ns_raddir = .FALSE.,&
    737736                call_psolver_at_all_substeps = .TRUE., &
    738737                cloud_droplets = .FALSE., cloud_physics = .FALSE., &
     
    767766                stop_dt = .FALSE., synchronous_exchange = .FALSE., &
    768767                terminate_run = .FALSE., turbulence = .FALSE., &
    769                 turbulent_inflow = .FALSE., &
     768                turbulent_inflow = .FALSE., use_cmax = .TRUE., &
    770769                use_prescribed_profile_data = .FALSE., use_reference = .FALSE.,&
    771770                use_surface_fluxes = .FALSE., use_top_fluxes = .FALSE., &
  • palm/trunk/SOURCE/parin.f90

    r1132 r1159  
    2020! Current revisions:
    2121! -----------------
     22! +use_cmax
    2223!
    2324!
     
    254255             top_momentumflux_u, top_momentumflux_v, top_salinityflux, &
    255256             turbulence, turbulent_inflow, ug_surface, ug_vertical_gradient, &
    256              ug_vertical_gradient_level, use_surface_fluxes, &
     257             ug_vertical_gradient_level, use_surface_fluxes, use_cmax, &
    257258             use_top_fluxes, use_ug_for_galilei_tr, use_upstream_for_tke, &
    258259             uv_heights, u_bulk, u_profile, vg_surface, vg_vertical_gradient, &
  • palm/trunk/SOURCE/poismg.f90

    r1093 r1159  
    2323! Current revisions:
    2424! -----------------
     25! bc_lr/ns_dirneu/neudir removed
    2526!
    2627!
     
    12511252!--       outflow conditions have to be used on all PEs after the switch,
    12521253!--       because then they have the total domain.
    1253           IF ( bc_lr_dirrad  .OR.  bc_lr_dirneu )  THEN
     1254          IF ( bc_lr_dirrad )  THEN
    12541255             inflow_l  = .TRUE.
    12551256             inflow_r  = .FALSE.
    12561257             outflow_l = .FALSE.
    12571258             outflow_r = .TRUE.
    1258           ELSEIF ( bc_lr_raddir  .OR.  bc_lr_neudir )  THEN
     1259          ELSEIF ( bc_lr_raddir )  THEN
    12591260             inflow_l  = .FALSE.
    12601261             inflow_r  = .TRUE.
     
    12631264          ENDIF
    12641265
    1265           IF ( bc_ns_dirrad  .OR.  bc_ns_dirneu )  THEN
     1266          IF ( bc_ns_dirrad )  THEN
    12661267             inflow_n  = .TRUE.
    12671268             inflow_s  = .FALSE.
    12681269             outflow_n = .FALSE.
    12691270             outflow_s = .TRUE.
    1270           ELSEIF ( bc_ns_raddir  .OR.  bc_ns_neudir )  THEN
     1271          ELSEIF ( bc_ns_raddir )  THEN
    12711272             inflow_n  = .FALSE.
    12721273             inflow_s  = .TRUE.
     
    13391340
    13401341          IF ( pleft == MPI_PROC_NULL )  THEN
    1341              IF ( bc_lr_dirrad  .OR.  bc_lr_dirneu )  THEN
     1342             IF ( bc_lr_dirrad )  THEN
    13421343                inflow_l  = .TRUE.
    1343              ELSEIF ( bc_lr_raddir  .OR.  bc_lr_neudir )  THEN
     1344             ELSEIF ( bc_lr_raddir )  THEN
    13441345                outflow_l = .TRUE.
    13451346             ENDIF
     
    13471348
    13481349          IF ( pright == MPI_PROC_NULL )  THEN
    1349              IF ( bc_lr_dirrad  .OR.  bc_lr_dirneu )  THEN
     1350             IF ( bc_lr_dirrad )  THEN
    13501351                outflow_r = .TRUE.
    1351              ELSEIF ( bc_lr_raddir  .OR.  bc_lr_neudir )  THEN
     1352             ELSEIF ( bc_lr_raddir )  THEN
    13521353                inflow_r  = .TRUE.
    13531354             ENDIF
     
    13551356
    13561357          IF ( psouth == MPI_PROC_NULL )  THEN
    1357              IF ( bc_ns_dirrad  .OR.  bc_ns_dirneu )  THEN
     1358             IF ( bc_ns_dirrad )  THEN
    13581359                outflow_s = .TRUE.
    1359              ELSEIF ( bc_ns_raddir  .OR.  bc_ns_neudir )  THEN
     1360             ELSEIF ( bc_ns_raddir )  THEN
    13601361                inflow_s  = .TRUE.
    13611362             ENDIF
     
    13631364
    13641365          IF ( pnorth == MPI_PROC_NULL )  THEN
    1365              IF ( bc_ns_dirrad  .OR.  bc_ns_dirneu )  THEN
     1366             IF ( bc_ns_dirrad )  THEN
    13661367                inflow_n  = .TRUE.
    1367              ELSEIF ( bc_ns_raddir  .OR.  bc_ns_neudir )  THEN
     1368             ELSEIF ( bc_ns_raddir )  THEN
    13681369                outflow_n = .TRUE.
    13691370             ENDIF
Note: See TracChangeset for help on using the changeset viewer.