Skip to content

Add the Brinkman kernel#282

Open
alexfikl wants to merge 2 commits intoinducer:mainfrom
alexfikl:brinkman
Open

Add the Brinkman kernel#282
alexfikl wants to merge 2 commits intoinducer:mainfrom
alexfikl:brinkman

Conversation

@alexfikl
Copy link
Copy Markdown
Collaborator

@alexfikl alexfikl commented May 9, 2026

This adds the Brinkman kernel and the corresponding Brinkman stress tensor. I'm not particularly sure the scaling is right (the 2-3 papers I've found all had different scaling), but I've checked (in Mathematica) that

  • The kernel itself (with the pressure kernel) satisfies the Brinkman equation.
  • The stress matches $-p_j \delta_{ik} + \mu (\partial_i K_{jk} + \partial_k K_{ij})$.
  • The limits as $k \to 0$ gives back the Stokeslet and Stresslet with the scalings that we already have.

Also added these to some tests: test_pde_check_kernels and test_translations. There's probably more things we could test, but it should be ok for now.

TODO:

  • There's also a stress tensor for this (matching the Stresslet).

@alexfikl alexfikl marked this pull request as draft May 9, 2026 19:39
@alexfikl alexfikl requested a review from Copilot May 9, 2026 19:44
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for a Brinkman (Brinkmanlet) kernel to sumpy.kernel, together with test coverage to exercise PDE checks, translations, and pickling.

Changes:

  • Introduce BrinkmanletKernel as an ExpressionKernel with loopy/codegen support for special functions (2D Hankel form).
  • Extend kernel PDE-check tests (test_misc.py) to include Brinkmanlet components in 2D/3D.
  • Extend kernel translation/pickling tests (test_kernels.py) to include Brinkmanlet and its runtime parameters.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
sumpy/kernel.py Adds BrinkmanletKernel, mapper hookups, and updates a comment in YukawaKernel.is_complex_valued.
sumpy/test/test_misc.py Adds PDE-check parametrization coverage for BrinkmanletKernel in 2D/3D.
sumpy/test/test_kernels.py Adds translation and pickle test coverage for BrinkmanletKernel, including runtime args (mu, k) and custom arg names.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sumpy/kernel.py
Comment thread sumpy/kernel.py Outdated
Comment thread sumpy/kernel.py
# [1] Equations 7.7.5 and 7.7.6
a = K0 + K1 / R - 1 / R**2
b = 2 / R**2 - 2 * K1 / R - K0
expr = a * delta_ij + b * d[icomp] * d[jcomp] / r ** 2
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this a * delta_ij get flattened somewhere? Is it better to flatten it here?

@alexfikl alexfikl marked this pull request as ready for review May 10, 2026 14:26
@alexfikl alexfikl requested a review from Copilot May 10, 2026 14:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

Comment thread sumpy/kernel.py
Comment thread sumpy/kernel.py
Comment thread sumpy/kernel.py Outdated
Comment thread sumpy/kernel.py
@alexfikl
Copy link
Copy Markdown
Collaborator Author

For what it's worth, doing the test_translations tests for these Brinkman things is quite slow compared to the other kernels in there 😁

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.

2 participants