Skip to content

Commit 9a7716d

Browse files
authored
fix MakeVsFromAmag in spherical-non axisymmetric runs (#293)
fix field computation for non-axisymmetric vector potential in spherical geometry that led to non-zero divergence
1 parent 2efed9c commit 9a7716d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/dataBlock/dataBlockHost.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ void DataBlockHost::MakeVsFromAmag(IdefixHostArray4D<real> &Ain) {
223223
+ 1/(x1m(i)*(cos(x2m(j))
224224
- cos(x2m(j+1)))) * (sin(x2m(j+1))*Ain(KDIR,k,j+1,i)
225225
- sin(x2m(j))*Ain(KDIR,k,j,i) ) ,
226-
- 1/(x1m(i)*sin(x2(j))*dx3(k)) * (Ain(JDIR,k+1,j,i)
227-
- Ain(JDIR,k,j,i) ) );
226+
- dx2(j)/(x1m(i)*((cos(x2m(j))- cos(x2m(j+1))))*dx3(k))
227+
* (Ain(JDIR,k+1,j,i) - Ain(JDIR,k,j,i) ) );
228228

229229
real Ax2m = fabs(sin(x2m(j)));
230230
// Regularisation along the axis

0 commit comments

Comments
 (0)