121 REAL*8,
INTENT(IN),
OPTIONAL :: r_qp(n_eqns)
122 COMPLEX*16,
INTENT(IN),
OPTIONAL :: c_qp(n_eqns)
124 COMPLEX*16 :: qp(n_eqns)
128 IF (
present(c_qp) )
THEN 134 qp = dcmplx( r_qp , 0.d0 )
145 x_d_md(1:n_gas) = qp(idx_xd_first:idx_xd_last)
147 alfa_g(1:n_gas) = qp(idx_alfa_first:idx_alfa_last)
156 IF ( n_mom .LE. 1 )
THEN 158 beta(1:n_cry) = qp(idx_beta_first:idx_beta_last)
209 + sum(
x_d(1:n_gas) *
cv_d(1:n_gas) ) &
210 + sum(
x_g(1:n_gas) *
cv_g(1:n_gas) )
235 REAL*8,
INTENT(IN) :: r_qp(n_vars)
236 REAL*8,
INTENT(OUT) :: qp2(1+n_cry+n_gas+n_gas+4)
238 COMPLEX*16 :: qp(n_vars)
244 qp(i) = dcmplx( r_qp(i), 0.d0 )
256 qp2(1+1:1+n_gas) =
REAL(
rho_g(1:n_gas))
257 qp2(1+n_gas+1:1+n_gas+n_cry) =
REAL(
beta_eq(1:n_cry))
258 qp2(1+n_gas+n_cry+1:1+n_gas+n_cry+n_gas) =
REAL( x_d_md_eq(1:n_gas) )
262 qp2(1+n_gas+n_cry+n_gas+1) =
REAL(
visc_mix )
266 qp2(1+n_gas+n_cry+n_gas+2) =
REAL(
visc_melt )
270 qp2(1+n_gas+n_cry+n_gas+3) =
REAL(
theta )
299 COMPLEX*16,
INTENT(IN),
OPTIONAL :: c_qp(n_vars)
300 COMPLEX*16,
INTENT(OUT),
OPTIONAL :: c_flux(n_eqns)
301 REAL*8,
INTENT(IN),
OPTIONAL :: r_qp(n_vars)
302 REAL*8,
INTENT(OUT),
OPTIONAL :: r_flux(n_eqns)
304 COMPLEX*16 :: qp(n_eqns)
305 COMPLEX*16 :: flux(n_eqns)
310 IF (
present(c_qp) .AND.
present(c_flux) )
THEN 314 ELSEIF (
present(r_qp) .AND.
present(r_flux) )
THEN 316 qp = dcmplx( r_qp , 0.d0 )
320 WRITE(*,*)
'Constitutive, eval_fluxes: problem with arguments' 328 flux(1:n_eqns) = dcmplx(0.d0,0.d0)
333 IF ( verbose_level .GE. 3 )
THEN 335 WRITE(*,*)
'Mixture mass flux' 351 IF ( verbose_level .GE. 3 )
THEN 353 WRITE(*,*)
'Volume Fraction1 flux' 362 IF ( verbose_level .GE. 3 )
THEN 364 WRITE(*,*)
'Mixture momentum flux' 381 IF ( verbose_level .GE. 3 )
THEN 383 WRITE(*,*)
'Relative velocity flux' 401 IF ( verbose_level .GE. 3 )
THEN 403 WRITE(*,*)
'Mixture energy flux' 413 IF ( verbose_level .GE. 3 )
THEN 415 WRITE(*,*)
'Dissolved gas mass fraction fluxes' 424 IF ( verbose_level .GE. 3 )
THEN 426 WRITE(*,*)
'Mass fraction exsolved gas' 433 IF ( n_mom .LE. 1 )
THEN 438 IF ( verbose_level .GE. 3 )
THEN 440 WRITE(*,*)
'Crystal volume fraction' 460 IF (
present(c_qp) .AND.
present(c_flux) )
THEN 464 ELSEIF (
present(r_qp) .AND.
present(r_flux) )
THEN 466 r_flux =
REAL( flux )
496 COMPLEX*16,
INTENT(IN),
OPTIONAL :: c_qp(n_vars)
497 COMPLEX*16,
INTENT(OUT),
OPTIONAL :: c_nh_term_impl(n_eqns)
498 REAL*8,
INTENT(IN),
OPTIONAL :: r_qp(n_vars)
499 REAL*8,
INTENT(OUT),
OPTIONAL :: r_nh_term_impl(n_eqns)
501 COMPLEX*16 :: qp(n_eqns)
503 COMPLEX*16 :: nh_term_impl(n_eqns)
505 COMPLEX*16 :: relaxation_term(n_eqns)
506 COMPLEX*16 :: forces_term(n_eqns)
507 COMPLEX*16 :: source_term(n_eqns)
512 IF (
present(c_qp) .AND.
present(c_nh_term_impl) )
THEN 516 ELSEIF (
present(r_qp) .AND.
present(r_nh_term_impl) )
THEN 520 qp(i) = dcmplx( r_qp(i) , 0.d0 )
526 WRITE(*,*)
'Constitutive, eval_fluxes: problem with arguments' 543 IF ( verbose_level .GE. 3 )
THEN 545 WRITE(*,*)
'relaxation_term' 546 WRITE(*,*) relaxation_term / (
radius**2 )
548 WRITE(*,*)
'forces_term' 549 WRITE(*,*) forces_term / (
radius **2 )
551 WRITE(*,*)
'source_term' 552 WRITE(*,*) source_term / (
radius **2 )
556 nh_term_impl = relaxation_term + forces_term + source_term
558 IF (
present(c_qp) .AND.
present(c_nh_term_impl) )
THEN 560 c_nh_term_impl = nh_term_impl
562 ELSEIF (
present(r_qp) .AND.
present(r_nh_term_impl) )
THEN 564 r_nh_term_impl =
REAL( nh_term_impl )
587 COMPLEX*16,
INTENT(OUT) :: relaxation_term(n_eqns)
589 COMPLEX*16 :: pressure_relaxation
590 COMPLEX*16 :: velocity_relaxation
598 relaxation_term(1:n_eqns) = dcmplx(0.d0,0.d0)
629 IF (
REAL( x_d_md(i) ) .LT.
REAL( x_d_md_eq(i) ) ) then
647 IF (
REAL( x_d_md(i) ) .LT.
REAL( x_d_md_eq(i) ) ) then
657 IF ( n_mom .LE. 1 )
THEN 703 COMPLEX*16,
INTENT(OUT) :: force_term(n_eqns)
705 COMPLEX*16 :: visc_force_1 , visc_force_2
706 COMPLEX*16 :: visc_force_1_rel , visc_force_2_rel
708 REAL*8 :: gas_wall_drag
716 force_term(1:n_eqns) = dcmplx(0.d0,0.d0)
733 gas_wall_drag = 0.03d0
737 visc_force_1 = visc_force_1 * ( 1.d0 -
frag_eff )
738 visc_force_2 = visc_force_2 *
frag_eff 756 visc_force_1_rel = visc_force_1 / ( ( 1.d0 -
alfa_2 ) *
rho_1 )
758 visc_force_2_rel = - visc_force_2 / (
alfa_2 *
rho_2 )
761 + visc_force_2_rel + visc_force_1_rel
775 + 2.d0 * visc_force_2 *
u_2 + 2.d0 * visc_force_1 *
u_1 782 force_term(i) = dcmplx(0.d0,0.d0)
789 force_term(i) = dcmplx(0.d0,0.d0)
796 force_term(i) = dcmplx(0.d0,0.d0)
823 COMPLEX*16,
INTENT(OUT) :: source_term(n_eqns)
827 COMPLEX*16 :: water_mass_flux
829 COMPLEX*16 :: heat_flux
837 q_lat = dcmplx(0.d0,0.d0)
850 q_lat = dcmplx(0.d0,0.d0)
857 water_mass_flux = dcmplx(0.d0,0.d0)
859 source_term(1:n_eqns) = dcmplx(0.d0,0.d0)
890 IF (
p_hydro .GE.
REAL(p_1) ) then
892 visc_w = 2.414d-5 * 10.d0 ** ( 247.8d0 / (
t_w - 140.d0 ) )
899 water_mass_flux = dcmplx( 0.d0 , 0.d0 )
907 IF (
p_lith .GE.
REAL(p_1) ) then
909 visc_w = 2.414d-5 * 10.d0 ** ( 247.8d0 / (
t_w - 140.d0 ) )
916 water_mass_flux = dcmplx( 0.d0 , 0.d0 )
926 water_mass_flux = dcmplx(0.d0,0.d0)
982 heat_flux = water_mass_flux *
cv_d(1) *
t_w 1011 source_term(i) = dcmplx(0.d0,0.d0)
1021 source_term(i) = - 2.d0 * q_lat *
radius 1025 source_term(i) = dcmplx(0.d0,0.d0)
1035 source_term(i) = dcmplx(0.d0,0.d0)
1058 REAL*8,
INTENT(OUT) :: expl_forces_term(n_eqns)
1066 expl_forces_term(1:n_eqns) = 0.d0
1096 expl_forces_term(i) = 0.d0
1103 expl_forces_term(i) = 0.d0
1110 expl_forces_term(i) = 0.d0
complex *16 u_1
melt-crystals phase local velocity
complex *16 x_md_1
melt+dis.gas mass fraction in phase 1
complex *16 rhob_m
melt bulk density
real *8 visc_w
Water viscosity.
subroutine eval_explicit_forces(expl_forces_term)
Explicit Forces terms.
logical isothermal
Flag for isothermal runs: .
integer idx_p2
Index of p2 in the qp array.
real *8 total_water_influx
Total water influx.
complex *16 s_1
local specific entropy of the melt-crystals phase
real *8 grav
gravitational acceleration
integer idx_ex_gas_eqn_last
complex *16, dimension(:,:), allocatable mom_cry
moments of the crystal referred to the melt-crystals phase
complex *16, dimension(:), allocatable rho_g
exsolved gas local density
logical ext_water
Flag to activate the injection of external water: .
complex *16, dimension(:), allocatable rho_c
crystals local density
complex *16 theta
Relative viscosity of the crystals.
complex *16 mu_2
free Gibbs energy of the exsolved gas
integer idx_u2
Index of u2 in the qp array.
complex *16 rho_m
melt local density
integer n_gas
Numbeer of crystal phases.
real *8 fixed_temp
Temperature for isothermal runs.
complex *16, dimension(:), allocatable x_c_1
cristal mass fractions in phase 1
real *8 visc_2
gas viscosity
complex *16 alfa_2
total exsolved gas local volume fraction
complex *16 u_2
exsolved gas local velocity
integer idx_ex_gas_eqn_first
subroutine eval_forces_terms(force_term)
Force terms.
complex *16 rho_mix
mixture local density
complex *16, dimension(:), allocatable beta_eq
equil. cry. volume fraction in the melt-crystals phase
subroutine eval_fluxes_qp(c_qp, r_qp, c_flux, r_flux)
Fluxes.
character *30 aquifer_type
Aquifer type: .
real *8 cv_2
exsolved gas specific heat capacity at constant volume
logical lateral_degassing
Flag for lateral degassing: .
subroutine f_bubbles
Exsolved gas relative viscosity.
subroutine eval_nonhyperbolic_terms_qp(c_qp, c_nh_term_impl, r_qp, r_nh_term_impl)
Non-Hyperbolic terms.
complex *16 p_2
local pressure of the exsolved gas
subroutine eval_qp2(r_qp, qp2)
Conservative to physical variables.
complex *16 e_2
local specific internal energy of the exsolved gas
real *8, dimension(:), allocatable tau_c
crystallization parameter:
complex *16, dimension(:), allocatable x_d_md_eq
equil. dis. gas mass fraction in the melt+dis.gas phase
integer idx_alfa_first
First index of alfa in the qp array.
subroutine vel_relax_term(velocity_relaxation)
Velocity relaxation term.
subroutine f_viscmelt
Melt viscosity.
complex *16, dimension(:), allocatable x_c
crystals mass fraction (with respect to the mixture)
logical lateral_degassing_flag
Input flag for lateral degassing: .
integer n_cry
Numbeer of crystal phases.
complex *16 rho_2
exsolved gas local density
complex *16 alfarho_2
bulk density of the exsolved gas
character *20 p_relax_model
pressure relaxation model
real *8, dimension(:), allocatable tau_d
exsolution parameter:
complex *16 t_boiling
Boiling temperature.
complex *16 u_mix
mixture velocity
complex *16 s_2
local specific entropy of the exsolved gas
complex *16 x_1
melt-crystals phase local mass fraction
real *8 k_cr
country rock permeability
complex *16 alfa_1
dis_gas+melt+crystals phase local volume fraction
complex *16, dimension(:), allocatable alfa_g
exsolved gas phases local volume fraction
integer idx_alfa_last
Last index of alfa in the qp array.
complex *16 alfa_m_1
melt volume fraction in phase 1
real *8 max_z_influx
Maximum depth of influx.
real *8 radius
Effective radius.
complex *16, dimension(:), allocatable alfa_g_2
exsolved gas volume fractions in phase 2
subroutine f_growth_rate
This subroutine compute the growth rates for the different crystal phases.
real *8 cv_m
melt specific heat capacity at constant volume
real *8 lambda_w
Latent heat of vaporization.
real *8 zeta_lith
Elevation above the bottom for the evaluation of the lithostatic pressure.
integer idx_beta_first
First index of beta in the qp array.
subroutine f_nucleation_rate
Lithostatic pressure.
logical inst_vaporization
Flag for instantaneous vaporization: .
complex *16, dimension(:), allocatable rhob_c
crystals bulk density
real *8 frag_eff
index of fragmentation in the interval [0;1]
integer n_mom
Number of moments for each crystal phase.
integer idx_dis_gas_eqn_first
subroutine f_beta_eq
Equilibrium Crystal content.
subroutine eval_relaxation_terms(relaxation_term)
Relaxation terms.
real *8, dimension(:), allocatable cv_g
exsolved gas heat capacity at constant volume
integer idx_xd_first
First index of xd in the qp array.
integer idx_p1
Index of p1 in the qp array.
integer idx_u1
Index of u1 in the qp array.
complex *16, dimension(:), allocatable x_g
exsolved gas mass fraction (with respect to the mixture)
character *30 drag_funct_model
drag function model
integer idx_cry_eqn_first
real *8, dimension(:), allocatable cv_d
dissolved gas heat capacity at constant volume
integer idx_beta_last
Last index of beta in the qp array.
complex *16, dimension(:), allocatable rho_d
dissolved gas local density
complex *16 e_1
local specific internal energy of the melt-crystals phase
complex *16 cv_mix
mixture specific heat capacity at constant volume
real *8, dimension(:), allocatable cv_c
crystals specific heat capacity at constant volume
real *8 p_hydro
Hydrostatic pressure.
real *8 min_z_influx
Minimum depth of influx.
integer idx_dis_gas_eqn_last
complex *16 x_m
melt mass fraction (with respect to the mixture)
complex *16, dimension(:), allocatable alfa_d_1
dissolved gas volume fractions in phase 1
subroutine press_relax_term(pressure_relaxation)
Pressure relaxation term.
complex *16, dimension(:), allocatable x_d_1
dissolved gas mass fractions in phase 1
complex *16 rho_1
dis_gas+melt+crystals phase local density
subroutine hydrostatic_pressure
Hydrostatic pressure.
complex *16, dimension(:), allocatable x_d
dissolved gas mass fraction (with respect to the mixture)
real *8 cv_w
Heat capacity of water.
real *8 t_w
Water temperature in the aquifer.
integer n_vars
Number of conservative variables.
real *8 rho_w
Water density.
complex *16, dimension(:), allocatable beta
crystal volume fraction in the melt-crystals phase
real *8 alfa2_lat_thr
Exsolved gas volume fraction threshold for lateral degassing.
subroutine eval_source_terms(source_term)
Source terms.
complex *16 x_m_1
melt mass fraction in phase 1
complex *16 x_2
exsolved gas local mass fraction
real *8 p_lith
Lithostatic pressure.
complex *16 mu_1
free Gibbs energy of the melt-crystals phase
complex *16 p_1
local pressure of the melt-crystals phase
subroutine lithostatic_pressure
Lithostatic pressure.
subroutine eval_densities
Phases densities.
subroutine f_xdis_eq
Equilibrium Dissolved gas.
complex *16 visc_rel_bubbles
relative viscosity due to bubbles
complex *16 t
mixture local temperature
subroutine phys_var_qp(r_qp, c_qp)
Physical variables.
complex *16, dimension(:), allocatable x_d_md
dissolved gas mass fraction in the melt+dis.gas phase
complex *16 visc_melt
melt viscosity
complex *16, dimension(:), allocatable x_g_2
exsolved gas mass fractions in phase 2
subroutine eos
Equation of state.
integer idx_t
Index of T in the qp array.
subroutine f_theta
Crystal relative viscosity.
subroutine mixture_viscosity
Mixture viscosity.
integer idx_xd_last
Last index of xd in the qp array.
complex *16 visc_mix
mixture viscosity
integer n_eqns
Number of equations.