[1682] | 1 | !> @file lpm_droplet_collision.f90 |
---|
[2000] | 2 | !------------------------------------------------------------------------------! |
---|
[1036] | 3 | ! This file is part of PALM. |
---|
| 4 | ! |
---|
[2000] | 5 | ! PALM is free software: you can redistribute it and/or modify it under the |
---|
| 6 | ! terms of the GNU General Public License as published by the Free Software |
---|
| 7 | ! Foundation, either version 3 of the License, or (at your option) any later |
---|
| 8 | ! version. |
---|
[1036] | 9 | ! |
---|
| 10 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
| 11 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
| 12 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
| 13 | ! |
---|
| 14 | ! You should have received a copy of the GNU General Public License along with |
---|
| 15 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
| 16 | ! |
---|
[1818] | 17 | ! Copyright 1997-2016 Leibniz Universitaet Hannover |
---|
[2000] | 18 | !------------------------------------------------------------------------------! |
---|
[1036] | 19 | ! |
---|
[849] | 20 | ! Current revisions: |
---|
| 21 | ! ------------------ |
---|
[2000] | 22 | ! Forced header and separation lines into 80 columns |
---|
[1823] | 23 | ! |
---|
[1321] | 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
| 26 | ! $Id: lpm_droplet_collision.f90 2000 2016-08-20 18:09:15Z knoop $ |
---|
| 27 | ! |
---|
[1885] | 28 | ! 1884 2016-04-21 11:11:40Z hoffmann |
---|
| 29 | ! Conservation of mass should only be checked if collisions took place. |
---|
| 30 | ! |
---|
[1861] | 31 | ! 1860 2016-04-13 13:21:28Z hoffmann |
---|
| 32 | ! Interpolation of dissipation rate adjusted to more reasonable values. |
---|
| 33 | ! |
---|
[1823] | 34 | ! 1822 2016-04-07 07:49:42Z hoffmann |
---|
| 35 | ! Integration of a new collision algortithm based on Shima et al. (2009) and |
---|
| 36 | ! Soelch and Kaercher (2010) called all_or_nothing. The previous implemented |
---|
| 37 | ! collision algorithm is called average_impact. Moreover, both algorithms are |
---|
| 38 | ! now positive definit due to their construction, i.e., no negative weighting |
---|
| 39 | ! factors should occur. |
---|
| 40 | ! |
---|
[1683] | 41 | ! 1682 2015-10-07 23:56:08Z knoop |
---|
| 42 | ! Code annotations made doxygen readable |
---|
| 43 | ! |
---|
[1360] | 44 | ! 1359 2014-04-11 17:15:14Z hoffmann |
---|
| 45 | ! New particle structure integrated. |
---|
| 46 | ! Kind definition added to all floating point numbers. |
---|
| 47 | ! |
---|
[1323] | 48 | ! 1322 2014-03-20 16:38:49Z raasch |
---|
| 49 | ! REAL constants defined as wp_kind |
---|
| 50 | ! |
---|
[1321] | 51 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
[1320] | 52 | ! ONLY-attribute added to USE-statements, |
---|
| 53 | ! kind-parameters added to all INTEGER and REAL declaration statements, |
---|
| 54 | ! kinds are defined in new module kinds, |
---|
| 55 | ! revision history before 2012 removed, |
---|
| 56 | ! comment fields (!:) to be used for variable explanations added to |
---|
| 57 | ! all variable declaration statements |
---|
[1072] | 58 | ! |
---|
[1093] | 59 | ! 1092 2013-02-02 11:24:22Z raasch |
---|
| 60 | ! unused variables removed |
---|
| 61 | ! |
---|
[1072] | 62 | ! 1071 2012-11-29 16:54:55Z franke |
---|
[1071] | 63 | ! Calculation of Hall and Wang kernel now uses collision-coalescence formulation |
---|
| 64 | ! proposed by Wang instead of the continuous collection equation (for more |
---|
| 65 | ! information about new method see PALM documentation) |
---|
| 66 | ! Bugfix: message identifiers added |
---|
[849] | 67 | ! |
---|
[1037] | 68 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
| 69 | ! code put under GPL (PALM 3.9) |
---|
| 70 | ! |
---|
[850] | 71 | ! 849 2012-03-15 10:35:09Z raasch |
---|
| 72 | ! initial revision (former part of advec_particles) |
---|
[849] | 73 | ! |
---|
[850] | 74 | ! |
---|
[849] | 75 | ! Description: |
---|
| 76 | ! ------------ |
---|
[1682] | 77 | !> Calculates change in droplet radius by collision. Droplet collision is |
---|
| 78 | !> calculated for each grid box seperately. Collision is parameterized by |
---|
[1822] | 79 | !> using collision kernels. Two different kernels are available: |
---|
[1682] | 80 | !> Hall kernel: Kernel from Hall (1980, J. Atmos. Sci., 2486-2507), which |
---|
| 81 | !> considers collision due to pure gravitational effects. |
---|
| 82 | !> Wang kernel: Beside gravitational effects (treated with the Hall-kernel) also |
---|
| 83 | !> the effects of turbulence on the collision are considered using |
---|
| 84 | !> parameterizations of Ayala et al. (2008, New J. Phys., 10, |
---|
| 85 | !> 075015) and Wang and Grabowski (2009, Atmos. Sci. Lett., 10, |
---|
| 86 | !> 1-8). This kernel includes three possible effects of turbulence: |
---|
| 87 | !> the modification of the relative velocity between the droplets, |
---|
| 88 | !> the effect of preferential concentration, and the enhancement of |
---|
| 89 | !> collision efficiencies. |
---|
[849] | 90 | !------------------------------------------------------------------------------! |
---|
[1682] | 91 | SUBROUTINE lpm_droplet_collision (i,j,k) |
---|
| 92 | |
---|
[849] | 93 | |
---|
[1359] | 94 | |
---|
[1320] | 95 | USE arrays_3d, & |
---|
[1822] | 96 | ONLY: diss, ql_v, ql_vp |
---|
[849] | 97 | |
---|
[1320] | 98 | USE cloud_parameters, & |
---|
[1822] | 99 | ONLY: rho_l |
---|
[1320] | 100 | |
---|
| 101 | USE constants, & |
---|
| 102 | ONLY: pi |
---|
| 103 | |
---|
| 104 | USE control_parameters, & |
---|
[1822] | 105 | ONLY: dt_3d, message_string, dz |
---|
[1320] | 106 | |
---|
| 107 | USE cpulog, & |
---|
| 108 | ONLY: cpu_log, log_point_s |
---|
| 109 | |
---|
| 110 | USE grid_variables, & |
---|
[1822] | 111 | ONLY: dx, dy |
---|
[1320] | 112 | |
---|
| 113 | USE kinds |
---|
| 114 | |
---|
| 115 | USE lpm_collision_kernels_mod, & |
---|
[1822] | 116 | ONLY: ckernel, recalculate_kernel |
---|
[1320] | 117 | |
---|
| 118 | USE particle_attributes, & |
---|
[1822] | 119 | ONLY: all_or_nothing, average_impact, dissipation_classes, & |
---|
| 120 | hall_kernel, iran_part, number_of_particles, particles, & |
---|
| 121 | particle_type, prt_count, use_kernel_tables, wang_kernel |
---|
[1320] | 122 | |
---|
[1822] | 123 | USE random_function_mod, & |
---|
| 124 | ONLY: random_function |
---|
| 125 | |
---|
[1359] | 126 | USE pegrid |
---|
| 127 | |
---|
[849] | 128 | IMPLICIT NONE |
---|
| 129 | |
---|
[1682] | 130 | INTEGER(iwp) :: eclass !< |
---|
| 131 | INTEGER(iwp) :: i !< |
---|
| 132 | INTEGER(iwp) :: j !< |
---|
| 133 | INTEGER(iwp) :: k !< |
---|
| 134 | INTEGER(iwp) :: n !< |
---|
[1822] | 135 | INTEGER(iwp) :: m !< |
---|
[1682] | 136 | INTEGER(iwp) :: rclass_l !< |
---|
| 137 | INTEGER(iwp) :: rclass_s !< |
---|
[849] | 138 | |
---|
[1822] | 139 | REAL(wp) :: collection_probability !< probability for collection |
---|
| 140 | REAL(wp) :: ddV !< inverse grid box volume |
---|
| 141 | REAL(wp) :: epsilon !< dissipation rate |
---|
| 142 | REAL(wp) :: factor_volume_to_mass !< 4.0 / 3.0 * pi * rho_l |
---|
| 143 | REAL(wp) :: xm !< mean mass of droplet m |
---|
| 144 | REAL(wp) :: xn !< mean mass of droplet n |
---|
[1359] | 145 | |
---|
[1822] | 146 | REAL(wp), DIMENSION(:), ALLOCATABLE :: weight !< weighting factor |
---|
| 147 | REAL(wp), DIMENSION(:), ALLOCATABLE :: mass !< total mass of super droplet |
---|
[1359] | 148 | |
---|
[849] | 149 | CALL cpu_log( log_point_s(43), 'lpm_droplet_coll', 'start' ) |
---|
| 150 | |
---|
[1822] | 151 | number_of_particles = prt_count(k,j,i) |
---|
| 152 | factor_volume_to_mass = 4.0_wp / 3.0_wp * pi * rho_l |
---|
| 153 | ddV = 1 / ( dx * dy * dz ) |
---|
[849] | 154 | ! |
---|
[1822] | 155 | !-- Collision requires at least one super droplet inside the box |
---|
| 156 | IF ( number_of_particles > 0 ) THEN |
---|
[849] | 157 | |
---|
| 158 | ! |
---|
[1359] | 159 | !-- Now apply the different kernels |
---|
[1822] | 160 | IF ( use_kernel_tables ) THEN |
---|
[849] | 161 | ! |
---|
[1822] | 162 | !-- Fast method with pre-calculated collection kernels for |
---|
[1359] | 163 | !-- discrete radius- and dissipation-classes. |
---|
| 164 | !-- |
---|
| 165 | !-- Determine dissipation class index of this gridbox |
---|
| 166 | IF ( wang_kernel ) THEN |
---|
[1860] | 167 | eclass = INT( diss(k,j,i) * 1.0E4_wp / 600.0_wp * & |
---|
[1359] | 168 | dissipation_classes ) + 1 |
---|
| 169 | epsilon = diss(k,j,i) |
---|
| 170 | ELSE |
---|
| 171 | epsilon = 0.0_wp |
---|
| 172 | ENDIF |
---|
| 173 | IF ( hall_kernel .OR. epsilon * 1.0E4_wp < 0.001_wp ) THEN |
---|
| 174 | eclass = 0 ! Hall kernel is used |
---|
| 175 | ELSE |
---|
| 176 | eclass = MIN( dissipation_classes, eclass ) |
---|
| 177 | ENDIF |
---|
| 178 | |
---|
[849] | 179 | ! |
---|
[1359] | 180 | !-- Droplet collision are calculated using collision-coalescence |
---|
| 181 | !-- formulation proposed by Wang (see PALM documentation) |
---|
[1822] | 182 | !-- Temporary fields for total mass of super-droplet and weighting factors |
---|
| 183 | !-- are allocated. |
---|
| 184 | ALLOCATE(mass(1:number_of_particles), weight(1:number_of_particles)) |
---|
[849] | 185 | |
---|
[1822] | 186 | mass(1:number_of_particles) = particles(1:number_of_particles)%weight_factor * & |
---|
| 187 | particles(1:number_of_particles)%radius**3 * & |
---|
| 188 | factor_volume_to_mass |
---|
| 189 | weight(1:number_of_particles) = particles(1:number_of_particles)%weight_factor |
---|
[849] | 190 | |
---|
[1822] | 191 | IF ( average_impact ) THEN ! select collision algorithm |
---|
[1071] | 192 | |
---|
[1822] | 193 | DO n = 1, number_of_particles |
---|
[1071] | 194 | |
---|
[1822] | 195 | rclass_l = particles(n)%class |
---|
| 196 | xn = mass(n) / weight(n) |
---|
[849] | 197 | |
---|
[1822] | 198 | DO m = n, number_of_particles |
---|
[849] | 199 | |
---|
[1822] | 200 | rclass_s = particles(m)%class |
---|
| 201 | xm = mass(m) / weight(m) |
---|
[849] | 202 | |
---|
[1822] | 203 | IF ( xm .LT. xn ) THEN |
---|
| 204 | |
---|
| 205 | ! |
---|
| 206 | !-- Particle n collects smaller particle m |
---|
| 207 | collection_probability = ckernel(rclass_l,rclass_s,eclass) * & |
---|
| 208 | weight(n) * ddV * dt_3d |
---|
[849] | 209 | |
---|
[1822] | 210 | mass(n) = mass(n) + mass(m) * collection_probability |
---|
| 211 | weight(m) = weight(m) - weight(m) * collection_probability |
---|
| 212 | mass(m) = mass(m) - mass(m) * collection_probability |
---|
| 213 | ELSEIF ( xm .GT. xn ) THEN |
---|
[849] | 214 | ! |
---|
[1822] | 215 | !-- Particle m collects smaller particle n |
---|
| 216 | collection_probability = ckernel(rclass_l,rclass_s,eclass) * & |
---|
| 217 | weight(m) * ddV * dt_3d |
---|
[849] | 218 | |
---|
[1822] | 219 | mass(m) = mass(m) + mass(n) * collection_probability |
---|
| 220 | weight(n) = weight(n) - weight(n) * collection_probability |
---|
| 221 | mass(n) = mass(n) - mass(n) * collection_probability |
---|
| 222 | ELSE |
---|
[1071] | 223 | ! |
---|
[1822] | 224 | !-- Same-size collections. If n = m, weight is reduced by the |
---|
| 225 | !-- number of possible same-size collections; the total mass |
---|
| 226 | !-- is not changed during same-size collection. |
---|
| 227 | !-- Same-size collections of different |
---|
| 228 | !-- particles ( n /= m ) are treated as same-size collections |
---|
| 229 | !-- of ONE partilce with weight = weight(n) + weight(m) and |
---|
| 230 | !-- mass = mass(n) + mass(m). |
---|
| 231 | !-- Accordingly, each particle loses the same number of |
---|
| 232 | !-- droplets to the other particle, but this has no effect on |
---|
| 233 | !-- total mass mass, since the exchanged droplets have the |
---|
| 234 | !-- same radius. |
---|
[849] | 235 | |
---|
[1822] | 236 | !-- Note: For m = n this equation is an approximation only |
---|
| 237 | !-- valid for weight >> 1 (which is usually the case). The |
---|
| 238 | !-- approximation is weight(n)-1 = weight(n). |
---|
| 239 | weight(n) = weight(n) - 0.5_wp * weight(n) * & |
---|
| 240 | ckernel(rclass_l,rclass_s,eclass) * & |
---|
| 241 | weight(m) * ddV * dt_3d |
---|
| 242 | IF ( n .NE. m ) THEN |
---|
| 243 | weight(m) = weight(m) - 0.5_wp * weight(m) * & |
---|
| 244 | ckernel(rclass_l,rclass_s,eclass) * & |
---|
| 245 | weight(n) * ddV * dt_3d |
---|
| 246 | ENDIF |
---|
| 247 | ENDIF |
---|
[1071] | 248 | |
---|
[1822] | 249 | ENDDO |
---|
[1071] | 250 | |
---|
[1822] | 251 | ql_vp(k,j,i) = ql_vp(k,j,i) + mass(n) / factor_volume_to_mass |
---|
| 252 | |
---|
[1359] | 253 | ENDDO |
---|
[849] | 254 | |
---|
[1822] | 255 | ELSEIF ( all_or_nothing ) THEN ! select collision algorithm |
---|
[849] | 256 | |
---|
[1822] | 257 | DO n = 1, number_of_particles |
---|
[849] | 258 | |
---|
[1822] | 259 | rclass_l = particles(n)%class |
---|
| 260 | xn = mass(n) / weight(n) ! mean mass of droplet n |
---|
[849] | 261 | |
---|
[1822] | 262 | DO m = n, number_of_particles |
---|
[849] | 263 | |
---|
[1822] | 264 | rclass_s = particles(m)%class |
---|
| 265 | xm = mass(m) / weight(m) ! mean mass of droplet m |
---|
[849] | 266 | |
---|
[1822] | 267 | IF ( weight(n) .LT. weight(m) ) THEN |
---|
| 268 | ! |
---|
| 269 | !-- Particle n collects weight(n) droplets of particle m |
---|
| 270 | collection_probability = ckernel(rclass_l,rclass_s,eclass) * & |
---|
| 271 | weight(m) * ddV * dt_3d |
---|
[1071] | 272 | |
---|
[1822] | 273 | IF ( collection_probability .GT. random_function( iran_part ) ) THEN |
---|
| 274 | mass(n) = mass(n) + weight(n) * xm |
---|
| 275 | weight(m) = weight(m) - weight(n) |
---|
| 276 | mass(m) = mass(m) - weight(n) * xm |
---|
| 277 | ENDIF |
---|
| 278 | |
---|
| 279 | ELSEIF ( weight(m) .LT. weight(n) ) THEN |
---|
[849] | 280 | ! |
---|
[1822] | 281 | !-- Particle m collects weight(m) droplets of particle n |
---|
| 282 | collection_probability = ckernel(rclass_l,rclass_s,eclass) * & |
---|
| 283 | weight(n) * ddV * dt_3d |
---|
| 284 | |
---|
| 285 | IF ( collection_probability .GT. random_function( iran_part ) ) THEN |
---|
| 286 | mass(m) = mass(m) + weight(m) * xn |
---|
| 287 | weight(n) = weight(n) - weight(m) |
---|
| 288 | mass(n) = mass(n) - weight(m) * xn |
---|
| 289 | ENDIF |
---|
| 290 | ELSE |
---|
[849] | 291 | ! |
---|
[1822] | 292 | !-- Collisions of particles of the same weighting factor. |
---|
| 293 | !-- Particle n collects 1/2 weight(n) droplets of particle m, |
---|
| 294 | !-- particle m collects 1/2 weight(m) droplets of particle n. |
---|
| 295 | !-- The total mass mass changes accordingly. |
---|
| 296 | !-- If n = m, the first half of the droplets coalesces with the |
---|
| 297 | !-- second half of the droplets; mass is unchanged because |
---|
| 298 | !-- xm = xn for n = m. |
---|
[849] | 299 | |
---|
[1822] | 300 | !-- Note: For m = n this equation is an approximation only |
---|
| 301 | !-- valid for weight >> 1 (which is usually the case). The |
---|
| 302 | !-- approximation is weight(n)-1 = weight(n). |
---|
| 303 | collection_probability = ckernel(rclass_l,rclass_s,eclass) * & |
---|
| 304 | weight(n) * ddV * dt_3d |
---|
[849] | 305 | |
---|
[1822] | 306 | IF ( collection_probability .GT. random_function( iran_part ) ) THEN |
---|
| 307 | mass(n) = mass(n) + 0.5_wp * weight(n) * ( xm - xn ) |
---|
| 308 | mass(m) = mass(m) + 0.5_wp * weight(m) * ( xn - xm ) |
---|
| 309 | weight(n) = weight(n) - 0.5_wp * weight(m) |
---|
| 310 | weight(m) = weight(n) |
---|
| 311 | ENDIF |
---|
| 312 | ENDIF |
---|
[849] | 313 | |
---|
[1822] | 314 | ENDDO |
---|
[849] | 315 | |
---|
[1822] | 316 | ql_vp(k,j,i) = ql_vp(k,j,i) + mass(n) / factor_volume_to_mass |
---|
[849] | 317 | |
---|
[1822] | 318 | ENDDO |
---|
[849] | 319 | |
---|
[1822] | 320 | ENDIF |
---|
[849] | 321 | |
---|
| 322 | |
---|
| 323 | |
---|
| 324 | |
---|
[1822] | 325 | IF ( ANY(weight < 0.0_wp) ) THEN |
---|
| 326 | WRITE( message_string, * ) 'negative weighting' |
---|
| 327 | CALL message( 'lpm_droplet_collision', 'PA0028', & |
---|
| 328 | 2, 2, -1, 6, 1 ) |
---|
| 329 | ENDIF |
---|
[849] | 330 | |
---|
[1822] | 331 | particles(1:number_of_particles)%radius = ( mass(1:number_of_particles) / & |
---|
| 332 | ( weight(1:number_of_particles) & |
---|
| 333 | * factor_volume_to_mass & |
---|
| 334 | ) & |
---|
| 335 | )**0.33333333333333_wp |
---|
[849] | 336 | |
---|
[1822] | 337 | particles(1:number_of_particles)%weight_factor = weight(1:number_of_particles) |
---|
[849] | 338 | |
---|
[1822] | 339 | DEALLOCATE(weight, mass) |
---|
[849] | 340 | |
---|
[1822] | 341 | ELSEIF ( .NOT. use_kernel_tables ) THEN |
---|
| 342 | ! |
---|
| 343 | !-- Collection kernels are calculated for every new |
---|
| 344 | !-- grid box. First, allocate memory for kernel table. |
---|
| 345 | !-- Third dimension is 1, because table is re-calculated for |
---|
| 346 | !-- every new dissipation value. |
---|
| 347 | ALLOCATE( ckernel(1:number_of_particles,1:number_of_particles,1:1) ) |
---|
| 348 | ! |
---|
| 349 | !-- Now calculate collection kernel for this box. Note that |
---|
| 350 | !-- the kernel is based on the previous time step |
---|
| 351 | CALL recalculate_kernel( i, j, k ) |
---|
| 352 | ! |
---|
| 353 | !-- Droplet collision are calculated using collision-coalescence |
---|
| 354 | !-- formulation proposed by Wang (see PALM documentation) |
---|
| 355 | !-- Temporary fields for total mass of super-droplet and weighting factors |
---|
| 356 | !-- are allocated. |
---|
| 357 | ALLOCATE(mass(1:number_of_particles), weight(1:number_of_particles)) |
---|
[849] | 358 | |
---|
[1822] | 359 | mass(1:number_of_particles) = particles(1:number_of_particles)%weight_factor * & |
---|
| 360 | particles(1:number_of_particles)%radius**3 * & |
---|
| 361 | factor_volume_to_mass |
---|
[849] | 362 | |
---|
[1822] | 363 | weight(1:number_of_particles) = particles(1:number_of_particles)%weight_factor |
---|
[849] | 364 | |
---|
[1822] | 365 | IF ( average_impact ) THEN ! select collision algorithm |
---|
[849] | 366 | |
---|
[1822] | 367 | DO n = 1, number_of_particles |
---|
[849] | 368 | |
---|
[1822] | 369 | xn = mass(n) / weight(n) ! mean mass of droplet n |
---|
[849] | 370 | |
---|
[1822] | 371 | DO m = n, number_of_particles |
---|
[849] | 372 | |
---|
[1822] | 373 | xm = mass(m) / weight(m) !mean mass of droplet m |
---|
[849] | 374 | |
---|
[1822] | 375 | IF ( xm .LT. xn ) THEN |
---|
[849] | 376 | ! |
---|
[1822] | 377 | !-- Particle n collects smaller particle m |
---|
| 378 | collection_probability = ckernel(n,m,1) * weight(n) * & |
---|
| 379 | ddV * dt_3d |
---|
| 380 | |
---|
| 381 | mass(n) = mass(n) + mass(m) * collection_probability |
---|
| 382 | weight(m) = weight(m) - weight(m) * collection_probability |
---|
| 383 | mass(m) = mass(m) - mass(m) * collection_probability |
---|
| 384 | ELSEIF ( xm .GT. xn ) THEN |
---|
[849] | 385 | ! |
---|
[1822] | 386 | !-- Particle m collects smaller particle n |
---|
| 387 | collection_probability = ckernel(n,m,1) * weight(m) * & |
---|
| 388 | ddV * dt_3d |
---|
[849] | 389 | |
---|
[1822] | 390 | mass(m) = mass(m) + mass(n) * collection_probability |
---|
| 391 | weight(n) = weight(n) - weight(n) * collection_probability |
---|
| 392 | mass(n) = mass(n) - mass(n) * collection_probability |
---|
| 393 | ELSE |
---|
[849] | 394 | ! |
---|
[1822] | 395 | !-- Same-size collections. If n = m, weight is reduced by the |
---|
| 396 | !-- number of possible same-size collections; the total mass |
---|
| 397 | !-- mass is not changed during same-size collection. |
---|
| 398 | !-- Same-size collections of different |
---|
| 399 | !-- particles ( n /= m ) are treated as same-size collections |
---|
| 400 | !-- of ONE partilce with weight = weight(n) + weight(m) and |
---|
| 401 | !-- mass = mass(n) + mass(m). |
---|
| 402 | !-- Accordingly, each particle loses the same number of |
---|
| 403 | !-- droplets to the other particle, but this has no effect on |
---|
| 404 | !-- total mass mass, since the exchanged droplets have the |
---|
| 405 | !-- same radius. |
---|
| 406 | !-- |
---|
| 407 | !-- Note: For m = n this equation is an approximation only |
---|
| 408 | !-- valid for weight >> 1 (which is usually the case). The |
---|
| 409 | !-- approximation is weight(n)-1 = weight(n). |
---|
| 410 | weight(n) = weight(n) - 0.5_wp * weight(n) * & |
---|
| 411 | ckernel(n,m,1) * weight(m) * & |
---|
| 412 | ddV * dt_3d |
---|
| 413 | IF ( n .NE. m ) THEN |
---|
| 414 | weight(m) = weight(m) - 0.5_wp * weight(m) * & |
---|
| 415 | ckernel(n,m,1) * weight(n) * & |
---|
| 416 | ddV * dt_3d |
---|
| 417 | ENDIF |
---|
| 418 | ENDIF |
---|
[849] | 419 | |
---|
| 420 | |
---|
[1359] | 421 | ENDDO |
---|
[849] | 422 | |
---|
[1822] | 423 | ql_vp(k,j,i) = ql_vp(k,j,i) + mass(n) / factor_volume_to_mass |
---|
[849] | 424 | |
---|
[1822] | 425 | ENDDO |
---|
[849] | 426 | |
---|
[1822] | 427 | ELSEIF ( all_or_nothing ) THEN ! select collision algorithm |
---|
[849] | 428 | |
---|
[1822] | 429 | DO n = 1, number_of_particles |
---|
[849] | 430 | |
---|
[1822] | 431 | xn = mass(n) / weight(n) ! mean mass of droplet n |
---|
[849] | 432 | |
---|
[1822] | 433 | DO m = n, number_of_particles |
---|
[849] | 434 | |
---|
[1822] | 435 | xm = mass(m) / weight(m) !mean mass of droplet m |
---|
[849] | 436 | |
---|
[1822] | 437 | IF ( weight(n) .LT. weight(m) ) THEN |
---|
| 438 | ! |
---|
| 439 | !-- Particle n collects smaller particle m |
---|
| 440 | collection_probability = ckernel(n,m,1) * weight(m) * & |
---|
| 441 | ddV * dt_3d |
---|
[1071] | 442 | |
---|
[1822] | 443 | IF ( collection_probability .GT. random_function( iran_part ) ) THEN |
---|
| 444 | mass(n) = mass(n) + weight(n) * xm |
---|
| 445 | weight(m) = weight(m) - weight(n) |
---|
| 446 | mass(m) = mass(m) - weight(n) * xm |
---|
| 447 | ENDIF |
---|
[1359] | 448 | |
---|
[1822] | 449 | ELSEIF ( weight(m) .LT. weight(n) ) THEN |
---|
[1071] | 450 | ! |
---|
[1822] | 451 | !-- Particle m collects smaller particle n |
---|
| 452 | collection_probability = ckernel(n,m,1) * weight(n) * & |
---|
| 453 | ddV * dt_3d |
---|
[1071] | 454 | |
---|
[1822] | 455 | IF ( collection_probability .GT. random_function( iran_part ) ) THEN |
---|
| 456 | mass(m) = mass(m) + weight(m) * xn |
---|
| 457 | weight(n) = weight(n) - weight(m) |
---|
| 458 | mass(n) = mass(n) - weight(m) * xn |
---|
| 459 | ENDIF |
---|
| 460 | ELSE |
---|
| 461 | ! |
---|
| 462 | !-- Collisions of particles of the same weighting factor. |
---|
| 463 | !-- Particle n collects 1/2 weight(n) droplets of particle m, |
---|
| 464 | !-- particle m collects 1/2 weight(m) droplets of particle n. |
---|
| 465 | !-- The total mass mass changes accordingly. |
---|
| 466 | !-- If n = m, the first half of the droplets coalesces with the |
---|
| 467 | !-- second half of the droplets; mass is unchanged because |
---|
| 468 | !-- xm = xn for n = m. |
---|
| 469 | !-- |
---|
| 470 | !-- Note: For m = n this equation is an approximation only |
---|
| 471 | !-- valid for weight >> 1 (which is usually the case). The |
---|
| 472 | !-- approximation is weight(n)-1 = weight(n). |
---|
| 473 | collection_probability = ckernel(n,m,1) * weight(n) * & |
---|
| 474 | ddV * dt_3d |
---|
[1071] | 475 | |
---|
[1822] | 476 | IF ( collection_probability .GT. random_function( iran_part ) ) THEN |
---|
| 477 | mass(n) = mass(n) + 0.5_wp * weight(n) * ( xm - xn ) |
---|
| 478 | mass(m) = mass(m) + 0.5_wp * weight(m) * ( xn - xm ) |
---|
| 479 | weight(n) = weight(n) - 0.5_wp * weight(m) |
---|
| 480 | weight(m) = weight(n) |
---|
| 481 | ENDIF |
---|
| 482 | ENDIF |
---|
[1071] | 483 | |
---|
| 484 | |
---|
[1822] | 485 | ENDDO |
---|
[1071] | 486 | |
---|
[1822] | 487 | ql_vp(k,j,i) = ql_vp(k,j,i) + mass(n) / factor_volume_to_mass |
---|
[1071] | 488 | |
---|
[1822] | 489 | ENDDO |
---|
[1071] | 490 | |
---|
[1822] | 491 | ENDIF |
---|
[1071] | 492 | |
---|
[1822] | 493 | IF ( ANY(weight < 0.0_wp) ) THEN |
---|
| 494 | WRITE( message_string, * ) 'negative weighting' |
---|
| 495 | CALL message( 'lpm_droplet_collision', 'PA0028', & |
---|
| 496 | 2, 2, -1, 6, 1 ) |
---|
| 497 | ENDIF |
---|
| 498 | |
---|
| 499 | particles(1:number_of_particles)%radius = ( mass(1:number_of_particles) / & |
---|
| 500 | ( weight(1:number_of_particles) & |
---|
| 501 | * factor_volume_to_mass & |
---|
| 502 | ) & |
---|
| 503 | )**0.33333333333333_wp |
---|
| 504 | |
---|
| 505 | particles(1:number_of_particles)%weight_factor = weight(1:number_of_particles) |
---|
| 506 | |
---|
| 507 | DEALLOCATE( weight, mass, ckernel ) |
---|
| 508 | |
---|
| 509 | ENDIF |
---|
| 510 | |
---|
[849] | 511 | ! |
---|
[1884] | 512 | !-- Check if LWC is conserved during collision process |
---|
| 513 | IF ( ql_v(k,j,i) /= 0.0_wp ) THEN |
---|
| 514 | IF ( ql_vp(k,j,i) / ql_v(k,j,i) >= 1.0001_wp .OR. & |
---|
| 515 | ql_vp(k,j,i) / ql_v(k,j,i) <= 0.9999_wp ) THEN |
---|
| 516 | WRITE( message_string, * ) ' LWC is not conserved during', & |
---|
| 517 | ' collision! ', & |
---|
| 518 | ' LWC after condensation: ', ql_v(k,j,i), & |
---|
| 519 | ' LWC after collision: ', ql_vp(k,j,i) |
---|
| 520 | CALL message( 'lpm_droplet_collision', 'PA0040', 2, 2, -1, 6, 1 ) |
---|
| 521 | ENDIF |
---|
[1359] | 522 | ENDIF |
---|
[1884] | 523 | |
---|
[1359] | 524 | ENDIF |
---|
[1884] | 525 | |
---|
[849] | 526 | CALL cpu_log( log_point_s(43), 'lpm_droplet_coll', 'stop' ) |
---|
| 527 | |
---|
[1359] | 528 | END SUBROUTINE lpm_droplet_collision |
---|