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

Go to the source code of this file.

Functions

ParmParse pp_prob ("prob")
 
pp_prob query ("advection_heating_rate", advection_heating_rate)
 
pp_prob query ("advection_heating_rate_base", advection_heating_rate_base)
 
 for (MFIter mfi(*src, TilingIfNotGPU());mfi.isValid();++mfi)
 

Variables

Real advection_heating_rate = amrex::Real(5.4e-5)
 
Real advection_heating_rate_base = amrex::Real(5.4e-5)
 
auto prob_lo = geom.ProbLoArray()
 
auto prob_hi = geom.ProbHiArray()
 
auto dx = geom.CellSizeArray()
 
const Real xc = myhalf * (prob_lo[0] + prob_hi[0])
 
const Real 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>& src_arr = src->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  auto c = amrex::Real(2890000.0);
29  auto r = std::sqrt((x-xc)*(x-xc) + (y-yc)*(y-yc));
30  auto rsqr = r*r;
31  if (time < 3600) {
32  src_arr(i, j, k) = (advection_heating_rate_base)*exp(-z/100);
33  } else {
34  src_arr(i, j, k) = (advection_heating_rate*exp(-rsqr / c))*exp(-z/100);
35  }
36  });
37  } else {
38  // src is a function over Z
39  ParallelFor(box, [=] AMREX_GPU_DEVICE (int i, int j, int k) {
40  src_arr(i, j, k) = advection_heating_rate;
41  });
42  }
43  }
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:11
ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { const auto prob_lo=geomdata.ProbLo();const auto dx=geomdata.CellSize();const Real x=(prob_lo[0]+(i+myhalf) *dx[0])/mf_m(i, j, 0);const Real z=z_cc(i, j, k);Real L=std::sqrt(std::pow((x - x_c)/x_r, 2)+std::pow((z - z_c)/z_r, 2));if(L<=one) { Real dT=T_pert *(std::cos(PI *L)+one)/two;Real Tbar_hse=p_hse(i, j, k)/(R_d *r_hse(i, j, k));Real theta_perturbed=(Tbar_hse+dT) *std::pow(p_0/p_hse(i, j, k), rdOcp);Real theta_0=(Tbar_hse) *std::pow(p_0/p_hse(i, j, k), rdOcp);if(const_rho) { state_pert(i, j, k, RhoTheta_comp)=r_hse(i, j, k) *(theta_perturbed - theta_0);} else { state_pert(i, j, k, Rho_comp)=getRhoThetagivenP(p_hse(i, j, k))/theta_perturbed - r_hse(i, j, k);} } })
amrex::Real Real
Definition: ERF_ShocInterface.H:19
auto prob_lo
Definition: ERF_UpdateRhoThetaSources_SDMCongestus3D.H:6
Real advection_heating_rate
Definition: ERF_UpdateRhoThetaSources_SDMCongestus3D.H:3
const Real yc
Definition: ERF_UpdateRhoThetaSources_SDMCongestus3D.H:12
Real advection_heating_rate_base
Definition: ERF_UpdateRhoThetaSources_SDMCongestus3D.H:4
const Real xc
Definition: ERF_UpdateRhoThetaSources_SDMCongestus3D.H:11
auto dx
Definition: ERF_UpdateRhoThetaSources_SDMCongestus3D.H:8
Here is the call graph for this function:

◆ pp_prob()

ParmParse pp_prob ( "prob"  )

◆ query() [1/2]

pp_prob query ( "advection_heating_rate"  ,
advection_heating_rate   
)

◆ query() [2/2]

pp_prob query ( "advection_heating_rate_base"  ,
advection_heating_rate_base   
)

Variable Documentation

◆ advection_heating_rate

Real advection_heating_rate = amrex::Real(5.4e-5)

Referenced by for().

◆ advection_heating_rate_base

Real advection_heating_rate_base = amrex::Real(5.4e-5)

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

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

Referenced by for().

◆ yc

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

Referenced by for().