<div dir="ltr"><div dir="ltr"><div dir="ltr">Hello FLASH-USERS,<br><br>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
. <br><br><img src="cid:ii_mvf4l9811" alt="image.png" style="margin-right:0px" width="778" height="307"><br><br>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.<br><br>The following routines involving non-ideal MHD implementation are affected by this. <br><ol><li>source/physics/Hydro/HydroMain/unsplit/MHD_StaggeredMesh/hy_uhd_addHallFluxes.F90</li><li>source/physics/Hydro/HydroMain/unsplit/MHD_StaggeredMesh/hy_uhd_addBiermannFluxes.F90</li><li>source/physics/Hydro/HydroMain/unsplit/MHD_StaggeredMesh/hy_uhd_addNernstFluxes.F90</li><li>source/physics/Hydro/HydroMain/unsplit/MHD_StaggeredMesh/hy_uhd_addResistiveFluxes.F90</li><li>source/physics/Hydro/HydroMain/unsplit/MHD_StaggeredMesh/hy_uhd_addCrossFieldFluxes.F90</li></ol><div>Happy to share a patch to fix this if needed.<br><br></div><div>Regards,<br>Vasanth Kashyap,</div><div><font color="#666666">COMPAC PhD Student<br>Scuola Normale Superiore di Pisa - Italy</font><br></div></div>
</div>
</div>