diff --git a/src/mhd/DirectInduction/mhd.h b/src/mhd/DirectInduction/mhd.h index 558eda981dc71cdbf1ac16eced4ed25519175cd4..ef83e645851d100fe2c43ea108d5236a8bf43c7b 100644 --- a/src/mhd/DirectInduction/mhd.h +++ b/src/mhd/DirectInduction/mhd.h @@ -348,7 +348,7 @@ __attribute__((always_inline)) INLINE static void mhd_end_gradient( B[2] = p->mhd_data.B_over_rho[2] * rho; float OW; - OW = 2.0f; + OW = 1.0f; float absB; absB = sqrtf(B[0]*B[0]+B[1]*B[1]+B[2]*B[2]); diff --git a/src/mhd/DirectInduction/mhd_iact.h b/src/mhd/DirectInduction/mhd_iact.h index c22248179c1c2fc9455ba3922abd8216afdac687..c23e96d9a5bd7aa1d5bf0493cbd5503ab8f8cc89 100644 --- a/src/mhd/DirectInduction/mhd_iact.h +++ b/src/mhd/DirectInduction/mhd_iact.h @@ -160,7 +160,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_mhd_gradient( /* Calculate OWAR */ float OW; - OW = 2.0f; + OW = 1.0f; float absBi; absBi = sqrtf(Bi[0]*Bi[0]+Bi[1]*Bi[1]+Bi[2]*Bi[2]); @@ -309,7 +309,7 @@ runner_iact_nonsym_mhd_gradient(const float r2, const float dx[3], /* Calculate OWAR */ float OW; - OW = 2.0f; + OW = 1.0f; float absBj; absBj = sqrtf(Bj[0]*Bj[0]+Bj[1]*Bj[1]+Bj[2]*Bj[2]); @@ -662,8 +662,8 @@ __attribute__((always_inline)) INLINE static void runner_iact_mhd_force( const float dvr = -(dv[0] * dx[0] + dv[1] * dx[1] + dv[2] * dx[2]); for (int i = 0; i < 3; i++) { - dB_dt_adv_i[i] = -over_rho2_i*(Bj[i]/over_rho2_j+Bi[i]/over_rho2_i) * dvr; - dB_dt_adv_j[i] = -over_rho2_j*(Bi[i]/over_rho2_i+Bj[i]/over_rho2_j) * dvr; + dB_dt_adv_i[i] = (Bj[i]*over_rho2_j+Bi[i]*over_rho2_i) * dvr / over_rho2_i; + dB_dt_adv_j[i] = (Bi[i]*over_rho2_i+Bj[i]*over_rho2_j) * dvr / over_rho2_j; } for (int i = 0; i < 3; i++) { @@ -932,7 +932,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_mhd_force( const float dvr = -(dv[0] * dx[0] + dv[1] * dx[1] + dv[2] * dx[2]); for (int i = 0; i < 3; i++) { - dB_dt_adv_i[i] = -over_rho2_i*(Bj[i]/over_rho2_j+Bi[i]/over_rho2_i) * dvr; + dB_dt_adv_i[i] = ( Bj[i]*over_rho2_j+Bi[i]*over_rho2_i ) * dvr / over_rho2_i; } for (int i = 0; i < 3; i++) {