Skip to content

Commit

Permalink
Fix wsp calc in YSU. (#1872)
Browse files Browse the repository at this point in the history
  • Loading branch information
AMLattanzi authored Oct 10, 2024
1 parent 52fe43d commit 12053bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/PBL/ERF_ComputeDiffusivityYSU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ ComputeDiffusivityYSU (const MultiFab& xvel,
while (!above_critical and bx.contains(i,j,kpbl+1)) {
kpbl += 1;
const Real zval = use_terrain ? Compute_Zrel_AtCellCenter(i,j,kpbl,z_nd_arr) : gdata.ProbLo(2) + (kpbl + 0.5)*gdata.CellSize(2);
const Real ws2_level = 0.25*((uvel(i,j,kpbl)+uvel(i+1,j,kpbl))*(uvel(i,j,kpbl)+uvel(i+1,j,kpbl)) + (vvel(i,j,kpbl)+vvel(i,j+1,kpbl))*(uvel(i,j,kpbl)+uvel(i,j+1,kpbl)));
const Real ws2_level = 0.25*( (uvel(i,j,kpbl)+uvel(i+1,j ,kpbl))*(uvel(i,j,kpbl)+uvel(i+1,j ,kpbl))
+ (vvel(i,j,kpbl)+vvel(i ,j+1,kpbl))*(vvel(i,j,kpbl)+vvel(i ,j+1,kpbl)) );
const Real theta = cell_data(i,j,kpbl,RhoTheta_comp) / cell_data(i,j,kpbl,Rho_comp);
Rib_dn = Rib_up;
Rib_up = (theta-base_theta)/base_theta * CONST_GRAV * zval / ws2_level;
Expand Down

0 comments on commit 12053bf

Please sign in to comment.