PartMC  2.3.0
coag_kernel_brown.F90
Go to the documentation of this file.
1 ! Copyright (C) 2005-2011 Nicole Riemer and Matthew West
2 ! Copyright (C) 2007 Richard Easter
3 ! Licensed under the GNU General Public License version 2 or (at your
4 ! option) any later version. See the file COPYING for details.
5 
6 !> \file
7 !> The pmc_coag_kernel_brown module.
8 
9 !> Brownian coagulation kernel.
11 
12  use pmc_env_state
13  use pmc_constants
14  use pmc_util
16 
17 contains
18 
19 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
20 
21  !> Compute the Brownian coagulation kernel.
22  !!
23  !! Uses equation (16.28) of M. Z. Jacobson, Fundamentals of
24  !! Atmospheric Modeling, Cambridge University Press, 1999.
25  subroutine kernel_brown(aero_particle_1, aero_particle_2, &
26  aero_data, env_state, k)
27 
28  !> First particle.
29  type(aero_particle_t), intent(in) :: aero_particle_1
30  !> Second particle.
31  type(aero_particle_t), intent(in) :: aero_particle_2
32  !> Aerosol data.
33  type(aero_data_t), intent(in) :: aero_data
34  !> Environment state.
35  type(env_state_t), intent(in) :: env_state
36  !> Kernel k(a,b) (m^3/s).
37  real(kind=dp), intent(out) :: k
38 
39  real(kind=dp) :: v1, v2, d1, d2
40 
41  v1 = aero_particle_volume(aero_particle_1)
42  v2 = aero_particle_volume(aero_particle_2)
43  d1 = aero_particle_density(aero_particle_1, aero_data)
44  d2 = aero_particle_density(aero_particle_2, aero_data)
45 
46  call kernel_brown_helper(v1, d1, v2, d2, env_state%temp, &
47  env_state%pressure, k)
48 
49  end subroutine kernel_brown
50 
51 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
52 
53  !> Compute the minimum and maximum Brownian coagulation kernel.
54  !!
55  !! Finds the minimum and maximum kernel values between particles of
56  !! volumes v1 and v2, by sampling over possible densities.
57  subroutine kernel_brown_minmax(v1, v2, aero_data, env_state, k_min, k_max)
58 
59  !> Volume of first particle (m^3).
60  real(kind=dp), intent(in) :: v1
61  !> Volume of second particle (m^3).
62  real(kind=dp), intent(in) :: v2
63  !> Aerosol data.
64  type(aero_data_t), intent(in) :: aero_data
65  !> Environment state.
66  type(env_state_t), intent(in) :: env_state
67  !> Minimum kernel value (m^3/s).
68  real(kind=dp), intent(out) :: k_min
69  !> Maximum kernel value (m^3/s).
70  real(kind=dp), intent(out) :: k_max
71 
72  !> Number of density sample points.
73  integer, parameter :: n_sample = 3
74 
75  real(kind=dp) :: d1, d2, d_min, d_max, k
76  integer :: i, j
77  logical :: first
78 
79  d_min = minval(aero_data%density)
80  d_max = maxval(aero_data%density)
81 
82  first = .true.
83  do i = 1,n_sample
84  do j = 1,n_sample
85  d1 = interp_linear_disc(d_min, d_max, n_sample, i)
86  d2 = interp_linear_disc(d_min, d_max, n_sample, j)
87  call kernel_brown_helper(v1, d1, v2, d2, &
88  env_state%temp, env_state%pressure, k)
89  if (first) then
90  first = .false.
91  k_min = k
92  k_max = k
93  else
94  k_min = min(k_min, k)
95  k_max = max(k_max, k)
96  end if
97  end do
98  end do
99 
100  end subroutine kernel_brown_minmax
101 
102 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
103 
104  !> Helper function that does the actual Brownian kernel computation.
105  !!
106  !! Helper function. Do not call directly. Instead use kernel_brown().
107  !!
108  !! Uses equation (16.28) of M. Z. Jacobson, Fundamentals of
109  !! Atmospheric Modeling, Cambridge University Press, 1999.
110  subroutine kernel_brown_helper(v1, d1, v2, d2, tk, press, bckernel)
111 
112  !> Volume of first particle (m^3).
113  real(kind=dp), intent(in) :: v1
114  !> Density of first particle (kg/m^3).
115  real(kind=dp), intent(in) :: d1
116  !> Volume of second particle (m^3).
117  real(kind=dp), intent(in) :: v2
118  !> Density of second particle (kg/m^3).
119  real(kind=dp), intent(in) :: d2
120  !> Temperature (K).
121  real(kind=dp), intent(in) :: tk
122  !> Pressure (Pa).
123  real(kind=dp), intent(in) :: press
124  !> Kernel k(a,b) (m^3/s).
125  real(kind=dp), intent(out) :: bckernel
126 
127  integer, parameter :: nbin_maxd = 1000
128  integer, save :: nbin = 0
129  real(kind=dp), save :: rad_sv(nbin_maxd)
130  real(kind=dp) :: avogad, bckernel1, boltz, cunning, deltasq_i, &
131  deltasq_j, den_i, den_j, diffus_i, diffus_j, diffus_sum, &
132  freepath, gasfreepath, gasspeed, knud, mwair, rad_i, rad_j, &
133  rad_sum, rgas, rhoair, speedsq_i, speedsq_j, tmp1, tmp2, &
134  viscosd, viscosk, vol_i, vol_j
135 
136  ! boltz = boltzmann's constant (erg/K = g*cm^2/s/K)
137  ! avogad = avogadro's number (molecules/mol)
138  ! mwair = molecular weight of air (g/mol)
139  ! rgas = gas constant (atmos/(mol/liter)/K)
140  ! rhoair = air density (g/cm^3)
141  ! viscosd = air dynamic viscosity (g/cm/s)
142  ! viscosk = air kinematic viscosity (cm^2/s)
143  ! gasspeed = air molecule mean thermal velocity (cm/s)
144  ! gasfreepath = air molecule mean free path (cm)
145 
146  boltz = const%boltzmann * 1d7 ! J/K to erg/K
147  avogad = const%avagadro
148  mwair = const%air_molec_weight * 1d3 ! kg/mole to g/mole
149  rgas = const%univ_gas_const * 1d3 / const%air_std_press ! J/mole/K to atmos/(mol/liter)/K
150 
151  rhoair = 0.001d0 * ((press/const%air_std_press)*mwair/(rgas*tk))
152 
153  viscosd = (1.8325d-04*(296.16d0+120d0)/(tk+120d0)) * (tk/296.16d0)**1.5d0
154  viscosk = viscosd/rhoair
155  gasspeed = sqrt(8d0*boltz*tk*avogad/(const%pi*mwair))
156  gasfreepath = 2d0*viscosk/gasspeed
157 
158  ! coagulation kernel from eqn 16.28 of jacobson (1999) text
159  !
160  ! diffus_i/j = particle brownian diffusion coefficient (cm^2/s)
161  ! speedsq_i/j = square of particle mean thermal velocity (cm/s)
162  ! freepath = particle mean free path (cm)
163  ! cunning = cunningham slip-flow correction factor
164  ! deltasq_i/j = square of "delta_i" in eqn 16.29d0
165  !
166  ! bckernel1 = brownian coagulation kernel (cm3/s)
167 
168  den_i = d1 * 1.0d-3 ! particle wet density (g/cm3)
169  vol_i = v1 * 1.0d+6 ! particle wet volume (cm3)
170  rad_i = vol2rad(vol_i) ! particle wet radius (cm)
171 
172  knud = gasfreepath/rad_i
173  cunning = 1d0 + knud*(1.249d0 + 0.42d0*exp(-0.87d0/knud))
174  diffus_i = boltz*tk*cunning/(6d0*const%pi*rad_i*viscosd)
175  speedsq_i = 8d0*boltz*tk/(const%pi*den_i*vol_i)
176  freepath = 8d0*diffus_i/(const%pi*sqrt(speedsq_i))
177  tmp1 = (2d0*rad_i + freepath)**3
178  tmp2 = (4d0*rad_i*rad_i + freepath*freepath)**1.5d0
179  deltasq_i = ( (tmp1-tmp2)/(6d0*rad_i*freepath) - 2d0*rad_i )**2
180 
181  den_j = d2 * 1.0d-3
182  vol_j = v2 * 1.0d+6
183  rad_j = vol2rad(vol_j)
184 
185  knud = gasfreepath/rad_j
186  cunning = 1d0 + knud*(1.249d0 + 0.42d0*exp(-0.87d0/knud))
187  diffus_j = boltz*tk*cunning/(6d0*const%pi*rad_j*viscosd)
188  speedsq_j = 8d0*boltz*tk/(const%pi*den_j*vol_j)
189  freepath = 8d0*diffus_j/(const%pi*sqrt(speedsq_j))
190  tmp1 = (2d0*rad_j + freepath)**3
191  tmp2 = (4d0*rad_j*rad_j + freepath*freepath)**1.5d0
192  deltasq_j = ( (tmp1-tmp2)/(6d0*rad_j*freepath) - 2d0*rad_j )**2
193 
194  rad_sum = rad_i + rad_j
195  diffus_sum = diffus_i + diffus_j
196  tmp1 = rad_sum/(rad_sum + sqrt(deltasq_i + deltasq_j))
197  tmp2 = 4d0*diffus_sum/(rad_sum*sqrt(speedsq_i + speedsq_j))
198  bckernel1 = 4d0*const%pi*rad_sum*diffus_sum/(tmp1 + tmp2)
199 
200  bckernel = bckernel1 * 1.0d-6
201 
202  end subroutine kernel_brown_helper
203 
204 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
205 
206 end module pmc_coag_kernel_brown
Physical constants.
Definition: constants.F90:9
The aero_particle_t structure and associated subroutines.
The env_state_t structure and associated subroutines.
Definition: env_state.F90:9
subroutine kernel_brown_helper(v1, d1, v2, d2, tk, press, bckernel)
Helper function that does the actual Brownian kernel computation.
real(kind=dp) function interp_linear_disc(x_1, x_n, n, i)
Linear interpolation over discrete indices.
Definition: util.F90:644
real(kind=dp) function aero_particle_density(aero_particle, aero_data)
Average density of the particle (kg/m^3).
Common utility subroutines.
Definition: util.F90:9
Current environment state.
Definition: env_state.F90:26
subroutine kernel_brown_minmax(v1, v2, aero_data, env_state, k_min, k_max)
Compute the minimum and maximum Brownian coagulation kernel.
Single aerosol particle data structure.
Brownian coagulation kernel.
real(kind=dp) elemental function vol2rad(v)
Convert volume (m^3) to radius (m).
Definition: util.F90:238
elemental real(kind=dp) function aero_particle_volume(aero_particle)
Total volume of the particle (m^3).
subroutine kernel_brown(aero_particle_1, aero_particle_2, aero_data, env_state, k)
Compute the Brownian coagulation kernel.
Aerosol material properties and associated data.
Definition: aero_data.F90:40