Skip to content

Commit

Permalink
fix convergence
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale committed Oct 5, 2023
1 parent aa22acf commit fb42e6e
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions Source/hydro/fourth_order.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -883,40 +883,40 @@ Castro::fourth_add_diffusive_flux(const Box& bx,
if (idir == 0) {

if (is_avg) {
// we are working with the cell-center state
dTdx = (-q_arr(i+1,j,k,temp_comp) + 27*q_arr(i,j,k,temp_comp) -
27*q_arr(i-1,j,k,temp_comp) + q_arr(i-2,j,k,temp_comp)) / (24.0_rt * dx[0]);

} else {
// we are working with the cell-average state
dTdx = (-q_arr(i+1,j,k,temp_comp) + 15*q_arr(i,j,k,temp_comp) -
15*q_arr(i-1,j,k,temp_comp) + q_arr(i-2,j,k,temp_comp)) / (12.0_rt * dx[0]);

} else {
// we are working with the cell-center state
dTdx = (-q_arr(i+1,j,k,temp_comp) + 27*q_arr(i,j,k,temp_comp) -
27*q_arr(i-1,j,k,temp_comp) + q_arr(i-2,j,k,temp_comp)) / (24.0_rt * dx[0]);
}

} else if (idir == 1) {

if (is_avg) {
// we are working with the cell-center state
dTdx = (-q_arr(i,j+1,k,temp_comp) + 27*q_arr(i,j,k,temp_comp) -
27*q_arr(i,j-1,k,temp_comp) + q_arr(i,j-2,k,temp_comp)) / (24.0_rt * dx[1]);

} else {
// we are working with the cell-average state
dTdx = (-q_arr(i,j+1,k,temp_comp) + 15*q_arr(i,j,k,temp_comp) -
15*q_arr(i,j-1,k,temp_comp) + q_arr(i,j-2,k,temp_comp)) / (12.0_rt * dx[1]);

} else {
// we are working with the cell-center state
dTdx = (-q_arr(i,j+1,k,temp_comp) + 27*q_arr(i,j,k,temp_comp) -
27*q_arr(i,j-1,k,temp_comp) + q_arr(i,j-2,k,temp_comp)) / (24.0_rt * dx[1]);
}

} else {

if (is_avg) {
// we are working with the cell-center state
dTdx = (-q_arr(i,j,k+1,temp_comp) + 27*q_arr(i,j,k,temp_comp) -
27*q_arr(i,j,k-1,temp_comp) + q_arr(i,j,k-2,temp_comp)) / (24.0_rt * dx[2]);

} else {
// we are working with the cell-average state
dTdx = (-q_arr(i,j,k+1,temp_comp) + 15*q_arr(i,j,k,temp_comp) -
15*q_arr(i,j,k-1,temp_comp) + q_arr(i,j,k-2,temp_comp)) / (12.0_rt * dx[2]);

} else {
// we are working with the cell-center state
dTdx = (-q_arr(i,j,k+1,temp_comp) + 27*q_arr(i,j,k,temp_comp) -
27*q_arr(i,j,k-1,temp_comp) + q_arr(i,j,k-2,temp_comp)) / (24.0_rt * dx[2]);
}

}
Expand Down

0 comments on commit fb42e6e

Please sign in to comment.