API Reference
Constructor Keywords
DiffusionModelMono
source: constant or callback(x...)/(x..., t)bc_border:BorderConditionsbc_interface:Union{Nothing, PenguinBCs.Robin}layout:UnknownLayout(defaultlayout_mono(cap.ntotal))coeff_mode::harmonic(default),:arithmetic,:face,:cell
DiffusionModelDiph
source: tuple(s1, s2)or callback returning a tuplebc_border:BorderConditionsicorbc_interface:Union{Nothing, InterfaceConditions}layout:UnknownLayout(defaultlayout_diph(cap.ntotal))coeff_mode::harmonic/:arithmetic/:face/:cell
Moving Constructors
MovingDiffusionModelMono(grid, body, D; ...)MovingDiffusionModelDiph(grid, body1, D1, D2; body2=nothing, ...)
with additional keyword:
geom_method(default:vofijul)
Time Scheme Values
All unsteady APIs accept:
:BE:CN- numeric
θwith0 ≤ θ ≤ 1
Expected State Shapes
- Mono:
- reduced:
ntotal(ω) - full:
length(model.layout.offsets.γ)(ω+γ)
- reduced:
- Diph:
- reduced:
2*ntotal(ω1+ω2) - full: full stacked system (
ω1,γ1,ω2,γ2)
- reduced:
Reduced initial states are expanded internally.
Public Symbols
PenguinDiffusion.DiffusionModelMono — Type
DiffusionModelMonoMonophasic diffusion model on a fixed cut-cell capacity/operator pair.
PenguinDiffusion.DiffusionModelDiph — Type
DiffusionModelDiphDiphasic diffusion model on fixed cut-cell capacities/operators.
PenguinDiffusion.MovingDiffusionModelMono — Type
MovingDiffusionModelMonoMonophasic moving-geometry diffusion model assembled from space-time slabs.
PenguinDiffusion.MovingDiffusionModelDiph — Type
MovingDiffusionModelDiphDiphasic moving-geometry diffusion model assembled from space-time slabs.
PenguinDiffusion.assemble_steady_mono! — Function
assemble_steady_mono!(sys, model, t)Assemble the steady monophasic linear system at time t.
The interface condition is sampled at C_γ.
PenguinDiffusion.assemble_unsteady_mono! — Function
assemble_unsteady_mono!(sys, model, uⁿ, t, dt, scheme)Assemble the fixed-geometry unsteady monophasic θ-system for one step [t, t+dt].
PenguinDiffusion.assemble_steady_diph! — Function
assemble_steady_diph!(sys, model, t)Assemble the steady diphasic linear system at time t.
Interface scalar/flux rows are sampled at C_γ.
PenguinDiffusion.assemble_unsteady_diph! — Function
assemble_unsteady_diph!(sys, model, uⁿ, t, dt, scheme)Assemble the fixed-geometry unsteady diphasic θ-system for one step [t, t+dt].
PenguinDiffusion.assemble_unsteady_mono_moving! — Function
assemble_unsteady_mono_moving!(sys, model, uⁿ, t, dt; scheme=:CN)Assemble the moving-geometry monophasic θ-system for one slab step [t, t+dt].
Interface/source data are blended in time with θ for θ < 1 and sampled at t+dt for :BE. Interface spatial sampling remains at slab C_γ.
PenguinDiffusion.assemble_unsteady_diph_moving! — Function
assemble_unsteady_diph_moving!(sys, model, uⁿ, t, dt; scheme=:CN)Assemble the moving-geometry diphasic θ-system for one slab step [t, t+dt].
Scalar/flux interface data are blended in time with θ for θ < 1 and sampled at t+dt for :BE, while spatial sampling remains at slab C_γ.
PenguinDiffusion.solve_steady! — Function
solve_steady!(model; t=0, method=:direct, kwargs...)Assemble and solve a steady diffusion system.
Returns the solved LinearSystem.
PenguinDiffusion.solve_unsteady! — Function
solve_unsteady!(model, u0, tspan; dt, scheme=:BE, method=:direct, save_history=true, kwargs...)Advance a fixed-geometry model in time.
Accepted scheme values are :BE, :CN, or numeric θ with 0 ≤ θ ≤ 1. Returns (times, states, system, reused_constant_operator).
PenguinDiffusion.solve_unsteady_moving! — Function
solve_unsteady_moving!(model, u0, tspan; dt, scheme=:CN, method=:direct, save_history=true, kwargs...)Advance a moving-geometry model in time.
Accepted scheme values are :BE, :CN, or numeric θ with 0 ≤ θ ≤ 1. Returns (times, states, system, reused_constant_operator=false).
PenguinDiffusion.compute_interface_exchange_metrics — Function
compute_interface_exchange_metrics(model, state; diffusivity_scale=nothing, characteristic_scale=1, reference_value=0)Compute generic interface-transfer diagnostics from a solved state:
- integrated and mean normal gradient
- integrated and mean normal diffusive flux
- mean interface value
- an exchange coefficient relative to
reference_value - a generic dimensionless transfer index (
exchange_coefficient * characteristic_scale / diffusivity_scale)
For diphasic models, returns (phase1=..., phase2=..., flux_balance=...).