ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
rico_flux Struct Reference

#include <ERF_MOSTStress.H>

Collaboration diagram for rico_flux:

Public Member Functions

 rico_flux (amrex::Real l_theta_z0, amrex::Real l_qsat_z0)
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real compute_q_flux (const int &i, const int &j, const int &k, const int &, 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 > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &q_star_arr, 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 int &, 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 > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &t_star_arr, const amrex::Array4< const amrex::Real > &) const
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real compute_u_flux (const int &i, const int &j, const int &k, const int &, 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 > &, 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 > &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 int &, 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 > &, 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 > &u_star_arr) const
 

Private Attributes

const amrex::Real eps = amrex::Real(1e-15)
 
amrex::Real theta_z0 = amrex::Real(298.0)
 
amrex::Real qsat_z0 = amrex::Real(0.0010)
 

Detailed Description

RICO flux formulation

Constructor & Destructor Documentation

◆ rico_flux()

rico_flux::rico_flux ( amrex::Real  l_theta_z0,
amrex::Real  l_qsat_z0 
)
inline

Construct the RICO flux calculator.

Parameters
[in]l_theta_z0surface reference potential temperature
[in]l_qsat_z0surface saturation specific humidity
2771  : theta_z0{l_theta_z0}, qsat_z0{l_qsat_z0} {}
amrex::Real qsat_z0
Definition: ERF_MOSTStress.H:2933
amrex::Real theta_z0
Definition: ERF_MOSTStress.H:2932

Member Function Documentation

◆ compute_q_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real rico_flux::compute_q_flux ( const int &  i,
const int &  j,
const int &  k,
const int &  ,
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 > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  q_star_arr,
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.
2797  {
2798  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
2799  amrex::Real qstar = q_star_arr(i,j,0);
2800  amrex::Real q = cons_arr(i, j, k, RhoQ1_comp) / rho;
2801 
2802  amrex::Real velx = myhalf * (velx_arr(i,j,k) + velx_arr(i+1,j,k));
2803  amrex::Real vely = myhalf * (vely_arr(i,j,k) + vely_arr(i,j+1,k));
2804  amrex::Real wsp = std::sqrt(velx*velx + vely*vely);
2805 
2806  // NOTE: this is rho*<q'w'> = -K dqdz
2807  amrex::Real moflux = (std::abs(qstar) > eps) ? - rho * qstar * wsp * (q - qsat_z0) : zero;
2808 
2809  return moflux;
2810  }
#define Rho_comp
Definition: ERF_IndexDefines.H:42
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:48
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:36
constexpr amrex::Real myhalf
Definition: ERF_NumericalConstants.H:41
amrex::Real Real
Definition: ERF_ShocInterface.H:19
@ qstar
Definition: ERF_SLM.H:30
@ rho
Definition: ERF_Kessler.H:25
@ q
Definition: ERF_WSM6.H:273
const amrex::Real eps
Definition: ERF_MOSTStress.H:2930

◆ compute_t_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real rico_flux::compute_t_flux ( const int &  i,
const int &  j,
const int &  k,
const int &  ,
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 > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  t_star_arr,
const amrex::Array4< const amrex::Real > &   
) 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.
2835  {
2836  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
2837  amrex::Real tstar = t_star_arr(i, j, 0);
2838  amrex::Real theta = cons_arr(i, j, k, RhoTheta_comp) / rho;
2839 
2840  amrex::Real velx = myhalf * (velx_arr(i,j,k) + velx_arr(i+1,j,k));
2841  amrex::Real vely = myhalf * (vely_arr(i,j,k) + vely_arr(i,j+1,k));
2842  amrex::Real wsp = std::sqrt(velx*velx + vely*vely);
2843 
2844  // NOTE: this is rho*<T'w'> = -K dTdz
2845  amrex::Real moflux = (std::abs(tstar) > eps) ? - rho * tstar * wsp * (theta - theta_z0) : zero;
2846 
2847  return moflux;
2848  }
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:43
@ tstar
Definition: ERF_SLM.H:29
@ theta
Definition: ERF_Kessler.H:26

◆ compute_u_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real rico_flux::compute_u_flux ( const int &  i,
const int &  j,
const int &  k,
const int &  ,
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 > &  ,
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 > &  u_star_arr 
) 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.
2873  {
2874  amrex::Real velx = velx_arr(i,j,k);
2875  amrex::Real vely = fourth * ( vely_arr(i ,j,k) + vely_arr(i ,j+1,k)
2876  + vely_arr(i-1,j,k) + vely_arr(i-1,j+1,k) );
2877  amrex::Real rho = myhalf * ( cons_arr(i-1,j,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2878 
2879  amrex::Real ustar = myhalf * ( u_star_arr(i-1,j,0) + u_star_arr(i,j,0) );
2880  amrex::Real wsp = std::sqrt(velx*velx+vely*vely);
2881 
2882  // NOTE: this is rho*<u'w'> = -K dudz
2883  amrex::Real stressx = -rho * ustar * wsp * velx;
2884 
2885  return stressx;
2886  }
constexpr amrex::Real fourth
Definition: ERF_NumericalConstants.H:42
@ ustar
Definition: ERF_SLM.H:28

◆ compute_v_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real rico_flux::compute_v_flux ( const int &  i,
const int &  j,
const int &  k,
const int &  ,
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 > &  ,
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 > &  u_star_arr 
) 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.
2911  {
2912  amrex::Real velx = fourth * ( velx_arr(i,j ,k) + velx_arr(i+1,j ,k)
2913  + velx_arr(i,j-1,k) + velx_arr(i+1,j-1,k) );
2914  amrex::Real vely = vely_arr(i,j,k);
2915  amrex::Real rho = myhalf * ( cons_arr(i,j-1,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2916 
2917  amrex::Real ustar = myhalf * ( u_star_arr(i,j-1,0) + u_star_arr(i,j,0) );
2918  amrex::Real wsp = std::sqrt(velx*velx+vely*vely);
2919 
2920  // NOTE: this is rho*<v'w'> = -K dvdz
2921  amrex::Real stressy = -rho * ustar * wsp * vely;
2922 
2923  return stressy;
2924  }

Member Data Documentation

◆ eps

const amrex::Real rico_flux::eps = amrex::Real(1e-15)
private

Referenced by compute_q_flux(), and compute_t_flux().

◆ qsat_z0

amrex::Real rico_flux::qsat_z0 = amrex::Real(0.0010)
private

Referenced by compute_q_flux().

◆ theta_z0

amrex::Real rico_flux::theta_z0 = amrex::Real(298.0)
private

Referenced by compute_t_flux().


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