API

Public Models

TransportModelMono(cap, ops, uω, uγ; kwargs...)

TransportModelMono(cap, uω, uγ; kwargs...)

Required inputs:

  • cap::AssembledCapacity
  • either prebuilt ops::AdvectionOps or velocities to build them
  • , : velocity containers with N components (tuple/vector), where each component is constant, callback, or vector of length ntotal

Key keywords:

  • source: constant or callback (x...) / (x..., t)
  • bc_border::BorderConditions
  • bc_interface: nothing, Inflow(value), Dirichlet(value), scalar, or callback
  • layout: default canonical mono layout (ω, then γ)
  • scheme: spatial advection discretization (Centered() or Upwind1())

Unknown layout:

x = [ φω ; φγ ]

TransportModelTwoPhase(cap1, cap2, ops1, ops2, u1ω, u1γ, u2ω, u2γ; kwargs...)

TransportModelTwoPhase(cap1, cap2, u1ω, u1γ, u2ω, u2γ; kwargs...)

Required inputs:

  • cap1, cap2 (same ntotal and grid shape)
  • per-phase velocities u1ω, u1γ, u2ω, u2γ with the same component conventions as mono

Key keywords:

  • source1, source2
  • bc_border1, bc_border2
  • layout: default canonical two-phase layout
  • scheme: spatial advection discretization (Centered() or Upwind1())

Unknown layout (fixed):

x = [ φω1 ; φγ1 ; φω2 ; φγ2 ]

MovingTransportModelMono(grid, body, uω, uγ; kwargs...)

MovingTransportModelTwoPhase(grid, body1, u1ω, u1γ, u2ω, u2γ; kwargs...)

Moving-geometry transport models using reduced space-time slabs.

Key moving-only inputs:

  • moving level-set callback(s) (body, or body1/body2) with signature (x..., t) (or (x...) if static)
  • interface geometry velocity
  • reduced slab caches and physical volumes are updated internally each step

Unknown layouts are identical to fixed models:

mono:      x = [ φω ; φγ ]
two-phase: x = [ φω1 ; φγ1 ; φω2 ; φγ2 ]

Assembly Functions

assemble_steady_mono!(sys, model, t)

Mutates sys.A, sys.b for mono steady transport at time t.

assemble_unsteady_mono!(sys, model, uⁿ, t, dt, scheme_or_theta)

Mutates sys.A, sys.b for one mono unsteady θ step.

  • uⁿ can be ω-only (ntotal) or full state length.
  • Accepted time schemes: :BE, :CN, numeric θ in [0,1].

assemble_steady_two_phase!(sys, model, t)

Mutates sys.A, sys.b for two-phase steady transport.

assemble_unsteady_two_phase!(sys, model, uⁿ, t, dt, scheme_or_theta)

Mutates sys.A, sys.b for one two-phase unsteady θ step.

  • uⁿ can be full state, concatenated ω blocks, or tuple (u01, u02).
  • Accepted time schemes: :BE, :CN, numeric θ in [0,1].

assemble_unsteady_mono_moving!(sys, model, uⁿ, t, dt, scheme_or_theta)

assemble_unsteady_two_phase_moving!(sys, model, uⁿ, t, dt, scheme_or_theta)

Assemble one moving-geometry unsteady slab step.

  • Uses reduced slab capacities/operators on [t, t+dt]
  • Uses physical volumes Vn/Vn1 in time terms
  • Uses discrete relative interface coefficient for closure logic: κrel extracted from slab ops.K assembled with (uγ - wγ)

Solver Wrappers

solve_steady!(model; t=0, method=:direct, kwargs...)

Assembles and solves one steady system. Returns LinearSystem with solution in sys.x.

solve_unsteady!(model, u0, tspan; dt, scheme=:BE, method=:direct, save_history=true, kwargs...)

Time-integrates mono or two-phase transport and returns:

(times, states, system, reused_constant_operator)

Important behavior:

  • Accepted time schemes are exactly :BE, :CN, or numeric θ ∈ [0,1].
  • Invalid symbols or out-of-range θ raise ArgumentError.
  • Reuses constant operator/factorization when matrix/RHS are time-invariant.

solve_unsteady_moving!(model, u0, tspan; dt, scheme=:BE, method=:direct, save_history=true, kwargs...)

Time-integrates moving mono or moving two-phase transport with the same scheme contract (:BE, :CN, or numeric θ ∈ [0,1]).

Operator/Geometry Maintenance

update_advection_ops!(model; t=0)

Rebuilds and stores advection operators at time t.

rebuild!(model, moments; bc=0, t=0)

Rebuilds mono geometry from new moments and refreshes advection operators.

Two-Phase Block Views

These helpers read sub-blocks from full two-phase state vectors:

  • omega1_view(model, x)
  • gamma1_view(model, x)
  • omega2_view(model, x)
  • gamma2_view(model, x)

All assume ordering (ω1, γ1, ω2, γ2).

Public Docstrings

PenguinTransport.TransportModelMonoType
TransportModelMono(cap, ops, uω, uγ; kwargs...)
TransportModelMono(cap, uω, uγ; kwargs...)

Monophasic advection transport model on cut cells.

Unknown ordering is (ω, γ) where ω are bulk cell values and γ are interface values.

PenguinTransport.TransportModelTwoPhaseType
TransportModelTwoPhase(cap1, cap2, ops1, ops2, u1ω, u1γ, u2ω, u2γ; kwargs...)
TransportModelTwoPhase(cap1, cap2, u1ω, u1γ, u2ω, u2γ; kwargs...)

Two-phase advection transport model with phase-wise cut-cell capacities and flux-coupled interface rows.

Unknown ordering is (ω1, γ1, ω2, γ2).

PenguinTransport.MovingTransportModelMonoType
MovingTransportModelMono(grid, body, uω, uγ; kwargs...)

Moving-geometry monophasic advection transport model assembled from space-time slabs.

Unknown ordering is (ω, γ) and interface inflow/outflow decisions use the same discrete interface coefficient as the ω-row embedded transport term, assembled from the relative interface velocity (uγ - wγ).

PenguinTransport.MovingTransportModelMonoMethod
MovingTransportModelMono(grid, body, uω, uγ; source, bc_border, bc_interface, layout, periodic, scheme, wγ, geom_method)

Build a moving monophasic transport model.

  • body is a level-set callback accepting (x...) or (x..., t).
  • is the interface geometry velocity sampled on C_γ.
  • Per-step slab caches (cap_slab, ops_slab, Vn, Vn1) are updated by moving assembly.
PenguinTransport.MovingTransportModelTwoPhaseType
MovingTransportModelTwoPhase(grid, body1, u1ω, u1γ, u2ω, u2γ; kwargs...)

Moving-geometry two-phase advection transport model assembled from space-time slabs.

Unknown ordering is (ω1, γ1, ω2, γ2) and local interface inflow/outflow decisions use the same discrete interface coefficients as the ω-row embedded transport terms, assembled from relative interface velocities.

PenguinTransport.MovingTransportModelTwoPhaseMethod
MovingTransportModelTwoPhase(grid, body1, u1ω, u1γ, u2ω, u2γ; source1, source2, body2, bc_border1, bc_border2, layout, periodic1, periodic2, scheme, wγ, geom_method)

Build a moving two-phase transport model.

  • If body2 is omitted, phase 2 uses -body1.
  • is the interface geometry velocity sampled on C_γ.
  • Per-step slab caches (cap*_slab, ops*_slab, V*n, V*n1) are updated by moving assembly.
PenguinTransport.assemble_unsteady_mono_moving!Function
assemble_unsteady_mono_moving!(sys, model, uⁿ, t, dt, scheme_or_theta)

Assemble one moving-geometry monophasic theta-method step on slab [t, t+dt]. Embedded-interface inflow/outflow switching uses the discrete relative interface coefficient extracted from the assembled transport operator.

PenguinTransport.assemble_unsteady_two_phase_moving!Function
assemble_unsteady_two_phase_moving!(sys, model, uⁿ, t, dt, scheme_or_theta)

Assemble one moving-geometry two-phase theta-method step on slab [t, t+dt]. Embedded-interface inflow/outflow switching uses discrete relative interface coefficients extracted from the assembled transport operators.

PenguinTransport.solve_steady!Function
solve_steady!(model; t=0, method=:direct, kwargs...)

Assemble and solve the steady linear system for mono or two-phase transport models.

PenguinTransport.solve_unsteady!Function
solve_unsteady!(model, u0, tspan; dt, scheme=:BE, method=:direct, save_history=true, kwargs...)

Time-integrate mono or two-phase transport with a theta-method (:BE, :CN, or numeric theta in [0,1]). Returns (times, states, system, reused_constant_operator).

PenguinTransport.solve_unsteady_moving!Function
solve_unsteady_moving!(model, u0, tspan; dt, scheme=:BE, method=:direct, save_history=true, kwargs...)

Time-integrate moving mono or moving two-phase transport. Accepted scheme values are :BE, :CN, or numeric theta in [0,1]. Returns (times, states, system, reused_constant_operator=false).

PenguinTransport.rebuild!Function
rebuild!(model::TransportModelMono, moments; bc=0, t=0)

Rebuild capacity geometry and refresh advection operators for a monophasic model.

PenguinTransport.omega1_viewFunction
omega1_view(model, x)

View the phase-1 bulk block (ω1) from a full two-phase state x. The expected unknown ordering is (ω1, γ1, ω2, γ2).

PenguinTransport.gamma1_viewFunction
gamma1_view(model, x)

View the phase-1 interface block (γ1) from a full two-phase state x. The expected unknown ordering is (ω1, γ1, ω2, γ2).

PenguinTransport.omega2_viewFunction
omega2_view(model, x)

View the phase-2 bulk block (ω2) from a full two-phase state x. The expected unknown ordering is (ω1, γ1, ω2, γ2).

PenguinTransport.gamma2_viewFunction
gamma2_view(model, x)

View the phase-2 interface block (γ2) from a full two-phase state x. The expected unknown ordering is (ω1, γ1, ω2, γ2).