ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_Wstar.H File Reference
#include <ERF_Constants.H>
Include dependency graph for ERF_Wstar.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool pblh_is_diagnosed (const amrex::Real &pblh)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_wstar (const amrex::Real &ust, const amrex::Real &tst, const amrex::Real &qst, const amrex::Real &pblh, const amrex::Real &th, const amrex::Real &thv, const amrex::Real &qv=amrex::Real(0))
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_wstar (const amrex::Real &hfx, const amrex::Real &pblh, const amrex::Real &thv)
 

Function Documentation

◆ calc_wstar() [1/2]

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_wstar ( const amrex::Real &  hfx,
const amrex::Real &  pblh,
const amrex::Real &  thv 
)

Calculate the convective velocity scale from buoyancy flux.

Parameters
[in]hfxBuoyancy flux.
[in]pblhPBL height.
[in]thvVirtual potential temperature.
Returns
Convective velocity scale.
60 {
61  if (hfx <= 0 || !pblh_is_diagnosed(pblh)) {
62  return amrex::Real(0);
63  } else {
64  return std::cbrt(CONST_GRAV / thv * pblh * hfx);
65  }
66 }
constexpr amrex::Real CONST_GRAV
Definition: ERF_Constants.H:72
amrex::Real Real
Definition: ERF_ShocInterface.H:19
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool pblh_is_diagnosed(const amrex::Real &pblh)
Definition: ERF_Wstar.H:15
Here is the call graph for this function:

◆ calc_wstar() [2/2]

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real calc_wstar ( const amrex::Real &  ust,
const amrex::Real &  tst,
const amrex::Real &  qst,
const amrex::Real &  pblh,
const amrex::Real &  th,
const amrex::Real &  thv,
const amrex::Real &  qv = amrex::Real(0) 
)
34 {
35  amrex::Real hfx = -ust*tst; // <theta'w'>
36  if (hfx <= 0 || !pblh_is_diagnosed(pblh)) {
37  return amrex::Real(0);
38  }
39  if (qv > 0) {
40  // have moisture -- estimate buoyancy flux, <thetav'w'> (Stull 4.4.5d)
41  hfx = hfx*(one + epsv*qv) + epsv*th*(-ust*qst);
42  }
43  return std::cbrt(CONST_GRAV / thv * pblh * hfx);
44 }
constexpr amrex::Real epsv
Definition: ERF_Constants.H:56
constexpr amrex::Real one
Definition: ERF_NumericalConstants.H:37
@ qv
Definition: ERF_Kessler.H:31

Referenced by surface_flux_charnock::iterate_flux(), surface_flux_mod_charnock::iterate_flux(), surface_flux_donelan::iterate_flux(), surface_temp_charnock::iterate_flux(), surface_temp_mod_charnock::iterate_flux(), surface_temp_donelan::iterate_flux(), surface_flux_wave_coupled::iterate_flux(), surface_temp_wave_coupled::iterate_flux(), surface_flux::iterate_flux(), surface_temp::iterate_flux(), surface_temp_eb::iterate_flux(), and surface_flux_eb::iterate_flux().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pblh_is_diagnosed()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool pblh_is_diagnosed ( const amrex::Real &  pblh)
16 {
17  return pblh < amrex::Real(0.5) * bogus_large_value;
18 }
constexpr amrex::Real bogus_large_value
Definition: ERF_Constants.H:19

Referenced by calc_wstar(), and SurfaceLayer::set_pblh().

Here is the caller graph for this function: