18 REAL*8,
ALLOCATABLE,
DIMENSION(:) :: rhstemp
21 REAL*8,
ALLOCATABLE,
DIMENSION(:) :: rhs
24 REAL*8,
ALLOCATABLE,
DIMENSION(:) :: ftemp
27 REAL*8,
ALLOCATABLE,
DIMENSION(:) :: f
30 REAL*8,
ALLOCATABLE,
DIMENSION(:) :: f_stepold
59 itotal = n_part * n_mom + 9
62 ALLOCATE(f_stepold(itotal))
64 ALLOCATE(rhstemp(itotal))
65 ALLOCATE(ftemp(itotal))
89 USE meteo_module, ONLY: u_atm , rho_atm , ta , duatm_dz , cpair , rair , &
92 USE mixture_module, ONLY: rho_mix , tp , cpmix , solid_tot_volume_fraction ,&
93 gas_mass_fraction , rgasmix , rho_gas
95 USE particles_module, ONLY: mom , set_rhop_mom , set_cp_rhop_mom , set_mom ,&
96 set_cp_mom , solid_partial_mass_fraction , solid_volume_fraction , &
99 USE plume_module, ONLY: s , r , u , w , mag_u , phi , alpha_inp , beta_inp ,&
100 rp , prob_factor , particles_loss , r0
105 REAL*8,
DIMENSION(:),
INTENT(OUT) :: rhs_
115 REAL*8 :: solid_term , cp_solid_term
119 REAL*8 :: alpha_p , beta_p
123 REAL*8 :: a_poly , b_poly , c_poly , d_poly
126 REAL*8 :: a_10 , a_10_deriv
130 IF ( alpha_inp .LE. 0.d0 )
THEN
134 IF ( s_star .LE. 10 )
THEN
137 a_10 = 2.45 - 1.05* exp( -4.65e-3*10.d0)
139 a_10_deriv = - 1.05* exp( -4.65e-3*10.d0) * ( -4.65e-3)
147 d_poly = - ( a_10 - 1.1 - a_10_deriv ) / 500
149 c_poly = ( a_10 - 1.1 - 1000*d_poly ) / 100
152 a = a_poly + b_poly*s_star + c_poly*s_star**2 + d_poly*s_star**3
157 a = 2.45d0 - 1.05d0* exp( -4.65e-3*s_star )
163 ri = gi * ( rho_atm - rho_mix ) * r / ( rho_atm * mag_u**2 )
165 alpha_p = max( 0.d0 , 0.5d0 * c + ( 1.d0 - 1.d0 / a ) * ri )
175 IF ( particles_loss )
THEN
177 factor0 = ( 1.d0 + 6.d0 / 5.d0 * alpha_p )** 2
178 prob_factor = ( factor0 - 1.d0 ) / ( factor0 + 1.d0 )
187 IF ( beta_inp .LE. 0.d0 )
THEN
198 ueps = alpha_p * abs( mag_u - u_atm * cos_phi ) + beta_p * abs( u_atm * &
201 IF ( distribution_variable .EQ.
"particles_number" )
THEN
203 solid_term = sum( solid_volume_fraction(1:n_part) * &
204 set_rhop_mom(1:n_part,3) )
206 ELSEIF ( distribution_variable .EQ.
"mass_fraction" )
THEN
208 solid_term = rho_mix * sum( solid_mass_fraction(1:n_part) * &
209 set_mom(1:n_part,0) )
215 rhs_(1) = 2.d0 * r * rho_atm * ueps - prob_factor * 2.d0 * r * &
220 rhs_(2) = - r**2 * rho_mix * w * duatm_dz - u * prob_factor * 2.d0 * r * &
225 rhs_(3) = gi * r**2 * ( rho_atm - rho_mix ) - w * prob_factor * 2.d0 * r * &
230 IF ( distribution_variable .EQ.
"particles_number" )
THEN
232 cp_solid_term = sum( solid_volume_fraction(1:n_part) * &
233 set_cp_rhop_mom(1:n_part,3) )
235 ELSEIF ( distribution_variable .EQ.
"mass_fraction" )
THEN
237 cp_solid_term = rho_mix * sum( solid_mass_fraction(1:n_part) * &
238 set_cp_mom(1:n_part,0) )
242 rhs_(4) = 1.d0 / ( rho_mix * mag_u * r**2 ) * ( - cpmix * rhs_(1) &
243 + cpair * 2.d0 * r * rho_atm * ueps - prob_factor * 2.d0 * r * &
247 rhs_(5) = 2.d0 * r * ueps * rho_atm * cpair * ta - ( r**2 ) * w * rho_atm * &
248 gi - tp * prob_factor * 2.d0 * r * cp_solid_term - rp * r * &
252 rhs_(6) = ( rair - rgasmix ) / ( rho_gas * mag_u * r**2 ) &
253 * ( 2.d0 * r * rho_atm * ueps )
259 rhs_(8) = cos_phi * cos_theta
262 rhs_(9) = cos_phi * sin_theta
269 IF ( distribution_variable .EQ.
"particles_number" )
THEN
271 rhs_(10+i+(i_part-1)*n_mom) = - prob_factor * 2.d0 * r * &
272 set_mom(i_part,i) * mom(i_part,i)
274 ELSEIF ( distribution_variable .EQ.
"mass_fraction" )
THEN
276 rhs_(10+i+(i_part-1)*n_mom) = - prob_factor * 2.d0 * r * &
277 rho_mix * set_mom(i_part,i) * mom(i_part,i)
306 USE plume_module, ONLY: s , x , z , y , r , u , w , mag_u
309 REAL*8,
DIMENSION(:),
INTENT(OUT) :: f_
314 f_(1) = rho_mix * mag_u * r**2
315 f_(2) = f_(1) * ( u - u_atm )
318 f_(5) = f_(1) * cpmix * tp
328 idx = 10+i_mom+(i_part-1)*n_mom
330 IF ( distribution_variable .EQ.
"particles_number" )
THEN
332 f_(idx) = mag_u * r**2 * mom(i_part,i_mom)
334 ELSEIF ( distribution_variable .EQ.
"mass_fraction" )
THEN
336 f_(idx) = mag_u * r**2 * mom(i_part,i_mom) * rho_mix
364 REAL*8,
DIMENSION(:),
INTENT(IN) :: fold,
rate
365 REAL*8,
DIMENSION(:),
INTENT(OUT) :: fnew
367 INTEGER :: i_part, i_mom
371 fnew(i) = fold(i) +
rate(i) * ds
379 IF ( fnew(10+i_mom+(i_part-1)*n_mom) .LE. 0.d0 )
THEN
381 IF ( distribution_variable .EQ.
'particle_moments' )
THEN
383 WRITE(*,*)
'WARNING: negative moment, part',i_part,
'mom',i_mom
411 USE meteo_module, ONLY: u_atm , ta , rho_atm , rair , pa
413 USE mixture_module, ONLY: rho_gas , rgasmix , cpmix , rho_mix , tp , &
414 gas_volume_fraction , solid_tot_volume_fraction , gas_mass_fraction , &
415 atm_mass_fraction , wvapour_mass_fraction , rwvapour
418 solid_partial_volume_fraction , rhop_mom , solid_volume_fraction , &
419 distribution , distribution_variable , solid_mass_fraction
421 USE plume_module, ONLY: x , z , y , r , u , w , mag_u , phi
425 USE variables, ONLY : pi_g , verbose_level
436 REAL*8,
DIMENSION(:),
INTENT(INOUT) :: f_
438 REAL*8,
DIMENSION(n_part,n_nodes) :: xi , wi , wi_temp
439 REAL*8,
DIMENSION(n_part,n_nodes) :: part_dens_array
441 REAL*8 :: rho_wvapour
443 REAL*8 :: rhob_solid_u_r2(n_part)
444 REAL*8 :: rhob_solid_tot_u_r2
446 REAL*8 :: alfa_s_u_r2(1:n_part)
447 REAL*8 :: alfa_g_u_r2
449 REAL*8 :: alfa_g_wvapour
452 REAL*8 :: atm_volume_fraction
453 REAL*8 :: wvapour_volume_fraction
457 REAL*8 :: rho_solid_avg(n_part)
458 REAL*8 :: rho_solid_tot_avg
464 INTEGER :: idx1 , idx2
478 u = u_atm + f_(2)/f_(1)
482 mag_u = sqrt( u*u + w*w )
486 tp = f_(5) / ( f_(1) * cpmix )
489 rho_gas = pa / ( rgasmix * tp )
491 rho_wvapour = pa / ( rwvapour * tp )
493 rho_atm_tp = pa / ( rair * tp )
495 alfa_g_wvapour = ( rho_gas - rho_atm_tp ) / ( rho_wvapour - rho_atm_tp )
497 alfa_g_atm = 1.d0 - alfa_g_wvapour
499 IF ( verbose_level .GT. 2 )
THEN
501 WRITE(*,*)
'************** UNLUMP ***************'
502 WRITE(*,*)
'rgasmix',rgasmix
504 WRITE(*,*)
'rho_gas,rho_wvapour,rho_atm_tp',rho_gas,rho_wvapour, &
507 WRITE(*,*)
'alfa_g_wvapour,alfa_g_atm',alfa_g_wvapour,alfa_g_atm
514 idx1 = 10 + 0 + n_mom * ( i_part - 1 )
515 idx2 = 10 + n_mom - 1 + n_mom * ( i_part - 1 )
517 IF ( distribution_variable .EQ.
'particles_number' )
THEN
523 IF ( distribution .EQ.
'constant' )
THEN
542 IF ( distribution_variable .EQ.
'particles_number' )
THEN
544 rhob_solid_u_r2(i_part) = sum( part_dens_array(i_part,:) * &
545 wi_temp(i_part,:) * xi(i_part,:)**3 ) / 6.d0 * pi_g
548 rho_solid_avg(i_part) = sum( part_dens_array(i_part,:) * &
549 wi_temp(i_part,:) * xi(i_part,:)**3 ) / &
550 sum( wi_temp(i_part,:) * xi(i_part,:)**3 )
552 ELSEIF ( distribution_variable .EQ.
'mass_fraction' )
THEN
554 rhob_solid_u_r2(i_part) = f_(idx1)
556 rho_solid_avg(i_part) = 1.d0 / ( sum( wi_temp(i_part,:) / &
557 part_dens_array(i_part,:) ) / sum( wi_temp(i_part,:) ) )
561 IF ( verbose_level .GT. 3 )
THEN
563 WRITE(*,*)
'rhoB_solid_U_r2',idx1,rhob_solid_u_r2(i_part)
564 WRITE(*,*)
'i_part,rho_solid_avg',i_part, rho_solid_avg(i_part)
570 alfa_s_u_r2(1:n_part) = rhob_solid_u_r2(1:n_part) / rho_solid_avg(1:n_part)
572 rhob_solid_tot_u_r2 = sum( rhob_solid_u_r2(1:n_part) )
574 alfa_g_u_r2 = ( f_(1) - rhob_solid_tot_u_r2 ) / rho_gas
576 u_r2 = sum( alfa_s_u_r2(1:n_part) ) + alfa_g_u_r2
578 r = dsqrt( u_r2 / mag_u )
580 rho_mix = f_(1) / u_r2
582 IF ( verbose_level .GT. 2 )
THEN
584 WRITE(*,*)
'rho_gas',rho_gas
585 WRITE(*,*)
'u_r2,r,mag_u',u_r2,r,mag_u
586 WRITE(*,*)
'rho_mix',rho_mix
587 WRITE(*,*)
' alfa_g', alfa_g_u_r2/ u_r2
594 solid_volume_fraction(1:n_part) = alfa_s_u_r2(1:n_part) / u_r2
596 solid_tot_volume_fraction = sum( solid_volume_fraction(1:n_part) )
598 solid_partial_volume_fraction(1:n_part) = solid_volume_fraction(1:n_part) / &
599 solid_tot_volume_fraction
601 solid_partial_mass_fraction = solid_partial_volume_fraction * rho_solid_avg &
602 / sum( solid_partial_volume_fraction * rho_solid_avg )
604 solid_mass_fraction(1:n_part) = solid_volume_fraction(1:n_part) * &
605 rho_solid_avg(1:n_part) / rho_mix
607 rho_solid_tot_avg = sum( solid_partial_volume_fraction * rho_solid_avg )
611 gas_mass_fraction = ( f_(1) - rhob_solid_tot_u_r2 ) / f_(1)
613 gas_volume_fraction = 1.d0 - solid_tot_volume_fraction
615 atm_volume_fraction = gas_volume_fraction * alfa_g_atm
617 wvapour_volume_fraction = gas_volume_fraction * alfa_g_wvapour
619 atm_mass_fraction = atm_volume_fraction * rho_atm_tp / rho_mix
625 wvapour_mass_fraction = wvapour_volume_fraction * rho_wvapour / rho_mix
631 idx1 = 10 + 0 + n_mom * ( i_part - 1 )
632 idx2 = 10 + n_mom - 1 + n_mom * ( i_part - 1 )
634 IF ( distribution_variable .EQ.
'particles_number' )
THEN
636 mom(i_part,0:n_mom-1) = f_(idx1:idx2) / ( u_r2 )
638 ELSEIF ( distribution_variable .EQ.
'mass_fraction' )
THEN
640 mom(i_part,0:n_mom-1) = f_(idx1:idx2) / ( rho_mix * u_r2 )
644 IF ( verbose_level .GE. 2 )
THEN
646 WRITE(*,*)
'i_part',i_part
647 WRITE(*,*)
'f',f_(idx1:idx2)
648 WRITE(*,*)
'mom',mom(i_part,0:n_mom-1)
652 IF ( distribution .EQ.
'constant' )
THEN
670 IF ( verbose_level .GE. 2 )
THEN
673 WRITE(*,*)
'************** UNLUMPED VARIABLES **************'
674 WRITE(*,*)
'cpmix',cpmix
676 WRITE(*,*)
'rgasmix',rgasmix
682 WRITE(*,*)
'************** DENSITIES **************'
683 WRITE(*,*)
'rho_gas',rho_gas
684 WRITE(*,*)
'rho solids',rho_solid_avg
685 WRITE(*,*)
'rho solid tot avg',rho_solid_tot_avg
686 WRITE(*,*)
'rho_mix',rho_mix
689 WRITE(*,*)
'************** VOLUME FRACTIONS **************'
690 WRITE(*,*)
'gas volume fraction',gas_volume_fraction
691 WRITE(*,*)
'solid_tot_volume_fraction',solid_tot_volume_fraction
692 WRITE(*,*)
'partial solid volume fraction',solid_partial_volume_fraction
695 WRITE(*,*)
'************** MASS FRACTIONS **************'
696 WRITE(*,*)
'solid partial mass fraction',solid_partial_mass_fraction
697 WRITE(*,*)
'solid mass fraction',solid_mass_fraction
698 WRITE(*,*)
'solid_tot_mass_fraction',1.d0 - gas_mass_fraction
699 WRITE(*,*)
'gas mass fraction',gas_mass_fraction
700 WRITE(*,*)
'atm_mass_fraction',atm_mass_fraction
701 WRITE(*,*)
'wvapour_mass_fraction',wvapour_mass_fraction
subroutine rate(rhs_)
Compute the right-hand side of the equations.
real *8 function particles_density(i_part, diam_in)
Particle density.
subroutine zmet
Meteo parameters.
Gas/particles mixture module.
subroutine moments_correction(m, iter)
Moments correction.
subroutine unlump(f_)
Calculate physical variables from lumped variables.
subroutine allocate_matrix
Solver variables allocation.
subroutine lump(f_)
Calculate the lumped variables.
Method of Moments module.
subroutine eval_particles_moments(xi, w)
Particles moments computation.
subroutine marching(fold, fnew, rate)
Marching s one step.
subroutine wheeler_algorithm(m, xi, w)
Wheeler algorithm.