Add compressible Navier-Stokes operator with BR1 viscous fluxes#405
Draft
Add compressible Navier-Stokes operator with BR1 viscous fluxes#405
Conversation
…low convergence test Agent-Logs-Url: https://github.com/inducer/grudge/sessions/b18f1f3d-6379-4375-9130-d6d7957983b3 Co-authored-by: inducer <352067+inducer@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add compressible Navier-Stokes operator with boundary conditions
Add compressible Navier-Stokes operator with BR1 viscous fluxes
Mar 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a compressible Navier-Stokes (CNS) operator to
grudge/models/, analogous to the existing Euler operator, using Bassi-Rebay 1 (BR1) fluxes for the viscous terms. Includes inflow, outflow, and no-slip boundary conditions, and a Poiseuille flow spatial convergence test.New module:
grudge/models/navierstokes.pyBR1 gradient (
compute_viscous_gradient):weak_local_grad(q) + M⁻¹face_mass({q}⊗n)Viscous flux (
compute_ns_viscous_flux):ConservedEulerFieldwith momentum=τ, energy=τ·u − qCNSOperatordiscretizes ∂Q/∂t + ∇·(F_inv − σ_vis) = 0:Boundary conditions:
NoSlipBC(isothermal or adiabatic),InflowBC(prescribed callable),OutflowBC(zero-order extrapolation). All implement both the inviscid trace pair and the BR1 gradient BC data interface.poiseuille_flow(x_vec, *, mu, ...): exact steady Poiseuille solution for use as IC/BC.New test:
test/test_navierstokes_model.pytest_poiseuille_convergenceevaluates the CNS operator residual at the exact Poiseuille solution on a channel mesh with all three BC types. Checks that the mass and x-momentum residuals (both analytically zero for this flow) converge at ≥ O(h^{p+0.5}) for polynomial orders 2 and 3, directly measuring spatial discretization accuracy of the viscous operator.