Changeset 3182 for palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90
- Timestamp:
- Jul 27, 2018 1:36:03 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90
r3065 r3182 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 22 ! Rename variables and extend error message 23 ! Enable geneartor also for stretched grids 23 24 ! 24 25 ! Former revisions: … … 119 120 !> @bug Height information from input file is not used. Profiles from input 120 121 !> must match with current PALM grid. 121 !> Transformation of length scales to number of gridpoints does not122 !> consider grid stretching.123 122 !> In case of restart, velocity seeds differ from precursor run if a11, 124 123 !> a22, or a33 are zero. … … 160 159 INCLUDE "mpif.h" 161 160 #endif 161 162 162 163 163 LOGICAL :: velocity_seed_initialized = .FALSE. !< true after first call of stg_main … … 317 317 318 318 USE control_parameters, & 319 ONLY: bc_lr, bc_ns, forcing, nest_domain, number_stretch_level_start,&320 rans_mode, turbulent_inflow319 ONLY: bc_lr, bc_ns, child_domain, nesting_offline, & 320 number_stretch_level_start, rans_mode, turbulent_inflow 321 321 322 322 USE pmc_interface, & … … 326 326 IMPLICIT NONE 327 327 328 IF ( .NOT. use_syn_turb_gen .AND. .NOT. rans_mode .AND. forcing ) THEN 329 message_string = 'Synthetic turbulence generator has to be applied ' // & 330 'when forcing is used and model operates in LES mode.' 331 CALL message( 'stg_check_parameters', 'PA0000', 1, 2, 0, 6, 0 ) 328 IF ( .NOT. use_syn_turb_gen .AND. .NOT. rans_mode .AND. & 329 nesting_offline ) THEN 330 message_string = 'No synthetic turbulence generator is applied. ' // & 331 'In case PALM operates in LES mode and lateral ' // & 332 'boundary conditions are provided by COSMO model, ' // & 333 'turbulence may require large adjustment lenght at ' //& 334 'the lateral inflow boundaries. Please check your ' // & 335 'results carefully.' 336 CALL message( 'stg_check_parameters', 'PA0000', 0, 0, 0, 6, 0 ) 332 337 ENDIF 333 338 334 IF ( .NOT. use_syn_turb_gen .AND. nest_domain&339 IF ( .NOT. use_syn_turb_gen .AND. child_domain & 335 340 .AND. rans_mode_parent .AND. .NOT. rans_mode ) THEN 336 341 message_string = 'Synthetic turbulence generator has to be applied ' // & … … 342 347 IF ( use_syn_turb_gen ) THEN 343 348 344 IF ( .NOT. forcing .AND. .NOT. nest_domain ) THEN345 349 IF ( .NOT. nesting_offline .AND. .NOT. child_domain ) THEN 350 346 351 IF ( INDEX( initializing_actions, 'set_constant_profiles' ) == 0 & 347 352 .AND. INDEX( initializing_actions, 'read_restart_data' ) == 0 ) THEN … … 371 376 CALL message( 'stg_check_parameters', 'PA0039', 1, 2, 0, 6, 0 ) 372 377 ENDIF 373 374 IF ( number_stretch_level_start > 0 ) THEN375 message_string = 'Using synthetic turbulence generator ' // &376 'in combination with stretching is not allowed'377 CALL message( 'stg_check_parameters', 'PA0420', 1, 2, 0, 6, 0 )378 ENDIF379 378 380 379 ENDIF … … 424 423 425 424 USE control_parameters, & 426 ONLY: coupling_char, dz, e_init, forcing, nest_domain, rans_mode 425 ONLY: child_domain, coupling_char, dz, e_init, nesting_offline, & 426 rans_mode 427 427 428 428 USE grid_variables, & … … 512 512 ! nzt_x_stg = myidx * nnz + MOD( nz , pdims(1) ) 513 513 514 IF ( forcing .OR. ( nest_domain .AND. rans_mode_parent .AND.&515 .NOT. rans_mode ) ) THEN514 IF ( nesting_offline .OR. ( child_domain .AND. rans_mode_parent & 515 .AND. .NOT. rans_mode ) ) THEN 516 516 nnz = nz / pdims(2) 517 517 nzb_y_stg = 1 + myidy * INT( nnz ) … … 558 558 !-- layer 559 559 !-- stg_type_xz: xz-slice with vertical bounds nzb:nzt+1 560 IF ( forcing .OR. ( nest_domain .AND. rans_mode_parent .AND.&561 .NOT. rans_mode ) ) THEN560 IF ( nesting_offline .OR. ( child_domain .AND. rans_mode_parent & 561 .AND. .NOT. rans_mode ) ) THEN 562 562 CALL MPI_TYPE_CREATE_SUBARRAY( 2, [nzt-nzb+2,nxrg-nxlg+1], & 563 563 [1,nxrg-nxlg+1], [0,0], MPI_ORDER_FORTRAN, MPI_REAL, newtype, ierr ) … … 612 612 READ( 90, * ) 613 613 614 DO k = nzb , nzt+1614 DO k = nzb+1, nzt+1 615 615 READ( 90, * ) zz, luy, luz, tu(k), lvy, lvz, tv(k), lwy, lwz, tw(k), & 616 616 r11(k), r21(k), r22(k), r31(k), r32(k), r33(k), & … … 618 618 619 619 ! 620 !-- Convert length scales from meter to number of grid points. Attention: 621 !-- Does not work if grid stretching is used 620 !-- Convert length scales from meter to number of grid points. 622 621 nuy(k) = INT( luy * ddy ) 623 nuz(k) = INT( luz / dz(1))622 nuz(k) = INT( luz * ddzw(k) ) 624 623 nvy(k) = INT( lvy * ddy ) 625 nvz(k) = INT( lvz / dz(1))624 nvz(k) = INT( lvz * ddzw(k) ) 626 625 nwy(k) = INT( lwy * ddy ) 627 nwz(k) = INT( lwz / dz(1))626 nwz(k) = INT( lwz * ddzw(k) ) 628 627 ! 629 628 !-- Workaround, assume isotropic turbulence … … 640 639 ENDIF 641 640 ENDDO 642 641 ! 642 !-- Set lenght scales at surface grid point 643 nuy(nzb) = nuy(nzb+1) 644 nuz(nzb) = nuz(nzb+1) 645 nvy(nzb) = nvy(nzb+1) 646 nvz(nzb) = nvz(nzb+1) 647 nwy(nzb) = nwy(nzb+1) 648 nwz(nzb) = nwz(nzb+1) 649 643 650 CLOSE( 90 ) 644 651 … … 710 717 ! 711 718 !-- Assign initial profiles 712 IF ( .NOT. forcing .AND. .NOT. nest_domain ) THEN719 IF ( .NOT. nesting_offline .AND. .NOT. child_domain ) THEN 713 720 u_init = mean_inflow_profiles(:,1) 714 721 v_init = mean_inflow_profiles(:,2) … … 1042 1049 1043 1050 USE control_parameters, & 1044 ONLY: dt_3d, forcing, intermediate_timestep_count, nest_domain,&1045 rans_mode, simulated_time, volume_flow_initial1051 ONLY: child_domain, dt_3d, intermediate_timestep_count, & 1052 nesting_offline, rans_mode, simulated_time, volume_flow_initial 1046 1053 1047 1054 USE grid_variables, & … … 1086 1093 CALL stg_generate_seed_yz( nwy, nwz, bwy, bwz, fw_yz, id_stg_left ) 1087 1094 1088 IF ( forcing .OR. ( nest_domain .AND. rans_mode_parent .AND.&1089 .NOT. rans_mode ) ) THEN1095 IF ( nesting_offline .OR. ( child_domain .AND. rans_mode_parent & 1096 .AND. .NOT. rans_mode ) ) THEN 1090 1097 ! 1091 1098 !-- Generate turbulence at right boundary … … 1112 1119 CALL stg_generate_seed_yz( nwy, nwz, bwy, bwz, fwo_yz, id_stg_left ) 1113 1120 1114 IF ( forcing .OR. ( nest_domain .AND. rans_mode_parent .AND.&1115 .NOT. rans_mode ) ) THEN1121 IF ( nesting_offline .OR. ( child_domain .AND. rans_mode_parent & 1122 .AND. .NOT. rans_mode ) ) THEN 1116 1123 ! 1117 1124 !-- Generate turbulence at right boundary … … 1191 1198 !-- This correction factor insures that the mass flux is preserved at the 1192 1199 !-- inflow boundary 1193 IF ( .NOT. forcing .AND. .NOT. nest_domain ) THEN1200 IF ( .NOT. nesting_offline .AND. .NOT. child_domain ) THEN 1194 1201 mc_factor_l = 0.0_wp 1195 1202 mc_factor = 0.0_wp
Note: See TracChangeset
for help on using the changeset viewer.