-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathGeoParams.jl
More file actions
59 lines (48 loc) · 1.77 KB
/
Copy pathGeoParams.jl
File metadata and controls
59 lines (48 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
function get_bulk_modulus(args::Vararg{Any, N}) where {N}
Kb = GeoParams.get_Kb(args...)
if isnan(Kb) || iszero(Kb)
return Inf
end
return Kb
end
function get_shear_modulus(args::Vararg{Any, N}) where {N}
G = GeoParams.get_G(args...)
if isnan(G) || iszero(G)
return Inf
end
return G
end
get_thermal_expansion(args::Vararg{Any, N}) where {N} = get_α(args...)
function get_α(rho::MeltDependent_Density; ϕ::T = 0.0, kwargs...) where {T}
αsolid = get_α(rho.ρsolid)
αmelt = get_α(rho.ρmelt)
return ϕ * αmelt + (1 - ϕ) * αsolid
end
function get_α(rho::BubbleFlow_Density; P = 0.0e0, kwargs...)
αmelt = get_α(rho.ρmelt, kwargs...)
αgas = get_α(rho.ρgas, kwargs...)
@unpack_val c0, a = rho
cutoff = c0^2 / a^2
if P < cutoff
c = a * sqrt(abs(P))
else
c = c0
end
return inv((c0 - c) / αgas + (1 - (c0 - c)) / αmelt)
end
function get_α(rho::GasPyroclast_Density; kwargs...)
αmelt = get_α(rho.ρmelt, kwargs...)
αgas = get_α(rho.ρgas, kwargs...)
@unpack_val δ, β = rho
return δ * αgas + (1 - δ) * αmelt
end
@inline get_α(p::MaterialParams) = get_α(p.Density[1])
@inline get_α(p::MaterialParams, args::NamedTuple) = get_α(p.Density[1], args)
@inline get_α(p::Union{T_Density, PT_Density, Melt_DensityX}) = GeoParams.get_α(p)
@inline get_α(p::Union{T_Density, PT_Density, Melt_DensityX}, ::Any) = GeoParams.get_α(p)
@inline get_α(rho::MeltDependent_Density, ::Any) = get_α(rho)
@inline get_α(rho::BubbleFlow_Density, ::Any) = get_α(rho)
@inline get_α(rho::GasPyroclast_Density, ::Any) = get_α(rho)
@inline get_α(rho::Melt_DensityX, ::Any) = get_α(rho)
@inline get_α(rho::ConstantDensity, args) = 0
@inline get_α(rho::ConstantDensity) = 0