40 const auto&
dx = geom.CellSizeArray();
41 const auto&
prob_lo = geom.ProbLoArray();
43 bool all_boxes_touch_bottom =
true;
44 for (
int i = 0; i < ba.size(); i++) {
45 if (ba[i].smallEnd(2) != geom.ProbLo(2)) {
46 all_boxes_touch_bottom =
false;
58 for (
unsigned ii = 0; ii <
m_x_forest.size(); ++ii)
81 treeZm = laimaxf * hf;
82 for (
int k(0); k<nk; ++k) {
83 ratio = (hf - treeZm) / (hf - ztree);
85 expFun += std::pow(ratio,
Real(6.0)) *
86 std::exp(6 * (1 - ratio));
88 expFun += std::pow(ratio,
myhalf) *
89 std::exp(
myhalf * (1 - ratio));
93 af = laif / (expFun *
dz);
98 Box gtbx = mfi.growntilebox();
100 const Array4<const Real>& z_cc = z_phys_cc->const_array(mfi);
101 const Array4<const Real>& z_nd = z_phys_nd->const_array(mfi);
103 ParallelFor(gtbx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept
110 const Real z_sfc =
fourth * ( z_nd(i,j ,0) + z_nd(i+1,j ,0)
111 +z_nd(i,j+1,0) + z_nd(i+1,j+1,0));
115 const Real radius = std::sqrt((
x - xf) * (
x - xf) +
116 (
y - yf) * (
y - yf));
120 if ((
z <= hf) && (radius <= (
myhalf * df))) {
122 Real ratio = (hf - treeZm) / (hf -
z);
124 factor = std::pow(ratio,
Real(6.0)) *
125 std::exp(
Real(6.0) * (
one - ratio));
126 }
else if (
z <= hf) {
127 factor = std::pow(ratio,
myhalf) *
131 levelDrag(i, j, k) = cdf * af * factor;
constexpr amrex::Real one
Definition: ERF_Constants.H:7
constexpr amrex::Real fourth
Definition: ERF_Constants.H:12
constexpr amrex::Real zero
Definition: ERF_Constants.H:6
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:11
const Real dx
Definition: ERF_InitCustomPert_ABL.H:23
AMREX_ALWAYS_ASSERT(bx.length()[2]==khi+1)
const Real dz
Definition: ERF_InitCustomPert_Bubble.H:25
const amrex::Real * prob_lo
Definition: ERF_InitCustomPert_DataAssimilation_ISV.H:16
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));})
std::unique_ptr< amrex::MultiFab > m_forest_drag
Definition: ERF_ForestDrag.H:39