Skip to content

Density

Methods

The density equation of state can be specified in a number of ways

GeoParams.MaterialParameters.Density.ConstantDensity Type
julia
ConstantDensity=2900kg/m^3)

Set a constant density:

ρ=cst

where ρ is the density [kg/m3].

source
GeoParams.MaterialParameters.Density.PT_Density Type
julia
PT_Density(ρ0=2900kg/m^3, α=3e-5/K, β=1e-9/Pa, T0=0C, P=0MPa)

Set a pressure and temperature-dependent density:

ρ=ρ0(1.0α(TT0)+β(PP0))

where ρ0 is the density [kg/m3] at reference temperature T0 and pressure P0, α is the temperature dependence of density and β the pressure dependence.

source
GeoParams.MaterialParameters.Density.T_Density Type
julia
T_Density(ρ0=2900kg/m^3, α=3e-5/K, T₀=273.15K)

Set a temperature-dependent density:

ρ=ρ0(1α(TT_0))

where ρ0 is the density [kg/m3] at reference temperature T0 and α the temperature dependence.

source
GeoParams.MaterialParameters.Density.Compressible_Density Type
julia
Compressible_Density(ρ0=2900kg/m^3, β=1e-9/Pa, P₀=0MPa)

Set a pressure-dependent density:

ρ=ρ0exp(β(PP_0))

where ρ0 is the density [kg/m3] at reference pressure P0 and β the pressure dependence.

source
GeoParams.MaterialParameters.Density.MeltDependent_Density Type
julia
MeltDependent_Density(ρsolid=ConstantDensity(), ρmelt=ConstantDensity())

If we use a single phase code the average density of a partially molten rock is

ρ=ϕρmelt+(1ϕ)ρsolid

where ρ is the average density [kg/m3], ρmelt the melt density, ρsolid the solid density and ϕ the melt fraction.

Note that any density formulation can be used for melt and solid.

source
GeoParams.MaterialParameters.Density.BubbleFlow_Density Type
julia
BubbleFlow_Density(ρmelt=ConstantDensity(), ρgas=ConstantDensity(), c0=0e0, a=0.0041MPa^-1/2)

Defines the BubbleFlow_Density as described in Slezin (2003) with a default gas solubility constant of 0.0041MPa1/2 used in e.g. Sparks et al. (1978)

ρ=1c0cρg+1(c0c)ρm

with

c={aP1/2for P<c02a2c0for Pc02a2

Arguments

  • ρmelt: Density of the melt

  • ρgas: Density of the gas

  • c0: Total volatile content

  • a: Gas solubility constant (default: 4.1e-6Pa1/2) (after Sparks et al., 1978)

Possible values for a are 3.2e-6-6.4e-6Pa1/2 where the lower value corresponds to mafic magmas at rather large pressures (400-600MPa) and the higher value to felsic magmas at low pressures (0 to 100-200MPa) (after Slezin (2003))

Example

julia
rheology = SetMaterialParams(;
                      Phase=1,
                      CreepLaws=(PowerlawViscous(), LinearViscous(; η=1e21Pa * s)),
                      Gravity=ConstantGravity(; g=9.81.0m / s^2),
                      Density= BubbleFlow_Density(ρmelt=ConstantDensity=2900kg/m^3), ρgas=ConstantDensity=1kg/m^3), c0=0.0, a=0.0041MPa^-1//2),
                      )

References

source
GeoParams.MaterialParameters.Density.GasPyroclast_Density Type
julia
GasPyroclast_Density(ρmelt=ConstantDensity(), ρgas=ConstantDensity(), δ=0e0)

Defines the GasPyroclast_Density as described in Slezin (2003) with a default volume fraction of free gas in the flow of 0.0 This is also used to model partly destroyed foam in the conduit.

ρ=ρgδ+ρp(1δ)

with

ρp=ρm(1β)+ρgβρl(1β)

Arguments

  • ρmelt: Density of the melt

  • ρgas: Density of the gas

  • δ: Volume fraction of free gas in the flow

  • β: Gas volume fraction enclosed within the particles

Example

julia
rheology = SetMaterialParams(;
                      Phase=1,
                      CreepLaws=(PowerlawViscous(), LinearViscous(; η=1e21Pa * s)),
                      Gravity=ConstantGravity(; g=9.81.0m / s^2),
                      Density= GasPyroclast_Density(ρmelt=ConstantDensity=2900kg/m^3), ρgas=ConstantDensity=1kg/m^3), δ=0.0, β=0.0),
                      )

References

source
GeoParams.MaterialParameters.Density.Melt_DensityX Type
julia
Melt_DensityX(; oxd_wt = oxd_wt)

Set a density depending on the oxide composition after the python script by Iacovino K & Till C (2019)

Arguments

  • oxd_wt::NTuple{9, T}: Melt composition as 9-element Tuple containing concentrations in [wt%] of the following oxides ordered in the exact sequence

           (SiO2 TiO2 Al2O3 FeO MgO CaO Na2O K2O H2O) 
    
           Default values are for a hydrous N-MORB composition

References

  • Iacovino K & Till C (2019). DensityX: A program for calculating the densities of magmatic liquids up to 1,627 °C and 30 kbar. Volcanica 2(1), p 1-10. doi:10.30909/vol.02.01.0110
source

Computational routines

To evaluate density within a user routine, use this:

GeoParams.MaterialParameters.Density.compute_density Function
julia
compute_density(P,T, s::PhaseDiagram_LookupTable)

Interpolates density as a function of T,P from a lookup table

source
GeoParams.MaterialParameters.Density.compute_density! Function
julia
compute_density!(rho::AbstractArray{_T, ndim}, MatParam::NTuple{N,AbstractMaterialParamsStruct}, Phases::AbstractArray{_I, ndim}; P=nothing, T=nothing) where {ndim,N,_T,_I<:Integer}

In-place computation of density rho for the whole domain and all phases, in case a vector with phase properties MatParam is provided, along with P and T arrays. This assumes that the Phase of every point is specified as an Integer in the Phases array.

Example

julia
julia> MatParam = (SetMaterialParams(Name="Mantle", Phase=1,
                        CreepLaws= (PowerlawViscous(), LinearViscous=1e23Pa*s)),
                        Density   = PT_Density()
                        ),
                    SetMaterialParams(Name="Crust", Phase=2,
                        CreepLaws= (PowerlawViscous(), LinearViscous=1e23Pas)),
                        Density   = ConstantDensity=2900kg/m^3))
                  );
julia> Phases = ones(Int64,10,10);
julia> Phases[:,5:end] .= 2
julia> rho     = zeros(size(Phases))
julia> T       =  ones(size(Phases))
julia> P       =  ones(size(Phases))*10
julia> args = (P=P, T=T)
julia> compute_density!(rho, MatParam, Phases, args)
julia> rho
10×10 Matrix{Float64}:
 2899.91  2899.91  2899.91  2899.91  2900.0  2900.0  2900.0  2900.0  2900.0  2900.0
 2899.91  2899.91  2899.91  2899.91  2900.0  2900.0  2900.0  2900.0  2900.0  2900.0
 2899.91  2899.91  2899.91  2899.91  2900.0  2900.0  2900.0  2900.0  2900.0  2900.0
 2899.91  2899.91  2899.91  2899.91  2900.0  2900.0  2900.0  2900.0  2900.0  2900.0
 2899.91  2899.91  2899.91  2899.91  2900.0  2900.0  2900.0  2900.0  2900.0  2900.0
 2899.91  2899.91  2899.91  2899.91  2900.0  2900.0  2900.0  2900.0  2900.0  2900.0
 2899.91  2899.91  2899.91  2899.91  2900.0  2900.0  2900.0  2900.0  2900.0  2900.0
 2899.91  2899.91  2899.91  2899.91  2900.0  2900.0  2900.0  2900.0  2900.0  2900.0
 2899.91  2899.91  2899.91  2899.91  2900.0  2900.0  2900.0  2900.0  2900.0  2900.0
 2899.91  2899.91  2899.91  2899.91  2900.0  2900.0  2900.0  2900.0  2900.0  2900.0

The routine is made to minimize allocations:

julia
julia> using BenchmarkTools
julia> @btime compute_density!($rho, $MatParam, $Phases, P=$P, T=$T)
    203.468 μs (0 allocations: 0 bytes)

compute_density!(rho::AbstractArray{_T, N}, MatParam::NTuple{K,AbstractMaterialParamsStruct}, PhaseRatios::AbstractArray{_T, M}, P=nothing, T=nothing)

In-place computation of density rho for the whole domain and all phases, in case a vector with phase properties MatParam is provided, along with P and T arrays. This assumes that the PhaseRatio of every point is specified as an Integer in the PhaseRatios array, which has one dimension more than the data arrays (and has a phase fraction between 0-1)

source

Note that density values are usually not used in itself in the governing PDE's, but usually in combination with other parameters, such as ρg or ρcp. The non-dimensional value of ρ may thus have very large or small values, but multiplied with the other values one often obtains numbers that are closer to one.