1342 amrex::Real velx, vely,
rho,
theta, eta;
1343 int ix, jx, iy, jy, ic, jc;
1345 ix = i < lbound(velx_arr).x ? lbound(velx_arr).x : i;
1346 jx = j < lbound(velx_arr).y ? lbound(velx_arr).y : j;
1347 ix = ix > ubound(velx_arr).x-1 ? ubound(velx_arr).x-1 : ix;
1348 jx = jx > ubound(velx_arr).y ? ubound(velx_arr).y : jx;
1350 iy = i < lbound(vely_arr).x ? lbound(vely_arr).x : i;
1351 jy = j < lbound(vely_arr).y ? lbound(vely_arr).y : j;
1352 iy = iy > ubound(vely_arr).x ? ubound(vely_arr).x : iy;
1353 jy = jy > ubound(vely_arr).y-1 ? ubound(vely_arr).y-1 : jy;
1355 ic = i < lbound(cons_arr).x ? lbound(cons_arr).x : i;
1356 jc = j < lbound(cons_arr).y ? lbound(cons_arr).y : j;
1357 ic = ic > ubound(cons_arr).x ? ubound(cons_arr).x : ic;
1358 jc = jc > ubound(cons_arr).y ? ubound(cons_arr).y : jc;
1360 velx = 0.5 *( velx_arr(ix,jx,
zlo) + velx_arr(ix+1,jx ,
zlo) );
1361 vely = 0.5 *( vely_arr(iy,jy,
zlo) + vely_arr(iy ,jy+1,
zlo) );
1365 amrex::Real theta_mean = tm_arr(ic,jc,
zlo);
1366 amrex::Real wsp_mean = umm_arr(ic,jc,
zlo);
1367 amrex::Real ustar = u_star_arr(ic,jc,
zlo);
1368 amrex::Real tstar = t_star_arr(ic,jc,
zlo);
1369 amrex::Real theta_surf = t_surf_arr(ic,jc,
zlo);
1371 amrex::Real wsp = sqrt(velx*velx+vely*vely);
1372 amrex::Real num1 = wsp * (theta_mean-theta_surf);
1373 amrex::Real num2 = wsp_mean * (
theta-theta_mean);
1374 amrex::Real deltaz = dz * (
zlo - k);
1376 wsp_mean = std::max(wsp_mean,
WSMIN);
1379 amrex::Real moflux = (std::abs(tstar) >
eps) ?
1380 -
rho*tstar*ustar*(num1+num2)/((theta_mean-theta_surf)*wsp_mean) : 0.0;
1385 dest_arr(i,j,k,icomp+n) = cons_arr(ic,jc,
zlo,
RhoTheta_comp) - rthetagrad * deltaz;
1388 ie = i < lbound(eta_arr).x ? lbound(eta_arr).x : i;
1389 je = j < lbound(eta_arr).y ? lbound(eta_arr).y : j;
1390 ie = ie > ubound(eta_arr).x ? ubound(eta_arr).x : ie;
1391 je = je > ubound(eta_arr).y ? ubound(eta_arr).y : je;
1393 eta = amrex::max(eta,
eta_eps);
1397 dest_arr(i,j,k,icomp+n) = dest_arr(i,j,
zlo,icomp+n) + moflux*
rho/eta*deltaz;
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:37
@ Theta_v
Definition: ERF_IndexDefines.H:157
@ theta
Definition: ERF_MM5.H:20
const amrex::Real eps
Definition: ERF_MOSTStress.H:1557
const amrex::Real WSMIN
Definition: ERF_MOSTStress.H:1559