Materials
Components combine into a Material via mixing rules. See the User Guide's materials chapter for the full walkthrough.
Components
Pyrolysis.Materials.Material — Type
Material{NC,NR,C,RT,LSL} <: AbstractMaterialA complete material definition with components, reactions, mixing rules, and gas transport.
Type Parameters
NC: Number of componentsNR: Number of reactionsC: Component tuple type (preserves heterogeneous component types)RT: Reaction tuple type (preserves heterogeneous reaction types)LSL: Lateral shrinkage law type (concreteFunctionsubtype, orNothing). Parameterizing here lets calls throughmaterial.lateral_shrinkage_lawspecialize statically — no dynamic dispatch throughUnion{Function,Nothing}.
Fields
name::Symbol: Material identifiercomponents::C: Material components tuplereactions::RT: Decomposition reactions tuplemixing::NamedTuple{(:k,:λ,:κ),Tuple{MixingSpec,MixingSpec,MixingSpec}}: Mixing rules (and per-rule β) for thermal conductivity (k), gas transfer coefficient (λ), and permeability (κ).lateral_shrinkage_law::LSL: Optional A(t)/A_0 = law(χ̄).nothing⇒ identity.
Gas Transport
Darcy-Fick gas transport is enabled when any solid/liquid component has κ > 0. The effective permeability is computed from component values via mixing rules, similar to thermal conductivity and gas transfer coefficient.
Specify κ on each component:
charring = Material(
name = :CharringWood,
components = (
SolidComponent(:virgin, ρ=530, c=2000, k=0.12, κ=1e-15), # tight structure
SolidComponent(:char, ρ=150, c=1500, k=0.20, κ=1e-12), # porous char
GaseousComponent(:gas, M=0.044, c=1800, k=0.03, λ=1e-4),
),
reactions = (...),
mixing = MaterialMixing(κ = MixingSpec(WEIGHTED, 0.5)),
)Example
# Simple PMMA (diffusion-only gas transport, κ=0 on all components)
pmma = Material(
name = :PMMA,
components = (
SolidComponent(:virgin, ρ=1190, c=1420, k=0.21, ε=0.86),
GaseousComponent(:MMA, M=0.100, c=1500, k=0.02, λ=1e-5)
),
reactions = (
Reaction(:decomposition, 1 => 2, A=8.5e12, E=188e3, h=870e3), # h > 0 = endothermic
),
mixing = MaterialMixing(k = MixingSpec(WEIGHTED, 0.5)),
)Pyrolysis.Materials.SolidComponent — Type
SolidComponent{Pρ,Pc,Pk,Pλ,Pκ,Pρi} <: AbstractComponentA solid-phase component with temperature-dependent thermophysical properties and Darcy-flow permeability.
density is the bulk (pure-phase) density used by mixing rules, mixture density, and volume-change kernels. intrinsic_density is the skeletal (cell-wall) density used only by the porosity formula φ = 1 − Σ ξⱼ/ρⱼ_intrinsic. When not specified, intrinsic_density defaults to density, recovering the implicit assumption that the pure phase has no pores.
Pyrolysis.Materials.LiquidComponent — Type
LiquidComponent{Pρ,Pc,Pk,Pλ,Pκ,Pρi} <: AbstractComponentA liquid-phase component (matrix-forming, with permeability).
See SolidComponent for the bulk vs. intrinsic density distinction.
Pyrolysis.Materials.GaseousComponent — Type
GaseousComponent{Pρ,Pc,Pk,Pλ} <: AbstractComponentA gas-phase component. Density is typically the ideal-gas law. Gases flow through the matrix, not part of it — there is no permeability field.
Phase queries
Pyrolysis.Materials.phase — Function
phase(comp::AbstractComponent) -> PhaseReturn the runtime Phase enum value for a component, derived from its type. Use this when a Phase value is needed for printing, logging, or comparison; use is_gas/is_solid/is_liquid for predicates in hot paths.
Pyrolysis.Materials.molar_mass — Function
molar_mass(comp::AbstractComponent) -> Float64Molar mass [kg/mol]. Returns the stored value for gases; 0.0 for solids and liquids (which do not carry a molar-mass field).
Pyrolysis.Materials.is_gas — Function
is_gas(comp::AbstractComponent) -> Booltrue for GaseousComponent. Resolves at compile time via dispatch.
Pyrolysis.Materials.is_solid — Function
is_solid(comp::AbstractComponent) -> Booltrue for SolidComponent. Resolves at compile time via dispatch.
Pyrolysis.Materials.is_liquid — Function
is_liquid(comp::AbstractComponent) -> Booltrue for LiquidComponent. Resolves at compile time via dispatch.
Mixing rules
The MixingRule enum values are PARALLEL, SERIES, WEIGHTED, BRUGGEMAN, and CARMAN_KOZENY (permeability only).
Pyrolysis.Materials.MixingRule — Type
MixingRuleEnumeration of property mixing rules for multi-component materials.
PARALLEL: Parallel (volume-weighted) mixing: k = Σᵢ vᵢkᵢSERIES: Series (harmonic) mixing: 1/k = Σᵢ vᵢ/kᵢWEIGHTED: Weighted combination: k = β·kparallel + (1-β)·kseriesBRUGGEMAN: Bruggeman effective medium: Σᵢ vᵢ(kᵢ - keff)/(kᵢ + 2keff) = 0. Defined only for scalar transport coefficients (thermal conductivityk); rejected for the gas-transfer coefficientλand for permeabilityκ.CARMAN_KOZENY: Porosity-based permeability closure (κ channel only): κ = ℓ²·φ³ / (180·(1-φ)²), with ℓ the characteristic particle/pore diameter supplied asMixingSpec(CARMAN_KOZENY; length_scale = ℓ). This is the EMT-replacement for permeability —BRUGGEMANis not a valid κ closure.
Pyrolysis.Materials.MixingSpec — Type
MixingSpec(rule::MixingRule, β::Float64 = 0.5; length_scale::Real = NaN)A mixing-rule + weighting pair. β is only meaningful when rule == WEIGHTED, but is always carried so a single uniform shape can describe every channel.
length_scale (ℓ) is only meaningful when rule == CARMAN_KOZENY (permeability channel), where it is the characteristic particle/pore diameter [m] entering κ = ℓ²·φ³/(180·(1-φ)²). It is required (a positive, finite value) for that rule and ignored otherwise; the constructor fails fast if CARMAN_KOZENY is requested without it.
Used by Material.mixing to bundle the mixing rule and its parameters for each of the three mixed properties: thermal conductivity (k), gas transfer coefficient (λ), and permeability (κ).
Pyrolysis.Materials.MaterialMixing — Function
MaterialMixing(; k = MixingSpec(WEIGHTED, 0.5),
λ = MixingSpec(PARALLEL, 0.5),
κ = MixingSpec(WEIGHTED, 0.5))Build the mixing NamedTuple expected by Material. k, λ, κ may be passed either as MixingSpec instances or as bare MixingRule enum values (β defaults to 0.5 in that case).