1343 amrex::Real velx, vely,
rho,
theta, eta;
1344 int ix, jx, iy, jy, ic, jc;
1346 ix = i < lbound(velx_arr).x ? lbound(velx_arr).x : i;
1347 jx = j < lbound(velx_arr).y ? lbound(velx_arr).y : j;
1348 ix = ix > ubound(velx_arr).x-1 ? ubound(velx_arr).x-1 : ix;
1349 jx = jx > ubound(velx_arr).y ? ubound(velx_arr).y : jx;
1351 iy = i < lbound(vely_arr).x ? lbound(vely_arr).x : i;
1352 jy = j < lbound(vely_arr).y ? lbound(vely_arr).y : j;
1353 iy = iy > ubound(vely_arr).x ? ubound(vely_arr).x : iy;
1354 jy = jy > ubound(vely_arr).y-1 ? ubound(vely_arr).y-1 : jy;
1356 ic = i < lbound(cons_arr).x ? lbound(cons_arr).x : i;
1357 jc = j < lbound(cons_arr).y ? lbound(cons_arr).y : j;
1358 ic = ic > ubound(cons_arr).x ? ubound(cons_arr).x : ic;
1359 jc = jc > ubound(cons_arr).y ? ubound(cons_arr).y : jc;
1361 velx = 0.5 *( velx_arr(ix,jx,
zlo) + velx_arr(ix+1,jx ,
zlo) );
1362 vely = 0.5 *( vely_arr(iy,jy,
zlo) + vely_arr(iy ,jy+1,
zlo) );
1366 amrex::Real theta_mean = tm_arr(ic,jc,
zlo);
1367 amrex::Real wsp_mean = umm_arr(ic,jc,
zlo);
1368 amrex::Real ustar = u_star_arr(ic,jc,
zlo);
1369 amrex::Real tstar = t_star_arr(ic,jc,
zlo);
1370 amrex::Real theta_surf = t_surf_arr(ic,jc,
zlo);
1372 amrex::Real wsp = sqrt(velx*velx+vely*vely);
1373 amrex::Real num1 = wsp * (theta_mean-theta_surf);
1374 amrex::Real num2 = wsp_mean * (
theta-theta_mean);
1375 amrex::Real deltaz = dz * (
zlo - k);
1377 wsp_mean = std::max(wsp_mean,
WSMIN);
1380 amrex::Real moflux = (std::abs(tstar) >
eps) ?
1381 -
rho*tstar*ustar*(num1+num2)/((theta_mean-theta_surf)*wsp_mean) : 0.0;
1386 dest_arr(i,j,k,icomp+n) = cons_arr(ic,jc,
zlo,
RhoTheta_comp) - rthetagrad * deltaz;
1389 ie = i < lbound(eta_arr).x ? lbound(eta_arr).x : i;
1390 je = j < lbound(eta_arr).y ? lbound(eta_arr).y : j;
1391 ie = ie > ubound(eta_arr).x ? ubound(eta_arr).x : ie;
1392 je = je > ubound(eta_arr).y ? ubound(eta_arr).y : je;
1394 eta = amrex::max(eta,
eta_eps);
1398 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:168
@ theta
Definition: ERF_MM5.H:20
const amrex::Real eps
Definition: ERF_MOSTStress.H:1558
const amrex::Real WSMIN
Definition: ERF_MOSTStress.H:1560