Fix terrain YSU countergradient scaling - #3543
Conversation
Apply the missing vertical grid factor to terrain-fitted momentum countergradient terms and document the dormant YSUNew dispatch gap.
|
There is a discrepancy between the actual terms in the YSU paper and how the code is implemented using WRF. The term is written as d/dz ( - nut gammac) (https://www2.mmm.ucar.edu/wrf/users/physics/phys_refs/PBL/YSU.pdf). We calculate gammac ~ surface flux / pblh. We tested it for very low geostrophic wind speeds and @pressel confirmed that the results are as expected. The Fact term already contains a dz_inv and the extra dz_inv would dilute the term with an extra dz and it should not be included. |
|
@hgopalan -- Could you add a comment in the code to that effect so that next time we run a check like this it doesn't identify this as an issue again? Thx! |
|
#3486 should fix the comments section. |
| const int hgam_comp = (stagdir == 0) ? EddyDiff::HGAMU_v : EddyDiff::HGAMV_v; | ||
| const Real gam_hi = myhalf * (mu_turb(i,j,klo,hgam_comp) + mu_turb(i,j,klo+1,hgam_comp)); | ||
| RHS_a(i,j,klo) += Fact * gfac * rhoAlpha_hi * gam_hi / met_h_zeta_hi; | ||
| RHS_a(i,j,klo) += Fact * gfac * dz_inv * rhoAlpha_hi * gam_hi / met_h_zeta_hi; |
There was a problem hiding this comment.
The countergradient term is d/dz(K gammac). The gammac term is written as w'theta' / pblh. So we have only one dz_inv we should use. This one has extra and it will dilute the counter gradient further. Line 137 is correct. I was not sure what the met_h_zeta... term was and assumed it was a curvature correction.
There was a problem hiding this comment.
I agree. The metric term now looks incorrect as well.
AMLattanzi
left a comment
There was a problem hiding this comment.
Again considering the counter gradient term:

There is no second derivative, so adding a dz_inv is not correct. Finally, the met_h_zeta also looks incorrect for the same reason it should be removed from PR 3544 --- i.e., the detJ from the divergence has been moved to the RHS.
Apply the missing vertical grid factor to terrain-fitted momentum countergradient terms and document the dormant YSUNew dispatch gap.