ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
moeng_flux Struct Reference

#include <ERF_MOSTStress.H>

Collaboration diagram for moeng_flux:

Public Member Functions

 moeng_flux ()
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real compute_q_flux (const int &, const int &, const int &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &) const
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real compute_t_flux (const int &i, const int &j, const int &k, const amrex::Array4< const amrex::Real > &cons_arr, const amrex::Array4< const amrex::Real > &velx_arr, const amrex::Array4< const amrex::Real > &vely_arr, const amrex::Array4< const amrex::Real > &umm_arr, const amrex::Array4< const amrex::Real > &tm_arr, const amrex::Array4< const amrex::Real > &u_star_arr, const amrex::Array4< const amrex::Real > &t_star_arr, const amrex::Array4< const amrex::Real > &t_surf_arr) const
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real compute_u_flux (const int &i, const int &j, const int &k, const amrex::Array4< const amrex::Real > &cons_arr, const amrex::Array4< const amrex::Real > &velx_arr, const amrex::Array4< const amrex::Real > &vely_arr, const amrex::Array4< const amrex::Real > &umm_arr, const amrex::Array4< const amrex::Real > &um_arr, const amrex::Array4< const amrex::Real > &u_star_arr) const
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real compute_v_flux (const int &i, const int &j, const int &k, const amrex::Array4< const amrex::Real > &cons_arr, const amrex::Array4< const amrex::Real > &velx_arr, const amrex::Array4< const amrex::Real > &vely_arr, const amrex::Array4< const amrex::Real > &umm_arr, const amrex::Array4< const amrex::Real > &vm_arr, const amrex::Array4< const amrex::Real > &u_star_arr) const
 

Private Attributes

const amrex::Real eps = 1e-15
 
const amrex::Real WSMIN = 0.1
 

Detailed Description

Moeng flux formulation

Constructor & Destructor Documentation

◆ moeng_flux()

moeng_flux::moeng_flux ( )
inline
1368 {}

Member Function Documentation

◆ compute_q_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real moeng_flux::compute_q_flux ( const int &  ,
const int &  ,
const int &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &   
) const
inline
1384  {
1385  // NOTE: this is rho*<q'w'> = -K dqdz
1386  amrex::Real moflux = 0.0;
1387 
1388  return moflux;
1389  }

◆ compute_t_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real moeng_flux::compute_t_flux ( const int &  i,
const int &  j,
const int &  k,
const amrex::Array4< const amrex::Real > &  cons_arr,
const amrex::Array4< const amrex::Real > &  velx_arr,
const amrex::Array4< const amrex::Real > &  vely_arr,
const amrex::Array4< const amrex::Real > &  umm_arr,
const amrex::Array4< const amrex::Real > &  tm_arr,
const amrex::Array4< const amrex::Real > &  u_star_arr,
const amrex::Array4< const amrex::Real > &  t_star_arr,
const amrex::Array4< const amrex::Real > &  t_surf_arr 
) const
inline
1405  {
1406  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
1407  amrex::Real theta = cons_arr(i,j,k,RhoTheta_comp) / rho;
1408  amrex::Real velx = 0.5 * ( velx_arr(i,j,k) + velx_arr(i+1,j ,k) );
1409  amrex::Real vely = 0.5 * ( vely_arr(i,j,k) + vely_arr(i ,j+1,k) );
1410 
1411  amrex::Real theta_mean = tm_arr(i,j,k);
1412  amrex::Real ustar = u_star_arr(i,j,k);
1413  amrex::Real tstar = t_star_arr(i,j,k);
1414  amrex::Real theta_surf = t_surf_arr(i,j,k);
1415  amrex::Real wsp_mean = umm_arr(i,j,k);
1416  wsp_mean = std::max(wsp_mean, WSMIN);
1417 
1418  amrex::Real wsp = sqrt(velx*velx+vely*vely);
1419  amrex::Real num1 = wsp * (theta_mean-theta_surf);
1420  amrex::Real num2 = wsp_mean * (theta-theta_mean);
1421 
1422  // NOTE: this is rho*<T'w'> = -K dTdz
1423  amrex::Real moflux = (std::abs(tstar) > eps) ?
1424  -rho*tstar*ustar*(num1+num2)/((theta_mean-theta_surf)*wsp_mean) : 0.0;
1425 
1426  return moflux;
1427  }
#define Rho_comp
Definition: ERF_IndexDefines.H:36
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:37
@ theta
Definition: ERF_MM5.H:20
@ rho
Definition: ERF_Kessler.H:22
const amrex::Real eps
Definition: ERF_MOSTStress.H:1504
const amrex::Real WSMIN
Definition: ERF_MOSTStress.H:1505

◆ compute_u_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real moeng_flux::compute_u_flux ( const int &  i,
const int &  j,
const int &  k,
const amrex::Array4< const amrex::Real > &  cons_arr,
const amrex::Array4< const amrex::Real > &  velx_arr,
const amrex::Array4< const amrex::Real > &  vely_arr,
const amrex::Array4< const amrex::Real > &  umm_arr,
const amrex::Array4< const amrex::Real > &  um_arr,
const amrex::Array4< const amrex::Real > &  u_star_arr 
) const
inline
1441  {
1442  amrex::Real velx = velx_arr(i,j,k);
1443  amrex::Real vely = 0.25 * ( vely_arr(i ,j,k) + vely_arr(i ,j+1,k)
1444  + vely_arr(i-1,j,k) + vely_arr(i-1,j+1,k) );
1445  amrex::Real rho = 0.5 * ( cons_arr(i-1,j,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
1446 
1447  amrex::Real umean = um_arr(i,j,k);
1448  amrex::Real ustar = 0.5 * ( u_star_arr(i-1,j,k) + u_star_arr(i,j,k) );
1449  amrex::Real wsp_mean = 0.5 * ( umm_arr(i-1,j,k) + umm_arr(i,j,k) );
1450  wsp_mean = std::max(wsp_mean, WSMIN);
1451 
1452  // Note: The surface mean shear stress is decomposed into tau_xz by
1453  // multiplying the modeled shear stress (rho*ustar^2) with
1454  // a factor of umean/wsp_mean for directionality; this factor
1455  // modifies the denominator from what is in Moeng 1984.
1456  amrex::Real wsp = sqrt(velx*velx+vely*vely);
1457  amrex::Real num1 = wsp * umean;
1458  amrex::Real num2 = wsp_mean * (velx-umean);
1459 
1460  // NOTE: this is rho*<u'w'> = -K dudz
1461  amrex::Real stressx = -rho*ustar*ustar * (num1+num2)/(wsp_mean*wsp_mean);
1462 
1463  return stressx;
1464  }

◆ compute_v_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real moeng_flux::compute_v_flux ( const int &  i,
const int &  j,
const int &  k,
const amrex::Array4< const amrex::Real > &  cons_arr,
const amrex::Array4< const amrex::Real > &  velx_arr,
const amrex::Array4< const amrex::Real > &  vely_arr,
const amrex::Array4< const amrex::Real > &  umm_arr,
const amrex::Array4< const amrex::Real > &  vm_arr,
const amrex::Array4< const amrex::Real > &  u_star_arr 
) const
inline
1478  {
1479  amrex::Real velx = 0.25 * ( velx_arr(i,j ,k) + velx_arr(i+1,j ,k)
1480  + velx_arr(i,j-1,k) + velx_arr(i+1,j-1,k) );
1481  amrex::Real vely = vely_arr(i,j,k);
1482  amrex::Real rho = 0.5 * ( cons_arr(i,j-1,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
1483 
1484  amrex::Real vmean = vm_arr(i,j,k);
1485  amrex::Real ustar = 0.5 * ( u_star_arr(i,j-1,k) + u_star_arr(i,j,k) );
1486  amrex::Real wsp_mean = 0.5 * ( umm_arr(i,j-1,k) + umm_arr(i,j,k) );
1487  wsp_mean = std::max(wsp_mean, WSMIN);
1488 
1489  // Note: The surface mean shear stress is decomposed into tau_yz by
1490  // multiplying the modeled shear stress (rho*ustar^2) with
1491  // a factor of vmean/wsp_mean for directionality; this factor
1492  // modifies the denominator from what is in Moeng 1984.
1493  amrex::Real wsp = sqrt(velx*velx+vely*vely);
1494  amrex::Real num1 = wsp * vmean;
1495  amrex::Real num2 = wsp_mean * (vely-vmean);
1496 
1497  // NOTE: this is rho*<v'w'> = -K dvdz
1498  amrex::Real stressy = -rho*ustar*ustar * (num1+num2)/(wsp_mean*wsp_mean);
1499 
1500  return stressy;
1501  }

Member Data Documentation

◆ eps

const amrex::Real moeng_flux::eps = 1e-15
private

Referenced by compute_t_flux().

◆ WSMIN

const amrex::Real moeng_flux::WSMIN = 0.1
private

The documentation for this struct was generated from the following file: