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

Functions

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_thl_tol () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_rt_tol () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_w_tol_sqd () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_w_thresh () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_large_neg () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_base_temp () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_tl_min () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_pdf_tmp () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_sqrt_pdf_tmp () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool shoc_do_thetal_skew () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real inv_sqrt_two_pi () noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real eps ()
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real clamp01 (Real x)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real signed_denominator (Real value, Real eps_in=eps())
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real weighted_linear_interp (Real x0, Real x1, Real y0, Real y1, Real x)
 
void interpolate_iface_to_cc (const ShocColumnData &col, const FArrayBox &iface_in, FArrayBox &cc_out, Real min_thresh)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void vv_parameters (Real w_first, Real w_sec, Real w3var, Real &skew_w, Real &w1_1, Real &w1_2, Real &w2_1, Real &w2_2, Real &a)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void thl_parameters (Real wthlsec, Real sqrtw2, Real sqrtthl, Real thlsec, Real thl_first, Real w1_1, Real w1_2, Real skew_w, Real a, Real &thl1_1, Real &thl1_2, Real &thl2_1, Real &thl2_2, Real &sqrtthl2_1, Real &sqrtthl2_2)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void qw_parameters (Real wqwsec, Real sqrtw2, Real skew_w, Real sqrtqt, Real qwsec, Real w1_2, Real w1_1, Real qw_first, Real a, Real &qw1_1, Real &qw1_2, Real &qw2_1, Real &qw2_2, Real &sqrtqw2_1, Real &sqrtqw2_2)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real inplume_correlation (Real sqrtqw2_1, Real sqrtthl2_1, Real a, Real sqrtqw2_2, Real sqrtthl2_2, Real qwthlsec, Real qw1_1, Real qw_first, Real thl1_1, Real thl_first, Real qw1_2, Real thl1_2)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real compute_temperature (Real thl1, Real pval)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void compute_qs_beta (Real temp, Real pval, Real &qs, Real &beta)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void compute_s_terms (Real qw1, Real qs, Real beta, Real pval, Real thl2, Real qw2, Real sqrtthl2, Real sqrtqw2, Real r_qwthl, Real &s, Real &std_s, Real &qn, Real &cfrac)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real compute_buoyancy_flux (Real wthlsec, Real wqwsec, Real pval, Real wqls)
 

Function Documentation

◆ clamp01()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocPDF::clamp01 ( Real  x)
33 { return shoc_clamp(x, 0.0_rt, 1.0_rt); }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE T shoc_clamp(T value, T lo, T hi)
Definition: ERF_ShocTypes.H:242

Referenced by ShocPDF::diagnose_pdf().

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

◆ compute_buoyancy_flux()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocPDF::compute_buoyancy_flux ( Real  wthlsec,
Real  wqwsec,
Real  pval,
Real  wqls 
)
268  {
269  const Real epsterm = R_d / R_v;
270  const Real pressure_ratio = p_0 / amrex::max(pval, eps());
271  const Real pressure_term = std::exp(RdoCp * std::log(pressure_ratio));
272  return wthlsec
273  + ((1.0_rt - epsterm) / epsterm) * shoc_base_temp() * wqwsec
274  + ((L_v / Cp_d) * pressure_term
275  - (1.0_rt / epsterm) * shoc_base_temp()) * wqls;
276  }
constexpr amrex::Real R_v
Definition: ERF_Constants.H:50
constexpr amrex::Real Cp_d
Definition: ERF_Constants.H:51
constexpr amrex::Real p_0
Definition: ERF_Constants.H:69
constexpr amrex::Real R_d
Definition: ERF_Constants.H:49
constexpr amrex::Real L_v
Definition: ERF_Constants.H:67
constexpr amrex::Real RdoCp
Definition: ERF_Constants.H:57
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_base_temp() noexcept
Definition: ERF_ShocPDF.cpp:20
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real eps()
Definition: ERF_ShocPDF.cpp:29

Referenced by ShocPDF::diagnose_pdf().

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

◆ compute_qs_beta()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void erf_detail_ShocPDF::compute_qs_beta ( Real  temp,
Real  pval,
Real &  qs,
Real &  beta 
)
224  {
225  qs = 0.0_rt;
226  erf_qsatw(temp, 0.01_rt * pval, qs);
227  qs = amrex::max(0.0_rt, qs);
228  beta = (R_d / R_v) * (L_v / (R_d * temp)) * (L_v / (Cp_d * temp));
229  }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void erf_qsatw(amrex::Real t, amrex::Real p, amrex::Real &qsatw)
Definition: ERF_MicrophysicsUtils.H:265
@ qs
Definition: ERF_Morrison.H:113
@ beta
Definition: ERF_SLM.H:154

Referenced by ShocPDF::diagnose_pdf().

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

◆ compute_s_terms()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void erf_detail_ShocPDF::compute_s_terms ( Real  qw1,
Real  qs,
Real  beta,
Real  pval,
Real  thl2,
Real  qw2,
Real  sqrtthl2,
Real  sqrtqw2,
Real  r_qwthl,
Real &  s,
Real &  std_s,
Real &  qn,
Real &  cfrac 
)
235  {
236  const Real beta_qs = 1.0_rt + beta * qs;
237  const Real pressure_ratio = pval / p_0;
238  const Real pressure_term = std::exp(RdoCp * std::log(pressure_ratio));
239  const Real cthl = ((1.0_rt + beta * qw1) / (beta_qs * beta_qs))
240  * (Cp_d / L_v) * beta * qs * pressure_term;
241  const Real cqt = 1.0_rt / (1.0_rt + beta * qs);
242  const Real variance = cthl * cthl * thl2
243  + cqt * cqt * qw2
244  - 2.0_rt * cthl * sqrtthl2 * cqt * sqrtqw2 * r_qwthl;
245  std_s = std::sqrt(amrex::max(0.0_rt, variance));
246  s = qw1 - qs * ((1.0_rt + beta * qw1) / (1.0_rt + beta * qs));
247 
248  cfrac = 0.0_rt;
249  qn = 0.0_rt;
250  if (std_s > std::sqrt(std::numeric_limits<Real>::min()) * 100.0_rt) {
251  cfrac = 0.5_rt * (1.0_rt + std::erf(s / (std::sqrt(2.0_rt) * std_s)));
252  if (cfrac != 0.0_rt) {
253  qn = s * cfrac + std_s * inv_sqrt_two_pi() * std::exp(-0.5_rt * (s / std_s) * (s / std_s));
254  }
255  } else if (s > 0.0_rt) {
256  cfrac = 1.0_rt;
257  qn = s;
258  }
259 
260  if (qn <= 0.0_rt) {
261  cfrac = 0.0_rt;
262  qn = 0.0_rt;
263  }
264  }
@ qn
Definition: ERF_Morrison.H:36
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real inv_sqrt_two_pi() noexcept
Definition: ERF_ShocPDF.cpp:25

Referenced by ShocPDF::diagnose_pdf().

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

◆ compute_temperature()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocPDF::compute_temperature ( Real  thl1,
Real  pval 
)
217  {
218  const Real pressure_ratio = p_0 / amrex::max(pval, eps());
219  return thl1 / std::exp(RdoCp * std::log(pressure_ratio));
220  }

Referenced by ShocPDF::diagnose_pdf().

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

◆ eps()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocPDF::eps ( )
29 { return Real(1.e-12); }

Referenced by compute_buoyancy_flux(), compute_temperature(), ShocPDF::diagnose_pdf(), and weighted_linear_interp().

Here is the caller graph for this function:

◆ inplume_correlation()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocPDF::inplume_correlation ( Real  sqrtqw2_1,
Real  sqrtthl2_1,
Real  a,
Real  sqrtqw2_2,
Real  sqrtthl2_2,
Real  qwthlsec,
Real  qw1_1,
Real  qw_first,
Real  thl1_1,
Real  thl_first,
Real  qw1_2,
Real  thl1_2 
)
204  {
205  const Real denom = a * sqrtqw2_1 * sqrtthl2_1 + (1.0_rt - a) * sqrtqw2_2 * sqrtthl2_2;
206  if (amrex::Math::abs(denom) <= 1.0e-18_rt) {
207  return 0.0_rt;
208  }
209  return shoc_clamp((qwthlsec
210  - a * (qw1_1 - qw_first) * (thl1_1 - thl_first)
211  - (1.0_rt - a) * (qw1_2 - qw_first) * (thl1_2 - thl_first)) / denom,
212  -1.0_rt, 1.0_rt);
213  }

Referenced by ShocPDF::diagnose_pdf().

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

◆ interpolate_iface_to_cc()

void erf_detail_ShocPDF::interpolate_iface_to_cc ( const ShocColumnData &  col,
const FArrayBox &  iface_in,
FArrayBox &  cc_out,
Real  min_thresh 
)
58  {
59  const auto zt = col.zt.const_array();
60  const auto zi = col.zi.const_array();
61  const auto in = iface_in.const_array();
62  auto out = cc_out.array();
63 
64  const auto layout = col.layout;
65  const Box cell_box(IntVect(0,0,0), IntVect(layout.ncell - 1, layout.nlev - 1, 0));
66  ParallelFor(cell_box, [=] AMREX_GPU_DEVICE (int ic, int k, int) noexcept
67  {
68  const Real interp = weighted_linear_interp(zi(ic,k,0), zi(ic,k+1,0),
69  in(ic,k,0), in(ic,k+1,0),
70  zt(ic,k,0));
71  out(ic,k,0) = amrex::max(min_thresh, interp);
72  });
73  }
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);})
@ zi
Definition: ERF_AdvanceWDM6.cpp:277
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real weighted_linear_interp(Real x0, Real x1, Real y0, Real y1, Real x)
Definition: ERF_ShocPDF.cpp:45
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 ShocPDF::diagnose_pdf().

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

◆ inv_sqrt_two_pi()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocPDF::inv_sqrt_two_pi ( )
noexcept
25 { return 0.39894228040143267794_rt; }

Referenced by compute_s_terms().

Here is the caller graph for this function:

◆ qw_parameters()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void erf_detail_ShocPDF::qw_parameters ( Real  wqwsec,
Real  sqrtw2,
Real  skew_w,
Real  sqrtqt,
Real  qwsec,
Real  w1_2,
Real  w1_1,
Real  qw_first,
Real  a,
Real &  qw1_1,
Real &  qw1_2,
Real &  qw2_1,
Real &  qw2_2,
Real &  sqrtqw2_1,
Real &  sqrtqw2_2 
)
157  {
158  qw1_1 = qw_first;
159  qw1_2 = qw_first;
160  qw2_1 = 0.0;
161  qw2_2 = 0.0;
162  sqrtqw2_1 = 0.0;
163  sqrtqw2_2 = 0.0;
164 
165  if (qwsec > shoc_rt_tol() * shoc_rt_tol() &&
166  amrex::Math::abs(w1_2 - w1_1) > shoc_w_thresh() &&
167  sqrtw2 > 0.0 && sqrtqt > 0.0) {
168  const Real corr = shoc_clamp(wqwsec / (sqrtw2 * sqrtqt), -1.0_rt, 1.0_rt);
169  const Real tmp1 = -corr / w1_1;
170  const Real tmp2 = -corr / w1_2;
171  const Real tsign = amrex::Math::abs(tmp1 - tmp2);
172  Real skew_qw = 0.0_rt;
173  if (tsign > 0.4_rt) {
174  skew_qw = 1.2_rt * skew_w;
175  } else if (tsign > 0.2_rt) {
176  skew_qw = ((1.2_rt * skew_w) / 0.2_rt) * (tsign - 0.2_rt);
177  }
178 
179  qw2_1 = shoc_clamp(
180  (3.0_rt * tmp1 * (1.0_rt - a * tmp2 * tmp2 - (1.0_rt - a) * tmp1 * tmp1)
181  - (skew_qw - a * tmp2 * tmp2 * tmp2 - (1.0_rt - a) * tmp1 * tmp1 * tmp1)) /
182  signed_denominator(3.0_rt * a * (tmp1 - tmp2)),
183  0.0_rt, 100.0_rt) * qwsec;
184 
185  qw2_2 = shoc_clamp(
186  (-3.0_rt * tmp2 * (1.0_rt - a * tmp2 * tmp2 - (1.0_rt - a) * tmp1 * tmp1)
187  + (skew_qw - a * tmp2 * tmp2 * tmp2 - (1.0_rt - a) * tmp1 * tmp1 * tmp1)) /
188  signed_denominator(3.0_rt * (1.0_rt - a) * (tmp1 - tmp2)),
189  0.0_rt, 100.0_rt) * qwsec;
190 
191  qw1_1 = tmp2 * sqrtqt + qw_first;
192  qw1_2 = tmp1 * sqrtqt + qw_first;
193  sqrtqw2_1 = std::sqrt(amrex::max(qw2_1, 0.0_rt));
194  sqrtqw2_2 = std::sqrt(amrex::max(qw2_2, 0.0_rt));
195  }
196  }
@ tmp1
Definition: ERF_AdvanceWSM6.cpp:117
@ tmp2
Definition: ERF_AdvanceWSM6.cpp:118
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_rt_tol() noexcept
Definition: ERF_ShocPDF.cpp:16
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_w_thresh() noexcept
Definition: ERF_ShocPDF.cpp:18
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real signed_denominator(Real value, Real eps_in=eps())
Definition: ERF_ShocPDF.cpp:36

Referenced by ShocPDF::diagnose_pdf().

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_ShocPDF::shoc_base_temp ( )
noexcept
20 { return 300.0_rt; }

Referenced by compute_buoyancy_flux().

Here is the caller graph for this function:

◆ shoc_do_thetal_skew()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool erf_detail_ShocPDF::shoc_do_thetal_skew ( )
noexcept
24 { return false; }

Referenced by thl_parameters().

Here is the caller graph for this function:

◆ shoc_large_neg()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocPDF::shoc_large_neg ( )
noexcept
19 { return -99999999.99_rt; }

Referenced by ShocPDF::diagnose_pdf().

Here is the caller graph for this function:

◆ shoc_pdf_tmp()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocPDF::shoc_pdf_tmp ( )
noexcept
22 { return 0.4_rt; }

Referenced by vv_parameters().

Here is the caller graph for this function:

◆ shoc_rt_tol()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocPDF::shoc_rt_tol ( )
noexcept
16 { return 1.0e-4_rt; }

Referenced by ShocPDF::diagnose_pdf(), and qw_parameters().

Here is the caller graph for this function:

◆ shoc_sqrt_pdf_tmp()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocPDF::shoc_sqrt_pdf_tmp ( )
noexcept
23 { return 0.77459666924148337704_rt; }

Referenced by vv_parameters().

Here is the caller graph for this function:

◆ shoc_thl_tol()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocPDF::shoc_thl_tol ( )
noexcept
15 { return 1.0e-2_rt; }

Referenced by ShocPDF::diagnose_pdf(), and thl_parameters().

Here is the caller graph for this function:

◆ shoc_tl_min()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocPDF::shoc_tl_min ( )
noexcept
21 { return 100.0_rt; }

Referenced by ShocPDF::diagnose_pdf().

Here is the caller graph for this function:

◆ shoc_w_thresh()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocPDF::shoc_w_thresh ( )
noexcept
18 { return 0.0_rt; }

Referenced by qw_parameters(), and thl_parameters().

Here is the caller graph for this function:

◆ shoc_w_tol_sqd()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocPDF::shoc_w_tol_sqd ( )
noexcept
17 { return 4.0e-4_rt; }

Referenced by vv_parameters().

Here is the caller graph for this function:

◆ signed_denominator()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real erf_detail_ShocPDF::signed_denominator ( Real  value,
Real  eps_in = eps() 
)
37  {
38  if (amrex::Math::abs(value) >= eps_in) {
39  return value;
40  }
41  return std::copysign(eps_in, value == 0.0_rt ? 1.0_rt : value);
42  }

Referenced by qw_parameters(), and thl_parameters().

Here is the caller graph for this function:

◆ thl_parameters()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void erf_detail_ShocPDF::thl_parameters ( Real  wthlsec,
Real  sqrtw2,
Real  sqrtthl,
Real  thlsec,
Real  thl_first,
Real  w1_1,
Real  w1_2,
Real  skew_w,
Real  a,
Real &  thl1_1,
Real &  thl1_2,
Real &  thl2_1,
Real &  thl2_2,
Real &  sqrtthl2_1,
Real &  sqrtthl2_2 
)
109  {
110  thl1_1 = thl_first;
111  thl1_2 = thl_first;
112  thl2_1 = 0.0;
113  thl2_2 = 0.0;
114  sqrtthl2_1 = 0.0;
115  sqrtthl2_2 = 0.0;
116 
117  if (thlsec > shoc_thl_tol() * shoc_thl_tol() &&
118  amrex::Math::abs(w1_2 - w1_1) > shoc_w_thresh() &&
119  sqrtw2 > 0.0 && sqrtthl > 0.0) {
120  const Real corr = shoc_clamp(wthlsec / (sqrtw2 * sqrtthl), -1.0_rt, 1.0_rt);
121  const Real tmp1 = -corr / w1_1;
122  const Real tmp2 = -corr / w1_2;
123  const Real tsign = amrex::Math::abs(tmp1 - tmp2);
124  Real skew_thl = 0.0_rt;
125  if (shoc_do_thetal_skew()) {
126  if (tsign > 0.4_rt) {
127  skew_thl = 1.2_rt * skew_w;
128  } else if (tsign > 0.2_rt) {
129  skew_thl = ((1.2_rt * skew_w) / 0.2_rt) * (tsign - 0.2_rt);
130  }
131  }
132 
133  thl2_1 = shoc_clamp(
134  (3.0_rt * tmp1 * (1.0_rt - a * tmp2 * tmp2 - (1.0_rt - a) * tmp1 * tmp1)
135  - (skew_thl - a * tmp2 * tmp2 * tmp2 - (1.0_rt - a) * tmp1 * tmp1 * tmp1)) /
136  signed_denominator(3.0_rt * a * (tmp1 - tmp2)),
137  0.0_rt, 100.0_rt) * thlsec;
138 
139  thl2_2 = shoc_clamp(
140  (-3.0_rt * tmp2 * (1.0_rt - a * tmp2 * tmp2 - (1.0_rt - a) * tmp1 * tmp1)
141  + (skew_thl - a * tmp2 * tmp2 * tmp2 - (1.0_rt - a) * tmp1 * tmp1 * tmp1)) /
142  signed_denominator(3.0_rt * (1.0_rt - a) * (tmp1 - tmp2)),
143  0.0_rt, 100.0_rt) * thlsec;
144 
145  thl1_1 = tmp2 * sqrtthl + thl_first;
146  thl1_2 = tmp1 * sqrtthl + thl_first;
147  sqrtthl2_1 = std::sqrt(amrex::max(thl2_1, 0.0_rt));
148  sqrtthl2_2 = std::sqrt(amrex::max(thl2_2, 0.0_rt));
149  }
150  }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_thl_tol() noexcept
Definition: ERF_ShocPDF.cpp:15
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool shoc_do_thetal_skew() noexcept
Definition: ERF_ShocPDF.cpp:24

Referenced by ShocPDF::diagnose_pdf().

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

◆ vv_parameters()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void erf_detail_ShocPDF::vv_parameters ( Real  w_first,
Real  w_sec,
Real  w3var,
Real &  skew_w,
Real &  w1_1,
Real &  w1_2,
Real &  w2_1,
Real &  w2_2,
Real &  a 
)
79  {
80  skew_w = 0.0;
81  w1_1 = w_first;
82  w1_2 = w_first;
83  w2_1 = 0.0;
84  w2_2 = 0.0;
85  a = 0.5_rt;
86 
87  if (w_sec > shoc_w_tol_sqd()) {
88  const Real w_sec_cu = w_sec * w_sec * w_sec;
89  const Real one_minus_pdf = 1.0_rt - shoc_pdf_tmp();
90  const Real one_minus_pdf_cu = one_minus_pdf * one_minus_pdf * one_minus_pdf;
91  const Real skew_denom = std::sqrt(amrex::max(w_sec_cu, 1.0e-18_rt));
92  skew_w = w3var / skew_denom;
93  const Real skew_term = std::sqrt(1.0_rt /
94  (4.0_rt * one_minus_pdf_cu + skew_w * skew_w));
95  a = shoc_clamp(0.5_rt * (1.0_rt - skew_w * skew_term), 0.01_rt, 0.99_rt);
96  w1_1 = std::sqrt((1.0_rt - a) / a) * shoc_sqrt_pdf_tmp();
97  w1_2 = -std::sqrt(a / (1.0_rt - a)) * shoc_sqrt_pdf_tmp();
98  w2_1 = shoc_pdf_tmp() * w_sec;
99  w2_2 = shoc_pdf_tmp() * w_sec;
100  }
101  }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_sqrt_pdf_tmp() noexcept
Definition: ERF_ShocPDF.cpp:23
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_w_tol_sqd() noexcept
Definition: ERF_ShocPDF.cpp:17
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Real shoc_pdf_tmp() noexcept
Definition: ERF_ShocPDF.cpp:22

Referenced by ShocPDF::diagnose_pdf().

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_ShocPDF::weighted_linear_interp ( Real  x0,
Real  x1,
Real  y0,
Real  y1,
Real  x 
)
46  {
47  const Real denom = x1 - x0;
48  if (amrex::Math::abs(denom) <= eps()) {
49  return 0.5_rt * (y0 + y1);
50  }
51  return y0 + (y1 - y0) * (x - x0) / denom;
52  }

Referenced by interpolate_iface_to_cc().

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