Skip to content

Add nonuniform grid support for interface boundary conditions with UpwindScheme#572

Open
utkuyilmaz1903 wants to merge 5 commits into
SciML:masterfrom
utkuyilmaz1903:feature/nonuniform-upwind-interface
Open

Add nonuniform grid support for interface boundary conditions with UpwindScheme#572
utkuyilmaz1903 wants to merge 5 commits into
SciML:masterfrom
utkuyilmaz1903:feature/nonuniform-upwind-interface

Conversation

@utkuyilmaz1903

@utkuyilmaz1903 utkuyilmaz1903 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR enables the default UpwindScheme() on nonuniform grids when interface or periodic boundary conditions are present. Previously, discretization failed with @assert length(bs) == 0 in the nonuniform upwind path.

Where the upwind stencil crosses an interface or a periodic wrap, stencil weights are now computed from the physical grid coordinates via calculate_weights, with cross-domain taps resolved through RefCartesianIndex and the coupled variable's grid. The uniform-grid path (DX <: Number) is unchanged.

Validation

check_boundarymap validates nonuniform interface setups through the 3-arg PDEBase hook used by discretize; a 2-arg method is kept for backward compatibility.

discretize throws ArgumentError for:

  • UpwindScheme(order > 1) when vector grids are used with interface or periodic BCs
  • misaligned interface coordinates (including the cross-domain ring case covered in tests)
  • mixing a scalar step size with a vector grid at an interface
  • mismatched uniform step sizes across connected domains (existing behavior)

Tests

New suite: test/pde_systems/MOL_1D_Interface_Upwind_NonUniform.jl
CI group: [Convection_Interface_NU] in test/test_groups.toml

Covers periodic and cross-domain interfaces, clustered grids, both wind directions, multi-domain chains, coordinate-mismatch guards, and related cases (108 tests).

@utkuyilmaz1903 utkuyilmaz1903 force-pushed the feature/nonuniform-upwind-interface branch from 43d0e0c to 83f4301 Compare June 8, 2026 17:01
@utkuyilmaz1903

Copy link
Copy Markdown
Contributor Author

@xtalax @ChrisRackauckas As discussed in #562, here is the full implementation and comprehensive test suite for non-uniform interface and periodic boundary support with UpwindScheme.

@utkuyilmaz1903

Copy link
Copy Markdown
Contributor Author

I will take a closer look this.

@ChrisRackauckas ChrisRackauckas requested a review from xtalax June 11, 2026 19:47
@utkuyilmaz1903 utkuyilmaz1903 force-pushed the feature/nonuniform-upwind-interface branch from 700376b to 2b49ca8 Compare June 11, 2026 22:35
@utkuyilmaz1903 utkuyilmaz1903 force-pushed the feature/nonuniform-upwind-interface branch 3 times, most recently from cad5373 to a73bf1e Compare June 19, 2026 11:01
@utkuyilmaz1903 utkuyilmaz1903 force-pushed the feature/nonuniform-upwind-interface branch from a73bf1e to 66619bc Compare June 19, 2026 11:06
@utkuyilmaz1903

Copy link
Copy Markdown
Contributor Author

@xtalax Just a gentle ping on this PR. This PR is ready.

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.

1 participant