Changeset 3550
- Timestamp:
- Nov 21, 2018 4:01:01 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/turbulence_closure_mod.f90
r3545 r3550 25 25 ! ----------------- 26 26 ! $Id$ 27 ! - calculate diss production same in vector and cache optimization 28 ! - move boundary condition for e and diss to boundary_conds 29 ! 30 ! 3545 2018-11-21 11:19:41Z gronemeier 27 31 ! - Set rans_mode according to value of turbulence_closure 28 32 ! - removed debug output … … 1937 1941 REAL(wp) :: sbt !< wheighting factor for sub-time step 1938 1942 1939 REAL(wp), DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg) :: advec !< advection term of TKE tendency1940 REAL(wp), DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg) :: produc !< production term of TKE tendency1941 1942 1943 ! 1943 1944 !-- If required, compute prognostic equation for turbulent kinetic … … 1982 1983 ENDIF 1983 1984 1984 IF ( rans_tke_e ) advec = tend1985 1986 1985 CALL production_e( .FALSE. ) 1987 1988 !1989 !-- Save production term for prognostic equation of TKE dissipation rate1990 IF ( rans_tke_e ) produc = tend - advec1991 1986 1992 1987 IF ( .NOT. humidity ) THEN … … 2024 2019 ENDDO 2025 2020 ENDDO 2026 2027 !2028 !-- Use special boundary condition in case of TKE-e closure2029 !> @todo do the same for usm and lsm surfaces2030 !> 2018-06-05, gronemeier2031 IF ( rans_tke_e ) THEN2032 DO i = nxl, nxr2033 DO j = nys, nyn2034 surf_s = surf_def_h(0)%start_index(j,i)2035 surf_e = surf_def_h(0)%end_index(j,i)2036 DO m = surf_s, surf_e2037 k = surf_def_h(0)%k(m)2038 e_p(k,j,i) = surf_def_h(0)%us(m)**2 / c_0**22039 ENDDO2040 ENDDO2041 ENDDO2042 ENDIF2043 2021 2044 2022 ! … … 2110 2088 ENDIF 2111 2089 ENDIF 2112 2113 2090 ! 2114 2091 !-- Production of TKE dissipation rate 2115 DO i = nxl, nxr 2116 DO j = nys, nyn 2117 DO k = nzb+1, nzt 2118 ! tend(k,j,i) = tend(k,j,i) + c_1 * diss(k,j,i) / ( e(k,j,i) + 1.0E-20_wp ) * produc(k) 2119 tend(k,j,i) = tend(k,j,i) + c_1 * c_0**4 * f / c_4 & !> @todo needs revision 2120 / surf_def_h(0)%us(surf_def_h(0)%start_index(j,i)) & 2121 * SQRT(e(k,j,i)) * produc(k,j,i) 2122 ENDDO 2123 ENDDO 2124 ENDDO 2125 2092 CALL production_e( .TRUE. ) 2093 ! 2094 !-- Diffusion term of TKE dissipation rate 2126 2095 CALL diffusion_diss 2127 2128 2096 ! 2129 2097 !-- Additional sink term for flows through plant canopies 2130 ! IF ( plant_canopy ) CALL pcm_tendency( ? ) !> @query what to do with this?2131 2132 ! CALL user_actions( 'diss-tendency' ) 2098 ! IF ( plant_canopy ) CALL pcm_tendency( ? ) !> @todo not yet implemented 2099 2100 ! CALL user_actions( 'diss-tendency' ) !> @todo not yet implemented 2133 2101 2134 2102 ! … … 2148 2116 IF ( diss_p(k,j,i) < 0.0_wp ) & 2149 2117 diss_p(k,j,i) = 0.1_wp * diss(k,j,i) 2150 ENDDO2151 ENDDO2152 ENDDO2153 2154 !2155 !-- Use special boundary condition in case of TKE-e closure2156 DO i = nxl, nxr2157 DO j = nys, nyn2158 surf_s = surf_def_h(0)%start_index(j,i)2159 surf_e = surf_def_h(0)%end_index(j,i)2160 DO m = surf_s, surf_e2161 k = surf_def_h(0)%k(m)2162 diss_p(k,j,i) = surf_def_h(0)%us(m)**3 / kappa * ddzu(k)2163 2118 ENDDO 2164 2119 ENDDO … … 2315 2270 ! 2316 2271 !-- Additional sink term for flows through plant canopies 2317 ! IF ( plant_canopy ) CALL pcm_tendency( i, j, ? ) 2318 2319 ! CALL user_actions( i, j, 'diss-tendency' ) 2272 ! IF ( plant_canopy ) CALL pcm_tendency( i, j, ? ) !> @todo not yet implemented 2273 2274 ! CALL user_actions( i, j, 'diss-tendency' ) !> @todo not yet implemented 2320 2275 2321 2276 ! … … 2361 2316 !> @warning The case with constant_flux_layer = F and use_surface_fluxes = T is 2362 2317 !> not considered well! 2363 !> @todo Adjust production term in case of rans_tke_e simulation2364 2318 !------------------------------------------------------------------------------! 2365 2319 SUBROUTINE production_e( diss_production ) … … 2645 2599 IF ( .NOT. diss_production ) THEN 2646 2600 2647 !-- Compute te mdency for TKE-production from shear2601 !-- Compute tendency for TKE-production from shear 2648 2602 tend(k,j,i) = tend(k,j,i) + km(k,j,i) * def * flag 2649 2603 2650 2604 ELSE 2651 2605 2652 !-- RANS mode: Compute te mdency for dissipation-rate-production from shear2606 !-- RANS mode: Compute tendency for dissipation-rate-production from shear 2653 2607 tend(k,j,i) = tend(k,j,i) + km(k,j,i) * def * flag * & 2654 2608 diss(k,j,i)/( e(k,j,i) + 1.0E-20_wp ) * c_1 … … 2703 2657 IF ( .NOT. diss_production ) THEN 2704 2658 2705 !-- Compute te mdency for TKE-production from shear2659 !-- Compute tendency for TKE-production from shear 2706 2660 DO k = nzb+1, nzt 2707 2661 flag = MERGE( 1.0_wp, 0.0_wp, BTEST(wall_flags_0(k,j,i),0) ) … … 2713 2667 ELSE 2714 2668 2715 !-- RANS mode: Compute te mdency for dissipation-rate-production from shear2669 !-- RANS mode: Compute tendency for dissipation-rate-production from shear 2716 2670 DO k = nzb+1, nzt 2717 2671 flag = MERGE( 1.0_wp, 0.0_wp, BTEST(wall_flags_0(k,j,i),0) ) … … 2777 2731 IF ( .NOT. diss_production ) THEN 2778 2732 2779 !-- Compute te mdency for TKE-production from shear2733 !-- Compute tendency for TKE-production from shear 2780 2734 DO k = nzb+1, nzt 2781 2735 flag = MERGE( 1.0_wp, 0.0_wp, BTEST(wall_flags_0(k,j,i),0) ) … … 2787 2741 ELSE 2788 2742 2789 !-- RANS mode: Compute te mdency for dissipation-rate-production from shear2743 !-- RANS mode: Compute tendency for dissipation-rate-production from shear 2790 2744 DO k = nzb+1, nzt 2791 2745 flag = MERGE( 1.0_wp, 0.0_wp, BTEST(wall_flags_0(k,j,i),0) ) … … 2992 2946 IF ( .NOT. diss_production ) THEN 2993 2947 2994 !-- Compute te mdency for TKE-production from shear2948 !-- Compute tendency for TKE-production from shear 2995 2949 DO k = nzb+1, nzt 2996 2950 flag = MERGE( 1.0_wp, 0.0_wp, BTEST(wall_flags_0(k,j,i),0) ) … … 3002 2956 ELSE 3003 2957 3004 !-- RANS mode: Compute te mdency for dissipation-rate-production from shear2958 !-- RANS mode: Compute tendency for dissipation-rate-production from shear 3005 2959 DO k = nzb+1, nzt 3006 2960 flag = MERGE( 1.0_wp, 0.0_wp, BTEST(wall_flags_0(k,j,i),0) ) … … 3031 2985 !> @warning The case with constant_flux_layer = F and use_surface_fluxes = T is 3032 2986 !> not considered well! 3033 !> @todo non-neutral case is not yet considered for RANS mode3034 2987 !------------------------------------------------------------------------------! 3035 2988 SUBROUTINE production_e_ij( i, j, diss_production ) … … 3313 3266 ELSE 3314 3267 3315 !-- RANS mode: Compute te mdency for dissipation-rate-production from shear3268 !-- RANS mode: Compute tendency for dissipation-rate-production from shear 3316 3269 tend(k,j,i) = tend(k,j,i) + km(k,j,i) * def * flag * & 3317 3270 diss(k,j,i)/( e(k,j,i) + 1.0E-20_wp ) * c_1 … … 3359 3312 IF ( .NOT. diss_production ) THEN 3360 3313 3361 !-- Compute te mdency for TKE-production from shear3314 !-- Compute tendency for TKE-production from shear 3362 3315 DO k = nzb+1, nzt 3363 3316 flag = MERGE( 1.0_wp, 0.0_wp, BTEST(wall_flags_0(k,j,i),0) ) … … 3369 3322 ELSE 3370 3323 3371 !-- RANS mode: Compute te mdency for dissipation-rate-production from shear3324 !-- RANS mode: Compute tendency for dissipation-rate-production from shear 3372 3325 DO k = nzb+1, nzt 3373 3326 flag = MERGE( 1.0_wp, 0.0_wp, BTEST(wall_flags_0(k,j,i),0) ) … … 3428 3381 IF ( .NOT. diss_production ) THEN 3429 3382 3430 !-- Compute te mdency for TKE-production from shear3383 !-- Compute tendency for TKE-production from shear 3431 3384 DO k = nzb+1, nzt 3432 3385 flag = MERGE( 1.0_wp, 0.0_wp, BTEST(wall_flags_0(k,j,i),0) ) … … 3438 3391 ELSE 3439 3392 3440 !-- RANS mode: Compute te mdency for dissipation-rate-production from shear3393 !-- RANS mode: Compute tendency for dissipation-rate-production from shear 3441 3394 DO k = nzb+1, nzt 3442 3395 flag = MERGE( 1.0_wp, 0.0_wp, BTEST(wall_flags_0(k,j,i),0) ) … … 3637 3590 IF ( .NOT. diss_production ) THEN 3638 3591 3639 !-- Compute te mdency for TKE-production from shear3592 !-- Compute tendency for TKE-production from shear 3640 3593 DO k = nzb+1, nzt 3641 3594 flag = MERGE( 1.0_wp, 0.0_wp, BTEST(wall_flags_0(k,j,i),0) ) … … 3647 3600 ELSE 3648 3601 3649 !-- RANS mode: Compute te mdency for dissipation-rate-production from shear3602 !-- RANS mode: Compute tendency for dissipation-rate-production from shear 3650 3603 DO k = nzb+1, nzt 3651 3604 flag = MERGE( 1.0_wp, 0.0_wp, BTEST(wall_flags_0(k,j,i),0) )
Note: See TracChangeset
for help on using the changeset viewer.