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
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
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.