Property functions

Temperature- (and state-) dependent component properties. Plain numbers, tuples, and callables convert automatically where a property function is expected; see the User Guide's property-function section.

Pyrolysis.Materials.ConstantPropertyType
ConstantProperty{T<:Real}

A property that does not depend on temperature.

Example

k = ConstantProperty(0.21)  # W/(m·K)
k(300.0)  # Returns 0.21
k(500.0)  # Returns 0.21
source
Pyrolysis.Materials.LinearPropertyType
LinearProperty{T<:Real}

A property that varies linearly with temperature: p(T) = a + b*T

Fields

  • a::T: Intercept (value at T=0)
  • b::T: Slope (change per Kelvin)

Example

cp = LinearProperty(1420.0, 2.5)  # J/(kg·K)
cp(300.0)  # Returns 1420 + 2.5*300 = 2170
source
Pyrolysis.Materials.PolynomialPropertyType
PolynomialProperty{N,T<:Real}

A property defined by a polynomial: p(T) = c₀ + c₁T + c₂T² + ...

Fields

  • coeffs::NTuple{N,T}: Polynomial coefficients (c₀, c₁, ..., cₙ₋₁)

Example

cp = PolynomialProperty((1000.0, 2.0, 0.001))  # c₀ + c₁T + c₂T²
cp(300.0)  # Returns 1000 + 2*300 + 0.001*300² = 1690
source
Pyrolysis.Materials.ArrheniusPropertyType
ArrheniusProperty{T<:Real}

A property following Arrhenius form: p(T) = A * exp(-E / (R*T))

Primarily used for reaction rate constants.

Fields

  • A::T: Pre-exponential factor
  • E::T: Activation energy [J/mol]
  • T_ref::T: Reference temperature (for normalization, optional)

Example

k = ArrheniusProperty(8.5e12, 188e3, 298.15)
k(600.0)  # Returns 8.5e12 * exp(-188000 / (8.314 * 600))
source
Pyrolysis.Materials.TablePropertyType
TableProperty{N,T<:Real}

A property defined by tabulated data with linear interpolation.

Fields

  • temperatures::NTuple{N,T}: Temperature values (must be sorted ascending)
  • values::NTuple{N,T}: Property values at each temperature

Example

k = TableProperty((300.0, 400.0, 500.0), (0.20, 0.22, 0.25))
k(350.0)  # Returns 0.21 (linear interpolation)
source
Pyrolysis.Materials.CallablePropertyType
CallableProperty{F}

A property defined by an arbitrary callable (function or functor).

Fields

  • func::F: Any callable f(T) -> value

Example

# Ideal gas density
ρ_gas = CallableProperty(T -> P_REF * M / (R_GAS * T))
ρ_gas(300.0)  # Returns density at 300 K
source
Pyrolysis.Materials.StateDependentPropertyType
StateDependentProperty{F}

A property that depends on both temperature and cell state (concentrations).

This is used for properties like moisture-dependent heat of sorption where the property value depends on the current composition of the material, not just temperature.

Fields

  • func::F: Any callable f(T, ξ) -> value where ξ is the concentration tuple

Example

# Heat of sorption that increases as moisture content decreases
# HoS(MC) = 2275 + 860 * exp(-0.120 * MC) [kJ/kg]
MOISTURE_IDX = 7
heat_sorption = StateDependentProperty((T, ξ) -> begin
	ξ_total = sum(ξ[i] for i in 1:7)  # total solid + liquid mass
	MC = 100.0 * ξ[MOISTURE_IDX] / max(ξ_total, 1.0)  # moisture content %
	return (2275.0 + 860.0 * exp(-0.120 * MC)) * 1e3  # Convert to J/kg
end)

Notes

  • When used as a heat of reaction, the concentration ξ is automatically passed by the kinetics evaluation functions.
  • Calling with just T (without ξ) will raise an error since state is required.
source