[FLASH-USERS] Bug in hy_uhd_getFaceCurrents (current density calculation Cartesian DIR_Z)

VASANTH KASHYAP vasanth.kashyap at sns.it
Mon Oct 19 08:00:43 EDT 2026


Hello FLASH-USERS,

I have recently come across spurious currents that were preferentially at
45 degrees to the ZY plane in my simulations, which didn't match what the
field geometry should have produced .

[image: image.png]

I believe it's due to an indexing bug in Unsplit Staggered Mesh
implementation of MHD, in hy_uhd_getFaceCurrents.F90
(physics/Hydro/HydroMain/unsplit/MHD_StaggeredMesh/
hy_uhd_getFaceCurrents). In the 3D Cartesian DIR_Z case used to compute
face-centered currents (J = curl B), ie, Jz = dBy/dx - dBx/dy calculation
for the DIR_Z faces, the -dBx/dy term is meant to be averaged over the two
z-planes (k and k-1) straddling the face.The k-plane term correctly uses
MAGX_VAR, but the k-1 plane term uses MAGY_VAR instead of MAGX_VAR.

The following routines involving non-ideal MHD implementation are affected
by this.

   1.
   source/physics/Hydro/HydroMain/unsplit/MHD_StaggeredMesh/hy_uhd_addHallFluxes.F90
   2.
   source/physics/Hydro/HydroMain/unsplit/MHD_StaggeredMesh/hy_uhd_addBiermannFluxes.F90
   3.
   source/physics/Hydro/HydroMain/unsplit/MHD_StaggeredMesh/hy_uhd_addNernstFluxes.F90
   4.
   source/physics/Hydro/HydroMain/unsplit/MHD_StaggeredMesh/hy_uhd_addResistiveFluxes.F90
   5.
   source/physics/Hydro/HydroMain/unsplit/MHD_StaggeredMesh/hy_uhd_addCrossFieldFluxes.F90

Happy to share a patch to fix this if needed.

Regards,
Vasanth Kashyap,
COMPAC PhD Student
Scuola Normale Superiore di Pisa - Italy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://flash.rochester.edu/pipermail/flash-users/attachments/20261019/3af4c33f/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 213862 bytes
Desc: not available
URL: <http://flash.rochester.edu/pipermail/flash-users/attachments/20261019/3af4c33f/attachment-0001.png>


More information about the flash-users mailing list