Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PBL negative K_turb fix #1271

Merged
merged 1 commit into from
Oct 20, 2023
Merged

Conversation

AMLattanzi
Copy link
Collaborator

With the PBL scheme, K_turb may become negative below the surface (k<0). This is due to the fact that the box operations in PBL are over a growntilebox(1) so they include halo cells in each region. At k==-1 the zval is negative and thus so it the l_S length scale. This can cause K_turb below the surface to become negative and flip the direction of diffusion.

Since MOST utilizes eta at the surface (k==0) to define the molecular fluxes, the following patch will limit zval to the quantity obtained with k==0 and thus K_turb at k==-1 will match that at k==0. This ensures the correct diffusive behavior at the bottom boundary. The top boundary should not require any special treatment since zval is still positive.

@AMLattanzi AMLattanzi requested review from ewquon and baperry2 October 19, 2023 22:59
@@ -163,7 +163,8 @@ ComputeTurbulentViscosityPBL (const amrex::MultiFab& xvel,

// First Length Scale
AMREX_ASSERT(l_obukhov != 0);
const amrex::Real zval = gdata.ProbLo(2) + (k + 0.5)*gdata.CellSize(2);
int lk = amrex::max(k,0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly what I would've implemented!

@AMLattanzi AMLattanzi merged commit f7c653c into erf-model:development Oct 20, 2023
12 checks passed
@AMLattanzi AMLattanzi deleted the PBLfix branch October 20, 2023 00:08
@ewquon ewquon mentioned this pull request Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants