Skip to content

Commit

Permalink
add get_α for MeltDependent_Density
Browse files Browse the repository at this point in the history
  • Loading branch information
aelligp committed Aug 27, 2024
1 parent 286e7da commit 240f151
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/rheology/GeoParams.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ 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

@inline get_α(p::MaterialParams) = get_α(p.Density[1])
@inline get_α(p::ConstantDensity) = 0.0
@inline get_α(p::MaterialParams, args::NamedTuple) = get_α(p.Density[1], args)
@inline get_α(p::Union{T_Density,PT_Density}) = GeoParams.get_α(p)
@inline get_α(p::MeltDependent_Density, ϕ) = GeoParams.get_α(p, (; ϕ = ϕ))
@inline get_α(rho::MeltDependent_Density, args) = get_α(rho; args...)
@inline get_α(rho::ConstantDensity, args) = 0
@inline get_α(rho::ConstantDensity) = 0

0 comments on commit 240f151

Please sign in to comment.