Skip to content

Add 2D Cartesian/RZ EB Neumann support to MLNodeLaplacian#5504

Open
ShuLiu-Clock wants to merge 1 commit into
AMReX-Codes:developmentfrom
ShuLiu-Clock:eb-nodal-inhomog-neumann-2d-rz
Open

Add 2D Cartesian/RZ EB Neumann support to MLNodeLaplacian#5504
ShuLiu-Clock wants to merge 1 commit into
AMReX-Codes:developmentfrom
ShuLiu-Clock:eb-nodal-inhomog-neumann-2d-rz

Conversation

@ShuLiu-Clock

Copy link
Copy Markdown

This adds a 2D-only MLNodeLaplacian API for embedded-boundary inhomogeneous Neumann flux data, documents the EB normal convention, enables RZ RAP stencils, and adds CPU/GPU regression tests covering Cartesian, RZ, EB Neumann, EB inflow, and physical Neumann boundary combinations. 3D EB Neumann support remains unsupported.

Summary

This PR adds support for inhomogeneous Neumann data on embedded boundaries for 2D nodal MLNodeLaplacian solves.

The new API is:

MLNodeLaplacian::setEBInhomogNeumannFlux(int amrlev, const MultiFab& eb_neumann_flux)

The first component of eb_neumann_flux contains cell-centered cut-cell values of sigma * dphi/dn_EB at the EB surface.

The EB normal convention is documented as the AMReX convention: n_EB points from the valid/fluid region toward the covered/body region.

This PR also enables RAP coarsening for 2D RZ MLNodeLaplacian stencils, including EB stencil and sync-residual paths. The existing EB inflow velocity convention is preserved.

The implementation is limited to 2D. Calls to the new EB Neumann API in other dimensions abort.

Additional background

This is intended for 2D nodal Poisson-type solves with EB natural flux data. The new EB Neumann path is separate from setEBInflowVelocity: EB inflow remains a velocity-divergence contribution, while the new API supplies the operator boundary flux sigma * dphi/dn_EB.

RZ support includes RAP coarsening so the multigrid hierarchy can remain deep for EB geometries.

A new small regression test directory is added:

Tests/LinearSolvers/NodeRZEBBaseline

It covers Cartesian and RZ baselines, EB Neumann plane/sphere cases, EB inflow compatibility, mixed and all-Neumann physical boundary conditions, and all-Neumann solvability-offset handling.

CPU validation performed:

make -j4 DIM=2 USE_MPI=TRUE USE_OMP=FALSE USE_EB=TRUE COMP=gnu
mpiexec -n 1 ./main2d.gnu.TEST.MPI.ex inputs.rz_eb_inflow_sphere
mpiexec -n 1 ./main2d.gnu.TEST.MPI.ex inputs.rz_eb_neumann_sphere
mpiexec -n 1 ./main2d.gnu.TEST.MPI.ex inputs.rz_eb_neumann_mixed_bc
mpiexec -n 4 ./main2d.gnu.TEST.MPI.ex inputs.rz_eb_inflow_sphere
mpiexec -n 4 ./main2d.gnu.TEST.MPI.ex inputs.rz_eb_neumann_sphere
mpiexec -n 4 ./main2d.gnu.TEST.MPI.ex inputs.rz_eb_neumann_mixed_bc

GPU validation performed:

make -j4 DIM=2 USE_MPI=TRUE USE_OMP=FALSE USE_EB=TRUE USE_CUDA=TRUE COMP=gnu
mpiexec -n 1 ./main2d.gnu.TEST.MPI.CUDA.ex inputs.rz_eb_inflow_sphere
mpiexec -n 1 ./main2d.gnu.TEST.MPI.CUDA.ex inputs.rz_eb_neumann_sphere
mpiexec -n 1 ./main2d.gnu.TEST.MPI.CUDA.ex inputs.rz_eb_neumann_mixed_bc

A focused mpiexec -n 4 GPU smoke test was also run on a single shared GPU with reduced AMReX arena preallocation. All focused CPU/MPI and GPU tests passed.

Checklist

The proposed changes:

  • fix a bug or incorrect behavior in AMReX
  • add new capabilities to AMReX
  • changes answers in the test suite to more than roundoff level
  • are likely to significantly affect the results of downstream AMReX users
  • include documentation in the code and/or rst files, if appropriate

This adds a 2D-only MLNodeLaplacian API for embedded-boundary inhomogeneous Neumann flux data, documents the EB normal convention, enables RZ RAP stencils, and adds CPU regression tests covering Cartesian, RZ, EB Neumann, EB inflow, and physical Neumann boundary combinations. 3D EB Neumann support remains unsupported.
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