Problem and solution

See the User Guide's problem-building chapter for the simulation-mode axes, and the solution chapter for post-processing.

Pyrolysis.Problem.PyrolysisProblemType
PyrolysisProblem{M,Mat,BCS,FT,Fξ} <: AbstractPyrolysisProblem

Complete specification of a pyrolysis simulation problem.

Type Parameters

  • M: Mesh type
  • Mat: Material type
  • BCS: BoundaryConditionSet type (type-stable BC storage)
  • FT: Initial temperature function type
  • : Initial concentration functions type

Fields

  • mesh::M: The computational mesh
  • material::Mat: Material definition with components and reactions
  • bc_set::BCS: BoundaryConditionSet with all boundary conditions (type-stable)
  • T_initial::FT: Initial temperature function z -> T(z)
  • ξ_initial::Vector{Fξ}: Initial concentration functions [z -> ξⱼ(z)]
  • tspan::Tuple{Float64,Float64}: Simulation time span (tstart, tend)
  • dt_initial::Float64: Initial timestep [s]
  • output_times::Vector{Float64}: Times at which to save output

Example

bc_set = BoundaryConditionSet(
	thermal = (top = HeatFluxBC(50e3), bottom = AdiabaticBC()),
	mass    = (top = ConvectiveMassBC(h_m = 0.01), bottom = ImpermeableBC()),
)

problem = PyrolysisProblem(
	mesh = create_uniform_mesh(0.01, 100, 2),
	material = pmma,
	bc_set = bc_set,
	T_initial = z -> 300.0,
	ξ_initial = [z -> 1190.0, z -> 0.0],
	tspan = (0.0, 100.0)
)
source
Pyrolysis.Problem.PyrolysisSolutionType
PyrolysisSolution{P, ExtraT} <: AbstractPyrolysisSolution

Container for pyrolysis simulation results, organized as a fixed core schema of concretely-typed fields plus a typed extras NamedTuple for opt-in diagnostics.

Core fields

  • problem::P: Reference to the original problem
  • t::Vector{Float64}: Solution times [s]
  • T::Matrix{Float64}: Temperature profiles, shape (n_cells, n_steps) [K]
  • ξ::Array{Float64,3}: Concentration profiles, shape (NC, n_cells, n_steps) [kg/m³]
  • z::Matrix{Float64}: Node positions, shape (n_nodes, n_steps) [m]; an empty 0×0 matrix in Eulerian mode
  • surface_T::Vector{Float64}: Surface temperature at each saved time [K]
  • mass_loss_rate::Vector{Float64}: Surface MLR per current area A(t) [kg/(m²·s)]
  • energy_residual::Vector{Float64}: Energy-conservation residual; zeros when the conservation tracker is disabled
  • retcode::Symbol: Return code from ODE solver
  • solve_time::Float64: Wall-clock solve time [s]
  • raw_solution: Raw DifferentialEquations.jl solution object (interpolation source)
  • extras::ExtraT: Typed NamedTuple of opt-in diagnostics (see below)

Extras

extras aggregates secondary diagnostics keyed by symbolic name. Vectors inside extras are mutable, so the per-step extraction code and the diagnostics callback write through the NamedTuple in place. Names: gas_generation_rate, back_temperature, total_mass, thickness_history, surface_mass_flux, surface_heat_flux_{net,absorbed,reradiation,convection, conduction,transpiration}, surface_emissivity, surface_conductivity, back_heat_flux, MLR_gauge, cross_section_area_history, diagnostics_log.

Accessors

state_t   = sol(t)            # interpolate raw solution at time t
T_profile = sol.T[:, i]       # temperature profile at saved time i
T_surface = sol.surface_T[i]  # surface temperature at saved time i
mlr       = sol.mass_loss_rate[i]
mlr_gauge = sol.extras.MLR_gauge[i]
source