38 const auto& dx = geom.CellSizeArray();
39 const auto& prob_lo = geom.ProbLoArray();
48 for (
unsigned ii = 0; ii <
m_x_forest.size(); ++ii) {
70 const Real dz = hf / Real(nk);
71 treeZm = laimaxf * hf;
72 for (
int k(0); k<nk; ++k) {
73 ratio = (hf - treeZm) / (hf - ztree);
75 expFun += std::pow(ratio, 6.0) *
76 std::exp(6 * (1 - ratio));
78 expFun += std::pow(ratio, 0.5) *
79 std::exp(0.5 * (1 - ratio));
83 af = laif / (expFun * dz);
88 Box gtbx = mfi.growntilebox();
90 const Array4<const Real>& z_nd = (z_phys_nd) ? z_phys_nd->const_array(mfi) :
92 ParallelFor(gtbx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k) noexcept
95 const Real
x = prob_lo[0] + (i + 0.5) * dx[0];
96 const Real
y = prob_lo[1] + (j + 0.5) * dx[1];
97 Real
z = prob_lo[2] + (k + 0.5) * dx[2];
99 z = 0.125 * ( z_nd(i ,j ,k ) + z_nd(i+1,j ,k )
100 + z_nd(i ,j+1,k ) + z_nd(i+1,j+1,k )
101 + z_nd(i ,j ,k+1) + z_nd(i+1,j ,k+1)
102 + z_nd(i ,j+1,k+1) + z_nd(i+1,j+1,k+1) );
107 const Real radius = std::sqrt((
x - xf) * (
x - xf) +
108 (
y - yf) * (
y - yf));
112 if ((
z <= hf) && (radius <= (0.5 * df))) {
114 Real ratio = (hf - treeZm) / (hf -
z);
116 factor = std::pow(ratio, 6.0) *
117 std::exp(6.0 * (1.0 - ratio));
118 }
else if (
z <= hf) {
119 factor = std::pow(ratio, 0.5) *
120 std::exp(0.5 * (1.0 - ratio));
123 levelDrag(i, j, k) = cdf * af * factor;
std::unique_ptr< amrex::MultiFab > m_forest_drag
Definition: ERF_ForestDrag.H:38