129 IF ( solid_transport_flag )
THEN 161 REAL*8,
INTENT(IN) :: Bj
162 REAL*8,
INTENT(IN),
OPTIONAL :: r_qj(n_vars)
163 COMPLEX*16,
INTENT(IN),
OPTIONAL :: c_qj(n_vars)
165 COMPLEX*16 :: qj(n_vars)
167 IF (
present(c_qj) )
THEN 177 h = qj(1) - dcmplx( bj , 0.d0 )
179 IF (
REAL( h ) .GT. eps_sing ** 0.25D0 ) then
187 u = dsqrt(2.d0) *
h * qj(2) / cdsqrt(
h**4 + eps_sing )
189 v = dsqrt(2.d0) *
h * qj(3) / cdsqrt(
h**4 + eps_sing )
193 IF ( solid_transport_flag )
THEN 195 IF (
REAL( h ) .GT. 1.D-25 ) then
199 IF ( temperature_flag )
t = qj(5) /
h 203 xs = dsqrt(2.d0) *
h * qj(4) / cdsqrt(
h**4 + eps_sing )
205 IF ( temperature_flag )
THEN 207 t = dsqrt(2.d0) *
h * qj(5) / cdsqrt(
h**4 + eps_sing )
215 IF ( temperature_flag )
THEN 217 IF (
REAL( h ) .GT. 1.D-25 ) then
223 t = dsqrt(2.d0) *
h * qj(4) / cdsqrt(
h**4 + eps_sing )
251 REAL*8,
INTENT(IN) :: qj(n_vars)
252 REAL*8,
INTENT(IN) :: Bj
253 REAL*8,
INTENT(OUT) :: vel_min(n_vars) , vel_max(n_vars)
257 vel_min(1:n_eqns) =
REAL(u) - DSQRT(
grav *
REAL(h) )
258 vel_max(1:n_eqns) =
REAL(u) + DSQRT(
grav *
REAL(h) )
280 REAL*8,
INTENT(IN) :: qj(n_vars)
281 REAL*8,
INTENT(IN) :: Bj
282 REAL*8,
INTENT(OUT) :: vel_min(n_vars) , vel_max(n_vars)
286 vel_min(1:n_eqns) =
REAL(v) - DSQRT(
grav *
REAL(h) )
287 vel_max(1:n_eqns) =
REAL(v) + DSQRT(
grav *
REAL(h) )
309 REAL*8,
INTENT(IN) :: qj(n_vars)
310 REAL*8,
INTENT(IN) :: Bj
311 REAL*8,
INTENT(OUT) :: vel_min(n_vars) , vel_max(n_vars)
313 REAL*8 :: h_temp , u_temp
317 IF ( h_temp .NE. 0.d0 )
THEN 319 u_temp = qj(2) / h_temp
327 vel_min(1:n_eqns) = u_temp - dsqrt(
grav * h_temp )
328 vel_max(1:n_eqns) = u_temp + dsqrt(
grav * h_temp )
350 REAL*8,
INTENT(IN) :: qj(n_vars)
351 REAL*8,
INTENT(IN) :: Bj
352 REAL*8,
INTENT(OUT) :: vel_min(n_vars) , vel_max(n_vars)
354 REAL*8 :: h_temp , v_temp
358 IF ( h_temp .NE. 0.d0 )
THEN 360 v_temp = qj(3) / h_temp
368 vel_min(1:n_eqns) = v_temp - dsqrt(
grav * h_temp )
369 vel_max(1:n_eqns) = v_temp + dsqrt(
grav * h_temp )
395 REAL*8,
INTENT(IN) :: qc(n_vars)
396 REAL*8,
INTENT(IN) :: B
397 REAL*8,
INTENT(OUT) :: qp(n_vars)
409 IF ( temperature_flag ) qp(5) =
REAL(
t)
413 IF ( temperature_flag ) qp(4) =
REAL(
t)
441 REAL*8,
INTENT(IN) :: qp(n_vars)
442 REAL*8,
INTENT(IN) :: B
443 REAL*8,
INTENT(OUT) :: qc(n_vars)
456 qc(2) = ( r_hb - b ) * r_u
457 qc(3) = ( r_hb - b ) * r_v
462 qc(4) = ( r_hb - b ) * r_xs
464 IF ( temperature_flag )
THEN 467 qc(5) = ( r_hb - b ) * r_t
473 IF ( temperature_flag )
THEN 476 qc(4) = ( r_hb - b ) * r_t
504 REAL*8,
INTENT(IN) :: qrec(n_vars)
505 REAL*8,
INTENT(IN) :: B
506 REAL*8,
INTENT(OUT) :: qc(n_vars)
522 qc(2) =
REAL(h) * r_u
523 qc(3) =
REAL(h) * r_v
528 qc(4) =
REAL(h) * r_xs
530 IF ( temperature_flag )
THEN 533 qc(5) =
REAL(h) * r_T
539 IF ( temperature_flag )
THEN 542 qc(4) =
REAL(h) * r_T
564 SUBROUTINE eval_fluxes(Bj,c_qj,r_qj,c_flux,r_flux,dir)
569 REAL*8,
INTENT(IN) :: Bj
570 COMPLEX*16,
INTENT(IN),
OPTIONAL :: c_qj(n_vars)
571 COMPLEX*16,
INTENT(OUT),
OPTIONAL :: c_flux(n_eqns)
572 REAL*8,
INTENT(IN),
OPTIONAL :: r_qj(n_vars)
573 REAL*8,
INTENT(OUT),
OPTIONAL :: r_flux(n_eqns)
574 INTEGER,
INTENT(IN) :: dir
576 COMPLEX*16 :: qj(n_vars)
577 COMPLEX*16 :: flux(n_eqns)
578 COMPLEX*16 :: h_temp , u_temp , v_temp
582 IF (
present(c_qj) .AND.
present(c_flux) )
THEN 586 ELSEIF (
present(r_qj) .AND.
present(r_flux) )
THEN 590 qj(i) = dcmplx( r_qj(i) )
596 WRITE(*,*)
'Constitutive, eval_fluxes: problem with arguments' 602 IF ( dir .EQ. 1 )
THEN 610 IF (
REAL(h_temp) .NE. 0.D0 ) then
612 u_temp = qj(2) / h_temp
614 flux(2) = h_temp * u_temp**2 + 0.5d0 *
grav * h_temp**2
616 flux(3) = u_temp * qj(3)
620 flux(4) = u_temp * qj(4)
623 IF ( temperature_flag ) flux(5) = u_temp * qj(5)
628 IF ( temperature_flag ) flux(4) = u_temp * qj(4)
634 flux(2:n_eqns) = 0.d0
638 ELSEIF ( dir .EQ. 2 )
THEN 646 IF(
REAL(h_temp).NE.0.d0)then
648 v_temp = qj(3) / h_temp
650 flux(2) = v_temp * qj(2)
652 flux(3) = h_temp * v_temp**2 + 0.5d0 *
grav * h_temp**2
656 flux(4) = v_temp * qj(4)
659 IF ( temperature_flag ) flux(5) = v_temp * qj(5)
664 IF ( temperature_flag ) flux(4) = v_temp * qj(4)
670 flux(2:n_eqns) = 0.d0
676 WRITE(*,*)
'Constitutive, eval_fluxes: problem with arguments' 682 IF (
present(c_qj) .AND.
present(c_flux) )
THEN 686 ELSEIF (
present(r_qj) .AND.
present(r_flux) )
THEN 688 r_flux =
REAL( flux )
709 c_qj , c_nh_term_impl , r_qj , r_nh_term_impl )
716 REAL*8,
INTENT(IN) :: Bj
717 REAL*8,
INTENT(IN) :: Bprimej_x, Bprimej_y
718 REAL*8,
INTENT(IN) :: grav3_surf
720 COMPLEX*16,
INTENT(IN),
OPTIONAL :: c_qj(n_vars)
721 COMPLEX*16,
INTENT(OUT),
OPTIONAL :: c_nh_term_impl(n_eqns)
722 REAL*8,
INTENT(IN),
OPTIONAL :: r_qj(n_vars)
723 REAL*8,
INTENT(OUT),
OPTIONAL :: r_nh_term_impl(n_eqns)
725 COMPLEX*16 :: qj(n_vars)
727 COMPLEX*16 :: nh_term(n_eqns)
729 COMPLEX*16 :: relaxation_term(n_eqns)
731 COMPLEX*16 :: forces_term(n_eqns)
735 COMPLEX*16 :: mod_vel
739 REAL*8 :: radiative_coeff
741 COMPLEX*16 :: radiative_term
743 REAL*8 :: convective_coeff
745 COMPLEX*16 :: convective_term
747 COMPLEX*16 :: conductive_coeff , conductive_term
749 REAL*8 :: thermal_diffusivity
751 REAL*8 :: h_threshold
759 COMPLEX*8 :: fluid_visc
762 COMPLEX*8 :: sed_vol_fract_cmplx
780 IF ( temperature_flag )
THEN 795 IF (
present(c_qj) .AND.
present(c_nh_term_impl) )
THEN 799 ELSEIF (
present(r_qj) .AND.
present(r_nh_term_impl) )
THEN 803 qj(i) = dcmplx( r_qj(i) )
809 WRITE(*,*)
'Constitutive, eval_fluxes: problem with arguments' 815 relaxation_term(1:n_eqns) = dcmplx(0.d0,0.d0)
818 forces_term(1:n_eqns) = dcmplx(0.d0,0.d0)
820 IF (rheology_flag)
THEN 824 mod_vel = cdsqrt(
u**2 +
v**2 )
827 IF ( rheology_model .EQ. 1 )
THEN 829 IF (
REAL(mod_vel) .NE. 0.D0 ) then
832 forces_term(2) = forces_term(2) - (
u / mod_vel ) * &
833 (
grav /
xi ) * mod_vel ** 2
835 forces_term(3) = forces_term(3) - (
v / mod_vel ) * &
836 (
grav /
xi ) * mod_vel ** 2
841 ELSEIF ( rheology_model .EQ. 2 )
THEN 843 IF (
REAL(mod_vel) .NE. 0.D0 ) then
845 forces_term(2) = forces_term(2) -
tau * (
u/mod_vel)
847 forces_term(3) = forces_term(3) -
tau * (
v/mod_vel)
852 ELSEIF ( rheology_model .EQ. 3 )
THEN 854 IF (
REAL(h) .GT. h_threshold ) then
867 IF (
REAL(mod_vel) .NE. 0.D0 ) then
870 forces_term(2) = forces_term(2) - gamma *
u 873 forces_term(3) = forces_term(3) - gamma *
v 878 ELSEIF ( rheology_model .EQ. 4 )
THEN 898 gamma_m = ( dcmplx(1.d0,0.d0) - sed_vol_fract_cmplx ) *
gamma_w &
899 + sed_vol_fract_cmplx *
gamma_s 902 tau_y =
alpha2 * cdexp(
beta2 * sed_vol_fract_cmplx )
905 fluid_visc =
alpha1 * cdexp(
beta1 * sed_vol_fract_cmplx )
908 IF (
h .GT. h_threshold )
THEN 911 s_y = tau_y / ( gamma_m *
h )
914 s_v =
kappa * fluid_visc * mod_vel / ( 8.d0 * gamma_m *
h**2 )
918 s_td =
n_td**2 * mod_vel**2 / (
h**(4.d0/3.d0) )
926 s_y = tau_y / ( gamma_m * h_threshold )
929 s_v =
kappa * fluid_visc * mod_vel / ( 8.d0 * gamma_m * &
933 s_td =
n_td**2 * (mod_vel**2) / ( h_threshold**(4.d0/3.d0) )
940 IF ( mod_vel .GT. 0.d0 )
THEN 942 forces_term(2) = forces_term(2) -
grav *
h * (
u / mod_vel ) * s_f
943 forces_term(3) = forces_term(3) -
grav *
h * (
v / mod_vel ) * s_f
956 ELSEIF ( rheology_model .EQ. 5 )
THEN 958 tau = 1.d-3 / ( 1.d0 + 10.d0 *
h ) * mod_vel
960 IF ( dble(mod_vel) .NE. 0.d0 )
THEN 962 forces_term(2) = forces_term(2) -
tau * (
u / mod_vel )
963 forces_term(3) = forces_term(3) -
tau * (
v / mod_vel )
971 IF ( temperature_flag )
THEN 975 IF (
REAL(h) .GT. 0.d0 ) then
982 radiative_coeff = 0.d0
986 IF (
REAL(T) .GT. T_env ) then
989 radiative_term = - radiative_coeff * (
t**4 - t_env**4 )
993 radiative_term = dcmplx(0.d0,0.d0)
997 IF (
REAL(h) .GT. 0.d0 ) then
1005 convective_coeff = 0.d0
1009 IF (
REAL(T) .GT. T_env ) then
1012 convective_term = - convective_coeff * (
t - t_env )
1016 convective_term = dcmplx(0.d0,0.d0)
1020 IF (
REAL(h) .GT. h_threshold ) then
1025 conductive_coeff =
enne * thermal_diffusivity /
h 1029 conductive_coeff = dcmplx(0.d0,0.d0)
1030 conductive_coeff =
enne * thermal_diffusivity / dcmplx(h_threshold,0.d0)
1035 IF (
REAL(T) .GT. T_ground ) then
1037 conductive_term = - conductive_coeff * (
t - t_ground )
1041 conductive_term = dcmplx(0.d0,0.d0)
1045 IF ( solid_transport_flag )
THEN 1047 relaxation_term(5) = radiative_term + convective_term + conductive_term
1051 relaxation_term(4) = radiative_term + convective_term + conductive_term
1057 nh_term = relaxation_term + forces_term
1059 IF (
present(c_qj) .AND.
present(c_nh_term_impl) )
THEN 1061 c_nh_term_impl = nh_term
1063 ELSEIF (
present(r_qj) .AND.
present(r_nh_term_impl) )
THEN 1065 r_nh_term_impl =
REAL( nh_term )
1085 c_nh_semi_impl_term , r_qj , r_nh_semi_impl_term )
1092 REAL*8,
INTENT(IN) :: Bj
1093 REAL*8,
INTENT(IN) :: grav3_surf
1095 COMPLEX*16,
INTENT(IN),
OPTIONAL :: c_qj(n_vars)
1096 COMPLEX*16,
INTENT(OUT),
OPTIONAL :: c_nh_semi_impl_term(n_eqns)
1097 REAL*8,
INTENT(IN),
OPTIONAL :: r_qj(n_vars)
1098 REAL*8,
INTENT(OUT),
OPTIONAL :: r_nh_semi_impl_term(n_eqns)
1100 COMPLEX*16 :: qj(n_vars)
1102 COMPLEX*16 :: forces_term(n_eqns)
1106 COMPLEX*16 :: mod_vel
1108 REAL*8 :: h_threshold
1116 COMPLEX*8 :: sed_vol_fract_cmplx
1119 COMPLEX*8 :: gamma_m
1126 IF (
present(c_qj) .AND.
present(c_nh_semi_impl_term) )
THEN 1130 ELSEIF (
present(r_qj) .AND.
present(r_nh_semi_impl_term) )
THEN 1134 qj(i) = dcmplx( r_qj(i) )
1140 WRITE(*,*)
'Constitutive, eval_fluxes: problem with arguments' 1146 forces_term(1:n_eqns) = dcmplx(0.d0,0.d0)
1148 IF (rheology_flag)
THEN 1152 mod_vel = cdsqrt(
u**2 +
v**2 )
1155 IF ( rheology_model .EQ. 1 )
THEN 1157 IF ( mod_vel .GT. 0.d0 )
THEN 1159 forces_term(2) = forces_term(2) - (
u / mod_vel ) * &
1160 mu *
h * ( -
grav * grav3_surf )
1162 forces_term(3) = forces_term(3) - (
v / mod_vel ) * &
1163 mu *
h * ( -
grav * grav3_surf )
1168 ELSEIF ( rheology_model .EQ. 2 )
THEN 1172 ELSEIF ( rheology_model .EQ. 3 )
THEN 1176 ELSEIF ( rheology_model .EQ. 4 )
THEN 1178 h_threshold = 1.d-20
1180 sed_vol_fract_cmplx = dcmplx(
sed_vol_perc*1.d-2 , 0.d0 )
1196 gamma_m = ( dcmplx(1.d0,0.d0) - sed_vol_fract_cmplx ) *
gamma_w &
1197 + sed_vol_fract_cmplx *
gamma_s 1200 tau_y =
alpha2 * cdexp(
beta2 * sed_vol_fract_cmplx )
1202 IF (
h .GT. h_threshold )
THEN 1205 s_y = tau_y / ( gamma_m *
h )
1210 s_y = tau_y / ( gamma_m * h_threshold )
1214 IF ( mod_vel .GT. 0.d0 )
THEN 1216 forces_term(2) = forces_term(2) -
grav *
h * (
u / mod_vel ) * s_y
1217 forces_term(3) = forces_term(3) -
grav *
h * (
v / mod_vel ) * s_y
1221 ELSEIF ( rheology_model .EQ. 5 )
THEN 1228 IF ( temperature_flag )
THEN 1234 IF (
present(c_qj) .AND.
present(c_nh_semi_impl_term) )
THEN 1236 c_nh_semi_impl_term = forces_term
1238 ELSEIF (
present(r_qj) .AND.
present(r_nh_semi_impl_term) )
THEN 1240 r_nh_semi_impl_term = dble( forces_term )
1258 SUBROUTINE eval_expl_terms( Bj, Bprimej_x , Bprimej_y , source_xy , qj , &
1265 REAL*8,
INTENT(IN) :: Bj
1266 REAL*8,
INTENT(IN) :: Bprimej_x
1267 REAL*8,
INTENT(IN) :: Bprimej_y
1268 REAL*8,
INTENT(IN) :: source_xy
1270 REAL*8,
INTENT(IN) :: qj(n_eqns)
1271 REAL*8,
INTENT(OUT) :: expl_term(n_eqns)
1273 REAL*8 :: visc_heat_coeff
1275 expl_term(1:n_eqns) = 0.d0
1281 expl_term(2) =
grav *
REAL(h) * Bprimej_x
1283 expl_term(3) =
grav *
REAL(h) * Bprimej_y
1287 IF ( solid_transport_flag )
THEN 1297 IF ( rheology_model .EQ. 3 )
THEN 1299 IF (
REAL(h) .GT. 0.D0 ) then
1306 visc_heat_coeff = 0.d0
1310 IF ( solid_transport_flag )
THEN 1314 expl_term(5) = expl_term(5) - visc_heat_coeff * (
REAL(
u)**2 &
1315 +
REAL(
v)**2 ) * dexp( - visc_par * (
REAL(T) -
t_ref ) )
1321 expl_term(4) = expl_term(4) - visc_heat_coeff * (
REAL(
u)**2 &
1322 +
REAL(
v)**2 ) * dexp( - visc_par * (
REAL(T) -
t_ref ) )
real *8 emissivity
emissivity (eps in Costa & Macedonio, 2005)
subroutine qc_to_qp(qc, B, qp)
Conservative to physical variables.
real *8 gamma_s
Specific weight of sediments.
real *8 nu_ref
reference kinematic viscosity [m2/s]
real *8 t_ground
temperature of lava-ground interface
real *8 beta2
2nd parameter for yield strenght empirical relationship (O'Brian et al, 1993)
real *8, parameter sbconst
Stephan-Boltzmann constant [W m-2 K-4].
logical temperature_flag
Flag to choose if we model temperature transport.
logical rheology_flag
Flag to choose if we add the rheology.
real *8 rad_coeff
radiative coefficient
subroutine qrec_to_qc(qrec, B, qc)
Reconstructed to conservative variables.
real *8 c_p
specific heat [J kg-1 K-1]
subroutine eval_local_speeds_x(qj, Bj, vel_min, vel_max)
Local Characteristic speeds x direction.
subroutine eval_local_speeds2_y(qj, Bj, vel_min, vel_max)
Local Characteristic speeds.
integer rheology_model
choice of the rheology model
real *8 thermal_conductivity
thermal conductivity [W m-1 K-1] (k in Costa & Macedonio, 2005)
real *8 beta1
2nd parameter for fluid viscosity empirical relationship (O'Brian et al, 1993)
integer n_vars
Number of conservative variables.
complex *16 v
velocity (y direction)
real *8 enne
thermal boundary layer fraction of total thickness
logical source_flag
Flag to choose if there is a source of mass within the domain.
real *8 rho
fluid density [kg/m3]
real *8 grav
gravitational acceleration
real *8 mu
drag coefficients (Voellmy-Salm model)
real *8 visc_par
viscosity parameter [K-1] (b in Table 1 Costa & Macedonio, 2005)
logical, dimension(:), allocatable implicit_flag
character(len=20) phase1_name
real *8 n_td
Mannings roughness coefficient ( units: T L^(-1/3) )
subroutine eval_fluxes(Bj, c_qj, r_qj, c_flux, r_flux, dir)
Hyperbolic Fluxes.
subroutine init_problem_param
Initialization of relaxation flags.
real *8 t_env
evironment temperature [K]
real *8 alpha2
1st parameter for yield strenght empirical relationship (O'Brian et al, 1993)
real *8 gamma_w
Specific weight of water.
subroutine eval_expl_terms(Bj, Bprimej_x, Bprimej_y, source_xy, qj, expl_term)
Explicit Forces term.
real *8 atm_heat_transf_coeff
atmospheric heat trasnfer coefficient [W m-2 K-1] (lambda in C&M, 2005)
subroutine eval_local_speeds_y(qj, Bj, vel_min, vel_max)
Local Characteristic speeds y direction.
subroutine phys_var(Bj, r_qj, c_qj)
Physical variables.
real *8 alpha1
1st parameter for fluid viscosity empirical relationship (O'Brian et al, 1993)
real *8 t_ref
reference temperature [K]
real *8 exp_area_fract
fractional area of the exposed inner core (f in C&M, 2005)
subroutine eval_nonhyperbolic_terms(Bj, Bprimej_x, Bprimej_y, grav3_surf, c_qj, c_nh_term_impl, r_qj, r_nh_term_impl)
Non-Hyperbolic terms.
subroutine eval_local_speeds2_x(qj, Bj, vel_min, vel_max)
Local Characteristic speeds.
integer n_eqns
Number of equations.
subroutine qp_to_qc(qp, B, qc)
Physical to conservative variables.
complex *16 xs
sediment concentration
real *8 emme
velocity boundary layer fraction of total thickness
real *8 eps_sing
parameter for desingularization
real *8 tau
drag coefficients (plastic model)
complex *16 u
velocity (x direction)
real *8 frict_coeff
friction coefficient
real *8 kappa
Empirical resistance parameter.
logical solid_transport_flag
Flag to choose if we model solid phase transport.
integer n_nh
Number of non-hyperbolic terms.
character(len=20) phase2_name
subroutine eval_nh_semi_impl_terms(Bj, grav3_surf, c_qj, c_nh_semi_impl_term, r_qj, r_nh_semi_impl_term)
Non-Hyperbolic semi-implicit terms.