22 REAL(wp),
ALLOCATABLE,
DIMENSION(:) ::
rhs1 25 REAL(wp),
ALLOCATABLE,
DIMENSION(:) ::
rhs2 28 REAL(wp),
ALLOCATABLE,
DIMENSION(:) ::
rhstemp 31 REAL(wp),
ALLOCATABLE,
DIMENSION(:) ::
rhs 34 REAL(wp),
ALLOCATABLE,
DIMENSION(:) ::
ftemp 37 REAL(wp),
ALLOCATABLE,
DIMENSION(:) ::
f 139 REAL(wp) :: cos_phi , sin_phi
142 REAL(wp) :: solid_term , cp_solid_term
146 REAL(wp) :: alpha_p , beta_p
150 REAL(wp) :: a_poly , b_poly , c_poly , d_poly
153 REAL(wp) :: a_10 , a_10_deriv
155 REAL(wp) :: rate_mom , f_mom , coeff_mom
159 cos_phi = sqrt(
u**2+
v**2 ) /
mag_u 166 IF ( s_star .LE. 10 )
THEN 169 a_10 = 2.45_wp - 1.05_wp * exp( -4.65e-3_wp * 10.0_wp )
171 a_10_deriv = - 1.05_wp * exp( -4.65e-3_wp * 10.0_wp ) * ( -4.65e-3_wp )
179 d_poly = - ( a_10 - 1.1_wp - a_10_deriv ) / 500.0_wp
181 c_poly = ( a_10 - 1.1_wp - 1000.0_wp * d_poly ) / 100.0_wp
184 a = a_poly + b_poly*s_star + c_poly*s_star**2 + d_poly*s_star**3
189 a = 2.45_wp - 1.05_wp * exp( -4.65e-3_wp * s_star )
197 alpha_p = max( 0.0_wp , 0.5_wp * c + ( 1.0_wp - 1.0_wp / a ) * ri )
210 factor0 = ( 1.0_wp + 6.0_wp / 5.0_wp * alpha_p )**2
211 prob_factor = ( factor0 - 1.0_wp ) / ( factor0 + 1.0_wp )
237 ueps = alpha_p * abs(
mag_u -
u_atm * cos_phi ) + beta_p * abs(
u_atm * &
281 + 0.5_wp *
mag_u**2 * solid_term) &
301 *
mom(i,i_sect,i_part)
324 IF ( read_atm_profile .EQ.
'standard' )
THEN 380 rhs2(idx) =
r**2 * ( birth_mom(i_mom,i_sect,i_part) - &
381 death_mom(i_mom,i_sect,i_part))
425 REAL(wp),
DIMENSION(:),
INTENT(OUT) :: f_
429 INTEGER :: idx , idx1 , idx2
432 f_(1) = rho_mix *
w *
r**2
439 mixture_enthalpy = dry_air_mass_fraction *
cpair * t_mix &
440 + solid_tot_mass_fraction *
cpsolid * t_mix &
444 + volcgas_mix_mass_fraction * cpvolcgas_mix * t_mix
447 f_(5) = f_(1) * ( mixture_enthalpy +
gi *
z + 0.5_wp *
mag_u**2 )
460 f_(idx) =
w *
r**2 *
mom(i_mom,i_sect,i_part)
475 * rho_mix ) *
w *
r**2
479 IF ( read_atm_profile .EQ.
'standard' )
THEN 506 REAL(wp),
DIMENSION(:),
INTENT(IN) :: fold, rate
507 REAL(wp),
DIMENSION(:),
INTENT(OUT) :: fnew
509 INTEGER :: i_part, i_mom
513 fnew(i) = fold(i) + rate(i) *
dz 576 REAL(wp),
DIMENSION(:),
INTENT(INOUT) :: f_
578 REAL(wp),
DIMENSION(n_part,n_nodes) :: xi , wi , wi_temp
580 REAL(wp) :: rhoB_volcgas_w_r2(n_gas)
582 REAL(wp) :: rhoB_solid_w_r2(n_part)
583 REAL(wp) :: rhoB_solid_tot_w_r2
585 REAL(wp) :: alfa_s_w_r2(1:n_part)
586 REAL(wp) :: alfa_g_w_r2
587 REAL(wp) :: alfa_lw_w_r2
588 REAL(wp) :: alfa_ice_w_r2
590 REAL(wp) :: atm_volume_fraction
591 REAL(wp) :: volcgas_mix_volume_fraction
595 REAL(wp) :: rho_solid_avg(n_part)
596 REAL(wp) :: rho_solid_tot_avg
606 INTEGER :: idx , idx1 , idx2
610 REAL(wp) :: gas_mix_volume_fraction
616 IF ( read_atm_profile .EQ.
'standard' )
THEN 631 phi = atan(
w / sqrt(
u**2+
v**2) )
634 volcgas_mass_fraction(1:n_gas) = &
635 f_(9+n_part*n_mom*n_sections+1:9+n_part*n_mom*n_sections+n_gas) / f_(1)
638 volcgas_mix_mass_fraction = sum( volcgas_mass_fraction(1:n_gas) )
640 rvolcgas_mix = 0.0_wp
641 cpvolcgas_mix = 0.0_wp
644 IF ( n_gas .GT. 0 )
THEN 648 rvolcgas_mix = rvolcgas_mix + volcgas_mass_fraction(i_gas) &
651 cpvolcgas_mix = cpvolcgas_mix + volcgas_mass_fraction(i_gas) &
655 rvolcgas_mix = rvolcgas_mix / sum(volcgas_mass_fraction(1:n_gas))
656 cpvolcgas_mix = cpvolcgas_mix / sum(volcgas_mass_fraction(1:n_gas))
660 WRITE(*,*)
'rvolcgas_mix :', rvolcgas_mix
661 WRITE(*,*)
'cpvolcgas_mix :', cpvolcgas_mix
667 rvolcgas_mix = 0.0_wp
668 cpvolcgas_mix = 0.0_wp
673 dry_air_mass_fraction = f_(8+n_part*n_mom*n_sections) / f_(1)
676 water_mass_fraction = f_(9+n_part*n_mom*n_sections) / f_(1)
679 solid_tot_mass_fraction = 1.0_wp-dry_air_mass_fraction- water_mass_fraction &
680 - volcgas_mix_mass_fraction
690 DO i_sect=1,n_sections
692 idx1 = 8+0+(i_part-1)*n_sections*n_mom+(i_sect-1)*n_mom
693 idx2 = 8+n_mom-1+(i_part-1)*n_sections*n_mom+(i_sect-1)*n_mom
695 mom(0:1,i_sect,i_part) = f_(idx1:idx2)
699 rhob_solid_w_r2(i_part) = sum(mom(1,:,i_part))
704 CALL eval_quad_values
709 rho_solid_avg(i_part) = 1.0_wp / ( sum( f_quad(:,:,i_part) &
710 * w_quad(:,:,i_part) * m_quad(:,:,i_part) / rho_quad(:,:,i_part) ) &
711 / sum(f_quad(:,:,i_part)* w_quad(:,:,i_part) * m_quad(:,:,i_part) ) )
715 WRITE(*,*)
'i_part',i_part
716 WRITE(*,*)
'rhoB_solid_w_r2',idx1,rhob_solid_w_r2(i_part)
717 WRITE(*,*)
'i_part,rho_solid_avg',i_part, rho_solid_avg(i_part)
718 WRITE(*,*)
'mom(0,1,i_part)',mom(0,1,i_part)
719 WRITE(*,*)
'mom(1,1,i_part)',mom(1,1,i_part)
720 WRITE(*,*)
'f_quad(:,1,i_part)',f_quad(:,1,i_part)
727 cpsolid = sum( rhob_solid_w_r2(1:n_part) * cp_part(1:n_part) ) &
728 / ( sum(rhob_solid_w_r2(1:n_part) ) )
731 rhob_solid_tot_w_r2 = sum( rhob_solid_w_r2(1:n_part) )
733 enth = f_(5) / f_(1) -
gi *
z - 0.50_wp *
mag_u**2
743 WRITE(*,*)
't_mix',t_mix
744 WRITE(*,*)
'enth',enth
745 WRITE(*,*)
'mag_u',
mag_u 746 WRITE(*,*)
'cpsolid',cpsolid
747 WRITE(*,*)
'solid_tot_mass_fraction',solid_tot_mass_fraction
748 WRITE(*,*)
'water_mass_fraction', water_mass_fraction
749 WRITE(*,*)
'volcgas_mix_mass_fraction', volcgas_mix_mass_fraction
750 WRITE(*,*)
'dry_air_mass_fraction', dry_air_mass_fraction
751 WRITE(*,*)
'water_vapor_mass_fraction', water_vapor_mass_fraction
752 WRITE(*,*)
'ice_mass_fraction',ice_mass_fraction
758 liquid_water_mass_fraction = water_mass_fraction-water_vapor_mass_fraction &
763 WRITE(*,*)
'liquid_water_mass_fraction',liquid_water_mass_fraction
768 rgasmix = ( f_(8+n_part*n_mom*n_sections)*rair + water_vapor_mass_fraction &
769 * f_(1) * rwv + volcgas_mix_mass_fraction * f_(1) * rvolcgas_mix ) &
770 / ( f_(8+n_part*n_mom*n_sections) + f_(1) * &
771 ( water_vapor_mass_fraction + volcgas_mix_mass_fraction ) )
774 rho_gas = pa / ( rgasmix * t_mix )
777 IF ( n_gas .GT. 0 )
THEN 779 rhovolcgas_mix = pa / ( rvolcgas_mix * t_mix )
783 rhovolcgas_mix = 0.0_wp
790 WRITE(*,*)
'*********************** UNLUMP ***********************' 791 WRITE(*,*)
'pa,t_mix',pa,t_mix
792 WRITE(*,*)
'rgasmix',rgasmix
794 WRITE(*,*)
'rho_gas,rhovolcgas_mix',rho_gas,rhovolcgas_mix
801 alfa_s_w_r2(1:n_part) = rhob_solid_w_r2(1:n_part) / rho_solid_avg(1:n_part)
804 alfa_g_w_r2 = ( f_(1) * ( 1.0_wp - liquid_water_mass_fraction &
805 - ice_mass_fraction ) - rhob_solid_tot_w_r2 ) / rho_gas
808 alfa_lw_w_r2 = f_(1) * liquid_water_mass_fraction / rho_lw
811 alfa_ice_w_r2 = f_(1) * ice_mass_fraction / rho_ice
813 w_r2 = sum( alfa_s_w_r2(1:n_part) ) + alfa_g_w_r2 + alfa_lw_w_r2 &
821 WRITE(*,*)
'w_r2,r,w',w_r2,
r,
w 826 rho_mix = f_(1) / w_r2
830 mom(0:n_mom-1,1:n_sections,1:n_part) = mom(0:n_mom-1,1:n_sections,1:n_part) &
834 f_quad(1:n_nodes,1:n_sections,1:n_part) = &
835 f_quad(1:n_nodes,1:n_sections,1:n_part) / w_r2
838 CALL eval_particles_moments
843 WRITE(*,*)
'*********** SUM(alfa_s(1:n_part))' , &
844 sum(alfa_s_w_r2(1:n_part))/w_r2
845 WRITE(*,*)
' alfa_g', alfa_g_w_r2/ w_r2
846 WRITE(*,*)
' alfa_lw', alfa_lw_w_r2/ w_r2
847 WRITE(*,*) ( alfa_lw_w_r2 + alfa_ice_w_r2 + alfa_g_w_r2 &
848 + sum(alfa_s_w_r2(1:n_part)) ) / w_r2
850 WRITE(*,*)
'rho_gas',rho_gas
851 WRITE(*,*)
'*********** SUM(alfa_s_w_r2(1:n_part))' , &
852 sum(alfa_s_w_r2(1:n_part))
853 WRITE(*,*)
'w_r2,r,w',w_r2,
r,
w 854 WRITE(*,*)
'f_(1),rho_gas',f_(1),rho_gas
855 WRITE(*,*)
'rhoB_solid_tot_w_r2',rhob_solid_tot_w_r2
856 WRITE(*,*)
'rho_mix',rho_mix
857 WRITE(*,*)
'alfa_g', alfa_g_w_r2 / w_r2
864 liquid_water_volume_fraction = liquid_water_mass_fraction * ( rho_mix &
868 ice_volume_fraction = ice_mass_fraction * ( rho_mix / rho_ice)
872 solid_volume_fraction(1:n_part) = alfa_s_w_r2(1:n_part) / w_r2
874 solid_tot_volume_fraction = sum( solid_volume_fraction(1:n_part) )
876 solid_partial_volume_fraction(1:n_part) = solid_volume_fraction(1:n_part) / &
877 solid_tot_volume_fraction
879 solid_partial_mass_fraction = solid_partial_volume_fraction * rho_solid_avg &
880 / sum( solid_partial_volume_fraction * rho_solid_avg )
882 solid_mass_fraction(1:n_part) = solid_volume_fraction(1:n_part) * &
883 rho_solid_avg(1:n_part) / rho_mix
885 rho_solid_tot_avg = sum( solid_partial_volume_fraction * rho_solid_avg )
890 gas_mass_fraction = ( f_(1) * ( 1.0_wp - liquid_water_mass_fraction &
891 - ice_mass_fraction ) - rhob_solid_tot_w_r2 ) / f_(1)
893 gas_volume_fraction = 1.0_wp - solid_tot_volume_fraction - &
894 liquid_water_volume_fraction - ice_volume_fraction
896 volcgas_mix_volume_fraction = volcgas_mix_mass_fraction * ( rho_mix / &
902 WRITE(*,*)
'************** UNLUMPED VARIABLES **************' 904 WRITE(*,*)
'rgasmix',rgasmix
905 WRITE(*,*)
't_mix',t_mix
906 WRITE(*,*)
'u,v,w',
u,
v,
w 909 WRITE(*,*)
'mass_flow_rate',
pi_g * rho_mix *
w * (
r**2)
912 WRITE(*,*)
'************** DENSITIES **************' 913 WRITE(*,*)
'rho_gas',rho_gas
914 WRITE(*,*)
'rho solids',rho_solid_avg
915 WRITE(*,*)
'rho solid tot avg',rho_solid_tot_avg
916 WRITE(*,*)
'rho_atm',rho_atm
917 WRITE(*,*)
'rho_mix',rho_mix
920 WRITE(*,*)
'************** VOLUME FRACTIONS **************' 921 WRITE(*,*)
'solid partial volume fractions',solid_partial_volume_fraction
922 WRITE(*,*)
'solid tot volume fraction',solid_tot_volume_fraction
923 WRITE(*,*)
'liquid water volume fraction',liquid_water_volume_fraction
924 WRITE(*,*)
'ice volume fraction',ice_volume_fraction
925 WRITE(*,*)
'gas volume fraction',gas_volume_fraction
926 WRITE(*,*)
'sum of previous four volume fractions', &
927 solid_tot_volume_fraction + liquid_water_volume_fraction + &
928 gas_volume_fraction + ice_volume_fraction
931 WRITE(*,*)
'************** MASS FRACTIONS **************' 932 WRITE(*,*)
'solid partial mass fractions',solid_partial_mass_fraction
933 WRITE(*,*)
'solid tot mass fraction',solid_tot_mass_fraction
934 WRITE(*,*)
'liquid water mass fraction',liquid_water_mass_fraction
935 WRITE(*,*)
'ice mass fraction',ice_mass_fraction
936 WRITE(*,*)
'gas mass fraction',gas_mass_fraction
937 WRITE(*,*)
'sum of previous four mass fractions', &
938 solid_tot_mass_fraction + liquid_water_mass_fraction + &
939 gas_mass_fraction + ice_mass_fraction
943 WRITE(*,*)
'volcgas_mass_fractions',volcgas_mass_fraction
944 WRITE(*,*)
'volcgas_mix_mass_fraction',volcgas_mix_mass_fraction
945 WRITE(*,*)
'water vapor mass fraction',water_vapor_mass_fraction
946 WRITE(*,*)
'dry air mass fraction',dry_air_mass_fraction
947 WRITE(*,*)
'sum of previous three mass fractions', &
948 volcgas_mix_mass_fraction + water_vapor_mass_fraction + &
949 dry_air_mass_fraction
950 WRITE(*,*)
'liquid water mass fraction',liquid_water_mass_fraction
951 WRITE(*,*)
'ice mass fraction',ice_mass_fraction
955 WRITE(*,*)
'Solid partial mass fractions' 959 WRITE(*,*)
'Particle phase:',i_part
960 WRITE(*,
"(30F8.2)") phil(n_sections:1:-1)
961 WRITE(*,
"(30F8.2)") phir(n_sections:1:-1)
962 WRITE(*,
"(30ES8.1)") mom(1,n_sections:1:-1,i_part) / &
963 sum( mom(1,:,i_part) )
subroutine aggr_rate
Compute the right-hand side of the equations.
integer n_mom
Number of moments.
integer n_part
number of particle phases
real(wp) exit_status
exit_status
real(wp) visc_atm
Atmospheric kinematic viscosity.
real(wp) pa
Atmospheric pressure.
real(wp), dimension(:), allocatable f_stepold
Integrated variables.
real(wp) u
plume x-horizontal velocity
real(wp) rho_atm
Atmospheric density.
real(wp), dimension(:), allocatable rhs2
Right-Hand Side (rhs2) aggregation terms only.
real(wp), dimension(:), allocatable volcgas_rate
Rate of change of volcanic gases.
real(wp) ice_mass_fraction
mass fraction of ice in the mixture
subroutine linear_reconstruction(Ml, Mr, mom, Ma, Mb, alfa, beta, gamma1, gamma2)
character(len=20) distribution
Ditribution of the particles: .
subroutine eval_particles_moments
Particles moments computation.
real(wp) liquid_water_mass_fraction
mass fraction of liquid water in the mixture
real(wp), dimension(:), allocatable volcgas_mass_fraction
mass fractions of volcanic gases
real(wp) cpair
specific heat capacity for dry air
real(wp), dimension(:,:,:), allocatable m_quad
Abscissa of quadrature formulas.
real(wp), parameter h_lw0
enthalpy of liquid water at reference temperature (J kg-1)
real(wp) v
plume y-horizontal velocity
integer itotal
Total number of equations.
real(wp) dz0
Initial integration step.
real(wp) gas_volume_fraction
gas vlume fraction in the mixture
real(wp), dimension(:), allocatable solid_volume_fraction
volume fraction of the particle phases with respect to the mixture
real(wp) water_vapor_mass_fraction
mass fraction of water vapor in the mixture
real(wp) rho_ice
Density of ice in the mixture.
real(wp), dimension(:,:,:), allocatable set_mom
Moments of the settling velocities.
real(wp) ta
Atmospheric temperature.
real(wp) dry_air_mass_fraction
mass fraction of dry air in the mixture
integer n_nodes
Number of nodes for the quadrature.
real(wp) x
plume location (downwind)
real(wp) rvolcgas_mix
gas constant of volcanic gases mixture ( J/(kg K) )
real(wp) volcgas_mix_mass_fraction
mass fraction of the volcanic gas in the mixture
real(wp) u_atm
Horizonal wind speed.
real(wp), dimension(:,:,:), allocatable set_cp_mom
Moments of the settling velocities times the heat capacity.
real(wp), dimension(:,:,:), allocatable f_quad
Values of linear reconstructions at quadrature points.
real(wp) beta_inp
entrainment coefficient (normal direction)
subroutine rate
Compute the right-hand side of the equations.
real(wp) alpha_inp
entrainment coefficient (parallel direction)
real(wp), dimension(:,:,:), allocatable rho_quad
Particle densities at quadrature points.
real(wp) cpvolcgas_mix
specific heat of volcanic gases mixture
real(wp), dimension(:), allocatable f
Integrated variables.
real(wp), dimension(:), allocatable cp_part
Heat capacity of particle phases.
real(wp) prob_factor
particle loss factor
real(wp) y
plume location (crosswind)
real(wp), dimension(:), allocatable solid_partial_mass_fraction
mass fraction of the particle phases with respect to the total solid
subroutine eval_temp(enth, pa, cpsolid)
Mixture temperature.
real(wp) solid_tot_volume_fraction
solid volume fraction in the mixture
real(wp) r0
initial radius of the plume
real(wp) rgasmix
universal constant for the mixture
subroutine update_aggregation(temp, visc, lw_vf, ice_vf, solid_mf)
Aggregation terms.
real(wp) atm_mass_fraction
mass fraction of the entrained air in the mixture
real(wp), dimension(:), allocatable solid_mass_fraction
mass fraction of the particle phases with respect to the mixture
real(wp) dz
Integration step.
real(wp) rp
radiation coefficient (kg/m**2/deg. k**3/s)
Gas/particles mixture module.
real(wp) rho_mix
mixture density
real(wp) s
length along plume centerline
real(wp), parameter h_wv0
enthalpy of water vapor at reference temperature (J kg-1)
real(wp) cos_theta
Wind angle.
real(wp) phi
angle between the plume trajectory and ground
subroutine zmet
Meteo parameters.
real(wp), parameter c_ice
specific heat of ice (J K-1 kg-1)
real(wp) rair
perfect gas constant for dry air ( J/(kg K) )
Method of Moments module.
logical particles_loss
logical defining if we loose particles
real(wp), dimension(:), allocatable rvolcgas
gas constants for volcanic gases
real(wp), dimension(:,:,:), allocatable mom
Moments of the particles diameter.
real(wp), dimension(:), allocatable phil
left boundaries of the sections in phi-scale
real(wp), parameter t_ref
reference temperature (K)
real(wp), dimension(:), allocatable rhs
Right-Hand Side (rhs)
logical entr_abv_nbl_flag
Flag to allow for entrainment above neutral buoyancy level.
real(wp) mag_u
velocity magnitude along the centerline
real(wp), dimension(:,:,:), allocatable w_quad
Weights of quadrature formulas.
real(wp), dimension(:), allocatable rhstemp
Right-Hand Side (rhs)
real(wp) liquid_water_volume_fraction
mass fraction of liquid water in the mixture
real(wp) z
plume vertical coordinate
real(wp) water_mass_fraction
mass fraction of water in the mixture
real(wp) rho_gas
gas phase density
real(wp), dimension(:,:,:), allocatable birth_mom
Term accounting for the birth of aggregates in the moments equations.
real(wp), dimension(:), allocatable cpvolcgas
specific heat capacity for volcanic gases
real(wp) cpsolid
Average heat capacity of particles.
integer, parameter wp
working precision
real(wp), dimension(:), allocatable ftemp
Integrated variables.
real(wp), dimension(:), allocatable phir
right boundaries of the sections in phi-scale
real(wp) t_mix
mixture temperature
real(wp), parameter c_lw
specific heat of liquid water (J K-1 kg-1)
real(wp), parameter c_wv
specifc heat of water vapor (J K-1 kg-1)
real(wp), dimension(:), allocatable rhs1
Right-Hand Side (rhs1) terms without aggregation.
real(wp) rhovolcgas_mix
volcanic gases mixture density
subroutine lump(f_)
Calculate the lumped variables.
real(wp), dimension(:,:,:), allocatable death_mom
Term accounting for the loss of particles because of aggregation.
subroutine marching(fold, fnew, rate)
Marching s one step.
real(wp) function particles_density(i_part, phi)
Particle density.
real *8 gi
Gravity acceleration.
real(wp) mixture_enthalpy
real(wp), parameter rwv
gas constant for water vapor ( J/(kg K) )
real(wp) rho_lw
Density of liquid water in the mixture.
subroutine unlump(f_)
Calculate physical variables from lumped variables.
subroutine eval_quad_values
Quadrature values computation.
subroutine allocate_matrix
Solver variables allocation.
integer n_gas
volcanic gas species number
real(wp), dimension(:), allocatable solid_partial_volume_fraction
volume fraction of the particle phases with respect to the total solid
real(wp) solid_tot_mass_fraction
solid mass fraction in the mixture
real(wp) ice_volume_fraction
mass fraction of ice in the mixture
real(wp) gas_mass_fraction
gas mass fraction in the mixture
real(wp) w
plume vertical velocity
character *10 read_atm_profile
integer verbose_level
Level of verbose output (0 = minimal output on screen)
real(wp) sphu_atm
Atmospheric specific humidity (kg/kg)