ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
erf_detail_ShocTKE Namespace Reference

Functions

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_base_temp () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_min_tke () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_max_tke () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_max_iso () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_tabs_crit () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_pbl_trans () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_stable_ckh () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_stable_ckm () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_shear_ck () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_tke_cs () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_tke_ce () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_tke_cee () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_trop_pres () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real weighted_linear_interp (Real x0, Real x1, Real y0, Real y1, Real x)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real interface_spacing (const Array4< const Real > &zt, const Array4< const Real > &zi, const ShocColumnLayout &layout, int ic, int k)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real top_taper_factor (const Array4< const Real > &zt, const Array4< const Real > &zi, const ShocColumnLayout &layout, const ShocRuntimeOptions &opts, int ic, int k)
 
void interpolate_iface_to_cc (const ShocColumnData &col, const FArrayBox &iface_in, FArrayBox &cc_out, Real min_thresh)
 

Function Documentation

◆ interface_spacing()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocTKE::interface_spacing ( const Array4< const Real > &  zt,
const Array4< const Real > &  zi,
const ShocColumnLayout &  layout,
int  ic,
int  k 
)
53  {
54  if (k <= 0) {
55  return amrex::max(zt(ic,0,0) - zi(ic,0,0), 1.0e-12_rt);
56  }
57  if (k >= layout.nlev) {
58  return amrex::max(zi(ic,layout.nlev,0) - zt(ic,layout.nlev-1,0), 1.0e-12_rt);
59  }
60  return amrex::max(zt(ic,k,0) - zt(ic,k-1,0), 1.0e-12_rt);
61  }
@ zi
Definition: ERF_AdvanceWDM6.cpp:277
int nlev
Definition: ERF_ShocTypes.H:62

Referenced by ShocTKE::compute_shear_production().

Here is the caller graph for this function:

◆ interpolate_iface_to_cc()

void erf_detail_ShocTKE::interpolate_iface_to_cc ( const ShocColumnData &  col,
const FArrayBox &  iface_in,
FArrayBox &  cc_out,
Real  min_thresh 
)
85  {
86  const auto zt = col.zt.const_array();
87  const auto zi = col.zi.const_array();
88  const auto in = iface_in.const_array();
89  auto out = cc_out.array();
90  const auto layout = col.layout;
91  const Box col_box(IntVect(0,0,0), IntVect(layout.ncell - 1, 0, 0));
92 
93  ParallelFor(col_box, [=] AMREX_GPU_DEVICE (int ic, int, int) noexcept
94  {
95  for (int k = 0; k < layout.nlev; ++k) {
96  const Real interp = weighted_linear_interp(zi(ic,k,0), zi(ic,k+1,0),
97  in(ic,k,0), in(ic,k+1,0),
98  zt(ic,k,0));
99  out(ic,k,0) = amrex::max(min_thresh, interp);
100  }
101  });
102  }
ParallelFor(fab_box, [=] AMREX_GPU_DEVICE(int i, int j, int k) { qrcuten_arr(i, j, k)=Real(0);qscuten_arr(i, j, k)=Real(0);qicuten_arr(i, j, k)=Real(0);})
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real weighted_linear_interp(Real x0, Real x1, Real y0, Real y1, Real x)
Definition: ERF_ShocTKE.cpp:39
ShocColumnLayout layout
Definition: ERF_ShocTypes.H:71
amrex::FArrayBox zi
Definition: ERF_ShocTypes.H:75
amrex::FArrayBox zt
Definition: ERF_ShocTypes.H:74

Referenced by ShocTKE::diagnose_tke_and_diffusivities().

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

◆ shoc_base_temp()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocTKE::shoc_base_temp ( )
noexcept
12 { return 300.0_rt; }

Referenced by ShocTKE::diagnose_tke_and_diffusivities().

Here is the caller graph for this function:

◆ shoc_max_iso()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocTKE::shoc_max_iso ( )
noexcept
15 { return 2.0e4_rt; }

Referenced by ShocTKE::diagnose_tke_and_diffusivities().

Here is the caller graph for this function:

◆ shoc_max_tke()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocTKE::shoc_max_tke ( )
noexcept
14 { return 50.0_rt; }

Referenced by ShocTKE::diagnose_tke_and_diffusivities().

Here is the caller graph for this function:

◆ shoc_min_tke()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocTKE::shoc_min_tke ( )
noexcept
13 { return 4.0e-4_rt; }

Referenced by ShocTKE::diagnose_tke_and_diffusivities().

Here is the caller graph for this function:

◆ shoc_pbl_trans()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocTKE::shoc_pbl_trans ( )
noexcept
17 { return 200.0_rt; }

Referenced by ShocTKE::diagnose_tke_and_diffusivities().

Here is the caller graph for this function:

◆ shoc_shear_ck()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocTKE::shoc_shear_ck ( )
noexcept
20 { return 0.1_rt; }

Referenced by ShocTKE::compute_shear_production(), and shoc_tke_ce().

Here is the caller graph for this function:

◆ shoc_stable_ckh()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocTKE::shoc_stable_ckh ( )
noexcept
18 { return 0.1_rt; }

Referenced by ShocTKE::diagnose_tke_and_diffusivities().

Here is the caller graph for this function:

◆ shoc_stable_ckm()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocTKE::shoc_stable_ckm ( )
noexcept
19 { return 0.1_rt; }

Referenced by ShocTKE::diagnose_tke_and_diffusivities().

Here is the caller graph for this function:

◆ shoc_tabs_crit()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocTKE::shoc_tabs_crit ( )
noexcept
16 { return 182.0_rt; }

Referenced by ShocTKE::diagnose_tke_and_diffusivities().

Here is the caller graph for this function:

◆ shoc_tke_ce()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocTKE::shoc_tke_ce ( )
noexcept
25  {
26  return (shoc_shear_ck() * shoc_shear_ck() * shoc_shear_ck()) /
27  ((shoc_tke_cs() * shoc_tke_cs()) * (shoc_tke_cs() * shoc_tke_cs()));
28  }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_shear_ck() noexcept
Definition: ERF_ShocTKE.cpp:20
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_tke_cs() noexcept
Definition: ERF_ShocTKE.cpp:21

Referenced by shoc_tke_cee().

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

◆ shoc_tke_cee()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocTKE::shoc_tke_cee ( )
noexcept
32  {
33  return (shoc_tke_ce() / 0.7_rt) * 0.19_rt + (shoc_tke_ce() / 0.7_rt) * 0.51_rt;
34  }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_tke_ce() noexcept
Definition: ERF_ShocTKE.cpp:24

Referenced by ShocTKE::diagnose_tke_and_diffusivities().

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

◆ shoc_tke_cs()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocTKE::shoc_tke_cs ( )
noexcept
21 { return 0.15_rt; }

Referenced by shoc_tke_ce().

Here is the caller graph for this function:

◆ shoc_trop_pres()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocTKE::shoc_trop_pres ( )
noexcept
36 { return 8.0e4_rt; }

Referenced by ShocTKE::diagnose_tke_and_diffusivities(), and ShocTKE::integrate_column_stability().

Here is the caller graph for this function:

◆ top_taper_factor()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocTKE::top_taper_factor ( const Array4< const Real > &  zt,
const Array4< const Real > &  zi,
const ShocColumnLayout &  layout,
const ShocRuntimeOptions &  opts,
int  ic,
int  k 
)
69  {
70  if (opts.top_taper_depth <= 0.0) {
71  return 1.0;
72  }
73 
74  const Real ztop = zi(ic,layout.nlev,0);
75  const Real distance_from_top = amrex::max(0.0_rt, ztop - zt(ic,k,0));
76  const Real x = shoc_clamp(distance_from_top / opts.top_taper_depth, 0.0_rt, 1.0_rt);
77  const Real smooth = x * x * (3.0_rt - 2.0_rt * x);
78  return opts.top_taper_min_factor + (1.0_rt - opts.top_taper_min_factor) * smooth;
79  }
const Real ztop
Definition: ERF_InitCustomPertVels_ParticleTests.H:4
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T shoc_clamp(T value, T lo, T hi)
Definition: ERF_ShocTypes.H:242
amrex::Real top_taper_depth
Definition: ERF_ShocTypes.H:32
amrex::Real top_taper_min_factor
Definition: ERF_ShocTypes.H:33

Referenced by ShocTKE::diagnose_tke_and_diffusivities().

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

◆ weighted_linear_interp()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocTKE::weighted_linear_interp ( Real  x0,
Real  x1,
Real  y0,
Real  y1,
Real  x 
)
40  {
41  const Real denom = x1 - x0;
42  if (amrex::Math::abs(denom) <= 1.0e-12_rt) {
43  return 0.5_rt * (y0 + y1);
44  }
45  return y0 + (y1 - y0) * (x - x0) / denom;
46  }

Referenced by interpolate_iface_to_cc().

Here is the caller graph for this function: