ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
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

Construct the Donelan flux calculator.

2268 {}

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

Compute moisture flux for one surface point.

Calling sequence
i, j, k, cons_arr, velx_arr, vely_arr, umm_arr, qvm_arr, u_star_arr, q_star_arr, q_surf_arr.
2291  {
2292  // NOTE: this is rho*<q'w'> = -K dqdz
2293  amrex::Real moflux = zero;
2294 
2295  return moflux;
2296  }
constexpr amrex::Real zero
Definition: ERF_Constants.H:8
amrex::Real Real
Definition: ERF_ShocInterface.H:19

◆ 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

Compute heat flux for one surface point.

Calling sequence
i, j, k, cons_arr, velx_arr, vely_arr, umm_arr, tm_arr, u_star_arr, t_star_arr, t_surf_arr.
2319  {
2320  amrex::Real Ch = amrex::Real(0.0012);
2321  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
2322 
2323  amrex::Real theta_surf = t_surf_arr(i,j,0);
2324  amrex::Real theta_mean = tm_arr(i,j,0);
2325  amrex::Real wsp_mean = umm_arr(i,j,0);
2326 
2327  // NOTE: this is rho*<T'w'> = -K dTdz
2328  amrex::Real moflux = -rho * Ch * wsp_mean * (theta_mean - theta_surf);
2329 
2330  return moflux;
2331  }
#define Rho_comp
Definition: ERF_IndexDefines.H:36
rho
Definition: ERF_InitCustomPert_Bubble.H:107

◆ 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

Compute x-momentum flux for one surface face.

Calling sequence
i, j, k, cons_arr, velx_arr, vely_arr, umm_arr, um_arr, u_star_arr.
2352  {
2353  amrex::Real velx = velx_arr(i,j,k);
2354  amrex::Real vely = fourth * ( vely_arr(i ,j,k) + vely_arr(i ,j+1,k)
2355  + vely_arr(i-1,j,k) + vely_arr(i-1,j+1,k) );
2356  amrex::Real rho = myhalf * ( cons_arr(i-1,j,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2357 
2358  amrex::Real Cd = amrex::Real(0.001);
2359  const amrex::Real c = amrex::Real(7e-5);
2360  amrex::Real wsp = std::sqrt(velx*velx+vely*vely);
2361  amrex::Real wsp_mean = myhalf * ( umm_arr(i-1,j,0) + umm_arr(i,j,0) );
2362  if (wsp_mean <= amrex::Real(5.0)) {
2363  Cd = amrex::Real(0.001);
2364  } else if (wsp_mean < amrex::Real(25.0) && wsp_mean > amrex::Real(5.0)) {
2365  Cd = amrex::Real(0.001) + c * (wsp_mean - amrex::Real(5.0));
2366  } else {
2367  Cd = amrex::Real(0.0024);
2368  }
2369 
2370  // NOTE: this is rho*<u'w'> = -K dudz
2371  amrex::Real stressx = -rho * Cd * velx * wsp;
2372 
2373  return stressx;
2374  }
constexpr amrex::Real fourth
Definition: ERF_Constants.H:14
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:13

◆ 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

Compute y-momentum flux for one surface face.

Calling sequence
i, j, k, cons_arr, velx_arr, vely_arr, umm_arr, vm_arr, u_star_arr.
2395  {
2396  amrex::Real velx = fourth * ( velx_arr(i,j ,k) + velx_arr(i+1,j ,k)
2397  + velx_arr(i,j-1,k) + velx_arr(i+1,j-1,k) );
2398  amrex::Real vely = vely_arr(i,j,k);
2399  amrex::Real rho = myhalf * ( cons_arr(i,j-1,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2400 
2401  amrex::Real Cd = amrex::Real(0.001);
2402  const amrex::Real c = amrex::Real(7e-5);
2403  amrex::Real wsp = std::sqrt(velx*velx+vely*vely);
2404  amrex::Real wsp_mean = myhalf * ( umm_arr(i,j-1,0) + umm_arr(i,j,0) );
2405  if (wsp_mean <= amrex::Real(5.0)) {
2406  Cd = amrex::Real(0.001);
2407  } else if (wsp_mean < amrex::Real(25.0) && wsp_mean > amrex::Real(5.0)) {
2408  Cd = amrex::Real(0.001) + c * (wsp_mean - amrex::Real(5.0));
2409  } else {
2410  Cd = amrex::Real(0.0024);
2411  }
2412 
2413  // NOTE: this is rho*<v'w'> = -K dvdz
2414  amrex::Real stressy = -rho * Cd * vely * wsp;
2415 
2416  return stressy;
2417  }

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