Function for computing the momentum RHS for diffusion operator with terrain.
47 auto dxinv = dxInv[0], dyinv = dxInv[1], dzinv = dxInv[2];
49 ParallelFor(bxx, bxy, bxz,
50 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
52 Real mf = mf_m(i,j,0);
54 Real diffContrib = ( (tau11(i , j , k ) - tau11(i-1, j ,k )) * dxinv * mf
55 + (tau12(i , j+1, k ) - tau12(i , j ,k )) * dyinv * mf
56 + (tau13(i , j , k+1) - tau13(i , j ,k )) * dzinv );
57 diffContrib /= 0.5*(detJ(i,j,k) + detJ(i-1,j,k));
58 rho_u_rhs(i,j,k) -= diffContrib;
60 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
62 Real mf = mf_m(i,j,0);
64 Real diffContrib = ( (tau21(i+1, j , k ) - tau21(i , j , k )) * dxinv * mf
65 + (tau22(i , j , k ) - tau22(i , j-1, k )) * dyinv * mf
66 + (tau23(i , j , k+1) - tau23(i , j , k )) * dzinv );
67 diffContrib /= 0.5*(detJ(i,j,k) + detJ(i,j-1,k));
68 rho_v_rhs(i,j,k) -= diffContrib;
70 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k)
72 Real mf = mf_m(i,j,0);
74 Real diffContrib = ( (tau31(i+1, j , k ) - tau31(i , j , k )) * dxinv * mf
75 + (tau32(i , j+1, k ) - tau32(i , j , k )) * dyinv * mf
76 + (tau33(i , j , k ) - tau33(i , j , k-1)) * dzinv );
77 diffContrib /= 0.5*(detJ(i,j,k) + detJ(i,j,k-1));
78 rho_w_rhs(i,j,k) -= diffContrib;