You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
🐛[BUG]: MHD_PDE equation "B_grad_u" uses v * Bx.diff(y) instead of By * u.diff(y) #2021
(B·∇)u should be Bx * u.diff(x) + By * u.diff(y). The next line (B_grad_v, L59) follows
the correct pattern, as does the hand-written version in losses/loss_mhd.py L539.
Impact: none for the shipped examples as far as I can tell. loss_mhd.py recomputes the
term correctly, and the *_physicsnemo.py losses only evaluate computations 12–24
(B_grad_u is index 2). Anyone reusing MHD_PDE.equations["B_grad_u"] gets a wrong term.
Suggested fix:
```
self.equations["B_grad_u"] = Bx * u.diff(x) + v * Bx.diff(y)
self.equations["B_grad_u"] = Bx * u.diff(x) + By * u.diff(y)
Found by checking MHD_PDE against an exact decaying Alfvén wave; all other terms
(u/v/Bx/By/A right-hand sides, div constraints) match it.
### Minimum reproducible example
```shell
cd examples/cfd/mhd_pino/losses
python -c "from mhd_pde import MHD_PDE; print(MHD_PDE().equations['B_grad_u'])"
# prints Bx*u__x + v*Bx__y — expected Bx*u__x + By*u__y
Activity