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 bool use_z_phys = use_physical_z()
 
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)
18  {
19  const auto &box = mfi.tilebox();
20  const Array4<Real>& src_arr = src->array(mfi);
21  if (box.length(0) != 1)
22  {
23  // if z dimension size is 1, then src is a spatially varying function over x,y at k=0
24  ParallelFor( box, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
25  {
26  auto x = prob_lo[0] + (i + myhalf) * dx[0];
27  auto y = prob_lo[1] + (j + myhalf) * dx[1];
28  auto z = use_z_phys ? d_zlevels_arr[k] : (k + myhalf) * dx[2];
29 
30  auto c = amrex::Real(2890000.0);
31  auto r = std::sqrt((x-xc)*(x-xc) + (y-yc)*(y-yc));
32  auto rsqr = r*r;
33  if (time < 3600) {
34  src_arr(i, j, k) = (advection_heating_rate_base)*std::exp(-z/100);
35  } else {
36  src_arr(i, j, k) = (advection_heating_rate*std::exp(-rsqr / c)) * std::exp(-z*amrex::Real(0.01));
37  }
38  });
39  } else {
40  // src is a function over Z
41  ParallelFor(box, [=] AMREX_GPU_DEVICE (int i, int j, int k) {
42  src_arr(i, j, k) = advection_heating_rate;
43  });
44  }
45  }
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);})
constexpr amrex::Real myhalf
Definition: ERF_NumericalConstants.H:41
amrex::Real Real
Definition: ERF_ShocInterface.H:19
auto prob_lo
Definition: ERF_UpdateRhoThetaSources_SDMCongestus3D.H:6
const bool use_z_phys
Definition: ERF_UpdateRhoThetaSources_SDMCongestus3D.H:10
Real advection_heating_rate
Definition: ERF_UpdateRhoThetaSources_SDMCongestus3D.H:3
const Real yc
Definition: ERF_UpdateRhoThetaSources_SDMCongestus3D.H:14
Real advection_heating_rate_base
Definition: ERF_UpdateRhoThetaSources_SDMCongestus3D.H:4
const Real xc
Definition: ERF_UpdateRhoThetaSources_SDMCongestus3D.H:13
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().

◆ use_z_phys

const bool use_z_phys = use_physical_z()

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().