Skip to content

Commit

Permalink
Merge branch 'development' into 2d_spherical_test
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Oct 14, 2024
2 parents 0a1cfb0 + 7b80efd commit 3577b58
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions Source/hydro/advection_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,18 @@ Castro::divu(const Box& bx,
// Finite difference to get divergence. ux = 1/r^2 d/dr(r^2 * u)
ux = (ur * rr * rr - ul * rl * rl) * dxinv / (rc * rc);

// These are transverse averages in the x-direction
Real vb = 0.5_rt * (q_arr(i,j-1,k,QV) + q_arr(i-1,j-1,k,QV));
Real vt = 0.5_rt * (q_arr(i,j,k,QV) + q_arr(i-1,j,k,QV));
// If sinc == 0, then vy goes inf.
// But due to Phi-symmetry, vt*sint = vb*sinb, so set to 0.
if (sinc == 0.0_rt) {
vy = 0.0_rt;
} else {
// These are transverse averages in the x-direction
Real vb = 0.5_rt * (q_arr(i,j-1,k,QV) + q_arr(i-1,j-1,k,QV));
Real vt = 0.5_rt * (q_arr(i,j,k,QV) + q_arr(i-1,j,k,QV));

// Finite difference to get divergence. vy = 1/(r sin) * d/dtheta(v sin)
vy = (vt * sint - vb * sinb) * dyinv / (rc * sinc);
// Finite difference to get divergence. vy = 1/(r sin) * d/dtheta(v sin)
vy = (vt * sint - vb * sinb) * dyinv / (rc * sinc);
}
}

div(i,j,k) = ux + vy;
Expand Down

0 comments on commit 3577b58

Please sign in to comment.