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

#include <ERF_MOSTStress.H>

Public Member Functions

 donelan_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 > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &umm_arr, const amrex::Array4< const amrex::Real > &tm_arr, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, 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 > &, const amrex::Array4< const amrex::Real > &) 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 > &, const amrex::Array4< const amrex::Real > &) const
 

Detailed Description

Donelan flux formulation

Constructor & Destructor Documentation

◆ donelan_flux()

donelan_flux::donelan_flux ( )
inline
1514 {}

Member Function Documentation

◆ compute_q_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real donelan_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
1530  {
1531  // NOTE: this is rho*<q'w'> = -K dqdz
1532  amrex::Real moflux = 0.0;
1533 
1534  return moflux;
1535  }

◆ compute_t_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real donelan_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 > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  umm_arr,
const amrex::Array4< const amrex::Real > &  tm_arr,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  t_surf_arr 
) const
inline
1551  {
1552  amrex::Real Ch = 0.0012;
1553  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
1554  amrex::Real theta_surf = t_surf_arr(i,j,k);
1555  amrex::Real theta_mean = tm_arr(i,j,k);
1556  amrex::Real wsp_mean = umm_arr(i,j,k);
1557 
1558  // NOTE: this is rho*<T'w'> = -K dTdz
1559  amrex::Real moflux = -rho * Ch * wsp_mean * (theta_mean - theta_surf);
1560 
1561  return moflux;
1562  }
#define Rho_comp
Definition: ERF_IndexDefines.H:36
@ rho
Definition: ERF_Kessler.H:22

◆ compute_u_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real donelan_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 > &  ,
const amrex::Array4< const amrex::Real > &   
) const
inline
1576  {
1577  amrex::Real velx = velx_arr(i,j,k);
1578  amrex::Real vely = 0.25 * ( vely_arr(i ,j,k) + vely_arr(i ,j+1,k)
1579  + vely_arr(i-1,j,k) + vely_arr(i-1,j+1,k) );
1580  amrex::Real rho = 0.5 * ( cons_arr(i-1,j,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
1581 
1582  amrex::Real Cd = 0.001;
1583  const amrex::Real c = 7e-5;
1584  amrex::Real wsp = sqrt(velx*velx+vely*vely);
1585  amrex::Real wsp_mean = 0.5 * ( umm_arr(i-1,j,k) + umm_arr(i,j,k) );
1586  if (wsp_mean <= 5.0) {
1587  Cd = 0.001;
1588  } else if (wsp_mean < 25.0 && wsp_mean > 5.0) {
1589  Cd = 0.001 + c * (wsp_mean - 5.0);
1590  } else {
1591  Cd = 0.0024;
1592  }
1593 
1594  // NOTE: this is rho*<u'w'> = -K dudz
1595  amrex::Real stressx = -rho * Cd * velx * wsp;
1596 
1597  return stressx;
1598  }

◆ compute_v_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real donelan_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 > &  ,
const amrex::Array4< const amrex::Real > &   
) const
inline
1612  {
1613  amrex::Real velx = 0.25 * ( velx_arr(i,j ,k) + velx_arr(i+1,j ,k)
1614  + velx_arr(i,j-1,k) + velx_arr(i+1,j-1,k) );
1615  amrex::Real vely = vely_arr(i,j,k);
1616  amrex::Real rho = 0.5 * ( cons_arr(i,j-1,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
1617 
1618  amrex::Real Cd = 0.001;
1619  const amrex::Real c = 7e-5;
1620  amrex::Real wsp = sqrt(velx*velx+vely*vely);
1621  amrex::Real wsp_mean = 0.5 * ( umm_arr(i,j-1,k) + umm_arr(i,j,k) );
1622  if (wsp_mean <= 5.0) {
1623  Cd = 0.001;
1624  } else if (wsp_mean < 25.0 && wsp_mean > 5.0) {
1625  Cd = 0.001 + c * (wsp_mean - 5.0);
1626  } else {
1627  Cd = 0.0024;
1628  }
1629 
1630  // NOTE: this is rho*<v'w'> = -K dvdz
1631  amrex::Real stressy = -rho * Cd * vely * wsp;
1632 
1633  return stressy;
1634  }

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