API Reference

Constructor Keywords

DiffusionModelMono

  • source: constant or callback (x...) / (x..., t)
  • bc_border: BorderConditions
  • bc_interface: Union{Nothing, PenguinBCs.Robin}
  • layout: UnknownLayout (default layout_mono(cap.ntotal))
  • coeff_mode: :harmonic (default), :arithmetic, :face, :cell

DiffusionModelDiph

  • source: tuple (s1, s2) or callback returning a tuple
  • bc_border: BorderConditions
  • ic or bc_interface: Union{Nothing, InterfaceConditions}
  • layout: UnknownLayout (default layout_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 θ with 0 ≤ θ ≤ 1

Expected State Shapes

  • Mono:
    • reduced: ntotal (ω)
    • full: length(model.layout.offsets.γ) (ω+γ)
  • Diph:
    • reduced: 2*ntotal (ω1+ω2)
    • full: full stacked system (ω1,γ1,ω2,γ2)

Reduced initial states are expanded internally.

Public Symbols

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_metricsFunction
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=...).