ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_UpdateRhoQtSources_SDMCongestus3D.H File Reference

Go to the source code of this file.

Functions

ParmParse pp_prob ("prob")
 
pp_prob query ("advection_moisture_rate", advection_moisture_rate)
 
pp_prob query ("advection_moisture_rate_base", advection_moisture_rate_base)
 
 for (MFIter mfi(*qsrc, TilingIfNotGPU());mfi.isValid();++mfi)
 

Variables

Real advection_moisture_rate = amrex::Real(1.0e-8)
 
Real advection_moisture_rate_base = amrex::Real(1.0e-8)
 
auto prob_lo = geom.ProbLoArray()
 
auto prob_hi = geom.ProbHiArray()
 
auto dx = geom.CellSizeArray()
 
auto xc = myhalf * (prob_lo[0] + prob_hi[0])
 
auto yc = myhalf * (prob_lo[1] + prob_hi[1])
 

Function Documentation

◆ for()

for ( MFIter mfi(*,  TilingIfNotGPU)
16  {
17  const auto &box = mfi.tilebox();
18  const Array4<Real>& qsrc_arr = qsrc->array(mfi);
19  if (box.length(0) != 1)
20  {
21  // if z dimension size is 1, then src is a spatially varying function over x,y at k=0
22  ParallelFor( box, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
23  {
24  auto x = prob_lo[0] + (i + myhalf) * dx[0];
25  auto y = prob_lo[1] + (j + myhalf) * dx[1];
26  auto z = prob_lo[2] + (k + myhalf) * dx[2];
27 
28  //const Real c = two*dx[0];
29  auto c = amrex::Real(1700.0)*amrex::Real(1700.0);
30  auto r = std::sqrt((x-xc)*(x-xc) + (y-yc)*(y-yc));
31  auto rsqr = r*r;
32  if (time < 3600) {
33  qsrc_arr(i, j, k) = (advection_moisture_rate_base)*exp(-z/100);
34  } else {
35  qsrc_arr(i, j, k) = (advection_moisture_rate*exp(-rsqr / c))*exp(-z/100);
36  }
37  });
38  } else {
39  // src is a function over Z
40  ParallelFor(box, [=] AMREX_GPU_DEVICE (int i, int j, int k) {
41  qsrc_arr(i, j, k) = zero;
42  });
43  }
44  }
constexpr amrex::Real zero
Definition: ERF_Constants.H:6
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:11
ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { const Real *dx=geomdata.CellSize();const Real x=(i+0.5) *dx[0];const Real y=(j+0.5) *dx[1];const Real Omg=erf_vortex_Gaussian(x, y, xc, yc, R, beta, sigma);const Real deltaT=-(gamma - 1.0)/(2.0 *sigma *sigma) *Omg *Omg;const Real rho_norm=std::pow(1.0+deltaT, inv_gm1);const Real T=(1.0+deltaT) *T_inf;const Real p=std::pow(rho_norm, Gamma)/Gamma *rho_0 *a_inf *a_inf;const Real rho_theta=rho_0 *rho_norm *(T *std::pow(p_0/p, rdOcp));state_pert(i, j, k, RhoTheta_comp)=rho_theta - getRhoThetagivenP(p_hse(i, j, k));const Real r2d_xy=std::sqrt((x-xc) *(x-xc)+(y-yc) *(y-yc));state_pert(i, j, k, RhoScalar_comp)=0.25 *(1.0+std::cos(PI *std::min(r2d_xy, R)/R));})
amrex::Real Real
Definition: ERF_ShocInterface.H:19
auto prob_lo
Definition: ERF_UpdateRhoQtSources_SDMCongestus3D.H:6
auto yc
Definition: ERF_UpdateRhoQtSources_SDMCongestus3D.H:12
auto xc
Definition: ERF_UpdateRhoQtSources_SDMCongestus3D.H:11
Real advection_moisture_rate_base
Definition: ERF_UpdateRhoQtSources_SDMCongestus3D.H:4
Real advection_moisture_rate
Definition: ERF_UpdateRhoQtSources_SDMCongestus3D.H:3
auto dx
Definition: ERF_UpdateRhoQtSources_SDMCongestus3D.H:8
Here is the call graph for this function:

◆ pp_prob()

ParmParse pp_prob ( "prob"  )

◆ query() [1/2]

pp_prob query ( "advection_moisture_rate"  ,
advection_moisture_rate   
)

◆ query() [2/2]

pp_prob query ( "advection_moisture_rate_base"  ,
advection_moisture_rate_base   
)

Variable Documentation

◆ advection_moisture_rate

Real advection_moisture_rate = amrex::Real(1.0e-8)

Referenced by for().

◆ advection_moisture_rate_base

Real advection_moisture_rate_base = amrex::Real(1.0e-8)

Referenced by for().

◆ dx

auto dx = geom.CellSizeArray()

Referenced by for().

◆ prob_hi

auto prob_hi = geom.ProbHiArray()

◆ prob_lo

auto prob_lo = geom.ProbLoArray()

Referenced by for().

◆ xc

auto xc = myhalf * (prob_lo[0] + prob_hi[0])

Referenced by for().

◆ yc

auto yc = myhalf * (prob_lo[1] + prob_hi[1])

Referenced by for().