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

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
1946  {
1947  // NOTE: this is rho*<q'w'> = -K dqdz
1948  amrex::Real moflux = 0.0;
1949 
1950  return moflux;
1951  }

◆ 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
1967  {
1968  amrex::Real Ch = 0.0012;
1969  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
1970  amrex::Real theta_surf = t_surf_arr(i,j,k);
1971  amrex::Real theta_mean = tm_arr(i,j,k);
1972  amrex::Real wsp_mean = umm_arr(i,j,k);
1973 
1974  // NOTE: this is rho*<T'w'> = -K dTdz
1975  amrex::Real moflux = -rho * Ch * wsp_mean * (theta_mean - theta_surf);
1976 
1977  return moflux;
1978  }
#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
1992  {
1993  amrex::Real velx = velx_arr(i,j,k);
1994  amrex::Real vely = 0.25 * ( vely_arr(i ,j,k) + vely_arr(i ,j+1,k)
1995  + vely_arr(i-1,j,k) + vely_arr(i-1,j+1,k) );
1996  amrex::Real rho = 0.5 * ( cons_arr(i-1,j,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
1997 
1998  amrex::Real Cd = 0.001;
1999  const amrex::Real c = 7e-5;
2000  amrex::Real wsp = sqrt(velx*velx+vely*vely);
2001  amrex::Real wsp_mean = 0.5 * ( umm_arr(i-1,j,k) + umm_arr(i,j,k) );
2002  if (wsp_mean <= 5.0) {
2003  Cd = 0.001;
2004  } else if (wsp_mean < 25.0 && wsp_mean > 5.0) {
2005  Cd = 0.001 + c * (wsp_mean - 5.0);
2006  } else {
2007  Cd = 0.0024;
2008  }
2009 
2010  // NOTE: this is rho*<u'w'> = -K dudz
2011  amrex::Real stressx = -rho * Cd * velx * wsp;
2012 
2013  return stressx;
2014  }

◆ 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
2028  {
2029  amrex::Real velx = 0.25 * ( velx_arr(i,j ,k) + velx_arr(i+1,j ,k)
2030  + velx_arr(i,j-1,k) + velx_arr(i+1,j-1,k) );
2031  amrex::Real vely = vely_arr(i,j,k);
2032  amrex::Real rho = 0.5 * ( cons_arr(i,j-1,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2033 
2034  amrex::Real Cd = 0.001;
2035  const amrex::Real c = 7e-5;
2036  amrex::Real wsp = sqrt(velx*velx+vely*vely);
2037  amrex::Real wsp_mean = 0.5 * ( umm_arr(i,j-1,k) + umm_arr(i,j,k) );
2038  if (wsp_mean <= 5.0) {
2039  Cd = 0.001;
2040  } else if (wsp_mean < 25.0 && wsp_mean > 5.0) {
2041  Cd = 0.001 + c * (wsp_mean - 5.0);
2042  } else {
2043  Cd = 0.0024;
2044  }
2045 
2046  // NOTE: this is rho*<v'w'> = -K dvdz
2047  amrex::Real stressy = -rho * Cd * vely * wsp;
2048 
2049  return stressy;
2050  }

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