Skip to content

add multifield advection#13

Merged
Iddingsite merged 5 commits into
mainfrom
multifield
Apr 17, 2026
Merged

add multifield advection#13
Iddingsite merged 5 commits into
mainfrom
multifield

Conversation

@Iddingsite
Copy link
Copy Markdown
Member

Multi-field advection support

Summary

Adds the ability to advect multiple scalar fields sharing the same velocity in a single WENO_step! call. Useful for problems involving multiple chemical components, tracers, or any set of fields transported by the same flow.


Usage

Each field gets its own u_min/u_max bounds for the Zhang-Shu limiter. Fields are advected sequentially, reusing the internal fl, fr, du, ut buffers — no additional memory is allocated.


Changes

New multi-field WENO_step! overloads accepting Tuple{Vararg{...}} of arrays:

  • time_stepping.jl — CPU 1D
  • time_stepping.jl — CPU 2D
  • time_stepping.jl — CPU 3D
  • KAExt.jl — KernelAbstractions 1D/2D/3D
  • ChmyExt.jl — Chmy 1D/2D/3D

Tests:

  • test_multi_field.jl — equivalence tests verifying multi-field WENO_step! produces identical results to calling single-field WENO_step! individually (1D/2D/3D CPU + 1D KA CPU)

Docs & examples:

  • README.md — added multi-field section with usage example
  • GettingStarted.md — added multi-field documentation
  • 2D_multi_field.jl — example advecting 3 chemical components

Design decisions

  • Sequential loop over fields rather than batched GPU kernels — simple, zero memory overhead, works on all backends. Batched kernels can be added later as an optimization if needed.
  • Tuple{Vararg{...}} signature instead of NTuple{NF, T} to avoid Aqua.jl unbound type parameter warnings from keyword-args desugaring.
  • Per-field u_min/u_max as Tuple{Vararg{Real}} — each field can have independent limiter bounds.

Tests

All 172 tests pass (including 9 new multi-field tests and all 11 Aqua checks).

@Iddingsite
Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

…ersion to 0.0.4

Co-authored-by: Iddingsite <50744020+Iddingsite@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 17, 2026

@copilot resolve the merge conflicts in this pull request

Resolved in c154b87. The only conflict was in README.md — I kept both the "Multi-field advection" section from this PR and the "Funding & author" section added in main. The merge also picks up the CI action bumps (actions/checkout@v6, julia-actions/cache@v3) and the version bump to 0.0.4 from main.

@Iddingsite Iddingsite merged commit edbe28c into main Apr 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants