Heat capacity
Methods
Heat capacity is defined as
GeoParams.MaterialParameters.HeatCapacity.ConstantHeatCapacity Type
ConstantHeatCapacity(Cp=1050J/kg/K)Set a constant heat capacity:
where
GeoParams.MaterialParameters.HeatCapacity.T_HeatCapacity_Whittington Type
T_HeatCapacity_Whittington()Sets a temperature-dependent heat capacity following the parameterization of Whittington et al. (2009), Nature:
where
a = 199.50 J/mol/K if T<= 846 K
a = 229.32 J/mol/K if T> 846 K
b = 0.0857J/mol/K^2 if T<= 846 K
b = 0.0323J/mol/K^2 if T> 846 K
c = 5e6J/mol*K if T<= 846 K
c = 47.9e-6J/mol*K if T> 846 K
molmass = 0.22178kg/mol
Note that this is slightly different than the equation in the manuscript, as Cp is in J/kg/K (rather than
GeoParams.MaterialParameters.HeatCapacity.T_HeatCapacity_Moitra Type
T_HeatCapacity_Moitra()Temperature-dependent heat capacity of a basanite glass (
with
a0 = 2020 J/kg/K, b0 = -0.133 J/kg/K², c0 = 4.54e6 J K/kg, d0 = -21100 J/kg/K^(1/2)
a1 = 2150 J/kg/K, b1 = -0.5 J/kg/K²
Tg = 1000 K
The fit is calibrated on laser-flash data between 298 and 1273 K (their Table 3) and jumps at T_HeatCapacity_Moitra_smoothed replaces the jump by a smooth transition.
References
- Moitra, P., Sonder, I., Valentine, G. A. (2018), Effects of size and temperature-dependent thermal conductivity on the cooling of pyroclasts in air, G-cubed 19, 3623-3636, https://doi.org/10.1029/2018GC007510
GeoParams.MaterialParameters.HeatCapacity.T_HeatCapacity_Moitra_smoothed Type
T_HeatCapacity_Moitra_smoothed()T_HeatCapacity_Moitra with the jump at
where T_HeatCapacity_Moitra evaluated at SmoothMelting with
GeoParams.MaterialParameters.HeatCapacity.ThreePhase_HeatCapacity Type
ThreePhase_HeatCapacity(; ρ=ThreePhase_Density(), Cpmelt=T_HeatCapacity_Moitra(), Cpsolid=T_HeatCapacity_Whittington(), Cpgas=ConstantHeatCapacity(Cp=3880J/kg/K))Specific heat capacity of a melt + crystal + gas magma, the mass-weighted mean of the phase heat capacities (Heap et al. 2020, eq. 3, extended from two to three phases):
so that ThreePhase_Density, is the volume-weighted sum of the phase values
The phase densities come from the sub-laws of ρ, so the same ThreePhase_Density describes the magma in the momentum and energy equations. The gas and crystal volume fractions ϕ_gas, ϕ_x are passed at runtime, as for ThreePhase_Density; all sub-laws receive the remaining arguments (e.g. P, T). The gas laws are only evaluated when ϕ_gas != 0. The result is NaN unless
The default gas heat capacity is that of pure H2O used by Degruyter & Huber (2014); it ignores the X_co2 that GasMixture_Conductivity takes. The default Cpmelt decreases above T_HeatCapacity_Moitra).
References
Heap, M. J., et al. (2020), The thermal properties of porous andesite, JVGR 398, 106901, https://doi.org/10.1016/j.jvolgeores.2020.106901
Degruyter, W., Huber, C. (2014), A model for the eruption frequency of upper crustal silicic magma chambers, EPSL 403, 117-130, https://doi.org/10.1016/j.epsl.2014.06.047
Heat capacity of magma
The glass and melt heat capacity of T_HeatCapacity_Moitra jumps at the glass transition T_HeatCapacity_Moitra_smoothed replaces the jump by a transition of width ΔTg. The fit is calibrated up to 1273 K. T_HeatCapacity_Whittington is shown for comparison.
using GeoParams, CairoMakie
T = range(300, 1400, 1101)
laws = (
"T_HeatCapacity_Moitra" => T_HeatCapacity_Moitra(),
"T_HeatCapacity_Moitra_smoothed (ΔTg = 20 K)" => T_HeatCapacity_Moitra_smoothed(),
"T_HeatCapacity_Whittington" => T_HeatCapacity_Whittington(),
)
fig = Figure(size = (800, 450))
ax = Axis(fig[1, 1]; xlabel = "temperature T (K)", ylabel = "heat capacity c_p (J/kg/K)")
vspan!(ax, 1273, 1400; color = (:gray, 0.2), label = "Moitra extrapolated (> 1273 K)")
vlines!(ax, 1000; color = :black, linestyle = :dot, label = "T_g = 1000 K")
for (name, law) in laws
lines!(ax, T, [compute_heatcapacity(law, (; T = t)) for t in T]; label = name)
end
axislegend(ax; position = :lt)
fig
ThreePhase_HeatCapacity mass-weights the phase heat capacities. The figure shows magma with 0–40 % crystals at 100 MPa and 850 °C, with an H2O gas of HalbachChatterjee_Density. The gas has a high specific heat capacity, so
using GeoParams, CairoMakie
ρ = ThreePhase_Density(; ρgas = HalbachChatterjee_Density())
cp = ThreePhase_HeatCapacity(; ρ)
ϕ_gas = range(0, 0.6, 121)
fig = Figure(size = (900, 400))
ax1 = Axis(fig[1, 1]; xlabel = "gas fraction ϕ_gas (–)", ylabel = "c_p (J/kg/K)", title = "mass-weighted c_p")
ax2 = Axis(fig[1, 2]; xlabel = "gas fraction ϕ_gas (–)", ylabel = "ρ c_p (MJ/m³/K)", title = "volumetric heat capacity ρ c_p")
for ϕ_x in (0.0, 0.2, 0.4)
args = [(; P = 1.0e8, T = 1123.15, ϕ_x, ϕ_gas = g) for g in ϕ_gas]
lines!(ax1, ϕ_gas, [compute_heatcapacity(cp, a) for a in args]; label = "ϕ_x = $ϕ_x")
lines!(ax2, ϕ_gas, [compute_density(ρ, a) * compute_heatcapacity(cp, a) / 1.0e6 for a in args]; label = "ϕ_x = $ϕ_x")
end
axislegend(ax2; position = :lb)
fig
Computational routines
To compute, use this:
GeoParams.MaterialParameters.HeatCapacity.compute_heatcapacity Function
compute_heatcapacity(a::Vector_HeatCapacity; index::Int64, kwargs...)Pointwise calculation of heat capacity from a vector where index is the index of the point
compute_heatcapacity(P,T, s::AbstractPhaseDiagramsStruct)Interpolates heat capacity as a function of T,P from a lookup table
Cp = compute_heatcapacity(s::AbstractHeatCapacity, P, T)Returns the heat capacity Cp at any temperature T and pressure P using any of the heat capacity laws implemented.
Currently available:
ConstantHeatCapacity
T_HeatCapacity_Whittington
T_HeatCapacity_Moitra
T_HeatCapacity_Moitra_smoothed
ThreePhase_HeatCapacity
Latent_HeatCapacity
Example
julia> cp = T_HeatCapacity_Whittington()
T-dependent heat capacity following Whittington et al. (2009) for average crust.
julia> compute_heatcapacity(cp, (; T = 1000.0))
1179.6374785821629The in-place compute_heatcapacity! fills a preallocated array instead:
julia> cp = T_HeatCapacity_Whittington();
julia> T = collect(250.0:250.0:1250.0);
julia> Cp = similar(T);
julia> compute_heatcapacity!(Cp, cp, (; T = T));
julia> Cp
5-element Vector{Float64}:
635.4269997294616
1002.5701145279105
1149.2745563671706
1179.6374785821629
1216.0474343943067GeoParams.MaterialParameters.HeatCapacity.compute_heatcapacity! Function
compute_heatcapacity!(Cp::AbstractArray{<:AbstractFloat}, MatParam::AbstractArray{<:AbstractMaterialParamsStruct}, Phases::AbstractArray{<:Integer}, P::AbstractArray{<:AbstractFloat},T::AbstractArray{<:AbstractFloat})In-place computation of heat capacity Cp 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.