Internals
Pyrolysis.Internal is an umbrella module that re-exports the public surface of every submodule except Experimental for advanced users:
using Pyrolysis
using Pyrolysis.Internal # brings in Geometry accessors, Solver helpers, …These names are not part of the stable public API and may change between releases. The User Guide's import cheat-sheet maps common tasks to the right imports.
Solution post-processing (Pyrolysis.Solver)
Pyrolysis.Solver.get_profile — Function
get_profile(solution::PyrolysisSolution, field::Symbol, time_idx::Int)Get a field profile at a specific saved time index.
Arguments
solution: The solutionfield: :T for temperature, :ξ for all concentrations, or :ξ1, :ξ2, etc.time_idx: Index into solution.t
Returns
Vector of values at cell centers.
Pyrolysis.Solver.get_cell_positions — Function
get_cell_positions(solution::PyrolysisSolution)Get cell center positions from the solution's mesh.
Pyrolysis.Solver.interpolate_solution — Function
interpolate_solution(solution::PyrolysisSolution, t::Real)Interpolate the full state vector at time t.
Boundary temperatures (Pyrolysis.Discretization)
Pyrolysis.Discretization.get_surface_temperature — Function
get_surface_temperature(mesh)Get the top surface temperature from the solved boundary state.
Pyrolysis.Discretization.get_back_face_temperature — Function
get_back_face_temperature(mesh)Get the back face (bottom) temperature from the solved boundary state.
Solver callbacks and iterative solvers (Pyrolysis.Solver)
Pyrolysis.Solver.create_thickness_termination_callback — Function
create_thickness_termination_callback(sv_ref, min_thickness) -> ContinuousCallbackCreate a callback that terminates the simulation when the live thickness z[n_live+1] − z[1] falls below min_thickness [m].
sv_ref is either a StateLayout (every cell is live) or a DepletionCallbackState, whose n_live tracks parked cells.
Pyrolysis.Solver.create_depletion_callback — Function
create_depletion_callback(ws, mesh, material, cb_state::DepletionCallbackState;
threshold=0.05, min_cells=2) -> DiscreteCallbackCreate the callback that parks depleted cells.
After every accepted step the condition scans the live cells (depletion_candidate); when one qualifies the affect! parks it — at most one cell per step, so the integrator adapts between events — or terminates the solve when only min_cells live cells remain. The state vector keeps its length; the park rewrites it in place, marks a derivative discontinuity (derivative_discontinuity!) and proposes DT_AFTER_PARK for the next step.
On a fixed mesh the condition also scans the cells below the top live cell for a void (interior_void_cell). A void there means the material has gasified from within. The model carries no heat across a void, so the affect! warns and terminates the solve.
Keyword Arguments
threshold::Float64=0.05: ALE — fraction of a cell's initial thickness; fixed mesh — fraction of the top cell's initial condensed concentration.min_cells::Int=2: terminate instead of parking whenn_live ≤ min_cells.
Pyrolysis.Solver.ILUGMRESFactorization — Type
ILUGMRESFactorization(; τ=0.1, gmres_rtol=1e-8, restart=30)ILU-preconditioned GMRES as a drop-in replacement for KLUFactorization().
Inherits LinearSolve.AbstractSparseFactorization so that OrdinaryDiffEq materializes the concrete sparse W = I/(γdt) - J matrix (rather than wrapping it in a matrix-free WOperator). The solve! method then builds an ILU(τ) preconditioner and solves with Krylov.jl's GMRES.
Pyrolysis.Solver.ILUBiCGSTABFactorization — Type
ILUBiCGSTABFactorization(; τ=0.1, rtol=1e-8)ILU-preconditioned BiCGSTAB as a drop-in replacement for a sparse direct factorization. Same approach as ILUGMRESFactorization but uses BiCGSTAB instead of GMRES. BiCGSTAB has fixed memory cost (no restart parameter) and can be faster for some matrix structures.