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 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 > &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 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 > &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 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 > &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 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 > &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
2752  : theta_z0{l_theta_z0}, qsat_z0{l_qsat_z0} {}
amrex::Real qsat_z0
Definition: ERF_MOSTStress.H:2902
amrex::Real theta_z0
Definition: ERF_MOSTStress.H:2901

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 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 > &  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.
2776  {
2777  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
2778  amrex::Real qstar = q_star_arr(i,j,0);
2779  amrex::Real q = cons_arr(i, j, k, RhoQ1_comp) / rho;
2780 
2781  amrex::Real velx = myhalf * (velx_arr(i,j,k) + velx_arr(i+1,j,k));
2782  amrex::Real vely = myhalf * (vely_arr(i,j,k) + vely_arr(i,j+1,k));
2783  amrex::Real wsp = std::sqrt(velx*velx + vely*vely);
2784 
2785  // NOTE: this is rho*<q'w'> = -K dqdz
2786  amrex::Real moflux = (std::abs(qstar) > eps) ? - rho * qstar * wsp * (q - qsat_z0) : zero;
2787 
2788  return moflux;
2789  }
constexpr amrex::Real zero
Definition: ERF_Constants.H:8
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:13
#define Rho_comp
Definition: ERF_IndexDefines.H:36
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:42
rho
Definition: ERF_InitCustomPert_Bubble.H:107
amrex::Real Real
Definition: ERF_ShocInterface.H:19
@ q
Definition: ERF_WSM6.H:184
const amrex::Real eps
Definition: ERF_MOSTStress.H:2899

◆ 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 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 > &  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.
2812  {
2813  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
2814  amrex::Real tstar = t_star_arr(i, j, 0);
2815  amrex::Real theta = cons_arr(i, j, k, RhoTheta_comp) / rho;
2816 
2817  amrex::Real velx = myhalf * (velx_arr(i,j,k) + velx_arr(i+1,j,k));
2818  amrex::Real vely = myhalf * (vely_arr(i,j,k) + vely_arr(i,j+1,k));
2819  amrex::Real wsp = std::sqrt(velx*velx + vely*vely);
2820 
2821  // NOTE: this is rho*<T'w'> = -K dTdz
2822  amrex::Real moflux = (std::abs(tstar) > eps) ? - rho * tstar * wsp * (theta - theta_z0) : zero;
2823 
2824  return moflux;
2825  }
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:37
@ theta
Definition: ERF_SLM.H:20

◆ 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 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 > &  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.
2846  {
2847  amrex::Real velx = velx_arr(i,j,k);
2848  amrex::Real vely = fourth * ( vely_arr(i ,j,k) + vely_arr(i ,j+1,k)
2849  + vely_arr(i-1,j,k) + vely_arr(i-1,j+1,k) );
2850  amrex::Real rho = myhalf * ( cons_arr(i-1,j,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2851 
2852  amrex::Real ustar = myhalf * ( u_star_arr(i-1,j,0) + u_star_arr(i,j,0) );
2853  amrex::Real wsp = std::sqrt(velx*velx+vely*vely);
2854 
2855  // NOTE: this is rho*<u'w'> = -K dudz
2856  amrex::Real stressx = -rho * ustar * wsp * velx;
2857 
2858  return stressx;
2859  }
constexpr amrex::Real fourth
Definition: ERF_Constants.H:14

◆ 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 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 > &  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.
2880  {
2881  amrex::Real velx = fourth * ( velx_arr(i,j ,k) + velx_arr(i+1,j ,k)
2882  + velx_arr(i,j-1,k) + velx_arr(i+1,j-1,k) );
2883  amrex::Real vely = vely_arr(i,j,k);
2884  amrex::Real rho = myhalf * ( cons_arr(i,j-1,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2885 
2886  amrex::Real ustar = myhalf * ( u_star_arr(i,j-1,0) + u_star_arr(i,j,0) );
2887  amrex::Real wsp = std::sqrt(velx*velx+vely*vely);
2888 
2889  // NOTE: this is rho*<v'w'> = -K dvdz
2890  amrex::Real stressy = -rho * ustar * wsp * vely;
2891 
2892  return stressy;
2893  }

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: