ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ERF_DiffTKEAdjustment.H File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 if (l_use_keqn &&(start_comp<=RhoKE_comp) &&(end_comp >=RhoKE_comp))
 

Function Documentation

◆ if()

if ( l_use_keqn &&  start_comp<=RhoKE_comp) &&(end_comp >=RhoKE_comp)
13  {
14  int qty_index = RhoKE_comp;
15  ParallelFor(bx,[=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
16  {
17  // Add Buoyancy Source
18  // where the SGS buoyancy flux tau_{theta,i} = -KH * dtheta/dx_i,
19  // such that for dtheta/dz < 0, there is a positive (upward) heat
20  // flux; the TKE buoyancy production is then
21  // B = g/theta_0 * tau_{theta,w}
22  // for a dry atmosphere.
23  // TODO: To account for moisture, the Brunt-Vaisala frequency,
24  // N^2 = g[1/theta * dtheta/dz + ...]
25  // **should** be a function of the water vapor and total water
26  // mixing ratios, depending on whether conditions are saturated or
27  // not (see the WRF model description, Skamarock et al 2019).
28  cell_rhs(i,j,k,qty_index) += l_abs_g * l_inv_theta0 * hfx_z(i,j,k);
29 
30  // TKE shear production
31  // P = -tau_ij * S_ij = 2 * mu_turb * S_ij * S_ij
32  // Note: This assumes that the horizontal and vertical diffusivities
33  // of momentum are equal
34  cell_rhs(i,j,k,qty_index) += 2.0*mu_turb(i,j,k,EddyDiff::Mom_v) * SmnSmn_a(i,j,k);
35 
36  // TKE dissipation
37  cell_rhs(i,j,k,qty_index) -= diss(i,j,k);
38  });
39  }
Real l_inv_theta0
Definition: ERF_DiffSetup.H:12
Real l_abs_g
Definition: ERF_DiffSetup.H:13
#define RhoKE_comp
Definition: ERF_IndexDefines.H:38
@ Mom_v
Definition: ERF_IndexDefines.H:175