Skip to content

Commit

Permalink
fix rho-weighting of anelastic buoyancy (erf-model#1924)
Browse files Browse the repository at this point in the history
  • Loading branch information
asalmgren authored Nov 3, 2024
1 parent 84efdc3 commit 08ff588
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/SourceTerms/ERF_buoyancy_utils.H
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ buoyancy_dry_anelastic (int& i,

amrex::Real theta_d_0_wface = amrex::Real(0.5) * (theta_d_0_lo + theta_d_0_hi);

return (-grav_gpu * (theta_d_wface - theta_d_0_wface) / theta_d_0_wface);
return (-grav_gpu * (theta_d_wface - theta_d_0_wface) / theta_d_0_wface * 0.5 * (r0_arr(i,j,k) + r0_arr(i,j,k-1)));
}

AMREX_GPU_DEVICE
Expand Down Expand Up @@ -87,7 +87,7 @@ buoyancy_moist_anelastic (int& i,

amrex::Real theta_v_0_wface = amrex::Real(0.5) * (theta_v_0_lo + theta_v_0_hi);

return (-grav_gpu * (theta_v_wface - theta_v_0_wface) / theta_v_0_wface);
return (-grav_gpu * (theta_v_wface - theta_v_0_wface) / theta_v_0_wface * 0.5 * (r0_arr(i,j,k) + r0_arr(i,j,k-1)));
}

AMREX_GPU_DEVICE
Expand Down

0 comments on commit 08ff588

Please sign in to comment.