Materials

Components combine into a Material via mixing rules. See the User Guide's materials chapter for the full walkthrough.

Components

Pyrolysis.Materials.MaterialType
Material{NC,NR,C,RT,LSL} <: AbstractMaterial

A complete material definition with components, reactions, mixing rules, and gas transport.

Type Parameters

  • NC: Number of components
  • NR: Number of reactions
  • C: Component tuple type (preserves heterogeneous component types)
  • RT: Reaction tuple type (preserves heterogeneous reaction types)
  • LSL: Lateral shrinkage law type (concrete Function subtype, or Nothing). Parameterizing here lets calls through material.lateral_shrinkage_law specialize statically — no dynamic dispatch through Union{Function,Nothing}.

Fields

  • name::Symbol: Material identifier
  • components::C: Material components tuple
  • reactions::RT: Decomposition reactions tuple
  • mixing::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)),
)
source
Pyrolysis.Materials.SolidComponentType
SolidComponent{Pρ,Pc,Pk,Pλ,Pκ,Pρi} <: AbstractComponent

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

source
Pyrolysis.Materials.GaseousComponentType
GaseousComponent{Pρ,Pc,Pk,Pλ} <: AbstractComponent

A gas-phase component. Density is typically the ideal-gas law. Gases flow through the matrix, not part of it — there is no permeability field.

source

Phase queries

Pyrolysis.Materials.phaseFunction
phase(comp::AbstractComponent) -> Phase

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

source
Pyrolysis.Materials.molar_massFunction
molar_mass(comp::AbstractComponent) -> Float64

Molar mass [kg/mol]. Returns the stored value for gases; 0.0 for solids and liquids (which do not carry a molar-mass field).

source

Mixing rules

The MixingRule enum values are PARALLEL, SERIES, WEIGHTED, BRUGGEMAN, and CARMAN_KOZENY (permeability only).

Pyrolysis.Materials.MixingRuleType
MixingRule

Enumeration 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-β)·kseries
  • BRUGGEMAN: Bruggeman effective medium: Σᵢ vᵢ(kᵢ - keff)/(kᵢ + 2keff) = 0. Defined only for scalar transport coefficients (thermal conductivity k); 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 as MixingSpec(CARMAN_KOZENY; length_scale = ℓ). This is the EMT-replacement for permeability — BRUGGEMAN is not a valid κ closure.
source
Pyrolysis.Materials.MixingSpecType
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 (κ).

source
Pyrolysis.Materials.MaterialMixingFunction
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).

source