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
1738 {}

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
1754  {
1755  // NOTE: this is rho*<q'w'> = -K dqdz
1756  amrex::Real moflux = 0.0;
1757 
1758  return moflux;
1759  }

◆ 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
1775  {
1776  amrex::Real Ch = 0.0012;
1777  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
1778  amrex::Real theta_surf = t_surf_arr(i,j,k);
1779  amrex::Real theta_mean = tm_arr(i,j,k);
1780  amrex::Real wsp_mean = umm_arr(i,j,k);
1781 
1782  // NOTE: this is rho*<T'w'> = -K dTdz
1783  amrex::Real moflux = -rho * Ch * wsp_mean * (theta_mean - theta_surf);
1784 
1785  return moflux;
1786  }
#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
1800  {
1801  amrex::Real velx = velx_arr(i,j,k);
1802  amrex::Real vely = 0.25 * ( vely_arr(i ,j,k) + vely_arr(i ,j+1,k)
1803  + vely_arr(i-1,j,k) + vely_arr(i-1,j+1,k) );
1804  amrex::Real rho = 0.5 * ( cons_arr(i-1,j,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
1805 
1806  amrex::Real Cd = 0.001;
1807  const amrex::Real c = 7e-5;
1808  amrex::Real wsp = sqrt(velx*velx+vely*vely);
1809  amrex::Real wsp_mean = 0.5 * ( umm_arr(i-1,j,k) + umm_arr(i,j,k) );
1810  if (wsp_mean <= 5.0) {
1811  Cd = 0.001;
1812  } else if (wsp_mean < 25.0 && wsp_mean > 5.0) {
1813  Cd = 0.001 + c * (wsp_mean - 5.0);
1814  } else {
1815  Cd = 0.0024;
1816  }
1817 
1818  // NOTE: this is rho*<u'w'> = -K dudz
1819  amrex::Real stressx = -rho * Cd * velx * wsp;
1820 
1821  return stressx;
1822  }

◆ 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
1836  {
1837  amrex::Real velx = 0.25 * ( velx_arr(i,j ,k) + velx_arr(i+1,j ,k)
1838  + velx_arr(i,j-1,k) + velx_arr(i+1,j-1,k) );
1839  amrex::Real vely = vely_arr(i,j,k);
1840  amrex::Real rho = 0.5 * ( cons_arr(i,j-1,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
1841 
1842  amrex::Real Cd = 0.001;
1843  const amrex::Real c = 7e-5;
1844  amrex::Real wsp = sqrt(velx*velx+vely*vely);
1845  amrex::Real wsp_mean = 0.5 * ( umm_arr(i,j-1,k) + umm_arr(i,j,k) );
1846  if (wsp_mean <= 5.0) {
1847  Cd = 0.001;
1848  } else if (wsp_mean < 25.0 && wsp_mean > 5.0) {
1849  Cd = 0.001 + c * (wsp_mean - 5.0);
1850  } else {
1851  Cd = 0.0024;
1852  }
1853 
1854  // NOTE: this is rho*<v'w'> = -K dvdz
1855  amrex::Real stressy = -rho * Cd * vely * wsp;
1856 
1857  return stressy;
1858  }

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